-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
update no_objects_found partial to allow not show new resource link #2289
Conversation
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.
Thanks. That makes sense, but can be improved by using local_assigns
.
@@ -1,4 +1,4 @@ | |||
<%= Spree.t(:no_resource, resource: plural_resource_name(resource)) %> | |||
<% if can? :create, resource %> | |||
<% if can? :create, resource and !new_resource_url.nil? %> |
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.
We should use local_assigns
here to make it optional.
if can?(:create, resource) && local_assigns[:new_resource_url]
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.
Yeah, is more clean like you propose 👍
I'll update the pulll request accordingly
@@ -41,7 +41,7 @@ | |||
<div class="col-9 no-objects-found"> | |||
<%= render 'spree/admin/shared/no_objects_found', | |||
resource: Spree::StockMovement, | |||
new_resource_url: new_object_url %> | |||
new_resource_url: nil %> |
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.
We can remove this local entirely if we use local_assigns
in the partial above.
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.
Thank you
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.
Thanks
update no_objects_found partial to allow not show new resource link solidusio#2289
Sorry that this took so long. Please feel free to ping us, if it takes too long for an approved PR to be merged. |
Fix #2150
Like described in the issue mentioned above there is an error when we try to generate a
new_object_url
for stock movements, this because stock movements only allow index route.