-
Notifications
You must be signed in to change notification settings - Fork 1
feat(backup): server state #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces a new backup feature that polls the server for state changes and updates the UI based on user permissions. Key changes include:
- Adding a new Vuex module (backup-provider) to manage backup state and polling logic.
- Adjusting component logic to use computed getters for permission checks.
- Updating documentation and linter configurations to support these changes.
Reviewed Changes
| File | Description |
|---|---|
| client/src/store.js | New store module for backup state and polling actions with some mutation issues. |
| mago.toml | Updated linter rules to adjust error levels on certain checks. |
| client/src/main.js | Registers the backup component on Statamic booting. |
| docs/pages/getting-started.md | Updated installation instructions for required cache driver. |
| client/src/components/Upload.vue | Refactored permission checks to use computed getters and improved dropzone logic. |
| client/src/components/Listing.vue | Changed conditionals for rendering based on updated backup state and permissions. |
| client/src/components/Backup.vue | Added module registration and polling on component creation, with module unregistration on destroy. |
| client/src/components/Actions.vue | Updated permission checks and dispatches to reflect new state management. |
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
| }, | ||
| cancelPoll(state) { | ||
| clearTimeout(state.timeout); | ||
| state.commit("timeout", null); |
Copilot
AI
Mar 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a Vuex mutation, calling state.commit is not valid because mutations only receive the state. Instead, directly assign state.timeout = null or refactor to commit a separate mutation from an action.
| state.commit("timeout", null); | |
| state.timeout = null; | |
| }, | |
| setTimeout(state, payload) { | |
| state.timeout = payload; |
No description provided.