Enhance Pinia History Plugin with State Filtering and Configuration Options

- Added an `ignoreKeys` option in the `mergeOptions` function of `pinia-history.js` to specify keys that should be excluded from history tracking, improving the plugin's flexibility.
- Introduced a new `filterState` function to filter out ignored keys from the state object, ensuring that only relevant state changes are tracked.
- Updated the history management logic to utilize the filtered state, enhancing the accuracy of undo/redo functionality.
- Modified the `working_form.js` store to include default ignored keys for history tracking, streamlining the configuration process.

These changes aim to improve the usability and performance of the Pinia history plugin by allowing developers to customize which state properties are tracked, thereby reducing unnecessary history entries.
This commit is contained in:
JhumanJ
2025-05-27 17:44:51 +02:00
parent f3a02df80e
commit 61fc30b95c
2 changed files with 38 additions and 8 deletions

View File

@@ -253,5 +253,7 @@ export const useWorkingFormStore = defineStore("working_form", {
this.setProperties(newFields)
}
},
history: {}
history: {
ignoreKeys: ['structureService', 'blockForm']
}
})