-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix: Unpublished or archived versions not shown in language menu #440
Conversation
Reviewer's Guide by SourceryThis pull request fixes a bug where unpublished or archived languages were not shown in the language menu. It modifies the Sequence diagram for language menu content retrievalsequenceDiagram
actor User
participant LM as Language Menu
participant PC as Page Content
participant V as Version Manager
User->>LM: View language menu
LM->>PC: get_admin_content(language)
PC->>V: Get latest version
Note over V: Now includes unpublished<br/>and archived versions
V-->>PC: Return content version
PC-->>LM: Return page content
LM-->>User: Display all available languages
Class diagram for version management changesclassDiagram
class AdminQuerySetMixin {
+_DraftOrPublished: Annotation
+_AnyOther: Annotation
+current_content()
+latest_content()
}
class Version {
+state: State
+content: Content
+check_modify(user)
}
class PageContent {
+get_admin_content(language)
+language: str
}
PageContent --> Version: has versions
Version --> AdminQuerySetMixin: uses
State diagram for version statesstateDiagram-v2
[*] --> Draft
Draft --> Published
Published --> Archived
Draft --> Unpublished
note right of Unpublished: Now visible in
language menu
note right of Archived: Now visible in
language menu
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #440 +/- ##
==========================================
- Coverage 91.21% 91.13% -0.08%
==========================================
Files 72 72
Lines 2663 2662 -1
Branches 307 307
==========================================
- Hits 2429 2426 -3
- Misses 163 164 +1
- Partials 71 72 +1 ☔ View full report in Codecov by Sentry. |
This PR fixes my problem. Thanks. |
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.
Hey @fsbraun - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please add tests to verify this fix and prevent future regression. The tests should cover both published and unpublished/archived language versions appearing correctly in the menu.
- Consider expanding the commit message to provide more context about the bug - what was the root cause and how does this fix address it?
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
157314c
to
1df97cd
Compare
@sourcery-ai review |
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.
Hey @fsbraun - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Also tested with the latest modifications to this PR and everything works. |
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.
Also tested with the latest modifications to this PR and everything works.
Description
Unpublished or archived languages were not shown in the language menu.
Related resources
[BUG] Language chooser in toolbar not showing all options #441
#...
Checklist
master
Slack to find a “pr review buddy” who is going to review my pull request.
Summary by Sourcery
Bug Fixes: