diff options
author | Piotr Darosz <piotr.darosz@nokia.com> | 2019-03-27 15:25:50 +0100 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-04-07 07:50:41 +0000 |
commit | 2c25cbab17de51f9b9a688644be92d0afdb2fa42 (patch) | |
tree | c716d8e217a86487d4b6bce16834e5a784899149 /catalog-ui/src/app/view-models | |
parent | 71b5dc0a3b445c64f1b6144c3f086128d88e4902 (diff) |
Generic Artifact Browser SDC UI
Introduce Generic Artifact Browser SDC UI in VF -> Deployment Artifacts
view.
Change-Id: I312c6c9d77f42ad2d073a8ad21c983ede39dfd0b
Issue-ID: SDC-2211
Signed-off-by: Piotr Darosz <piotr.darosz@nokia.com>
Diffstat (limited to 'catalog-ui/src/app/view-models')
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" |