summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/workspace
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/view-models/workspace')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts40
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html5
2 files changed, 43 insertions, 2 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts
index c652da4eab..73273e04d5 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts
@@ -3,6 +3,7 @@
* SDC
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nokia. 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.
@@ -26,6 +27,10 @@ import {ArtifactModel, ArtifactGroupModel, Resource} from "app/models";
import {ArtifactsUtils, ModalsHandler, ValidationUtils} from "app/utils";
import {ComponentServiceNg2} from "app/ng2/services/component-services/component.service";
import {ComponentGenericResponse} from "../../../../ng2/services/responses/component-generic-response";
+import {GenericArtifactBrowserComponent} from "../../../../ng2/components/logic/generic-artifact-browser/generic-artifact-browser.component";
+import {PathsAndNamesDefinition} from "../../../../models/paths-and-names";
+import {ModalService as ModalServiceSdcUI} from "sdc-ui/lib/angular/modals/modal.service";
+import {IModalConfig} from "sdc-ui/lib/angular/modals/models/modal-config";
interface IDeploymentArtifactsViewModelScope extends IWorkspaceViewModelScope {
tableHeadersList:Array<any>;
@@ -64,7 +69,8 @@ export class DeploymentArtifactsViewModel {
'ValidationUtils',
'ArtifactsUtils',
'ModalsHandler',
- 'ComponentServiceNg2'
+ 'ComponentServiceNg2',
+ 'ModalServiceSdcUI'
];
constructor(private $scope:IDeploymentArtifactsViewModelScope,
@@ -73,7 +79,8 @@ export class DeploymentArtifactsViewModel {
private validationUtils:ValidationUtils,
private artifactsUtils:ArtifactsUtils,
private ModalsHandler:ModalsHandler,
- private ComponentServiceNg2: ComponentServiceNg2) {
+ private ComponentServiceNg2: ComponentServiceNg2,
+ private ModalServiceSdcUI: ModalServiceSdcUI) {
this.initScope();
}
@@ -270,6 +277,35 @@ export class DeploymentArtifactsViewModel {
}
};
+ this.$scope.openGenericArtifactBrowserModal = (artifact:ArtifactModel):void => {
+ let modalConfig: IModalConfig = {
+ size: 'xl',
+ title: 'Generic Artifact Browser',
+ type: 'custom',
+ buttons: [{
+ id: 'okButton',
+ text: 'OK',
+ size: "'x-small'",
+ closeModal: true
+ },
+ {text: "Cancel", size: "'x-small'", closeModal: true}]
+ };
+
+ let pathsandnames: PathsAndNamesDefinition[] = [
+ {friendlyName: 'Action', path: 'event.action[2]'},
+ {friendlyName: 'Comment', path: 'event.comment'},
+ {friendlyName: 'Alarm Additional Information',
+ path: 'event.structure.faultFields.structure.alarmAdditionalInformation.comment'}];
+
+ let modalInputs = {
+ pathsandnames: pathsandnames,
+ artifactid: artifact.esId,
+ resourceid: this.$scope.component.uniqueId
+ };
+
+ this.ModalServiceSdcUI.openCustomModal(modalConfig, GenericArtifactBrowserComponent, modalInputs);
+ };
+
this.$scope.openEditEnvParametersModal = (artifact:ArtifactModel):void => {
this.ModalsHandler.openEditEnvParametersModal(artifact, this.$scope.component).then(()=> {
this.initArtifacts(true);
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html b/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html
index 279f5baa81..a26bcdeccd 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html
+++ b/catalog-ui/src/app/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html
@@ -1,5 +1,6 @@
<!--
~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ ~ Modifications Copyright (C) 2019 Nokia. 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.
@@ -78,6 +79,10 @@
data-ng-if="!isViewMode() && !artifact.isHEAT() && !artifact.isThirdParty() && !isLicenseArtifact(artifact)" data-ng-click="delete(artifact)"> </button>
<button class="table-download-btn" download-artifact data-tests-id="download_{{artifact.artifactDisplayName}}"
data-ng-if="artifact.artifactDisplayName" component="component" artifact="artifact"></button>
+ <button ng-if="artifact.isGenericBrowseable()"
+ class="table-magnifier-btn"
+ data-ng-click="openGenericArtifactBrowserModal(artifact)" component="component" artifact="artifact"
+ data-tests-id="gab-{{artifact.artifactDisplayName}}"></button>
<button ng-if="!isViewMode() && artifact.isHEAT()"
class="sprite e-sdc-small-icon-pad edit-paramtes-button"
data-ng-click="openEditEnvParametersModal(artifact)" type="button"