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

Console: allow user to collapse table treeview node. Close #10320 #10321

Conversation

bertyhell
Copy link
Contributor

Description

With this PR when the user clicks on an expended schema in the data treeview it will collapse that entry in the treeview

Open a schema entry
image

Click the schema entry again. This is the result
image

Changelog

Component : console

Type: enhancement

Product: community-edition

Short Changelog

Allow users to collapse schema's and their tables after expanding them in the data manager view

Related Issues

#10320

Solution and Design

When the user click on an expanded schema treeview entry, the state for the current schema is set to undefined and the url is redirected to be the global database view

Steps to test and verify

Open a schema
Click the schema again to close it

Limitations, known bugs & workarounds

none

Metadata

Does this PR add a new Metadata feature?

  • No

GraphQL

  • No new GraphQL schema is generated

Breaking changes

  • No Breaking changes

@Varun-Choudhary
Copy link
Contributor

Hey @bertyhell, thanks for raising the PR. I tested it out locally and I see a bug where the URL is going to an undefined state which might cause an issue. I have attached the screenshot below to show how the URL is behaving.

Screen.Recording.2024-07-23.at.4.10.59.PM.mov

@vijayprasanna13
Copy link
Member

vijayprasanna13 commented Sep 16, 2024

Hey @bertyhell, thanks for the submission! The links of the tree-view are tied to the schema routes and data loading behaviour for the corresponding schemas, and the change you've proposed routes to an undefined schema temporarily to simulate a "closed" state for the node. I wouldn't recommend doing this since it can cause unexpected issue while navigating between databases or schemas.

Another alternative would be to stop the redirect while setting undefined, like so -

if (value === currentSchema) {
      dispatch(updateCurrentSchema(undefined, currentDataSource, false)).then(
        () => {
          dispatch(_push(`/data/${currentDataSource}`));
        }
      );
      return;
      // Clicking the same schema again should collapse the treeview node
    }

but this would still cause re-fetching of schema related info every time an open-close action is triggered, which can be quite expensive.

Given this scenario, I'd recommend you check out the new tree view we have in the improved data-tab UI. It's faster and has a filter that can search across schemas. For the time being we'd like to keep the current behaviour for the legacy one.

@bertyhell bertyhell deleted the feature/console-allow-collapse-treeview-node branch September 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants