Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
meneman committed Aug 28, 2023
1 parent 436cc69 commit d289030
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
11 changes: 0 additions & 11 deletions src/features/ToolSettings/ToolSettingsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 0 additions & 2 deletions src/features/ToolSettings/ToolSettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions src/features/wizard/WizardSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export const jsonFormsEditSlice = createSlice({
return
}
state.selectedElementKey = null
state.editMode = false

state.jsonSchema = jsonSchema
state.uiSchema = uiSchema
},
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d289030

Please sign in to comment.