Update form block autoscreens to render buttons at bottom and include quiet row action buttons
This commit is contained in:
parent
902112d5a7
commit
028dc40a0d
|
@ -63,6 +63,7 @@ export const getRowActionButtonTemplates = async ({
|
||||||
_instanceName: Helpers.uuid(),
|
_instanceName: Helpers.uuid(),
|
||||||
text: action.name,
|
text: action.name,
|
||||||
type: "primary",
|
type: "primary",
|
||||||
|
quiet: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ const form = async ({ tableOrView, type, permissions, screens }) => {
|
||||||
actionType: getActionType(type),
|
actionType: getActionType(type),
|
||||||
title: getTitle(type),
|
title: getTitle(type),
|
||||||
rowId: type === "new" ? undefined : `{{ url.id }}`,
|
rowId: type === "new" ? undefined : `{{ url.id }}`,
|
||||||
|
buttonPosition: "bottom",
|
||||||
})
|
})
|
||||||
.instanceName(`${tableOrView.name} - Form block`)
|
.instanceName(`${tableOrView.name} - Form block`)
|
||||||
.json()
|
.json()
|
||||||
|
@ -69,6 +70,11 @@ const form = async ({ tableOrView, type, permissions, screens }) => {
|
||||||
})
|
})
|
||||||
if (rowActionButtons.length) {
|
if (rowActionButtons.length) {
|
||||||
formBlock.buttons = [...(formBlock.buttons || []), ...rowActionButtons]
|
formBlock.buttons = [...(formBlock.buttons || []), ...rowActionButtons]
|
||||||
|
|
||||||
|
// Collapse buttons if more than 3 row actions
|
||||||
|
if (rowActionButtons.length > 3) {
|
||||||
|
formBlock.buttonsCollapsed = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
}}
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
normal: {
|
normal: {
|
||||||
"margin-top": "16",
|
"margin-top": "24",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
order={1}
|
order={1}
|
||||||
|
|
|
@ -240,7 +240,7 @@ export const buildFormBlockButtonConfig = props => {
|
||||||
_component: "@budibase/standard-components/button",
|
_component: "@budibase/standard-components/button",
|
||||||
onClick: onDelete,
|
onClick: onDelete,
|
||||||
quiet: true,
|
quiet: true,
|
||||||
type: "secondary",
|
type: "warning",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue