From fc3164594f1824451139da582c83cb662f568595 Mon Sep 17 00:00:00 2001 From: shaaban Altanany Date: Sun, 2 Feb 2020 11:20:55 +0200 Subject: adding DSL-Definition component Issue-ID: CCSDK-2066 Signed-off-by: shaaban Altanany Change-Id: I8b16e78cf3961c0c37a721fd37898fb3a7a850a0 --- .../dsl-definitions-tab.component.css | 4 ++ .../dsl-definitions-tab.component.html | 2 +- .../dsl-definitions-tab.component.ts | 21 ++++++--- .../mapping-models/CBAPacakge.model.ts | 10 ++++ .../package-creation.component.html | 2 +- .../package-creation/package-creation.store.ts | 11 ++++- .../source-editor/source-editor.component.html | 2 +- .../source-editor/source-editor.component.ts | 55 ++++++++++++---------- 8 files changed, 71 insertions(+), 36 deletions(-) (limited to 'cds-ui/designer-client/src') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.css b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.css index e69de29bb..4334e1d0f 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.css +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.css @@ -0,0 +1,4 @@ +.dsl-editor { + height: 500px; + +} \ No newline at end of file diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.html index 844481a2d..dde21297a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.html @@ -1 +1 @@ -

dsl-definitions-tab works!

+ diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.ts index af0630293..032ba0b7f 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/dsl-definitions-tab/dsl-definitions-tab.component.ts @@ -1,15 +1,22 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {DslDefinition} from '../mapping-models/CBAPacakge.model'; +import {PackageCreationStore} from '../package-creation.store'; @Component({ - selector: 'app-dsl-definitions-tab', - templateUrl: './dsl-definitions-tab.component.html', - styleUrls: ['./dsl-definitions-tab.component.css'] + selector: 'app-dsl-definitions-tab', + templateUrl: './dsl-definitions-tab.component.html', + styleUrls: ['./dsl-definitions-tab.component.css'] }) export class DslDefinitionsTabComponent implements OnInit { - constructor() { } + dslDefinition: DslDefinition = new DslDefinition(); + lang = 'json'; - ngOnInit() { - } + constructor(private packageCreationStore: PackageCreationStore) { + } + ngOnInit() { + this.packageCreationStore.changeDslDefinition(this.dslDefinition); + + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts index a5f5ec70a..78a9b5212 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts @@ -4,12 +4,14 @@ export class Definition { public metaDataTab: MetaDataTabModel; public imports: Map; + public dslDefinition: DslDefinition; // public dslDefinition: constructor() { this.imports = new Map(); this.metaDataTab = new MetaDataTabModel(); + this.dslDefinition = new DslDefinition(); } public setImports(key: string, value: string) { @@ -22,6 +24,14 @@ export class Definition { return this; } + public setDslDefinition(dslDefinition: DslDefinition): Definition { + this.dslDefinition = dslDefinition; + return this; + } +} + +export class DslDefinition { + content: string; } export class Scripts { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html index 89a190ef6..528a005d4 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html @@ -77,7 +77,7 @@