From 568ff4d867dd09c087246fe7cc343c1d581e6255 Mon Sep 17 00:00:00 2001 From: shaaban Altanany Date: Mon, 24 Feb 2020 13:39:41 +0200 Subject: enable source code editing and adding viewing feature Issue-ID: CCSDK-2113 Signed-off-by: shaaban Altanany Change-Id: Ic7643841afe21bfacc130908d6c851519b399acd --- .../configuration-dashboard.component.html | 136 ++++++++++++++++++++- .../configuration-dashboard.component.ts | 3 + .../configuration-dashboard.service.ts | 1 - .../imports-tab/imports-tab.component.html | 4 +- .../imports-tab/imports-tab.component.ts | 12 +- .../metadata-tab/metadata-tab.component.ts | 30 +++-- .../scripts-tab/scripts-tab.component.html | 4 +- .../scripts-tab/scripts-tab.component.ts | 12 +- .../templ-mapp-creation.component.html | 2 +- .../templ-mapp-creation.component.ts | 5 + 10 files changed, 182 insertions(+), 27 deletions(-) (limited to 'cds-ui/designer-client/src/app') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html index 804aad057..f07258439 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html @@ -1,7 +1,133 @@ - - -

package-viewing works! + + +

+
+
+
+

+ +

+ +
+
+ + + +
+ +
+ + +
+
+
+
+
+ +
+
+
+ Package Name + .vLB.CDS + +
+
+ Last modified Oct 4, 2019 03:48 PM By Ahmed Abbas +
+
+ +
+
+
+
+
+ + +
+
+ +
+ + +
+
+ +
+
+
+
+
+
- {{viewedPackage!.artifactName}}} -

diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts index 84fdafb36..b08ea3e4f 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts @@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {PackageStore} from './package.store'; import {BluePrintDetailModel} from '../model/BluePrint.detail.model'; +import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model'; @Component({ @@ -18,6 +19,8 @@ export class ConfigurationDashboardComponent implements OnInit { this.configurationStore.getPagedPackages(id); this.configurationStore.state$.subscribe( el => { + const cbaPackage = new CBAPackage(); + if (el && el.configuration) { this.viewedPackage = el.configuration; } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts index 51d0e9db1..ab280fd10 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts @@ -17,6 +17,5 @@ export class ConfigurationDashboardService { getBluePrintModel(id: string): Observable { return this.api.getOne(BlueprintURLs.getOneBlueprint + '/' + id); - } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html index 344e7f599..63d392e35 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html @@ -47,7 +47,7 @@
- @@ -130,4 +130,4 @@
- \ No newline at end of file + diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts index 106fe3090..bc31e6c25 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; -import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop'; -import { PackageCreationStore } from '../package-creation.store'; -import { PackageCreationUtils } from '../package-creation.utils'; +import {Component, OnInit} from '@angular/core'; +import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop'; +import {PackageCreationStore} from '../package-creation.store'; +import {PackageCreationUtils} from '../package-creation.utils'; @Component({ @@ -74,4 +74,8 @@ export class ImportsTabComponent implements OnInit { resetTheUploadedFiles() { this.uploadedFiles = []; } + + textChanges(code: any, key: string) { + this.packageCreationStore.addDefinition(key, code); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts index 2f8ebcc7c..c71e2564a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts @@ -1,7 +1,8 @@ -import { Component, OnInit } from '@angular/core'; -import { PackageCreationService } from '../package-creation.service'; -import { MetaDataTabModel } from '../mapping-models/metadata/MetaDataTab.model'; -import { PackageCreationStore } from '../package-creation.store'; +import {Component, OnInit} from '@angular/core'; +import {PackageCreationService} from '../package-creation.service'; +import {MetaDataTabModel} from '../mapping-models/metadata/MetaDataTab.model'; +import {PackageCreationStore} from '../package-creation.store'; +import {PackageStore} from '../../configuration-dashboard/package.store'; @Component({ @@ -15,13 +16,14 @@ export class MetadataTabComponent implements OnInit { tags = new Set(); customKeysMap = new Map(); modes: object[] = [ - { name: 'Designer Mode', style: 'mode-icon icon-designer-mode' }, - { name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode' }, - { name: 'Generic Script Mode', style: 'mode-icon icon-generic-script-mode' }]; + {name: 'Designer Mode', style: 'mode-icon icon-designer-mode'}, + {name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode'}, + {name: 'Generic Script Mode', style: 'mode-icon icon-generic-script-mode'}]; private metaDataTab: MetaDataTabModel = new MetaDataTabModel(); private errorMessage: string; - constructor(private packageCreationService: PackageCreationService, private packageCreationStore: PackageCreationStore) { + constructor(private packageCreationService: PackageCreationService, private packageCreationStore: PackageCreationStore, + private packageStore: PackageStore) { } @@ -29,12 +31,22 @@ export class MetadataTabComponent implements OnInit { this.metaDataTab.templateTags = this.tags; this.metaDataTab.mapOfCustomKey = this.customKeysMap; this.packageCreationStore.changeMetaData(this.metaDataTab); + + this.packageStore.state$.subscribe(element => { + if (element && element.configuration) { + this.metaDataTab.name = element.configuration.artifactName; + this.metaDataTab.version = element.configuration.artifactVersion; + this.metaDataTab.tags = element.configuration.tags; + this.metaDataTab.description = element.configuration.artifactDescription; + } + }); } removeTag(value) { // console.log(event); this.tags.delete(value); } + addTag(event) { const value = event.target.value; console.log(value); @@ -48,6 +60,7 @@ export class MetadataTabComponent implements OnInit { console.log(event); this.customKeysMap.delete(key); } + addCustomKey() { // tslint:disable-next-line: no-string-literal const key = document.getElementsByClassName('mapKey')[0]; @@ -64,6 +77,7 @@ export class MetadataTabComponent implements OnInit { value['value'] = ''; } } + validatePackageNameAndVersion() { if (this.metaDataTab.name && this.metaDataTab.version) { this.packageCreationService.checkBluePrintNameAndVersion(this.metaDataTab.name, this.metaDataTab.version).then(element => { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html index 824152035..54491488e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html @@ -30,7 +30,7 @@
- @@ -91,4 +91,4 @@
- \ No newline at end of file + 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 eee291bba..c70109fc5 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 @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; -import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop'; -import { PackageCreationStore } from '../package-creation.store'; -import { PackageCreationUtils } from '../package-creation.utils'; +import {Component, OnInit} from '@angular/core'; +import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop'; +import {PackageCreationStore} from '../package-creation.store'; +import {PackageCreationUtils} from '../package-creation.utils'; import 'ace-builds/src-noconflict/ace'; import 'ace-builds/webpack-resolver'; @@ -76,4 +76,8 @@ export class ScriptsTabComponent implements OnInit { resetTheUploadedFiles() { this.uploadedFiles = []; } + + textChanges(code: any, key: string) { + this.packageCreationStore.addScripts(key, code); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html index 07c88c330..c3a36c9cb 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html @@ -61,7 +61,7 @@ File
+ (textChange)="textChanges($event,templateInfo.fileName)" [(text)]="templateInfo.fileContent">
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts index 836b0f5a6..d63eb2a38 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts @@ -113,8 +113,13 @@ export class TemplMappCreationComponent implements OnInit { } initTemplateMappingTableFromCurrentTemplate() { + console.log('happend'); if (this.variables && this.variables.length > 0) { this.packageCreationStore.getTemplateAndMapping(this.variables); } } + + textChanges(code: any, fileName: string) { + this.packageCreationStore.addTemplate(fileName, code); + } } -- cgit 1.2.3-korg