-
Notifications
You must be signed in to change notification settings - Fork 3
fix(spp_change_request_v2,spp_base_common): route post-submit CRs through stage review form + hide single-record pager (#920) #202
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
Open
emjay0921
wants to merge
5
commits into
19.0
Choose a base branch
from
fix/hide-pager-on-single-record
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d53886d
fix(spp_base_common): hide form-view pager when only one record
emjay0921 58e6d29
fix(spp_change_request_v2): route post-submit CRs through the stage r…
emjay0921 b013691
fix(cr): set stage='review' on submit so demo-generated CRs route thr…
emjay0921 9b9e857
Merge branch '19.0' into fix/hide-pager-on-single-record
emjay0921 5881862
chore: apply pre-commit auto-fixes from CI (OP#920)
emjay0921 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // See OP#920 + spp_base_common/static/src/xml/pager_hide_single.xml. | ||
| // The control-panel right-side toolbar (refresh button, embedded | ||
| // actions, view switcher) had no vertical alignment of its own — it | ||
| // relied on the pager's h-100 nav to anchor the row's height. | ||
| // Once the pager is hidden, those siblings collapse to top-aligned. | ||
| // Set align-items: center explicitly so they stay vertically centred | ||
| // whether the pager is visible or not. | ||
| .o_control_panel_navigation { | ||
| align-items: center; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <!-- | ||
| Hide the form-view "1/1" pager when there's only one record to navigate. | ||
|
|
||
| The standard web.Pager renders the counter + chevrons even when | ||
| `total === 1`, leaving a disabled "1/1 < >" widget that confuses | ||
| users. We drop the entire <nav> with `t-if` and pair the change | ||
| with an `align-items: center` rule on the parent | ||
| `o_control_panel_navigation` (see pager_hide_single.scss) so the | ||
| sibling refresh button stays vertically centred without the | ||
| pager's old h-100 anchor. `1/1+` (updateTotal set) stays visible | ||
| because the count may still grow. | ||
|
|
||
| See OP#920. | ||
| --> | ||
| <templates xml:space="preserve"> | ||
| <t | ||
| t-name="spp_base_common.PagerHideSingle" | ||
| t-inherit="web.Pager" | ||
| t-inherit-mode="extension" | ||
| > | ||
| <xpath expr="//nav[hasclass('o_pager')]" position="attributes"> | ||
| <attribute name="t-if">props.total > 1 or props.updateTotal</attribute> | ||
| </xpath> | ||
| </t> | ||
| </templates> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The methods _action_open_review_form and _action_open_documents_form are almost identical. Refactoring them into a single helper method reduces code duplication and improves maintainability. Additionally, using self._name instead of a hardcoded model string is more idiomatic and robust for inheritance, aligning with the practice of preferring the _name attribute to avoid synchronization edge cases.
References