Merge "CDS add vFW Use Case from Integration project"
authorKAPIL SINGAL <ks220y@att.com>
Tue, 15 Dec 2020 17:40:24 +0000 (17:40 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 15 Dec 2020 17:40:24 +0000 (17:40 +0000)
13 files changed:
cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.css
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/topology-template/topology-template.component.html

index 3efc688..b0f6a34 100644 (file)
                                 role="tab" aria-controls="nav-imports" aria-selected="false">DEFINITIONS</a>
                             <a class="nav-item nav-link" id="nav-authentication-tab" data-toggle="tab"
                                 href="#nav-authentication" role="tab" aria-controls="nav-authentication"
-                                aria-selected="false">EXTERNAL SYSTEM AUTHENTICATION PROPERTIES</a>
+                                aria-selected="false">DSL PROPERTIES</a>
                             <a class="nav-item nav-link" id="nav-topologytemplate-tab" data-toggle="tab"
                                 href="#nav-topologytemplate" role="tab" aria-controls="nav-authentication"
                                 aria-selected="false">Topology Template</a>
             </div>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>
index b3894fe..c69bf1b 100644 (file)
@@ -252,8 +252,6 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
         this.packageCreationStore.addTopologyTemplate(this.cbaPackage.templateTopology);
         this.formTreeData();
         this.enrichPackage();
-        this.designerStore.clear();
-        this.packageCreationStore.clear();
     }
 
 
index 8746569..6a73d9e 100644 (file)
                 </div>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
-                <button type="button" class="btn btn-primary" (click)="submitAttributes()">Submit Attributes</button>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+                <button type="button" class="btn btn-primary" data-dismiss="modal" (click)="submitAttributes()">Submit
+                    Attributes</button>
             </div>
         </div>
     </div>
index 97ab441..5dd1231 100644 (file)
@@ -434,7 +434,6 @@ export class ActionAttributesComponent implements OnInit {
                 if (currentFunction.definition['attributes']) {
                     Object.keys(currentFunction.definition['attributes']).forEach(attribute => {
                         this.suggestedAttributes.push(attribute);
-                        this.suggestedAttributes.push('assignment-map');
                     });
                 }
                 console.log(this.suggestedAttributes);
index 0f6e38c..cc7de5f 100644 (file)
@@ -25,35 +25,35 @@ limitations under the License.
 
 import dagre from 'dagre';
 import graphlib from 'graphlib';
-import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
+import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
 import * as joint from 'jointjs';
 import './jointjs/elements/palette.function.element';
 import './jointjs/elements/action.element';
 import './jointjs/elements/board.function.element';
-import {DesignerStore} from './designer.store';
-import {ActionElementTypeName} from 'src/app/common/constants/app-constants';
-import {GraphUtil} from './graph.util';
-import {GraphGenerator} from './graph.generator.util';
-import {FunctionsStore} from './functions.store';
-import {Subject} from 'rxjs';
-import {distinctUntilChanged, takeUntil} from 'rxjs/operators';
-import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
-import {ActivatedRoute, Router} from '@angular/router';
-import {DesignerService} from './designer.service';
-import {FilesContent, FolderNodeElement} from '../package-creation/mapping-models/metadata/MetaDataTab.model';
-import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes';
-import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder';
-import {PackageCreationStore} from '../package-creation/package-creation.store';
-import {PackageCreationService} from '../package-creation/package-creation.service';
-import {PackageCreationUtils} from '../package-creation/package-creation.utils';
+import { DesignerStore } from './designer.store';
+import { ActionElementTypeName } from 'src/app/common/constants/app-constants';
+import { GraphUtil } from './graph.util';
+import { GraphGenerator } from './graph.generator.util';
+import { FunctionsStore } from './functions.store';
+import { Subject } from 'rxjs';
+import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
+import { BluePrintDetailModel } from '../model/BluePrint.detail.model';
+import { ActivatedRoute, Router } from '@angular/router';
+import { DesignerService } from './designer.service';
+import { FilesContent, FolderNodeElement } from '../package-creation/mapping-models/metadata/MetaDataTab.model';
+import { PackageCreationModes } from '../package-creation/creationModes/PackageCreationModes';
+import { PackageCreationBuilder } from '../package-creation/creationModes/PackageCreationBuilder';
+import { PackageCreationStore } from '../package-creation/package-creation.store';
+import { PackageCreationService } from '../package-creation/package-creation.service';
+import { PackageCreationUtils } from '../package-creation/package-creation.utils';
 import * as JSZip from 'jszip';
-import {saveAs} from 'file-saver';
-import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service';
-import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model';
-import {TopologyTemplate} from './model/designer.topologyTemplate.model';
-import {ToastrService} from 'ngx-toastr';
-import {DesignerDashboardState} from './model/designer.dashboard.state';
-import {NgxUiLoaderService} from 'ngx-ui-loader';
+import { saveAs } from 'file-saver';
+import { PackageCreationExtractionService } from '../package-creation/package-creation-extraction.service';
+import { CBAPackage } from '../package-creation/mapping-models/CBAPacakge.model';
+import { TopologyTemplate } from './model/designer.topologyTemplate.model';
+import { ToastrService } from 'ngx-toastr';
+import { DesignerDashboardState } from './model/designer.dashboard.state';
+import { NgxUiLoaderService } from 'ngx-ui-loader';
 
 @Component({
     selector: 'app-designer',
@@ -77,7 +77,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
     paletteGraph: joint.dia.Graph;
     palettePaper: joint.dia.Paper;
     ngUnsubscribe = new Subject();
-    opt = {tx: 100, ty: 100};
+    opt = { tx: 100, ty: 100 };
     filesData: any = [];
     folder: FolderNodeElement = new FolderNodeElement();
     zipFile: JSZip = new JSZip();
@@ -127,7 +127,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
 
     publishBluePrint() {
         this.create();
-        this.zipFile.generateAsync({type: 'blob'})
+        this.zipFile.generateAsync({ type: 'blob' })
             .then(blob => {
                 const formData = new FormData();
                 formData.append('file', blob);
@@ -173,7 +173,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
                     this.packageCreationService.downloadPackage(this.viewedPackage.artifactName + '/'
                         + this.viewedPackage.artifactVersion)
                         .subscribe(response => {
-                            const blob = new Blob([response], {type: 'application/octet-stream'});
+                            const blob = new Blob([response], { type: 'application/octet-stream' });
                             this.packageCreationExtractionService.extractBlobToStore(blob);
                         });
                 }
@@ -236,7 +236,7 @@ export class DesignerComponent implements OnInit, OnDestroy {
                         setLinkVertices: false,
                         marginX: 10,
                         marginY: 10,
-                        clusterPadding: {top: 100, left: 30, right: 10, bottom: 100},
+                        clusterPadding: { top: 100, left: 30, right: 10, bottom: 100 },
                         rankDir: 'TB'
                     });
                     this.actions = [];
@@ -474,11 +474,10 @@ export class DesignerComponent implements OnInit, OnDestroy {
 
     enrichBluePrint() {
         this.ngxService.start();
+        console.log('start enrich ------------');
         this.packageCreationStore.addTopologyTemplate(this.cbaPackage.templateTopology);
         this.formTreeData();
         this.enrichPackage();
-        this.designerStore.clear();
-        this.packageCreationStore.clear();
     }
 
     private formTreeData() {
@@ -493,14 +492,18 @@ export class DesignerComponent implements OnInit, OnDestroy {
 
     private enrichPackage() {
         this.create();
-        this.zipFile.generateAsync({type: 'blob'})
+        this.zipFile.generateAsync({ type: 'blob' })
             .then(blob => {
                 this.packageCreationService.enrichAndDeployPackage(blob).subscribe(response => {
                     // this.packageCreationService.enrichPackage(blob).subscribe(response => {
+                    response = JSON.parse(response);
+                    console.log(response);
                     console.log('success');
-                    const blobInfo = new Blob([response], {type: 'application/octet-stream'});
-                    this.packageCreationStore.clear();
-                    this.packageCreationExtractionService.extractBlobToStore(blobInfo);
+                    const id = response['blueprintModel']['id'];
+                    this.router.navigate(['/packages/designer/' + id]);
+                    // const blobInfo = new Blob([response], { type: 'application/octet-stream' });
+                    // this.packageCreationStore.clear();
+                    // this.packageCreationExtractionService.extractBlobToStore(blobInfo);
                     this.toastService.success('Enriched & Deployed successfully ');
                 }, err => {
                     console.log(err);
@@ -528,22 +531,22 @@ export class DesignerComponent implements OnInit, OnDestroy {
 
     saveBluePrintToDataBase() {
         this.create();
-        this.zipFile.generateAsync({type: 'blob'})
+        this.zipFile.generateAsync({ type: 'blob' })
             .then(blob => {
-                    this.packageCreationService.savePackage(blob).subscribe(
-                        bluePrintDetailModels => {
-                            this.toastService.success('Package is successfully updated ');
-                            const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
-                            this.router.navigate(['/packages/designer/' + id]);
-                            console.log('success');
-                        }, error => {
-                            this.toastService.error('Error occured when editing ' + error.message);
-                            console.log('Error -' + error.message);
-                        }, () => {
-                            this.ngxService.stop();
-                        });
-                }, err => {
-                },
+                this.packageCreationService.savePackage(blob).subscribe(
+                    bluePrintDetailModels => {
+                        this.toastService.info('success updating the package');
+                        const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1];
+                        this.router.navigate(['/packages/designer/' + id]);
+                        console.log('success');
+                    }, error => {
+                        this.toastService.error('error happened when editing ' + error.message);
+                        console.log('Error -' + error.message);
+                    }, () => {
+                        this.ngxService.stop();
+                    });
+            }, err => {
+            },
                 () => {
                     this.ngxService.stop();
                 });
@@ -566,12 +569,17 @@ export class DesignerComponent implements OnInit, OnDestroy {
         // console.log(this.designerState.template.workflows[this.currentActionName]
         // ['steps'][customFunctionName]['target']);
         this.designerStore.setCurrentFunction(this.designerState.template.workflows[this.currentActionName]
-            ['steps'][customFunctionName]['target']);
+        ['steps'][customFunctionName]['target']);
     }
 
     getTarget(stepname) {
-        return this.designerState.template.workflows[this.currentActionName]
+        try {
+            //  console.log(this.currentActionName + " -- " + stepname)
+            return this.designerState.template.workflows[this.currentActionName]
             ['steps'][stepname]['target'];
+        } catch (e) {
+            // console.log(e);
+        }
     }
 
     downloadPackage() {
@@ -579,16 +587,16 @@ export class DesignerComponent implements OnInit, OnDestroy {
         this.ngxService.start();
         this.packageCreationService.downloadPackage(this.viewedPackage.artifactName + '/'
             + this.viewedPackage.artifactVersion).subscribe(response => {
-            const blob = new Blob([response], {type: 'application/octet-stream'});
-            saveAs(blob, this.viewedPackage.artifactName + '-' + this.viewedPackage.artifactVersion + '-CBA.zip');
-
-        }, err => {
-            this.toastService.error('Package ' + this.viewedPackage.artifactName + 'has error when downloading' +
-                err.message);
-            this.ngxService.stop();
-        }, () => {
-            this.toastService.success('Package ' + this.viewedPackage.artifactName + 'has been downloaded successfully');
-            this.ngxService.stop();
-        });
+                const blob = new Blob([response], { type: 'application/octet-stream' });
+                saveAs(blob, this.viewedPackage.artifactName + '-' + this.viewedPackage.artifactVersion + '-CBA.zip');
+
+            }, err => {
+                this.toastService.error('package ' + this.viewedPackage.artifactName + 'has error when downloading' +
+                    err.message);
+                this.ngxService.stop();
+            }, () => {
+                this.toastService.success('package ' + this.viewedPackage.artifactName + 'downloaded successfully');
+                this.ngxService.stop();
+            });
     }
 }
index ea17f88..ded7e5f 100644 (file)
                                                 Template</label>
                                         </div>
                                         <br />
-                                        <button type="button" data-toggle="modal" data-target="#templateModal"
-                                            class="btn btn-select-template m-auto"><i class="icon-add-circle"
-                                                type="button" aria-hidden="true"></i> Select Template</button>
+                                        <button (click)="init()" type="button" data-toggle="modal"
+                                            data-target="#templateModal" class="btn btn-select-template m-auto"><i
+                                                class="icon-add-circle" type="button" aria-hidden="true"></i> Select
+                                            Template</button>
                                     </div>
 
                                     <div class="attribute-wrap"
 
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" (click)="cancel()" data-dismiss="modal">Close</button>
-                <button type="button" class="btn btn-primary" data-dismiss="modal" (click)="addTemplates()">Add
-                    Template</button>
+                <button type="button" class="btn btn-secondary" (click)="cancel()" data-dismiss="modal">Cancel</button>
+                <button type="button" class="btn btn-primary" data-dismiss="modal"
+                    (click)="addTemplates()">Save</button>
             </div>
         </div>
     </div>
index d36b16f..f46004b 100644 (file)
@@ -99,7 +99,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
 
     onInitMapping() {
         // selectedTemplates , templateAndMappingMap
-        this.selectedTemplates = new Map<string, TemplateAndMapping>();
+        // this.selectedTemplates = new Map<string, TemplateAndMapping>();
         try {
             const functionMap = this.designerState.template.node_templates[this.functionName].artifacts;
             console.log(this.templateAndMappingMap);
@@ -117,6 +117,10 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
         } catch (e) { }
     }
 
+    init() {
+        this.selectedTemplates = new Map(this.finalTemplates);
+    }
+
     toNodeProcess(nodeTemplate, functionName) {
         console.log(nodeTemplate);
         this.currentFuncion['instance-name'] = functionName;
@@ -156,7 +160,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
     }
 
     addTemplates() {
-        this.finalTemplates = this.selectedTemplates;
+        this.finalTemplates = new Map(this.selectedTemplates);
     }
     cancel() {
         this.selectedTemplates = new Map<string, TemplateAndMapping>();
index 238906e..d188dbf 100644 (file)
                                role="tab" aria-controls="nav-imports" aria-selected="false">DEFINITIONS</a> -->
               <a (click)="openTourGuide('dslTab')" tourAnchor="dslTab" class="nav-item nav-link"
                 id="nav-authentication-tab" data-toggle="tab" href="#nav-authentication" role="tab"
-                aria-controls="nav-authentication" aria-selected="false">EXTERNAL
-                SYSTEM AUTHENTICATION
-                PROPERTIES</a>
+                aria-controls="nav-authentication" aria-selected="false">DSL PROPERTIES</a>
             </div>
           </div>
 
index 2625dc8..1e0e36a 100644 (file)
@@ -64,7 +64,7 @@ export class PackageCreationService {
     }
 
     private enrichandpublish(body: any | null, options?: any): Observable<any> {
-        return this.api.post(BlueprintURLs.enrichandpublish, body, {responseType: 'blob'});
+        return this.api.post(BlueprintURLs.enrichandpublish, body, {responseType: 'text'});
     }
 
     private deployBluePrint(body: any | null, options?: any): Observable<any> {
index 5027c5c..490eef3 100644 (file)
@@ -5,7 +5,9 @@
             <a class="enter-link" href="#"><i class="icon-enter-link"></i></a>
         </div>
         <span tourAnchor="st-scriptsImport" class="import-container-span">Or you can also <a data-target="#scriptsModal"
-                data-toggle="modal" (click)="resetTheUploadedFiles()" href="#"><b>Import File</b></a></span>
+                                                                                             data-toggle="modal"
+                                                                                             (click)="resetTheUploadedFiles()"
+                                                                                             href="#"><b>Import File</b></a></span>
 
     </div>
 
                 <div [id]="'head-script-'+mapIndex" class="card-header">
                     <h5 class="mb-0 d-flex justify-content-between">
                         <button (click)="changeDivShow(mapIndex)" aria-expanded="false" class="btn btn-link collapsed"
-                            data-toggle="collapse">
+                                data-toggle="collapse">
                             <i class="icon-file-code"></i> {{file.key}}
                         </button>
                         <a data-toggle="modal" (click)="initDelete(file)" data-target="#exampleModal"
-                            class="accordion-delete"><i class="icon-delete-sm"></i></a>
+                           class="accordion-delete"><i class="icon-delete-sm"></i></a>
                         <!-- <a (click)="removeFile(file.key,mapIndex)" data-toggle="modal" data-target="#exampleModal" class="accordion-delete"><i
                                     class="icon-delete-sm"></i></a> -->
                         <!-- Delete Modal -->
                         <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
-                            aria-labelledby="exampleModalLabel" aria-hidden="true">
+                             aria-labelledby="exampleModalLabel" aria-hidden="true">
                             <div class="modal-dialog" role="document">
                                 <div class="modal-content">
                                     <div class="modal-header">
                                         <h5 class="modal-title" id="exampleModalLabel">Delete Script</h5>
                                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                                            <img src="assets/img/icon-close.svg" />
+                                            <img src="assets/img/icon-close.svg"/>
                                         </button>
                                     </div>
                                     <div class="modal-body">
                                     </div>
                                     <div class="modal-footer">
                                         <button type="button" class="btn btn-secondary"
-                                            data-dismiss="modal">Cancel</button>
+                                                data-dismiss="modal">Cancel
+                                        </button>
                                         <button type="button" (click)="removeFile(fileToDelete?.key,0)"
-                                            data-dismiss="modal" class="btn btn-danger">Delete</button>
+                                                data-dismiss="modal" class="btn btn-danger">Delete
+                                        </button>
                                     </div>
                                 </div>
                             </div>
                     </h5>
                 </div>
                 <div [attr.aria-labelledby]="'head-script-'+mapIndex" [id]="'id-script-'+mapIndex" class="collapse"
-                    data-parent="#accordion-script">
+                     data-parent="#accordion-script">
                     <div class="card-body">
                         <ace-editor [(text)]="file.value" (textChange)="textChanges($event,file.key)" [mode]="'kotlin'"
-                            [autoUpdateContent]="true" [durationBeforeCallback]="1000" [theme]="'eclipse'" #editor
-                            style="height:300px;">
+                                    [autoUpdateContent]="true" [durationBeforeCallback]="5000" [theme]="'eclipse'"
+                                    #editor
+                                    style="height:300px;">
                         </ace-editor>
                     </div>
                 </div>
 </div>
 
 <div aria-hidden="true" aria-labelledby="scriptsModalLabel" class="modal fade" id="scriptsModal" role="dialog"
-    tabindex="-1">
+     tabindex="-1">
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title" id="scriptsModalLabel">Import File</h5>
                 <button aria-label="Close" class="close" data-dismiss="modal" type="button">
-                    <img src="assets/img/icon-close.svg" />
+                    <img src="assets/img/icon-close.svg"/>
                 </button>
             </div>
             <div class="modal-body">
                 <ngx-file-drop accept=".kt,.py" (onFileDrop)="dropped($event)" (onFileLeave)="fileLeave($event)"
-                    (onFileOver)="fileOver($event)" dropZoneLabel="Drop files here">
+                               (onFileOver)="fileOver($event)" dropZoneLabel="Drop files here">
                     <ng-template let-openFileSelector="openFileSelector" ngx-file-drop-content-tmp>
                         <div class="folder-upload">
-                            <img src="assets/img/folder-upload.svg" />
+                            <img src="assets/img/folder-upload.svg"/>
                         </div>
                         <div class="folder-upload-text">
                             Drag & Drop file
                 <div class="upload-table">
                     <table class="table">
                         <thead>
-                            <tr *ngFor="let item of uploadedFiles; let i=index">
-                                <th width="40"><img src="assets/img/icon-file-code.svg" /></th>
-                                <th>{{ item.name }}</th>
-                                <th (click)="removeInitFile(i)" width="40" class="text-right"><img
-                                        src="assets/img/icon-remove-file.svg" /></th>
-                            </tr>
+                        <tr *ngFor="let item of uploadedFiles; let i=index">
+                            <th width="40"><img src="assets/img/icon-file-code.svg"/></th>
+                            <th>{{ item.name }}</th>
+                            <th (click)="removeInitFile(i)" width="40" class="text-right"><img
+                                    src="assets/img/icon-remove-file.svg"/></th>
+                        </tr>
                         </thead>
                     </table>
                 </div>
             </div>
             <div class="modal-footer">
                 <button (click)="resetTheUploadedFiles()" class="btn btn-sm btn-secondary" data-dismiss="modal"
-                    type="button">Cancel
+                        type="button">Cancel
                 </button>
                 <button (click)="setFilesToStore()" class="btn btn-sm btn-primary" [disabled]="uploadedFiles?.length<=0"
-                    data-dismiss="modal" type="button">
+                        data-dismiss="modal" type="button">
                     Import
                 </button>
             </div>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>
index 2653d73..fb275a0 100644 (file)
@@ -1,8 +1,10 @@
-import { Component, OnInit } from '@angular/core';
-import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop';
-import { PackageCreationStore } from '../package-creation.store';
+import {Component, OnInit} from '@angular/core';
+import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop';
+import {PackageCreationStore} from '../package-creation.store';
 import 'ace-builds/src-noconflict/ace';
 import 'ace-builds/webpack-resolver';
+import {ToastrService} from 'ngx-toastr';
+
 declare var $: any;
 
 @Component({
@@ -20,7 +22,9 @@ export class ScriptsTabComponent implements OnInit {
 
     constructor(
         private packageCreationStore: PackageCreationStore,
-    ) { }
+        private toastService: ToastrService
+    ) {
+    }
 
 
     ngOnInit() {
@@ -53,6 +57,7 @@ export class ScriptsTabComponent implements OnInit {
     initDelete(file) {
         this.fileToDelete = file;
     }
+
     removeFile(filePath: string, FileIndex: number) {
         const filename = filePath.split('/')[2] || '';
         //  const filename = 'Scripts/' + this.getFileType(this.uploadedFiles[fileIndex].name) + '/' + this.uploadedFiles[fileIndex].name;
@@ -107,6 +112,7 @@ export class ScriptsTabComponent implements OnInit {
 
     textChanges(code: any, key: string) {
         this.packageCreationStore.addScripts(key, code);
+        this.toastService.success(key + ' is updated successfully');
     }
 
     changeDivShow(mapIndex: number) {