Handle resize all
This commit is contained in:
parent
b7b932788b
commit
6096f106b3
|
@ -79,16 +79,24 @@ export const deriveStores = context => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createActions = context => {
|
export const createActions = context => {
|
||||||
const { columns, datasource, schema } = context
|
const { columns, datasource } = context
|
||||||
|
|
||||||
// Updates the width of all columns
|
// Updates the width of all columns
|
||||||
const changeAllColumnWidths = async width => {
|
const changeAllColumnWidths = async width => {
|
||||||
const $schema = get(schema)
|
const $columns = get(columns)
|
||||||
let mutations = {}
|
$columns.forEach(column => {
|
||||||
Object.keys($schema).forEach(field => {
|
const { related } = column
|
||||||
mutations[field] = { width }
|
const mutation = { width }
|
||||||
|
if (!related) {
|
||||||
|
datasource.actions.addSchemaMutation(column.name, mutation)
|
||||||
|
} else {
|
||||||
|
datasource.actions.addSubSchemaMutation(
|
||||||
|
related.subField,
|
||||||
|
related.field,
|
||||||
|
mutation
|
||||||
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
datasource.actions.addSchemaMutations(mutations)
|
|
||||||
await datasource.actions.saveSchemaMutations()
|
await datasource.actions.saveSchemaMutations()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue