-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Views V2 #11573
Merged
Merged
Views V2 #11573
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e data table for views V2
…g of nullish view params
Guard frontend view permissions
Support views on plus datasources
…sociated with the table
adrinr
reviewed
Aug 30, 2023
adrinr
reviewed
Aug 30, 2023
packages/builder/src/components/backend/DataTable/modals/grid/GridCreateViewModal.svelte
Outdated
Show resolved
Hide resolved
packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte
Outdated
Show resolved
Hide resolved
adrinr
reviewed
Aug 30, 2023
...rc/pages/builder/app/[application]/design/_components/NewScreen/DatasourceTemplateRow.svelte
Outdated
Show resolved
Hide resolved
@@ -269,6 +269,7 @@ router | |||
|
|||
router.post( | |||
"/api/v2/views/:viewId/search", | |||
paramResource("viewId"), |
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.
Not sure this will actually work as expected. I will double check with my permissions changes once merged
adrinr
reviewed
Aug 31, 2023
packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte
Show resolved
Hide resolved
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies for the size of this PR - I realise it's un-reviewable. The scope of this change was absolutely massive and it affects every part of Budibase.
Description
This PR adds a new implementation of views. A TLDR of a view is that it's an independent view over some table's data, with it's own saved filters, sorting, column selection, access and grid metadata (column order, size, row size, primary display). Views can be updated and saved independently from their parent table.
Data in views is the same data as the table, i.e. updating a row from a view will cause the row in the table to also be updated. It's the same dataset, just viewed differently.
Views can be created for both internal and SQL tables, using the button above the grid.
Views will be created with whatever the currently applied filters, sorting and table metadata are. Initially it will look like a complete clone of your table, and you can customise it from there.
Access
Access can be controlled independently from tables. You can have an admin only table, yet create a public view of a subset of that data.
Data that is not contained in a view, because you applied filters or hid columns, cannot be retrieved by users. It will not be sent over the API. Views are a secure way of limiting access to table data.
Apps
Views are drop in replacements for tables inside apps. Anywhere that you can use a table, you can now use a view. They fully support CRUD, and are "datasource plus" in the sense that they support additional server-side filtering, pagination, sorting and limiting.
Views work with data providers and blocks as normal.
You can also create autoscreens from views.
When adding filters to views in an app, these filters are applied in addition to the saved filters in the view itself. You cannot use filters to retrieve data that the view does not already contain. Attempting to filter on the same column that a view already contains a saved filter for will do nothing.
Addresses: