Fix inputs/policy tabs view for self and instances 99/128799/3
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Fri, 22 Apr 2022 14:48:40 +0000 (15:48 +0100)
committerMichael Morris <michael.morris@est.tech>
Mon, 9 May 2022 15:47:29 +0000 (15:47 +0000)
Issue-ID: SDC-3983
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I2b1f0e5c7f6e55765f35ac807926725343a8aa9e

catalog-ui/src/app/ng2/components/ui/tabs/tab/tab.component.ts
catalog-ui/src/app/ng2/components/ui/tabs/tabs.component.html
catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html
catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less
catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts

index bad7b80..e0eacdc 100644 (file)
@@ -24,7 +24,7 @@ import { ViewEncapsulation } from '@angular/core';
 @Component({
     selector: 'tab',
     template: `
-    <div *ngIf="active" class="tab-content">
+    <div *ngIf="active && show" class="tab-content">
       <ng-content></ng-content>
     </div>
     `,
@@ -33,6 +33,7 @@ import { ViewEncapsulation } from '@angular/core';
 export class Tab {
     @Input('tabTitle') title: string;
     @Input() active:boolean = false;
+    @Input() show:boolean = true;
     @Input() indication?: number;
 
 }
index 8a8ecc3..d52dccc 100644 (file)
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
+
 <div class="tabs {{tabStyle}}">
-    <div class="tab" *ngFor="let tab of tabs" (click)="selectTab(tab)" [class.active]="tab.active"  [attr.data-tests-id]="tab.title">
+<ng-container *ngFor="let tab of tabs">
+    <div class="tab" *ngIf="tab.show" (click)="selectTab(tab)" [class.active]="tab.active" [attr.data-tests-id]="tab.title">
         {{tab.title}}
         <div class="tab-indication" *ngIf="tab.indication" [@indicatorAnimation]="tab.indication">{{tab.indication}}</div>
     </div>
+</ng-container>
 </div>
 <div class="tab-content-container">
     <ng-content></ng-content>
index 747624a..d04ddf5 100644 (file)
@@ -40,7 +40,7 @@
                             (deleteProperty)="deleteProperty($event)">
                         </properties-table>
                     </tab>
-                    <tab tabTitle="Inputs">
+                    <tab tabTitle="Inputs" [show]="isSelf()">
                         <inputs-table class="properties-table"
                             [fePropertiesMap]="instanceFePropertiesMap"
                             [readonly]="isReadonly"
@@ -53,7 +53,7 @@
                             (inputChanged)="dataChanged($event)">
                         </inputs-table>
                     </tab>
-                    <tab tabTitle="Policies">
+                    <tab tabTitle="Policies" [show]="isSelf()">
                         <policies-table class="properties-table"
                                       [readonly]="isReadonly"
                                       [policies]="policies | searchFilter:'name':searchQuery"
index a1309ab..1c62758 100644 (file)
@@ -30,7 +30,7 @@
        min-width:930px;
 
         /deep/ .tabs {
-            width:33%;
+            width:18%;
             text-align:center;
         }
 
index 786aa8d..4baae19 100644 (file)
@@ -648,6 +648,8 @@ export class PropertiesAssignmentComponent {
         this.topologyTemplateService
             .createInput(this.component, inputsToCreate, this.isSelf())
             .subscribe((response) => {
+                this.selectInstanceRow(SERVICE_SELF_TITLE);
+                this.onInstanceSelectedUpdate(this.instances[0]);
                 this.setInputTabIndication(response.length);
                 this.checkedPropertiesCount = 0;
                 this.checkedChildPropertiesCount = 0;