(model, mappingData)
| 17 | |
| 18 | class MappingList { |
| 19 | constructor(model, mappingData) { |
| 20 | this.model = model; |
| 21 | this.mappingItems = new Map(); |
| 22 | |
| 23 | if (mappingData) { |
| 24 | Object.entries(mappingData).forEach( |
| 25 | ([id, { schema, keys, properties }], i) => { |
| 26 | const ftmSchema = model.getSchema(schema); |
| 27 | this.mappingItems.set(id, { |
| 28 | id, |
| 29 | color: this.assignColor(i), |
| 30 | altLabel: this.getLabelFromId(id, ftmSchema), |
| 31 | schema: ftmSchema, |
| 32 | keys: keys || [], |
| 33 | properties: properties || {}, |
| 34 | }); |
| 35 | } |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | this.removeProperty = this.removeProperty.bind(this); |
| 40 | this.changeId = this.changeId.bind(this); |
| 41 | } |
| 42 | |
| 43 | assignColor() { |
| 44 | const colorIndex = this.getValues() |
nothing calls this directly
no test coverage detected