MCPcopy Create free account
hub / github.com/alephdata/aleph / constructor

Method constructor

ui/src/components/MappingEditor/MappingList.js:19–41  ·  view source on GitHub ↗
(model, mappingData)

Source from the content-addressed store, hash-verified

17
18class 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()

Callers

nothing calls this directly

Calls 3

assignColorMethod · 0.95
getLabelFromIdMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected