Issues found when trying to create activities in interface operations 99/136099/1
authorfranciscovila <javier.paradela.vila@est.tech>
Wed, 4 Oct 2023 10:34:24 +0000 (11:34 +0100)
committerfranciscovila <javier.paradela.vila@est.tech>
Wed, 4 Oct 2023 10:34:24 +0000 (11:34 +0100)
Issue-ID: SDC-4644
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: Ib615973bf83b15525b8841c1560eaac9ba81ea46

catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.html
catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.html
catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts

index e0889c7..b187fa5 100644 (file)
               </select>
         </div>
 
-        <div class="group-with-border content-row">
+        <div class="group-with-border content-row" *ngIf="showActivities">
             <label class="sub-operations-label"> Sub operations </label>
             <tabs tabStyle="basic-tabs" [hideIndicationOnTabChange]="true" (tabChanged)="tabChanged($event)">
                 <div *ngFor="let milestone of milestones">
index d3f02e7..f82ad66 100644 (file)
@@ -103,6 +103,7 @@ export class InterfaceOperationHandlerComponent {
     customToscaFunctions: Array<CustomToscaFunction>;
     enableAddArtifactImplementation: boolean;
     propertyValueValid: boolean = true;
+    showActivities: boolean = false;
     inputTypeOptions: any[];
     timeoutValue = new FormControl('');
     timeoutType = new FormControl('');
@@ -157,6 +158,7 @@ export class InterfaceOperationHandlerComponent {
             this.dataTypeService.findAllDataTypesByModel(this.modelName)
             .then((dataTypesMap: Map<string, DataTypeModel>) => {
                 subscriber.next(dataTypesMap);
+                this.showActivities = dataTypesMap.has("tosca.dataTypes.tmf.milestoneJeopardyData");
             });
         });
         this.dataTypeMap$.subscribe(value => {
index 15fe65a..cfdba12 100644 (file)
@@ -28,7 +28,7 @@
     <div class="top-add-btn add-btn" [ngClass]="{'disabled': readonly}" *ngIf="!component.isService()" data-tests-id="add-operation" (click)="onSelectInterfaceOperation(undefined, undefined)">
     {{ 'INTERFACE_ADD_OPERATION' | translate }}
     </div>
-    <div class="operation-list">
+    <div class="operation-list" *ngIf="!this.component.isService() || this.enableFlag || this.selectedInstanceData && !this.selectedInstanceData.name === 'SELF'">
       <div *ngIf="!isInterfaceListEmpty()">
         <div class="expand-collapse" *ngIf="isOperationListEmpty()">
           <a class="link"
@@ -87,7 +87,7 @@
     </div>
   </div>
   <div class="right-column" *ngIf="component.isService()">
-    <div class="add-btn" [ngClass]="{'disabled': disableFlag}" data-tests-id="add-operation" (click)="onSelectInterfaceOperation(undefined, undefined)">
+    <div class="add-btn" [ngClass]="{'disabled': !enableFlag}" data-tests-id="add-operation" (click)="onSelectInterfaceOperation(undefined, undefined)">
       {{ 'INTERFACE_ADD_OPERATION' | translate }}
     </div>
     <tabs #hierarchyNavTabs tabStyle="simple-tabs" class="gray-border">
index 4ada629..4a2ad8a 100644 (file)
@@ -139,7 +139,7 @@ export class InterfaceDefinitionComponent {
     loadingInstances: boolean = false;
     selectedInstanceData: any = null;
     hierarchyInstancesDisplayOptions: HierarchyDisplayOptions = new HierarchyDisplayOptions('uniqueId', 'name', 'archived', null, 'iconClass');
-    disableFlag : boolean = true;
+    enableFlag : boolean = false;
 
     deploymentArtifactsFilePath: Array<DropdownValue> = [];
 
@@ -241,7 +241,7 @@ export class InterfaceDefinitionComponent {
         this.interfaces = [];
         this.selectedInstanceData = instance;
         if (instance.name != "SELF") {
-            this.disableFlag = !this.isAllowAddOperation(instance.originType);
+            this.enableFlag = this.isAllowAddOperation(instance.originType);
             if (!instance.interfaces) {
                 return;
             }
@@ -284,7 +284,7 @@ export class InterfaceDefinitionComponent {
             }
             this.interfaces = newInterfaces.map((interf) => new UIInterfaceModel(interf));
         } else {
-            this.disableFlag = true;
+            this.enableFlag = false;
             this.interfaces = this.serviceInterfaces.map((interf) => new UIInterfaceModel(interf));
         }
         this.sortInterfaces();