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

Remove unnecessary route #2005

Closed
wants to merge 1 commit into from
Closed

Remove unnecessary route #2005

wants to merge 1 commit into from

Conversation

jcoyne
Copy link
Member

@jcoyne jcoyne commented Oct 31, 2018

This was already defined by lib/blacklight/routes/searchable.rb

This was already defined by `lib/blacklight/routes/searchable.rb`
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 94.724% when pulling 08aeb3a on remove-unnecessary-route into 2a23401 on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 94.724% when pulling 08aeb3a on remove-unnecessary-route into 2a23401 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 94.724% when pulling 08aeb3a on remove-unnecessary-route into 2a23401 on master.

@jcoyne jcoyne added this to the 7.0 milestone Oct 31, 2018
@barmintor
Copy link
Contributor

@jcoyne I think this change looks good, but it's raising the question of where the Searchable routes are tested? I might be missing them, so I'll spend a minute more looking.

@barmintor
Copy link
Contributor

Some testing in blacklight/spec/controllers/catalog_controller_spec.rb

Copy link
Contributor

@barmintor barmintor left a comment

Choose a reason for hiding this comment

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

Does this helper break if your blacklight controller is not called catalog? The searchable concern is agnostic.

@jcoyne
Copy link
Member Author

jcoyne commented Nov 1, 2018

@barmintor I suspect so, but I also suspect it was broken before this too as that route was explicitly to /catalog

@barmintor
Copy link
Contributor

Is it possible that this route is not actually redundant/unnecessary? When the :searchable concern is effective, you don't fall into that block (your helper should respond to "track_#{controller_name}_path"). If you don't (like the BookmarksController), you still need a path and you don't have that routing concern to provide it.

@barmintor
Copy link
Contributor

@jcoyne that is, it might be wrong or deceptive (especially when you don't name your BL controller Catalog, so it's just a free standing broken route).

@barmintor barmintor added this to In Progress in Blacklight 7.0 Release Nov 2, 2018
@@ -72,7 +72,7 @@ def session_tracking_path document, params = {}
if respond_to?(controller_tracking_method)
send(controller_tracking_method, params.merge(id: document))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this message be sent to main_app as well? cf respond_to? guard.

@@ -72,7 +72,7 @@ def session_tracking_path document, params = {}
if respond_to?(controller_tracking_method)
send(controller_tracking_method, params.merge(id: document))
else
blacklight.track_search_context_path(params.merge(id: document))
main_app.track_catalog_path(params.merge(id: document))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a log message here warning that falling back to an unsafe default?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it would be nice if these track path worked with more than just catalog... we usually have to add these after the fact in order to make our build not fail (i.e. track for articles vs catalog etc.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that logging a message about the controller_tracking_method not being defined and falling back on the unsafe default, perhaps with a pointer to some docs, would be a good addition here.

@jcoyne jcoyne mentioned this pull request Nov 20, 2018
@barmintor
Copy link
Contributor

Closed via #2031

@barmintor barmintor closed this Nov 26, 2018
@barmintor barmintor removed this from In Progress in Blacklight 7.0 Release Nov 26, 2018
@jcoyne jcoyne deleted the remove-unnecessary-route branch December 13, 2018 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants