diff options
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts index fb275a04a..60be0d7ba 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts @@ -19,6 +19,10 @@ export class ScriptsTabComponent implements OnInit { public files: NgxFileDropEntry[] = []; private fileNames: Set<string> = new Set(); fileToDelete: any = {}; + currentFileName: any; + scriptExtension: any; + currentFileContent = ''; + currentExtension = ''; constructor( private packageCreationStore: PackageCreationStore, @@ -123,4 +127,28 @@ export class ScriptsTabComponent implements OnInit { divElement.setAttribute('class', 'collapse show'); } } + + textCurrentChanges() { + console.log(this.currentFileName); + console.log(this.currentFileContent); + if (this.currentFileName) { + let fileExtension = 'kt'; + if (this.currentExtension.includes('python')) { + fileExtension = 'py'; + } else if (this.currentExtension.includes('ansible')) { + fileExtension = 'yaml'; + } + this.packageCreationStore.addScripts('Scripts/' + this.currentExtension + '/' + this.currentFileName + '.' + fileExtension + , this.currentFileContent); + this.toastService.success('the ' + this.currentFileName + ' has been added'); + this.currentFileName = ''; + this.currentExtension = ''; + this.currentFileContent = ''; + } + } + + changeExtension() { + this.currentExtension = this.scriptExtension; + console.log(this.scriptExtension); + } } |