Remove readonly
This commit is contained in:
parent
151ff27351
commit
06549149b6
|
@ -13,9 +13,8 @@
|
||||||
|
|
||||||
const toggleColumn = async (column, permission) => {
|
const toggleColumn = async (column, permission) => {
|
||||||
const visible = permission !== PERMISSION_OPTIONS.HIDDEN
|
const visible = permission !== PERMISSION_OPTIONS.HIDDEN
|
||||||
const readonly = permission === PERMISSION_OPTIONS.READONLY
|
|
||||||
|
|
||||||
datasource.actions.addSchemaMutation(column.name, { visible, readonly })
|
datasource.actions.addSchemaMutation(column.name, { visible })
|
||||||
await datasource.actions.saveSchemaMutations()
|
await datasource.actions.saveSchemaMutations()
|
||||||
dispatch(visible ? "show-column" : "hide-column")
|
dispatch(visible ? "show-column" : "hide-column")
|
||||||
}
|
}
|
||||||
|
@ -27,13 +26,11 @@
|
||||||
|
|
||||||
const PERMISSION_OPTIONS = {
|
const PERMISSION_OPTIONS = {
|
||||||
WRITABLE: "writable",
|
WRITABLE: "writable",
|
||||||
READONLY: "readonly",
|
|
||||||
HIDDEN: "hidden",
|
HIDDEN: "hidden",
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
{ icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE },
|
{ icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE },
|
||||||
{ icon: "Visibility", value: PERMISSION_OPTIONS.READONLY },
|
|
||||||
{ icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN },
|
{ icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -42,10 +39,6 @@
|
||||||
return PERMISSION_OPTIONS.HIDDEN
|
return PERMISSION_OPTIONS.HIDDEN
|
||||||
}
|
}
|
||||||
|
|
||||||
if (column.readonly) {
|
|
||||||
return PERMISSION_OPTIONS.READONLY
|
|
||||||
}
|
|
||||||
|
|
||||||
return PERMISSION_OPTIONS.WRITABLE
|
return PERMISSION_OPTIONS.WRITABLE
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue