Skip to content

refactor: access view_type from resource #3814

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

Merged
merged 3 commits into from
Apr 28, 2025
Merged

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Apr 28, 2025

Description

This refactor moves view_type from @index_params into the resource object.

In this PR, we need to pass view_type to the action through params. With this change, we don't have to manually pass it to the action path generator. Since the action path generator already has access to the resource, it can just grab the view_type directly from there.

Without this refactor manual view_type would be required, such as:

        path, data = Avo::Actions::City::Update.link_arguments(
          resource: resource,
          view_type: ... # this would be required in order to enable grid item reload when using reload_records feature
        )

Copy link

Code Climate has analyzed commit 9a853ba and detected 0 issues on this pull request.

View more on Code Climate.

@Paul-Bob Paul-Bob merged commit 3afd2fe into main Apr 28, 2025
20 checks passed
@Paul-Bob Paul-Bob deleted the refactor/view_type_access branch April 28, 2025 17:46
@Paul-Bob Paul-Bob self-assigned this Apr 28, 2025
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

@Paul-Bob Paul-Bob restored the refactor/view_type_access branch April 28, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant