Skip to content
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

[16.0][MIG] web_ir_actions_act_window_page #2548

Merged
merged 18 commits into from
Aug 8, 2023

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Jun 28, 2023

This addon allows a developer to return the following action types:

{'type': 'ir.actions.act_window.page.next'}

or:

{'type': 'ir.actions.act_window.page.prev'}

which trigger the form's controller to page into the requested direction on the client
side.

A use case could be the case of a validation flow. As a developer, you set up a tree
view with a domain on records to be validated. The user opens the first record in a form
view and validates the record. The validation method returns the 'next' action type so
that the browser window of the user is presented with the next record in the form view.

@hbrunn hbrunn force-pushed the 16.0-web_ir_actions_act_window_page branch from 2d9349d to f5b8329 Compare July 5, 2023 06:18
Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Tested locally works perfectly

image

@StefanRijnhart
Copy link
Member

/ocabot migration web_ir_actions_act_window_page

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Jul 21, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request Jul 21, 2023
45 tasks
@StefanRijnhart
Copy link
Member

StefanRijnhart commented Jul 21, 2023

Please mention the version numbers in your migration commits.
image

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is beautifully adapted to the new upstream code. The use of the bus is revealing.
Please fix the commit messages.

patch(Pager.prototype, "navigate event listener", {
setup() {
this._super.apply();
const handleNavigate = (ev) => this._handleNavigate(ev);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random unsolicited code review. I hope it's not rude. You can import useBus from "@web/core/utils/hooks". It allow you to register when mounted and it will take care of unregistering when unmounted:

  useBus(this.env.bus, "pager:navigate", handleNavigate);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the contrary, very much appreciated and sorry for the long delay! Took your suggestion in 3a0e116

@hbrunn hbrunn force-pushed the 16.0-web_ir_actions_act_window_page branch from 3a0e116 to 0cf9d4c Compare July 31, 2023 09:26
@hbrunn hbrunn force-pushed the 16.0-web_ir_actions_act_window_page branch from 0cf9d4c to 06c1460 Compare July 31, 2023 09:27
@StefanRijnhart
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-2548-by-StefanRijnhart-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8926555 into OCA:16.0 Aug 8, 2023
9 of 10 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at ba22257. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants