From dd60339b06d252fcb1382aa97ab3d65b37dad021 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Wed, 12 Jul 2017 00:54:52 +0300 Subject: [sdc] rebase update Change-Id: I8f1fc7150975122dd9f3f4e653b9983064b399a6 Signed-off-by: Michael Lando --- .../view-models/workspace/workspace-view-model.ts | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src/app/view-models/workspace/workspace-view-model.ts') 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 4300c33412..21bd199aac 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 @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + /** * Created by obarda on 3/30/2016. */ @@ -71,6 +91,7 @@ export interface IWorkspaceViewModelScope extends ng.IScope { updateSelectedMenuItem():void; uploadFileChangedInGeneralTab():void; updateMenuComponentName(ComponentName:string):void; + reload(component:Component):void; } export class WorkspaceViewModel { @@ -238,7 +259,9 @@ export class WorkspaceViewModel { this.$scope.onVersionChanged = (selectedId:string):void => { if (this.$state.current.data && this.$state.current.data.unsavedChanges) { - this.$scope.changeVersion.selectedVersion = _.find(this.$scope.versionsList, {versionId: this.$scope.component.uniqueId}); + this.$scope.changeVersion.selectedVersion = _.find(this.$scope.versionsList, (versionObj)=> { + return versionObj.versionId === this.$scope.component.uniqueId; + }); } this.$scope.isLoading = true; this.$state.go(this.$state.current.name, { @@ -619,6 +642,11 @@ export class WorkspaceViewModel { this.$scope.isDeployment = (newVal.indexOf(States.WORKSPACE_DEPLOYMENT) > -1); } }); + + this.$scope.reload = (component:Component):void => { + this.$state.go(this.$state.current.name,{id:component.uniqueId},{reload:true}); + }; + }; private initAfterScope = ():void => { -- cgit 1.2.3-korg