Implement revive of json after load + Added parentId
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e2ad8d6ebd
commit
cf49ad644a
5 changed files with 48 additions and 3 deletions
|
@ -43,7 +43,7 @@ export class Properties extends React.Component<IPropertiesProps, IPropertiesSta
|
|||
) => {
|
||||
const id = `property-${key}`;
|
||||
const type = isNaN(Number(value)) ? 'text' : 'number';
|
||||
const isDisabled = key === 'id'; // hardcoded
|
||||
const isDisabled = key === 'id' || key === 'parentId'; // hardcoded
|
||||
groupInput.push(
|
||||
<div key={id} className='mt-4'>
|
||||
<label className='text-sm font-medium text-slate-200' htmlFor={id}>{key}</label>
|
||||
|
|
|
@ -78,3 +78,13 @@ export function getAbsolutePosition(container: IContainerModel): [number, number
|
|||
}
|
||||
return [x, y];
|
||||
}
|
||||
|
||||
export function findContainerById(root: IContainerModel, id: string): IContainerModel | undefined {
|
||||
const it = MakeIterator(root);
|
||||
for (const container of it) {
|
||||
if (container.properties.id === id) {
|
||||
return container;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue