query_reviewer
query_reviewer copied to clipboard
box won't render unless tracing is enable?
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.
I think this was broken by 1dea755592e0afa8e49289ce98dcc8bcbea3536f, which exits early from add_query_output_to_view unless cookies["query_review_enabled"] is set.
Happy to accept a pull request for this behavior
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 ?
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.