-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Filter bindings #13549
Conversation
…or multiple binding types
I've marked two of the tests related to Multiuser columns as |
There was a problem hiding this 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!
Description
Added the ability to use bindings when filtering tables or creating views. Supports
handlebars
,js
andjs snippets
!View
.User
field types can filter rows by app user id. TheCurrent User
bindings can be used to filter rows by the currently logged in user.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, theCurrent User
bindings will not resolve.Date
- contains aServer 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](https://private-user-images.githubusercontent.com/5913006/324874731-2dab9bc7-1c75-4c10-88fa-1dac9cf5f063.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTgxOTQsIm5iZiI6MTcyMDM1Nzg5NCwicGF0aCI6Ii81OTEzMDA2LzMyNDg3NDczMS0yZGFiOWJjNy0xYzc1LTRjMTAtODhmYS0xZGFjOWNmNWYwNjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMTMxMTM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTc3YzBjMWM2YzVmYmYwOWUxMjBhZDAxYTFkNGQ5YzMyMmUxNTg5ODlmMjk1MDg5YjBhYWU3NTU3YWY2YzlmMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.COSylVLX8iI7qkjzl9zkrWAVa7CLi9w-7cgJl88VESQ)
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](https://private-user-images.githubusercontent.com/5913006/324859205-b1913778-7443-43e9-9d5d-ec21c50852e5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTgxOTQsIm5iZiI6MTcyMDM1Nzg5NCwicGF0aCI6Ii81OTEzMDA2LzMyNDg1OTIwNS1iMTkxMzc3OC03NDQzLTQzZTktOWQ1ZC1lYzIxYzUwODUyZTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMTMxMTM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmJkODQ3ODQ1MTk2NzhhY2NlZDgzYmU3ODZkYTA3ODc0MmVmMjRjODkzMGQ2ZWQ3YWY1ZDU1NzQ0MjRkNTU4MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Esz_Z1cpcfv-UL2CTAhQZK3lTpU9gUoMXud5vbTKLSg)
A view created with a js snippet.
![Screenshot 2024-04-23 at 14 44 23](https://private-user-images.githubusercontent.com/5913006/324859178-66ca0393-ec66-41bb-8b12-33944a44d516.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTgxOTQsIm5iZiI6MTcyMDM1Nzg5NCwicGF0aCI6Ii81OTEzMDA2LzMyNDg1OTE3OC02NmNhMDM5My1lYzY2LTQxYmItOGIxMi0zMzk0NGE0NGQ1MTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMTMxMTM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2FiOTNjMmYyMGZmZGU3OTk3ZTFiZWM4NzA1NTI5Njg4N2I4OGZjYzc1ZTRlMTJhNTFiNDJmNGUwZWZiZTgzZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.u4igfuMyOm8wg4mOlRo3CWxUPi2DWI5uIBZs4_sgHbg)
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](https://private-user-images.githubusercontent.com/5913006/324863078-4dc6dbcc-f488-4ba1-8b2b-ddd76d3706ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNTgxOTQsIm5iZiI6MTcyMDM1Nzg5NCwicGF0aCI6Ii81OTEzMDA2LzMyNDg2MzA3OC00ZGM2ZGJjYy1mNDg4LTRiYTEtOGIyYi1kZGQ3NmQzNzA2YWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMTMxMTM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmQ0Njk5YTJlMDFjNzMxNmZkZmMyNWU4MWQxOGU0ZmVkMzNkMTUzZTJjMmIyMjY4ZDQ4OGFiNjI3YmYyNjdhZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.WUdfh-ATj7B3rDNPhF7Q41EquzHw_MlYt7F5A8-cBPY)
Launchcontrol
Bindings now available when creating views, table filters or filtering builder component datasources.