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
Make fetching workspaces deleted query param consistent
#2176
Comments
|
This is a great writeup; thanks for adding it. I think your reasoning is solid and an implementation as described above would definitely make our lives easier. |
|
@misskniss @tjcran A good one for the prettier issue: #1939 |
|
Can we instead treat deletion status the same way we intend to treat other search fields? Then it ends up as part of the query string currently used just for |
|
@ketang that is how it can be done on the FE. On the backend If you mean changing Also currently we do not use joins on the BE, so query wise, we cannot support |
|
Ok so as I look more into this, it looks like we can have many deleted workspaces with the same name. So For the list, |
|
We should use that query syntax in API calls as well. It shouldn't be something we do on the front end only. I see value in this for general API use but also the CLI. |
|
@ketang I support passing the query directly. |
|
After chatting with @f0ssel @Kira-Pilot we decided not to allow showing deleted workspaces in the workspace list view. It's not needed and can actually cause more issues than it's worth. I made WorkspaceByID and WorkspaceByOwnerAndName match This will suffice for community mvp. |
|
#2217 for doing this query on the back end instead of making the front end responsible for mapping from the search query to the API parameters. |
Currently if you attempt to fetch a deleted workspace, if it is deleted you need to include
?deleted=truequery parameter. We also have ainclude_deletedquery param in the case that it will return regardless if it is deleted or not.If you fetch workspaces, then the
?deletedquery param only shows deleted workspace OR it shows active workspaces. It will never show a mixed set of deleted and active. From a UI perspective, this is kinda strange, as you'd assume there are cases you want the mixed set.Proposal
We should keep only the
?deletedquery param and treat it as follows:deleted="": Show both deleted and activedeleted="true": Show only deletedThe empty string applies no filters and returns the mixed set. We should add a
Deletedfield toWorkspacedata type for the user to see the workspace status.Reasoning
Fetching single
When fetching a single workspace, we already have the
idor thename. We want to know if the workspace exists regardless of it's state. They should check theDeletedfield to know if it's active or not. I assume we might even allow the workspace to be brought back to life in the future?If they want to only see active/deleted they can use the
deletedquery paramFetching multiple
In our other filters we treat empty string as "do not apply the filter", so the same case goes here. We just need that
Deletedfield for the user to know the status.The text was updated successfully, but these errors were encountered: