From c2fa1b7e8d43a236219d1f6ad2831de1af296cb4 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Thu, 13 Jan 2022 14:33:25 +0000 Subject: View Interface definition on VFC Add Interface support to VFC view UI Issue-ID: SDC-3850 Signed-off-by: aribeiro Change-Id: Icd195c939af39d40ae8c617e740323dd3e70fc15 --- .../interface-operations.component.ts | 3 ++- .../interface-operation-handler.component.html | 24 ++++++++++++++-------- .../interface-operation-handler.component.ts | 3 +++ 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/composition') diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts index 2cc91a92a0..60d66788ac 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts @@ -227,7 +227,8 @@ export class InterfaceOperationsComponent { toscaArtifactTypes: this.toscaArtifactTypes, selectedInterface: interfaceModel, selectedInterfaceOperation: operation, - validityChangedCallback: this.enableOrDisableSaveButton + validityChangedCallback: this.enableOrDisableSaveButton, + isViewOnly: false } ); this.modalInstance.instance.open(); diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.html b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.html index 428c4cd5ed..6dec4160f6 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.html +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.html @@ -28,7 +28,7 @@ + [disabled]=isViewOnly> @@ -36,7 +36,7 @@ + [disabled]=isViewOnly> @@ -46,7 +46,8 @@ label="{{'OPERATION_DESCRIPTION' | translate}}" [(value)]="operationToUpdate.description" testId="interface-operation-description" - (valueChange)="onDescriptionChange($event)"> + (valueChange)="onDescriptionChange($event)" + [disabled]=isViewOnly> @@ -55,7 +56,8 @@
+ (checkedChange)="onMarkToAddArtifactToImplementation($event)" + [disabled]=isViewOnly>
@@ -63,7 +65,8 @@ label="{{'INTERFACE_OPERATION_IMPLEMENTATION_NAME' | translate}}" testId="interface-operation-implementation-name" [(value)]="artifactName" - (valueChange)="onImplementationNameChange($event)"> + (valueChange)="onImplementationNameChange($event)" + [disabled]=isViewOnly>
@@ -76,7 +79,8 @@ [selectedOption]="toscaArtifactTypeSelected" placeHolder="{{toscaArtifactTypeSelected != undefined ? toscaArtifactTypeSelected : 'Select...'}}" (changed)="onSelectToscaArtifactType($event)" - [options]="toscaArtifactTypes"> + [options]="toscaArtifactTypes" + [disabled]=isViewOnly>
@@ -85,7 +89,8 @@ data-tests-id="artifactFile" [(value)]="artifactName" [required]="true" - (valueChange)="onArtifactFileChange($event)"> + (valueChange)="onArtifactFileChange($event)" + [disabled]=isViewOnly>
@@ -93,7 +98,8 @@ label="{{ 'ARTIFACT_VERSION' | translate }}" data-tests-id="artifactVersion" [(value)]="artifactVersion" - (valueChange)="onArtifactVersionChange($event)"> + (valueChange)="onArtifactVersionChange($event)" + [disabled]=isViewOnly>
@@ -122,7 +128,7 @@ diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts index 6e4ae45487..1099391548 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts @@ -49,6 +49,7 @@ export class InterfaceOperationHandlerComponent { selectedInterface: UIInterfaceModel; selectedInterfaceOperation: InterfaceOperationModel; validityChangedCallback: Function; + isViewOnly: boolean; }; interfaceType: string; @@ -60,6 +61,7 @@ export class InterfaceOperationHandlerComponent { properties: Array = []; isLoading: boolean = false; readonly: boolean; + isViewOnly: boolean; toscaArtifactTypeSelected: string; toscaArtifactTypeProperties: Array = []; @@ -70,6 +72,7 @@ export class InterfaceOperationHandlerComponent { propertyValueValid: boolean = true; ngOnInit() { + this.isViewOnly = this.input.isViewOnly; this.interfaceType = this.input.selectedInterface.displayType(); this.operationToUpdate = new InterfaceOperationModel(this.input.selectedInterfaceOperation); this.operationToUpdate.interfaceId = this.input.selectedInterface.uniqueId; -- cgit 1.2.3-korg