CBA wizard stepper form 84/77584/1
authorezhil <ezhrajam@in.ibm.com>
Wed, 30 Jan 2019 14:44:08 +0000 (20:14 +0530)
committerezhil <ezhrajam@in.ibm.com>
Wed, 30 Jan 2019 14:44:28 +0000 (20:14 +0530)
Change-Id: I1df4882bafe581a3d0f7cc7c31de228166fa5312
Issue-ID: CCSDK-703
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
cds-ui/client/src/app/common/constants/app-constants.ts
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.html
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.ts

index a00e25f..0efabeb 100644 (file)
@@ -22,13 +22,73 @@ export const GlobalContants = {
     endpoints: {
 
     },
+    // cbawizard: {
+    //     stepsRequired: {stepCount: 3, 
+    //                     steps: [{name:'CBA Metadata', componentURL:'/controllerBlueprint/selectTemplate'}, 
+    //                             {name:'Controller Blueprint Designer', componentURL:'/controllerBlueprint/modifyTemplate'}, 
+    //                             {name:'Test', componentURL:'/controllerBlueprint/testTemplate'},
+    //                             {name:'Deploy', componentURL:'/controllerBlueprint/deployTemplate'}]
+    //                     }
+    // }
     cbawizard: {
-        stepsRequired: {stepCount: 3, 
-                        steps: [{name:'CBA Metadata', componentURL:'/controllerBlueprint/selectTemplate'}, 
-                                {name:'Controller Blueprint Designer', componentURL:'/controllerBlueprint/modifyTemplate'}, 
-                                {name:'Test', componentURL:'/controllerBlueprint/testTemplate'},
-                                {name:'Deploy', componentURL:'/controllerBlueprint/deployTemplate'}]
-                        }
-    }
+        stepsRequired: 
+        {
+            stepCount: 4,
+            steps: [{
+                name: 'CBA Metadata',
+                componentURL: '/controllerBlueprint/selectTemplate',
+                label: 'CBA Metadata',
+                link: '/blueprint/selectTemplate',
+                index: 0,
+                component: 'SelectTemplateComponent'
+            },
+            {
+                name: 'Controller Blueprint Designer',
+                componentURL: '/controllerBlueprint/modifyTemplate',
+                label: 'Controller Blueprint Designer',
+                link: '/blueprint/modifyTemplate',
+                index: 1,
+                component: 'ModifyTemplateComponent'
+            },
+            {
+                name: 'Test',
+                componentURL: '/controllerBlueprint/testTemplate',
+                label: 'Test',
+                link: '/blueprint/testTemplate',
+                index: 2,
+                component: 'TestTemplateComponent'
+            },
+            {
+                name: 'Deploy',
+                componentURL: '/controllerBlueprint/deployTemplate',
+                label: 'Deploy',
+                link: '/blueprint/deployTemplate',
+                index: 3,
+                component: 'DeployTemplateComponent'
+            }]
+        }
+    },
+    datadictionary: {
+        stepsRequired: 
+        {
+            stepCount: 3,
+            steps: [{
+                      name: 'Resource Creation', componentURL: '/dataDictionary/selectTemplate',
+                      label: 'Resource Creation',
+                      component: 'ResourceCreationComponent'
 
+                    },
+                   {
+                      name: 'Edit/Validate', componentURL: '/dataDictionary/modifyTemplate',
+                      label: 'Edit/Validate',
+                      component: 'ResourceEditComponent'
+                   },
+                   {
+                      name: 'Save', componentURL: '/dataDictionary/saveTemplate',
+                      label: 'Save Resource',
+                      component: 'SaveResourceComponent'
+                   }]
+       }
+
+    }
 };
\ No newline at end of file
index a925b45..b7c59b2 100644 (file)
@@ -31,7 +31,7 @@ limitations under the License.
   </mat-card-content>
 </mat-card> -->
 
-<mat-card class="CBAform">
+<!-- <mat-card class="CBAform">
   <mat-card-content>
     <mat-horizontal-stepper [linear]=true #stepper (selectionChange)="changeRoute($event)">
       <a *ngFor="let routeLink of stepsRequired; let i = index;">
