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

Filter bindings #13549

Merged
merged 37 commits into from
May 9, 2024
Merged

Filter bindings #13549

merged 37 commits into from
May 9, 2024

Conversation

deanhannigan
Copy link
Contributor

Description

Added the ability to use bindings when filtering tables or creating views. Supports handlebars, js and js snippets!

  • When browsing a table in the Data section you can now apply a number of bindings directly to a filter.
  • You can incorporate a mixture of useful bindings and save them as a reusable View.
  • Internal datasources utilising User field types can filter rows by app user id. The Current User bindings can be used to filter rows by the currently logged in user.
  • Components in the builder can also apply filter bindings to their respective datasource settings.
  • Updated UX utilising the new drawers

Binding Categories

  • Current User - metadata for the currently authenticated user. If a view or filter is executed outside of a session e.g. in a public screen, the Current User bindings will not resolve.
  • Date - contains a Server date binding. This will reflect the timestamp at the moment the view/filter is executed.
  • Helpers - the same handlebars helpers used throughout Budibase e.g. {{ default Current User._firstName 'no user'}}

Addresses

Screenshots

Previously the filter type only allowed the use of static values. Now there is a second binding option.
Screenshot 2024-04-23 at 15 28 55

A view created with a simple js binding to check for rows created in the last 2 weeks.
Screenshot 2024-04-23 at 14 45 02

A view created with a js snippet.
Screenshot 2024-04-23 at 14 44 23

A view filtering by a user column matching by the sessions current user id. This example utilises the handlebars syntax
Screenshot 2024-04-23 at 14 58 38

Launchcontrol

Bindings now available when creating views, table filters or filtering builder component datasources.

@deanhannigan deanhannigan requested a review from a team as a code owner April 23, 2024 14:32
@deanhannigan deanhannigan requested review from mike12345567 and aptkingston and removed request for a team April 23, 2024 14:32
@deanhannigan deanhannigan marked this pull request as draft April 24, 2024 07:50
@deanhannigan deanhannigan marked this pull request as ready for review May 8, 2024 09:24
@deanhannigan
Copy link
Contributor Author

I've marked two of the tests related to Multiuser columns as !sqs. The SQS search doesn't seem to fully support them yet. The search logic does return the correct rows in the responses, but the Multiuser columns are empty causing them to appear to fail.

Copy link
Collaborator

@samwho samwho left a comment

Choose a reason for hiding this comment

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

From a backend perspective, barring a couple of small questions, I'm happy with this.

Thanks so much for extending search.spec.ts, the tests for this are really good!

packages/server/src/api/routes/tests/search.spec.ts Outdated Show resolved Hide resolved
@deanhannigan deanhannigan requested a review from samwho May 9, 2024 10:45
@deanhannigan deanhannigan merged commit e5a7cd8 into master May 9, 2024
10 checks passed
@deanhannigan deanhannigan deleted the feature/filter-bindings branch May 9, 2024 13:44
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants