diff options
Diffstat (limited to 'catalog-ui/src/app/view-models')
-rw-r--r-- | catalog-ui/src/app/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts | 3 | ||||
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/workspace-view-model.ts | 4 |
2 files changed, 5 insertions, 2 deletions
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<string> = 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; }; |