Skip to content

Commit

Permalink
CHE-10335: update the flow for adding a new stack (#10393)
Browse files Browse the repository at this point in the history
  • Loading branch information
akurinnoy authored Jul 18, 2018
1 parent ffd3a13 commit 0f3a4f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/app/stacks/list-stacks/list-stacks.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
che-search-model="listStacksController.stackFilter.name"
che-on-search-change="listStacksController.onSearchChanged(str)"
che-hide-search="listStacksController.stacks.length === 0"
che-add-button-title="Add Stack"
che-add-button-href="#stack/create"
che-import-button-title="Build Stack From Recipe"
che-import-button-title="Add Stack"
che-on-import="listStacksController.showSelectStackRecipeDialog($event)"
che-delete-button-title="Delete"
che-on-delete="listStacksController.deleteSelectedStacks()"
Expand Down
16 changes: 0 additions & 16 deletions src/app/stacks/stacks-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,6 @@ export class StacksConfig {
controller: 'ListStacksController',
controllerAs: 'listStacksController'
})
.accessWhen('/stack/create', {
title: () => {
return 'create';
},
templateUrl: 'app/stacks/stack-details/stack.html',
controller: 'ImportStackController',
controllerAs: 'stackController',
resolve: {
initData: ['cheStack', (cheStack: CheStack) => {
return cheStack.fetchStacks().then(() => {
const stack = cheStack.getStackTemplate();
return {stack};
});
}]
}
})
.accessWhen('/stack/import', {
title: () => {
return 'create';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,21 @@ export class StackSelectorController {
}

/**
* Handles the adding stack options.
*/
onAddStack(): void {
this.confirmDialogService.showConfirmDialog('Create stack', 'Would you like to create a new stack?', 'Yes', 'No').then(() => {
this.$location.path('/stacks');
* Show dialog for stack to create.
*
* @param $event {MouseEvent}
*/
onAddStack($event: MouseEvent): void {
this.$mdDialog.show({
targetEvent: $event,
controller: 'BuildStackController',
controllerAs: 'buildStackController',
bindToController: true,
clickOutsideToClose: true,
locals: {
callbackController: this
},
templateUrl: 'app/stacks/list-stacks/build-stack/build-stack.html'
});
}

Expand Down

0 comments on commit 0f3a4f1

Please sign in to comment.