From b2c60183d5d654b945a24ec5564807e4f691c6e8 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Mon, 7 Aug 2017 07:05:40 +0300 Subject: [SDC] code sync Change-Id: I576dd69504722c341b0f41a1f6232ed3f4bee8df Signed-off-by: Michael Lando --- .../forms/resource-instance-name-form/resource-instance-name-model.ts | 3 ++- catalog-ui/src/app/view-models/workspace/workspace-view-model.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'catalog-ui/src/app/view-models') diff --git a/catalog-ui/src/app/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts b/catalog-ui/src/app/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts index 3f0838cabc..fa027296d6 100644 --- a/catalog-ui/src/app/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts +++ b/catalog-ui/src/app/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts @@ -109,7 +109,8 @@ export class ResourceInstanceNameViewModel { ]; this.$scope.$watch("[forms.editNameForm.$invalid,componentInstanceModel.name,isAlreadyPressed]", (newVal, oldVal) => { - this.$scope.footerButtons[0].disabled = this.$scope.forms.editNameForm.$invalid || this.$scope.isAlreadyPressed || this.$scope.componentInstanceModel.name === this.$scope.oldName; + //if the name is invalid or if user pressed ok and didn't try to change name again or the new name = source name + this.$scope.footerButtons[0].disabled = this.$scope.forms.editNameForm.$invalid || (this.$scope.isAlreadyPressed && newVal[1] === oldVal[1]) || this.$scope.componentInstanceModel.name === this.$scope.oldName; }); } } diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts index 97a58402de..a3af8ca68e 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts @@ -616,8 +616,10 @@ export class WorkspaceViewModel { }; this.$scope.updateSelectedMenuItem = (state:string):void => { + let stateArray:Array = state.split('.'); + let stateWithoutInternalNavigate:string = stateArray[0] + '.' + stateArray[1]; let selectedItem:MenuItem = _.find(this.$scope.leftBarTabs.menuItems, (item:MenuItem) => { - return item.state === state; + return _.startsWith(item.state, stateWithoutInternalNavigate); }); this.$scope.leftBarTabs.selectedIndex = selectedItem ? this.$scope.leftBarTabs.menuItems.indexOf(selectedItem) : 0; }; -- cgit 1.2.3-korg