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

Views V2 #11573

Merged
merged 175 commits into from
Aug 31, 2023
Merged

Views V2 #11573

merged 175 commits into from
Aug 31, 2023

Conversation

aptkingston
Copy link
Member

@aptkingston aptkingston commented Aug 21, 2023

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.
image
image

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.

image

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:

packages/client/src/components/Component.svelte Outdated Show resolved Hide resolved
packages/frontend-core/src/api/viewsV2.js Outdated Show resolved Hide resolved
@@ -269,6 +269,7 @@ router

router.post(
"/api/v2/views/:viewId/search",
paramResource("viewId"),
Copy link
Collaborator

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

@aptkingston aptkingston merged commit 9ef3313 into develop Aug 31, 2023
@aptkingston aptkingston deleted the views-v2-frontend branch August 31, 2023 07:55
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2023
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.

4 participants