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

fix: action visibility on show controls #1833

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Jul 5, 2023

Description

Fixes #1769

Action visibility block runs even on show controls actions now

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@Paul-Bob Paul-Bob self-assigned this Jul 5, 2023
@github-actions github-actions bot added the Fix label Jul 5, 2023
@codeclimate
Copy link

codeclimate bot commented Jul 5, 2023

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

View more on Code Climate.

Comment on lines 7 to 17
def initialize(klass, record: nil, resource: nil, view: nil, **args)
super(**args)

@klass = klass
@resource = resource
@model = model
@record = record
@view = view
end

def action
@instance ||= @klass.new(model: @model, resource: @resource, view: @view)
@instance ||= @klass.new(model: @record, resource: @resource, view: @view)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason this class is initialized by Avo::Resources::Controls::Action.new(klass, record: record, resource: resource, view: view, **args) but the initialize method was not expecting the same argument name, using model instead record. (In avo3 this is already uniformed)

@adrianthedev
Copy link
Collaborator

Can we add some tests please?

@Paul-Bob Paul-Bob merged commit bbece3b into main Jul 6, 2023
12 of 14 checks passed
@Paul-Bob Paul-Bob deleted the fix/action_visibility_on_show_controls branch July 6, 2023 10:26
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

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

Please check the release guide for more information.

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.

The action's visible block is not respected in the action show control
2 participants