aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models
diff options
context:
space:
mode:
authorAhmed <ahmed.eldeeb.ext@orange.com>2020-02-27 17:15:30 +0200
committerAhmed Eldeeb <ahmed.eldeeb.ext@orange.com>2020-02-28 09:32:13 +0000
commitd20383f0b00a363b0193e162ac297dd731088ca2 (patch)
tree2a4f43c7e3b69a07514c5c3cdfafacbefcb0111b /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models
parentb2b847587d7c06db5737a06820d1809b9aeb73e1 (diff)
adding dependacies to mapping table
Issue-ID: CCSDK-2065 Signed-off-by: ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I4e91ceaec3327df8f3d92ac339bc96dc2ba8e63a
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/mappingAdapter.model.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/mappingAdapter.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/mappingAdapter.model.ts
index 638654a95..b4de578b9 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/mappingAdapter.model.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/mappingAdapter.model.ts
@@ -1,10 +1,13 @@
import { ResourceDictionary } from './ResourceDictionary.model';
import { JsonObject, JsonProperty, JsonConvert } from 'json2typescript';
-// Convert ResourceDictionary object to store Mapping
+// Convert ResourceDictionary object to store Mapping.
export class MappingAdapter {
- constructor(private resourceDictionary: ResourceDictionary) { }
+ constructor(
+ private resourceDictionary: ResourceDictionary,
+ private dependancies: Map<string, Array<string>>,
+ private dependanciesSource: Map<string, string>) { }
ToMapping(): Mapping {
const mapping = new Mapping();
@@ -12,8 +15,12 @@ export class MappingAdapter {
mapping.dictionaryName = this.resourceDictionary.name;
mapping.property = this.resourceDictionary.definition.property;
mapping.inputParam = false;
- mapping.dictionarySource = 'sdnc';
- mapping.dependencies = [];
+ mapping.dictionarySource = this.dependanciesSource.get(mapping.name);
+ if (this.dependancies.get(mapping.name)) {
+ mapping.dependencies = this.dependancies.get(mapping.name);
+ } else {
+ mapping.dependencies = [];
+ }
mapping.version = 0;
return mapping;
}
@@ -32,7 +39,7 @@ export class Mapping {
@JsonProperty('dictionary-source')
dictionarySource: string;
@JsonProperty()
- dependencies: [];
+ dependencies: string[];
@JsonProperty()
version: number;
}