MCPcopy Create free account
hub / github.com/DTStack/molecule / update

Method update

src/services/workbench/panelService.ts:251–264  ·  view source on GitHub ↗
(data: IPanelItem)

Source from the content-addressed store, hash-verified

249 }
250
251 public update(data: IPanelItem): IPanelItem | undefined {
252 const panes = this.state.data || [];
253 const targetIndex = panes?.findIndex(searchById(data.id));
254 if (targetIndex !== undefined && targetIndex > -1) {
255 Object.assign(panes[targetIndex], data);
256 this.setState({
257 data: [...panes],
258 });
259 return panes[targetIndex];
260 } else {
261 logger.error(`There is no panel found in data via the ${data.id}`);
262 return undefined;
263 }
264 }
265
266 public remove(id: UniqueId): IPanelItem | undefined {
267 const { data } = this.state;

Callers 1

updateOutputPropertyMethod · 0.95

Calls 2

searchByIdFunction · 0.90
setStateMethod · 0.80

Tested by

no test coverage detected