diff --git a/src/features/ToolSettings/ToolSettingsSelectors.ts b/src/features/ToolSettings/ToolSettingsSelectors.ts index 0cce928..c4923d0 100644 --- a/src/features/ToolSettings/ToolSettingsSelectors.ts +++ b/src/features/ToolSettings/ToolSettingsSelectors.ts @@ -22,14 +22,3 @@ const selectSelectedElementJsonSchema = createSelector( ) export { selectSelectedElementJsonSchema } - -function getJsonSchemaByPath(jsonSchema, path) { - const pathArray = path.split('.') - const selectedElement = pathArray.reduce((prev, key) => { - if (prev.type === 'object' && prev.properties && prev.properties[key]) { - return prev.properties[key] - } - return null - }, jsonSchema) - return selectedElement -} diff --git a/src/features/ToolSettings/ToolSettingsView.tsx b/src/features/ToolSettings/ToolSettingsView.tsx index 49c63e6..4f4a6c4 100644 --- a/src/features/ToolSettings/ToolSettingsView.tsx +++ b/src/features/ToolSettings/ToolSettingsView.tsx @@ -7,8 +7,6 @@ import { selectSelectedElementJsonSchema } from '../wizard/WizardSliceSelectors' import useToolSettings from './useToolSettings' function ToolSettings() { - const selectedElementJsonSchema = useSelector(selectSelectedElementJsonSchema) - const UIElementFromSelection = useSelector(selectUIElementFromSelection) const { handleChange, toolSettingsJsonSchema, tooldataBuffer } = useToolSettings() return ( diff --git a/src/features/wizard/WizardSlice.ts b/src/features/wizard/WizardSlice.ts index 92d03d9..30463d4 100644 --- a/src/features/wizard/WizardSlice.ts +++ b/src/features/wizard/WizardSlice.ts @@ -252,7 +252,7 @@ export const jsonFormsEditSlice = createSlice({ return } state.selectedElementKey = null - state.editMode = false + state.jsonSchema = jsonSchema state.uiSchema = uiSchema }, @@ -390,8 +390,8 @@ export const jsonFormsEditSlice = createSlice({ // this is the move source const { path: sourcePath } = draggableMeta.uiSchema as any const { index: sourceIndex, parentPath: sourceParentPath } = getIndexAndParentPathOfUISchemaElement(sourcePath) - if(child.path === sourcePath) { - return + if (child.path === sourcePath) { + return } const targetIndex = index + (placeBefore ? 0 : 1) // const sourceIndex = getIndexFromPath(sourcePath)