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

Method changeId

ui/src/components/MappingEditor/MappingList.js:76–91  ·  view source on GitHub ↗
(oldId, newId)

Source from the content-addressed store, hash-verified

74 }
75
76 changeId(oldId, newId) {
77 const mapping = this.getMapping(oldId);
78 if (mapping && oldId !== newId) {
79 mapping.id = newId;
80 mapping.altLabel = null;
81 this.mappingItems.set(newId, mapping);
82
83 // replace any references to this mapping in other mappings' properties
84 this.applyToEntityRefs(oldId, (mappingId, propName) =>
85 this.addProperty(mappingId, propName, { entity: newId })
86 );
87 this.removeMapping(oldId);
88 }
89
90 return this;
91 }
92
93 getValues() {
94 return Array.from(this.mappingItems.values());

Callers 1

onMappingIdChangeMethod · 0.80

Calls 5

getMappingMethod · 0.95
applyToEntityRefsMethod · 0.95
addPropertyMethod · 0.95
removeMappingMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected