Implement revive of json after load + Added parentId
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Siklos 2022-08-04 18:02:27 +02:00
parent e2ad8d6ebd
commit cf49ad644a
5 changed files with 48 additions and 3 deletions

View file

@ -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>

View file

@ -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;
}