query_reviewer icon indicating copy to clipboard operation
query_reviewer copied to clipboard

box won't render unless tracing is enable?

Open rwygand opened this issue 13 years ago • 4 comments

I'd like the query review box to render if query reviewer is enabled in the configuration yml, even if the cookie isn't enabled and no tracing occurs. As it is right now, the query review view and all associated javascript does't get loaded so there's no clickable interface to enable tracing anywhere on the page, unless I manually include query_review_output in a view somewhere.

But if I do this, once I enable the cookie by clicking the link in the view, I get the query reviewer view injected into my html twice.

Am I missing some configuration to avoid this? If not, I think the solution is to always add_query_output_to_view in controller_extensions (that is, remove the return unless Thread.current["query_reviewer_enabled"]) and, instead, in perform_action_with_query_review, change the Thread.current[...] = to return unless.

I can submit a pull request if you'd like.

rwygand avatar Jul 20 '12 04:07 rwygand

I think this was broken by 1dea755592e0afa8e49289ce98dcc8bcbea3536f, which exits early from add_query_output_to_view unless cookies["query_review_enabled"] is set.

jdelStrother avatar Nov 27 '12 16:11 jdelStrother

Happy to accept a pull request for this behavior

nesquena avatar Nov 27 '12 19:11 nesquena

I think my pull request would involve just deleting the return unless Thread.current["query_reviewer_enabled"] line... but then, I can't quite follow exactly why that's there in the first place. @mikegee ?

jdelStrother avatar Dec 09 '12 00:12 jdelStrother

My changes allowed query_reviewer to run in production and be invisible to all but an admin user. Feel free to break my use case, though. I got what I needed out of it and don't use query_reviewer anymore.

mikegee avatar Dec 09 '12 04:12 mikegee