Adjust grid props and config
This commit is contained in:
parent
24182b3f1b
commit
9665ec34dd
|
@ -32,12 +32,12 @@
|
|||
export let datasource = null
|
||||
export let schemaOverrides = null
|
||||
export let columnWhitelist = null
|
||||
export let allowAddRows = true
|
||||
export let allowExpandRows = true
|
||||
export let allowEditRows = true
|
||||
export let allowDeleteRows = true
|
||||
export let allowEditColumns = true
|
||||
export let allowSchemaChanges = true
|
||||
export let canAddRows = true
|
||||
export let canExpandRows = true
|
||||
export let canEditRows = true
|
||||
export let canDeleteRows = true
|
||||
export let canEditColumns = true
|
||||
export let canSaveSchema = true
|
||||
export let stripeRows = false
|
||||
export let collaboration = true
|
||||
export let showAvatars = true
|
||||
|
@ -83,12 +83,12 @@
|
|||
datasource,
|
||||
schemaOverrides,
|
||||
columnWhitelist,
|
||||
allowAddRows,
|
||||
allowExpandRows,
|
||||
allowEditRows,
|
||||
allowDeleteRows,
|
||||
allowEditColumns,
|
||||
allowSchemaChanges,
|
||||
canAddRows,
|
||||
canExpandRows,
|
||||
canEditRows,
|
||||
canDeleteRows,
|
||||
canEditColumns,
|
||||
canSaveSchema,
|
||||
stripeRows,
|
||||
collaboration,
|
||||
showAvatars,
|
||||
|
|
|
@ -21,16 +21,10 @@ export const deriveStores = context => {
|
|||
[props, hasNonAutoColumn],
|
||||
([$props, $hasNonAutoColumn]) => {
|
||||
let config = {
|
||||
// Row features
|
||||
canAddRows: $props.allowAddRows,
|
||||
canExpandRows: $props.allowExpandRows,
|
||||
canEditRows: $props.allowEditRows,
|
||||
canDeleteRows: $props.allowDeleteRows,
|
||||
...$props,
|
||||
|
||||
// Column features
|
||||
canEditColumns: $props.allowEditColumns,
|
||||
canEditPrimaryDisplay: $props.allowEditColumns,
|
||||
canSaveSchema: $props.allowSchemaChanges,
|
||||
// Additional granular features which we don't expose as props
|
||||
canEditPrimaryDisplay: $props.canEditColumns,
|
||||
}
|
||||
|
||||
// Disable some features if we're editing a view
|
||||
|
@ -42,15 +36,11 @@ export const deriveStores = context => {
|
|||
config.canAddRows = false
|
||||
}
|
||||
|
||||
console.log($hasNonAutoColumn)
|
||||
|
||||
// Disable adding rows if we don't have any valid columns
|
||||
if (!$hasNonAutoColumn) {
|
||||
config.canAddRows = false
|
||||
}
|
||||
|
||||
console.log(config)
|
||||
|
||||
return config
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue