Added mode for kt and create method 25/95225/2
authorEzhilarasi <ezhrajam@in.ibm.com>
Mon, 9 Sep 2019 12:27:56 +0000 (17:57 +0530)
committerBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>
Tue, 10 Sep 2019 00:29:00 +0000 (00:29 +0000)
Change-Id: I4c1c20077a2da5269724fff12fc456a86b5168f4
Issue-ID: CCSDK-1275
Signed-off-by: Ezhilarasi <ezhrajam@in.ibm.com>
cds-ui/client/src/app/common/utility/zipfile-extraction.component.ts
cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts

index fcadee8..279405a 100644 (file)
@@ -39,11 +39,21 @@ export class ZipfileExtractionComponent implements OnInit {
   private entryDefinition: string;
   validfile: boolean = false;
   uploadedFileName: string;
-
+  filesData: any = [];
+  
   constructor(private loader: LoaderService) { }
 
   ngOnInit() {
   }
+
+  create() {
+    this.filesData.forEach((path) => {
+      let index = path.name.indexOf("/");
+      let name = path.name.slice(index + 1, path.name.length);
+      this.zipFile.file(name, path.data);
+    });
+  }
+
   async buildFileViewData(zip) {
     this.validfile = false;
     this.paths = [];
index 08f1ca1..f45ee9e 100644 (file)
@@ -244,9 +244,8 @@ export class EditorComponent implements OnInit {
     })
     this.fileExtension = this.selectedFile.substr(this.selectedFile.lastIndexOf('.') + 1);
     this.setEditorMode();
-    if(this.options == '3')
-    {
-      this.editorReadOnly= true;
+    if (this.options == '3') {
+      this.editorReadOnly = true;
     }
   }
 
@@ -357,6 +356,9 @@ export class EditorComponent implements OnInit {
       case "kts":
         this.mode = 'kotlin';
         break;
+      case "kt":
+        this.mode = 'kotlin';
+        break;
       case "txt":
         this.mode = 'text';
         break;