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