search-template change 45/83145/1
authorArundathi Patil <arundpil@in.ibm.com>
Mon, 25 Mar 2019 07:09:02 +0000 (12:39 +0530)
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>
Mon, 25 Mar 2019 07:09:09 +0000 (12:39 +0530)
Removed the use of the shift array method which was removing the base
folder entry from tree.

Issue-ID: CCSDK-1171
Change-Id: Ic07a9fb89f9daba8d773d1d592c49566b28ac8f9
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.ts

index 777faee..3687623 100644 (file)
@@ -60,6 +60,7 @@ export class SearchTemplateComponent implements OnInit {
   }
 
   fileChanged(e: any) {
+    this.paths = [];
     this.file = e.target.files[0];
     this.zipFile.files = {};
     this.zipFile.loadAsync(this.file)
@@ -119,7 +120,7 @@ export class SearchTemplateComponent implements OnInit {
     paths.forEach((path) => {
 
       const pathParts = path.name.split('/');
-      pathParts.shift();
+      // pathParts.shift();
       let currentLevel = tree;
 
       pathParts.forEach((part) => {
@@ -131,7 +132,8 @@ export class SearchTemplateComponent implements OnInit {
           const newPart = {
             name: part,
             children: [],
-            data: path.data
+            data: path.data,
+            path : path.name
           };
           if(part.trim() == this.blueprintName.trim()) { 
             this.activationBlueprint = path.data;