mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* feat: undo for button field action configuration Creating, editing, reordering and deleting a button's actions bypassed undo, so Ctrl+Z restored the field but not its actions. * fix: keep button action undo working across edits and type changes A type change dropped trashed actions and gave restored ones new ids, so redo failed. A reopened editor kept stale card values and could revert an undo on save. A concurrent delete of one action returned a 500. * test: e2e coverage for button field action undo Covers one undo reverting a whole editor save, redo, and redo after a field is changed into a button. * fix: skip the order call when a button save keeps the order Each call adds an undo step, and an undo group only reverts 20 of them. * docs: document create_instance_from_serialized parameters * fix: keep sensitive fields when undoing a button action type change A type change deleted the old service, and undo rebuilt it from logged values that leave sensitive fields out. The replaced service is now kept until the undo step is cleaned up. * fix: remove a button action's trash entry when the action is deleted A field changing away from a button deleted its trashed actions but left their entries listed in the trash. * fix: harden button action undo around secrets and field type changes Field backups logged action secrets, undo reattached integrations unchecked, and a field type round trip broke redo. Sensitive-only edits added empty undo steps, and the delete race error could never be reached. * fix: rebuild button action cards when the editor is cancelled Each card copies its values once, so a cancelled edit stayed visible and could be saved later. * fix: skip undo of a button action already restored from the trash * fix: restore a deleted button action to its old position on undo * fix: check the workflow when undo brings back a start workflow action * perf: check a kept button action service in one query * fix: name a trashed button action by its position * chore: invoke button action types through the action registry * fix: send a button save too big for one undo group ungrouped * docs: spell out what button action undo leaves unreverted
22 lines
666 B
JavaScript
22 lines
666 B
JavaScript
import { generateUUID } from '@baserow/modules/core/utils/string'
|
|
|
|
export const createNewUndoRedoActionGroupId = () => {
|
|
return generateUUID()
|
|
}
|
|
|
|
export const UNDO_REDO_ACTION_GROUP_HEADER = 'ClientUndoRedoActionGroupId'
|
|
|
|
export const getUndoRedoActionRequestConfig = ({ undoRedoActionGroupId }) => {
|
|
const config = { params: {} }
|
|
if (undoRedoActionGroupId != null) {
|
|
config.headers = {
|
|
[UNDO_REDO_ACTION_GROUP_HEADER]: undoRedoActionGroupId,
|
|
}
|
|
}
|
|
return config
|
|
}
|
|
|
|
// The backend setting of the same name: one undo takes back at most this many
|
|
// steps of an action group, newest first.
|
|
export const MAX_UNDOABLE_ACTIONS_PER_ACTION_GROUP = 20
|