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(),
|
||||
text: action.name,
|
||||
type: "primary",
|
||||
quiet: true,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ const form = async ({ tableOrView, type, permissions, screens }) => {
|
|||
actionType: getActionType(type),
|
||||
title: getTitle(type),
|
||||
rowId: type === "new" ? undefined : `{{ url.id }}`,
|
||||
buttonPosition: "bottom",
|
||||
})
|
||||
.instanceName(`${tableOrView.name} - Form block`)
|
||||
.json()
|
||||
|
@ -69,6 +70,11 @@ const form = async ({ tableOrView, type, permissions, screens }) => {
|
|||
})
|
||||
if (rowActionButtons.length) {
|
||||
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={{
|
||||
normal: {
|
||||
"margin-top": "16",
|
||||
"margin-top": "24",
|
||||
},
|
||||
}}
|
||||
order={1}
|
||||
|
|
|
@ -240,7 +240,7 @@ export const buildFormBlockButtonConfig = props => {
|
|||
_component: "@budibase/standard-components/button",
|
||||
onClick: onDelete,
|
||||
quiet: true,
|
||||
type: "secondary",
|
||||
type: "warning",
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue