-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(#684): add druxtMenu/flushEntities mutation #689
Conversation
🦋 Changeset detectedLatest commit: 273a630 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe DruxtMenu component has been updated to enhance cache management for logged-in users on statically generated sites. It now includes functionality to clear specific menu-related entities from the Vuex state before fetching new menu data. This ensures that users see the most current menu information without old data interfering. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (3)
- .changeset/happy-ties-rule.md (1 hunks)
- packages/menu/src/components/DruxtMenu.vue (1 hunks)
- packages/menu/src/stores/menu.js (2 hunks)
Additional comments: 3
.changeset/happy-ties-rule.md (1)
- 5-5: The changeset description is clear and follows the conventional commit message format.
packages/menu/src/stores/menu.js (1)
- 49-69: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [26-52]
The
addEntities
mutation method is implemented correctly, ensuring reactivity with Vue's reactivity system.packages/menu/src/components/DruxtMenu.vue (1)
- 225-225: Verify that the
settings
variable is being used correctly in themounted
lifecycle hook, as it is defined but not used in the provided code snippet.Verification successful
The previous ast-grep command contained a syntax error. I will correct the pattern and run a new script to check if the
settings
variable is used within thefetchData
method.
The ast-grep pattern still contains a syntax error. I will now use ripgrep (rg) to search for references to the
settings
variable within thefetchData
method.
The ripgrep command contained a regex parse error. I will correct the regex pattern and run a new script to check if the
settings
variable is used within thefetchData
method.
The regex pattern used in the ripgrep command is still causing a parse error. I will simplify the pattern to avoid these issues and attempt to verify the usage of the
settings
variable within thefetchData
method once more.
Based on the output from the latest script, it is evident that the
settings
variable is indeed used within thefetchData
method in theDruxtMenu.vue
file. Thesettings
variable is passed as an argument to thefetchData
method and is also used within the method itself.This confirms that the
settings
variable is being used correctly in the context of thefetchData
method, and the review comment concerning the usage ofsettings
is addressed.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if settings variable is used within fetchData method. ast-grep --lang javascript --pattern $'fetchData($_) { $$$ settings $$$ }'Length of output: 544
Script:
#!/bin/bash # Corrected command to check if settings variable is used within fetchData method. ast-grep --lang javascript --pattern $'method_definition[name="fetchData"] { $$$ identifier[name="settings"] $$$ }'Length of output: 626
Script:
#!/bin/bash # Use ripgrep to search for references to the 'settings' variable within the 'fetchData' method. rg "fetchData\(.*\)\s*{[^}]*settings[^}]*}" -A 3 -B 3Length of output: 195
Script:
#!/bin/bash # Corrected regex pattern to search for references to the 'settings' variable within the 'fetchData' method. rg "fetchData\(.*\)\s*{.*settings.*}" -A 3 -B 3Length of output: 183
Script:
#!/bin/bash # Simplified regex pattern to search for references to the 'settings' variable within the 'fetchData' method. rg "fetchData" -A 10 -B 10 | rg "settings"Length of output: 2766
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/menu/src/stores/menu.js (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/menu/src/stores/menu.js
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #689 +/- ##
===========================================
+ Coverage 96.14% 96.23% +0.09%
===========================================
Files 91 91
Lines 2362 2367 +5
Branches 509 511 +2
===========================================
+ Hits 2271 2278 +7
+ Misses 76 74 -2
Partials 15 15 ☔ View full report in Codecov by Sentry. |
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.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/menu/test/stores/menu.test.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/menu/test/stores/menu.test.js
Types of changes
Description
Adds druxtMenu/flushEntities Vuex mutation to allow the menu vuex store to be flushed when logging in/out with an authenticated user.
Checklist:
Screenshots/Media:
Summary by CodeRabbit
New Features
Refactor