Skip to content

Commit

Permalink
fix(ui): load version without remote filter if no repository linked (#…
Browse files Browse the repository at this point in the history
…1591)

Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
  • Loading branch information
bnjjj authored and fsamin committed Nov 28, 2017
1 parent f90cd50 commit a1798d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions engine/api/workflowv0/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ func LoadCDTree(db gorp.SqlExecutor, store cache.Store, projectkey, appName stri
pipeline.LoadPipelineBuildOpts.WithBranchName(branchName),
}

if remote == "" || remote == root.Application.RepositoryFullname {
if remote == "" || (root.Application.RepositoryFullname != "" && remote == root.Application.RepositoryFullname) {
opts = append(opts, pipeline.LoadPipelineBuildOpts.WithEmptyRemote(root.Application.RepositoryFullname))
} else {
} else if root.Application.RepositoryFullname != "" && remote != "" {
opts = append(opts, pipeline.LoadPipelineBuildOpts.WithRemoteName(remote))
}

Expand All @@ -319,9 +319,9 @@ func LoadCDTree(db gorp.SqlExecutor, store cache.Store, projectkey, appName stri
pipeline.LoadPipelineBuildOpts.WithBranchName(branchName),
}

if remote == "" || remote == root.Application.RepositoryFullname {
if remote == "" || (root.Application.RepositoryFullname != "" && remote == root.Application.RepositoryFullname) {
opts = append(opts, pipeline.LoadPipelineBuildOpts.WithEmptyRemote(root.Application.RepositoryFullname))
} else {
} else if root.Application.RepositoryFullname != "" && remote != "" {
opts = append(opts, pipeline.LoadPipelineBuildOpts.WithRemoteName(remote))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,8 @@ export class ApplicationWorkflowComponent implements OnInit, OnDestroy {
*/
loadVersions(key: string, appName: string): Observable<Array<string>> {
this.loading.version = true;
return this._appWorkflow.getVersions(key, appName, this.applicationFilter.branch, this.applicationFilter.remote).pipe(
finalize(() => {
this.loading.version = false;
}))
return this._appWorkflow.getVersions(key, appName, this.applicationFilter.branch || 'master', this.applicationFilter.remote)
.pipe(finalize(() => this.loading.version = false))
.map((versions) => this.versions = [' ', ...versions.map((v) => v.toString())]);

}
Expand Down

0 comments on commit a1798d6

Please sign in to comment.