renaming bug
This commit is contained in:
parent
841ee44835
commit
dfb5eb9bb6
|
@ -93,7 +93,13 @@ export const getBackendUiStore = () => {
|
||||||
saveField: ({ originalName, field }) => {
|
saveField: ({ originalName, field }) => {
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
// delete the original if renaming
|
// delete the original if renaming
|
||||||
|
if (originalName) {
|
||||||
delete state.draftModel.schema[originalName]
|
delete state.draftModel.schema[originalName]
|
||||||
|
state.draftModel._rename = {
|
||||||
|
old: originalName,
|
||||||
|
updated: field.name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
state.draftModel.schema[field.name] = cloneDeep(field)
|
state.draftModel.schema[field.name] = cloneDeep(field)
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
$: sort = $backendUiStore.sort
|
$: sort = $backendUiStore.sort
|
||||||
$: sorted = sort ? fsort(data)[sort.direction](sort.column) : data
|
$: sorted = sort ? fsort(data)[sort.direction](sort.column) : data
|
||||||
|
|
||||||
$: headers = Object.keys($backendUiStore.selectedModel.schema).filter(
|
$: headers = Object.keys($backendUiStore.selectedModel.schema)
|
||||||
id => !INTERNAL_HEADERS.includes(id)
|
.sort()
|
||||||
)
|
.filter(id => !INTERNAL_HEADERS.includes(id))
|
||||||
|
|
||||||
$: schema = $backendUiStore.selectedModel.schema
|
$: schema = $backendUiStore.selectedModel.schema
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue