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

feat: human readable dimension filters in URL #5340

Closed
wants to merge 9 commits into from

Conversation

briangregoryholmes
Copy link
Contributor

@briangregoryholmes briangregoryholmes commented Jul 25, 2024

https://www.notion.so/rilldata/Passing-Filters-as-part-of-URL-ac2972fcd3f64de3af20838ec1c0231b?pvs=4

The API is largely taken from https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters , but see the notion doc above for greater detail.

Single value, no parenthesis:
"dimension_0 eq 'Zoom'"
dimension_0 eq 'Zoom'

With parentheses:
"dimension_0 eq ('Zoom')"
dimension_0 eq ('Zoom')
"dimension_0 eq ('Zoom', 'Zapier')"
dimension_0 eq ('Zoom', 'Zapier')

Exclude:
dimension_0 ne ('Zoom')
dimension_0 ne 'Zoom'

Multiple filters:
dimension_0 eq ('Zoom', 'Zapier') and dimension_1 eq 'Standard Plan'

Angled versions of single and double quotes (if copied from a text editor that automatically changes the character) should also work:
”dimension_0 eq (‘Zoom’, ‘Zapier’)”

@briangregoryholmes briangregoryholmes self-assigned this Jul 25, 2024
@briangregoryholmes briangregoryholmes marked this pull request as draft July 25, 2024 16:34
@nishantmonu51
Copy link
Collaborator

@briangregoryholmes : Can you resolve the conflicts here ? Is this ready to review ?

@briangregoryholmes briangregoryholmes marked this pull request as ready for review August 27, 2024 15:35
@ericpgreen2
Copy link
Contributor

It looks like you need to add support for this feature to Rill Cloud. On opening a Cloud dashboard, I hit this error:
image

And while we currently don't need support for the other instances of the <Dashboard /> component (MetricsExplorerEmbed.svelte, [org]/[project]/-/share/[token]/+page.svelte), I'm guessing they'll need to be protected from the above error.

@ericpgreen2
Copy link
Contributor

On an Adbids dashboard, I've tried navigating to this URL: http://localhost:3001/dashboard/Adbids_dashboard?filter="publisher eq Facebook"

The "F" is getting clipped from "Facebook" to "acebook":

image

Can you please update the PR description with the API that you've implemented and some examples?

@briangregoryholmes
Copy link
Contributor Author

@ericpgreen2 According to the Notion, dimension values are required to be surrounded by some form of single quotes. I updated the description with a variety of examples.

Unfortunately, I don't think it's practical to validate whether a dimension value is valid, though that's certainly something we can discuss. I've added some guard rails and an updated warning if we're able to detect that something should be quoted that isn't.

Added cloud support.

@ericpgreen2
Copy link
Contributor

@ericpgreen2 According to the Notion, dimension values are required to be surrounded by some form of single quotes. I updated the description with a variety of examples.

Oh, got it now, thanks.

I commented in the Notion doc, but IMO the ephemeral nature of these filters makes for a frustrating UX. Often, I find myself getting some part of the filter syntax incorrect. I would like to iterate on the filter / edit it after submission. But when the filter is immediately transformed into its protobuf representation, I cannot edit what I input. Let's wait for feedback from @mindspank and @nishantmonu51.

@nishantmonu51 nishantmonu51 added the blocker A release blocker issue that should be resolved before a new release label Sep 3, 2024
@ericpgreen2 ericpgreen2 removed the blocker A release blocker issue that should be resolved before a new release label Sep 9, 2024
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.

3 participants