aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-12-10 18:55:03 +0200
committerTal Gitelman <tg851x@intl.att.com>2017-12-10 19:33:38 +0200
commit51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 (patch)
tree3ac236a864d74d19b0f5c9020891a7a7e5c31b44 /catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts
parentb5cc2e0695f195716d6ccdc65e73807a6632ec70 (diff)
Final commit to master merge from
Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507 Issue-ID: SDC-714 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts
index 4b9dd6fc00..5236259f30 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/composition/composition-view-model.ts
@@ -25,7 +25,7 @@ import {IWorkspaceViewModelScope} from "../../workspace-view-model";
import {ComponentServiceNg2} from "app/ng2/services/component-services/component.service";
import {ComponentGenericResponse} from "app/ng2/services/responses/component-generic-response";
import {Resource} from "app/models/components/resource";
-import {ResourceType} from "../../../../utils/constants";
+import {ResourceType,ComponentType} from "../../../../utils/constants";
export interface ICompositionViewModelScope extends IWorkspaceViewModelScope {
@@ -48,6 +48,7 @@ export interface ICompositionViewModelScope extends IWorkspaceViewModelScope {
setSelectedInstance(componentInstance:ComponentInstance):void;
printScreen():void;
isPNF():boolean;
+ isConfiguration():boolean;
cacheComponentsInstancesFullData:Component;
}
@@ -167,9 +168,12 @@ export class CompositionViewModel {
this.$scope.updateSelectedComponent = ():void => {
if (this.$scope.currentComponent.selectedInstance) {
-
+ let parentComponentUid = this.$scope.currentComponent.selectedInstance.componentUid
+ if(this.$scope.currentComponent.selectedInstance.originType === ComponentType.SERVICE_PROXY){
+ parentComponentUid = this.$scope.currentComponent.selectedInstance.sourceModelUid;
+ }
let componentParent = _.find(this.cacheComponentsInstancesFullData, (component) => {
- return component.uniqueId === this.$scope.currentComponent.selectedInstance.componentUid;
+ return component.uniqueId === parentComponentUid;
});
if (componentParent) {
this.$scope.selectedComponent = componentParent;
@@ -185,7 +189,7 @@ export class CompositionViewModel {
console.log("Error updating selected component");
this.$scope.isLoadingRightPanel = false;
};
- this.ComponentFactory.getComponentFromServer(this.$scope.currentComponent.selectedInstance.originType, this.$scope.currentComponent.selectedInstance.componentUid).then(onSuccess, onError);
+ this.ComponentFactory.getComponentFromServer(this.$scope.currentComponent.selectedInstance.originType, parentComponentUid).then(onSuccess, onError);
} catch (e) {
console.log("Error updating selected component", e);
this.$scope.isLoadingRightPanel = false;
@@ -247,6 +251,10 @@ export class CompositionViewModel {
return this.$scope.selectedComponent.isResource() && (<Resource>this.$scope.selectedComponent).resourceType === ResourceType.PNF;
};
+ this.$scope.isConfiguration = (): boolean => {
+ return this.$scope.selectedComponent.isResource() && (<Resource>this.$scope.selectedComponent).resourceType === ResourceType.CONFIGURATION;
+ };
+
this.eventListenerService.registerObserverCallback(EVENTS.ON_CHECKOUT, this.$scope.reload);
}