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

Enhancement Request - Full Screen Results should show filtered results, not all results #433

Closed
MYX-GitHub opened this issue Jan 23, 2021 · 8 comments · Fixed by #442
Closed

Comments

@MYX-GitHub
Copy link

The Full Screen Results is a great feature, but somewhat limited because it always shows all query results, whereas the many screen can show results that are filtered through the use of parameters (i.e. - the main screen with filtering parameters can show 100 records, but opening the Full Screen Results shows 1000 results, because it is unfiltered)

Is it possible to enable the Full Screen Results to show only the query results that match the additional parameters (i.e. both screens only show the 100 filtered results)?

Thanks!

Mike

@marksweb
Copy link
Collaborator

Can you give an example please? Perhaps with screenshots & the type of URL params you're talking about.

@MYX-GitHub
Copy link
Author

MYX-GitHub commented Jan 24, 2021

Thanks for looking into this.

Here's an example query with a filtering parameter $$Domain$$:

SELECT
	Domain,
	EntityType AS 'Entity Type',
	COALESCE(EntitySubtype, '') AS 'Entity Sub-Type',
	COUNT(*) AS 'Qty'

FROM
	ACTGEAR

WHERE
	Domain LIKE '$$Domain$$%'
	AND EntityType LIKE '%'
	AND RuleStatus NOT IN ('Dev', 'Draft')

GROUP BY
	Domain, EntityType, EntitySubtype
	
ORDER BY
	Domain, EntityType

The URL on the main screen for the unfiltered query returns 937 rows:

http://127.0.0.1:8000/explorer/13/?params=domain%3A

The URL on the "Full Screen Results" link is:

http://127.0.0.1:8000/explorer/13/?fullscreen=1&rows=1000

Specifying a Domain Parameter of "Business" filters the results and only shows 26 rows.

The URL on the main screen for the filtered query that returns the 26 rows:

http://127.0.0.1:8000/explorer/13/?params=domain%3ABusiness

The URL on the Full screen Results link is (the same as when the main screen was unfiltered:

http://127.0.0.1:8000/explorer/13/?fullscreen=1&rows=1000

(I took 2 screen captures, but for some reason, I can't attach the PDF files. Will try something different and attach later.)

@MYX-GitHub
Copy link
Author

Can't attach files for some reason - GitHub allows me to select a file to open, but doesn't attach it.

I tried SQL Explorer and attaching files in two different browsers and got the same results (FireFox and Pale Moon - a FireFox clone)

Let me know if you'd like the screen captures emailed.

Regards,

Mike

@marksweb
Copy link
Collaborator

Ok, I can see now. I've just never used it like this so wasn't familiar with the steps.

It looks like it's simply because the GET params aren't passed with the a tag for fullscreen;

    {%  if query.id %}
      <a id="fullscreen" href="./?fullscreen=1&rows={{ rows }}" target="_blank" title="Fullscreen results">
    {% elif ql_id %}
      <a id="fullscreen" href="./?querylog_id={{ ql_id }}&fullscreen=1&rows={{ rows }}" target="_blank" title="Fullscreen results">
    {% endif %}

Are you able to submit a PR?

The code that needs changing is here, on lines 33 and 35

@MYX-GitHub
Copy link
Author

I'm not really setup to submit a PR (Rather than a developer, I'm a hacker who can code myself out of a paper bag, as long as it is sufficiently wet.) I'll try updating my installed code with your lines 33 and 35 above and let you know how it works.

@MYX-GitHub
Copy link
Author

Ok, my mistake ... lines 33 and 35 are where the fix would go (they aren't actually the fixed lines). I'll scratch my head a little bit to see if I can come up with something, but with my level of coding skills, I'm not even sure where on my head I should be scratching.

@marksweb
Copy link
Collaborator

marksweb commented Feb 1, 2021

@MYX-GitHub ah ok, sorry, I just assume that people using this are likely to be python devs.

I've pushed a branch which hopefully resolves this. You can install from it directly and test it using;

pip install git+https://github.com/groveco/django-sql-explorer.git@fix/433

@marksweb
Copy link
Collaborator

marksweb commented May 14, 2021

This should be resolved in #442

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 a pull request may close this issue.

2 participants