diff --git a/dashboard/src/app/projects/create-project/create-project.controller.js b/dashboard/src/app/projects/create-project/create-project.controller.js index 5d89a5947e..8bb83718d9 100755 --- a/dashboard/src/app/projects/create-project/create-project.controller.js +++ b/dashboard/src/app/projects/create-project/create-project.controller.js @@ -122,20 +122,26 @@ export class CreateProjectCtrl { } - // fetch workspaces when initializing - let promise = cheAPI.getWorkspace().fetchWorkspaces(); - promise.then(() => { - this.updateData(); - }, - (error) => { - // etag handling so also retrieve last data that were fetched before - if (error.status === 304) { - // ok + this.workspaces = this.cheAPI.getWorkspace().getWorkspaces(); + + if (this.workspaces.length > 0) { + this.updateData(); + } else { + // fetch workspaces when initializing + let promise = cheAPI.getWorkspace().fetchWorkspaces(); + promise.then(() => { this.updateData(); - return; - } - this.state = 'error'; - }); + }, + (error) => { + // etag handling so also retrieve last data that were fetched before + if (error.status === 304) { + // ok + this.updateData(); + return; + } + this.state = 'error'; + }); + } // selected current tab this.currentTab = ''; @@ -237,17 +243,23 @@ export class CreateProjectCtrl { * Fetching operation has been done, so get workspaces and websocket connection */ updateData() { - - this.workspaces = this.cheAPI.getWorkspace().getWorkspaces(); - - // generate project name - this.generateProjectName(true); - - // init WS bus - if (this.workspaces.length > 0) { - this.messageBus = this.cheAPI.getWebsocket().getBus(this.workspaces[0].id); + //if create project in progress and workspace have started + if (this.createProjectSvc.isCreateProjectInProgress() && this.createProjectSvc.getCurrentProgressStep() > 0) { + let workspaceName = this.createProjectSvc.getWorkspaceOfProject(); + let findWorkspace = this.lodash.find(this.workspaces, function (workspace) { + return workspace.config.name === workspaceName; + }); + //check current workspace + if (findWorkspace) { + // init WS bus + this.messageBus = this.cheAPI.getWebsocket().getBus(findWorkspace.id); + } else { + this.resetCreateProgress(); + } + } else { + // generate project name + this.generateProjectName(true); } - } /** diff --git a/dashboard/src/app/projects/create-project/create-project.html b/dashboard/src/app/projects/create-project/create-project.html index 57a64fcc67..2c54a93b87 100644 --- a/dashboard/src/app/projects/create-project/create-project.html +++ b/dashboard/src/app/projects/create-project/create-project.html @@ -49,8 +49,7 @@
- -
+
diff --git a/dashboard/src/app/projects/create-project/create-project.styl b/dashboard/src/app/projects/create-project/create-project.styl index bb6b3fa4b7..b05f9d2e6a 100644 --- a/dashboard/src/app/projects/create-project/create-project.styl +++ b/dashboard/src/app/projects/create-project/create-project.styl @@ -60,6 +60,7 @@ md-select.create-project-select background-repeat no-repeat background-position-x 0 background-position-y bottom + background-image url('../assets/images/bg-intermediate-screen.svg') height 220px padding-left 40px padding-right 40px diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-details.html b/dashboard/src/app/workspaces/workspace-details/workspace-details.html index dfe64fbdee..e2ff1e2588 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-details.html +++ b/dashboard/src/app/workspaces/workspace-details/workspace-details.html @@ -65,7 +65,7 @@