@@ -42,4 +42,21 @@ limitations under the License.
           </a>
     </mat-horizontal-stepper>
   </mat-card-content>
-</mat-card>
+</mat-card> -->
+
+<mat-card class="CBAform">
+  <!-- <label>{{appName}}</label> -->
+  <mat-card-content>
+    <mat-horizontal-stepper [linear]=true #stepper >
+      <!-- <mat-step style="display: none;" *ngFor="let routeLink of stepsRequired; let i = index;"> -->
+        <mat-step style="display: none;" *ngFor="let routeLink of steps">
+        <ng-template matStepLabel>{{routeLink.label}}</ng-template>
+        <!-- {{appToLoad.component}} -->
+        <template #steppercontainer> </template>
+      </mat-step>
+      <div style="position:relative">
+        <button mat-button matStepperNext style="color:white;background:gray; right: 20px; position: absolute;bottom:5px; ">Next</button>
+      </div>
+    </mat-horizontal-stepper>
+  </mat-card-content>
+</mat-card>
\ No newline at end of file
index 9373fac..fc284b3 100644 (file)
@@ -30,34 +30,36 @@ import { GlobalContants } from '../../../constants/app-constants';
   styleUrls: ['./cbawizard.component.scss']
 })
 export class CBAWizardComponent implements OnInit {
-  @Input() stepsRequired: any[];
+  // @Input() stepsRequired: any[];
+  @Input() appName: any;
   @ViewChild('stepper') stepper: MatStepper;
   @Output() stepChanged = new EventEmitter();
   public stepDetails = GlobalContants.cbawizard.stepsRequired.steps;
   private routeLinks : any[];
   activeLinkIndex = -1;
-
-
+  stepsRequired: any;
+  steps: any[];
+  
   constructor(private router: Router) {
-    this.routeLinks = [
-      {
-          label: 'CBA Metadata',
-          link: '/blueprint/selectTemplate',
-          index: 0
-      }, {
-          label: 'Controller Blueprint Designer',
-          link: '/blueprint/modifyTemplate',
-          index: 1
-      }, {
-          label: 'Test',
-          link: '/blueprint/testTemplate',
-          index: 2
-      }, {
-          label: 'Deploy',
-          link: '/blueprint/deployTemplate',
-          index: 3
-      }
-  ];
+  //   this.routeLinks = [
+  //     {
+  //         label: 'CBA Metadata',
+  //         link: '/blueprint/selectTemplate',
+  //         index: 0
+  //     }, {
+  //         label: 'Controller Blueprint Designer',
+  //         link: '/blueprint/modifyTemplate',
+  //         index: 1
+  //     }, {
+  //         label: 'Test',
+  //         link: '/blueprint/testTemplate',
+  //         index: 2
+  //     }, {
+  //         label: 'Deploy',
+  //         link: '/blueprint/deployTemplate',
+  //         index: 3
+  //     }
+  // ];
 
   }
 
@@ -66,11 +68,21 @@ export class CBAWizardComponent implements OnInit {
   //     this.activeLinkIndex = this.routeLinks.indexOf(this.routeLinks.find(tab => tab.link === this.router.url));
   //     this.stepper.selectedIndex = this.activeLinkIndex; 
   // });
-   this.stepsRequired.forEach((step, index)=>{
-    if(step.link == this.router.url) {
-      this.stepper.selectedIndex = step.index
-    }
-   });
+  //  this.stepsRequired.forEach((step, index)=>{
+  //   if(step.link == this.router.url) {
+  //     this.stepper.selectedIndex = step.index
+  //   }
+  //  });
+   if (this.appName == "cba") {
+    this.stepsRequired = GlobalContants.cbawizard.stepsRequired.stepCount;
+    this.steps = GlobalContants.cbawizard.stepsRequired.steps;
+    // this.createComponent();
+  }
+  if (this.appName == "datadict") {
+    this.stepsRequired = GlobalContants.datadictionary.stepsRequired.stepCount;
+    this.steps = GlobalContants.datadictionary.stepsRequired.steps;
+    // this.createComponent();
+  }
   }
 
   changeRoute(event){