aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-03-04 15:10:05 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-04 15:10:05 +0000
commit7a8bfb25a92a9400862d70e690313a4e743124da (patch)
tree61a4a1121cf027e4397fa27b3ac08046e6a747a0 /cds-ui/designer-client/src/app
parentda1303759f22b7882b46fb8670704f2770bf46ed (diff)
parent2201f57353c27995b08892f311429b400538c492 (diff)
Merge "add integrating with designer from viewing package"
Diffstat (limited to 'cds-ui/designer-client/src/app')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html4
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts11
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts4
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts6
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts7
5 files changed, 25 insertions, 7 deletions
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 bb7647449..df1911a7d 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
@@ -70,7 +70,7 @@
(click)="downloadPackage(viewedPackage.artifactName,viewedPackage.artifactVersion)"><i
class="fa"></i> Download</button>
- <button class="btn btn-sm btn-primary">Designer Mode</button>
+ <button class="btn btn-sm btn-primary" (click)="goToDesignerMode()">Designer Mode</button>
</div>
</div>
@@ -130,4 +130,4 @@
</div>
</div>
</div>
-</div> \ No newline at end of file
+</div>
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 c67331c3e..6de76f949 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
@@ -12,6 +12,7 @@ import {PackageCreationUtils} from '../package-creation/package-creation.utils';
import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes';
import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder';
import {saveAs} from 'file-saver';
+import {DesignerStore} from '../designer/designer.store';
@Component({
selector: 'app-configuration-dashboard',
@@ -37,7 +38,8 @@ export class ConfigurationDashboardComponent implements OnInit {
constructor(private route: ActivatedRoute, private configurationDashboardService: ConfigurationDashboardService,
private packageCreationStore: PackageCreationStore,
private packageCreationUtils: PackageCreationUtils,
- private router: Router) {
+ private router: Router,
+ private designerStore: DesignerStore) {
}
ngOnInit() {
@@ -104,6 +106,10 @@ export class ConfigurationDashboardComponent implements OnInit {
}
this.packageCreationStore.changeDslDefinition(dslDefinition);
this.packageCreationStore.setCustomKeys(mapOfCustomKeys);
+ // console.log(definition.topology_template.content);
+ if (definition.topology_template.content) {
+ this.designerStore.saveSourceContent(definition.topology_template.content);
+ }
} else {
this.packageCreationStore.addDefinition(filename, fileData);
@@ -200,4 +206,7 @@ export class ConfigurationDashboardComponent implements OnInit {
this.router.navigate(['/packages']);
}
+ goToDesignerMode() {
+ this.router.navigate(['/packages/designer']);
+ }
}
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
index b72a5bc47..ba8b2f0f1 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts
@@ -76,11 +76,11 @@ export class DesignerStore extends Store<DesignerDashboardState> {
}
saveSourceContent(code: string) {
- const topologtTemplate = JSON.parse(code);
+ const topologyTemplate = JSON.parse(code);
this.setState({
...this.state,
sourceContent: code,
- template: topologtTemplate
+ template: topologyTemplate
});
}
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 45a00ff06..a37339d90 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
@@ -1,4 +1,6 @@
-import { MetaDataTabModel } from './metadata/MetaDataTab.model';
+import {MetaDataTabModel} from './metadata/MetaDataTab.model';
+
+
export class Definition {
@@ -50,6 +52,7 @@ export class Base {
return this.files.get(key);
}
}
+
export class Scripts {
public files: Map<string, string>;
@@ -83,6 +86,7 @@ export class Template {
export class Mapping extends Base {
}
+
export class CBAPackage {
public metaData: MetaDataTabModel;
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts
index 8e2ff475e..630baa1ac 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts
@@ -1,5 +1,9 @@
import { Any, JsonObject, JsonProperty } from 'json2typescript';
+@JsonObject('topology_template')
+export class TemplateTopology {
+ public content: string;
+}
@JsonObject
export class VlbDefinition {
@@ -10,7 +14,8 @@ export class VlbDefinition {
imports: Import[];
// tslint:disable-next-line: variable-name
dsl_definitions: DslContent;
- // topology_template: TopologyTemplate;
+ // tslint:disable-next-line: variable-name
+ topology_template: TemplateTopology;
}
@JsonObject('dsl_definitions')