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

Method addMapping

ui/src/components/MappingEditor/MappingList.js:159–175  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

157 }
158
159 addMapping(schema) {
160 const id = this.assignId(schema);
161 const schemaCount = this.getSchemaCount(schema);
162
163 const newMapping = {
164 id,
165 altLabel: schemaCount
166 ? `${schema.label} ${schemaCount + 1}`
167 : schema.label,
168 color: this.assignColor(),
169 schema,
170 keys: [],
171 properties: {},
172 };
173 this.mappingItems.set(id, newMapping);
174 return this;
175 }
176
177 removeMapping(idToRemove) {
178 this.mappingItems.delete(idToRemove);

Callers 1

onMappingAddMethod · 0.80

Calls 4

assignIdMethod · 0.95
getSchemaCountMethod · 0.95
assignColorMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected