-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add databases page #3246
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
feat: add databases page #3246
Conversation
|
@greptile review |
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.
Pull request overview
This PR adds a new databases page feature to the YDB Embedded UI, transforming the previous "clusters" page into a unified "home page" with two tabs: "All Clusters" and "My Databases". The databases page supports environment filtering when multiple environments are configured.
Key Changes:
- Renamed "clusters" page to "home page" with tabbed navigation between clusters and databases views
- Added environment filtering support for the databases page via new
/meta/environmentsAPI endpoint - Enhanced tenant data model to include cluster information for cross-cluster database navigation
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes.ts | Replaced clusters route with homePage route supporting activeTab parameter; added helper functions for navigation and Zod schema for tab validation |
| src/containers/HomePage/HomePage.tsx | New home page component with tabbed interface for clusters/databases, environment selection, and conditional rendering based on user permissions |
| src/containers/HomePage/useDatabasesPageEnvironment.ts | Custom hook managing environment selection state with query params, localStorage, and factory defaults |
| src/containers/HomePage/useHomePageTab.tsx | Hook to extract active tab from route parameters |
| src/containers/HomePage/i18n/* | Internationalization resources for home page UI strings |
| src/containers/Clusters/Clusters.tsx | Refactored to remove page chrome (moved to HomePage), now accepts scrollContainerRef prop |
| src/containers/Tenants/TenantsTable.tsx | Extracted reusable table component supporting both cluster-specific and cross-cluster views with environment filtering |
| src/containers/Tenants/TenantsClusterTab.tsx | Wrapper component for cluster-scoped tenants view |
| src/containers/Header/Header.tsx | Updated breadcrumb logic to support home page tabs and environment-aware navigation |
| src/containers/Header/breadcrumbs.tsx | Refactored breadcrumb generation to handle home page tabs and databases page with environment context |
| src/store/reducers/tenants/tenants.ts | Enhanced tenants query to accept environmentName parameter for filtering databases by environment |
| src/store/reducers/environments/* | New RTK Query endpoint for fetching and filtering available environments |
| src/store/reducers/capabilities/hooks.ts | Added useMetaEnvironmentsAvailable hook to check if environments feature is enabled |
| src/services/api/meta.ts | Added getMetaEnvironments method and updated getTenantsV2 to support environment filtering |
| src/types/api/tenant.ts | Added optional Cluster field to TTenant for cross-cluster database identification |
| src/types/api/environments.ts | New type definitions for environments API response |
| src/types/api/capabilities.ts | Added '/meta/environments' capability |
| src/uiFactory/types.ts | Renamed clustersPageTitle to homePageTitle; added databasesEnvironmentsConfig for environment customization |
| src/utils/hooks/useMetaAuth.ts | Renamed checkIsClustersPage to checkIsHomePage for clarity |
| src/containers/App/Content.tsx | Updated routing to use HomePage with HomePageSlot instead of ClustersSlot |
| src/components/TenantNameWrapper/TenantNameWrapper.tsx | Updated to pass cluster name in tenant path for proper navigation |
|
In stand with envs when I switch to Development databases I see the next query in Network Undefined seems to be unexpectable. |
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.
29 files reviewed, 2 comments
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.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated no new comments.
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.
Additional Comments (6)
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)syntax: hardcoded user-facing string should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source) -
src/containers/Tenants/TenantsTable.tsx, line 153 (link)syntax: hardcoded user-facing string should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source) -
src/containers/Tenants/TenantsTable.tsx, line 164 (link)syntax: hardcoded column header should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source) -
src/containers/Tenants/TenantsTable.tsx, line 177 (link)syntax: hardcoded column header should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source) -
src/containers/Tenants/TenantsTable.tsx, line 201 (link)syntax: hardcoded button text should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source) -
src/containers/Tenants/TenantsTable.tsx, line 323 (link)syntax: hardcoded error message should use i18n
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Context Used: Rule from
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source)
29 files reviewed, 6 comments
I don't know why this happens, it doesn't connected with my PR, I uploaded old version to host and there is still Created a separate issue for this: #3247 |
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.
Additional Comments (8)
-
src/containers/Tenants/TenantsTable.tsx, line 62 (link)logic: hardcoded string
'Unspecified'should be extracted to i18n fileNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 64 (link)logic: hardcoded string
'Pending'should be extracted to i18n fileNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)logic: hardcoded placeholder string should be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 153 (link)logic: hardcoded label string should be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 164 (link)logic: hardcoded column header should be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 178 (link)logic: hardcoded column header
'Name'should be extracted to i18n fileNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 202 (link)logic: hardcoded button text should be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)logic: hardcoded error message should be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
29 files reviewed, 8 comments
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.
Additional Comments (12)
-
src/containers/Tenants/TenantsTable.tsx, line 61 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 63 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 145 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 152 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 163 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 177 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 201 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 249 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 275 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 284 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 293 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)syntax: hardcoded i18n string - extract to translation file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
30 files reviewed, 12 comments
20b29ed to
18ed6f9
Compare
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.
Additional Comments (10)
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)syntax: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 153 (link)syntax: hardcoded string must be extracted to i18n file
-
src/containers/Tenants/TenantsTable.tsx, line 61-62 (link)syntax: hardcoded strings must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 164 (link)syntax: hardcoded column header must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 178 (link)syntax: hardcoded column header must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 202 (link)syntax: hardcoded button text must be extracted to i18n file
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)syntax: hardcoded empty message must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 275-276 (link)syntax: hardcoded column headers must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 284-285 (link)syntax: hardcoded column headers must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 293-294 (link)syntax: hardcoded column header must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
30 files reviewed, 10 comments
| const metaEnvironmentsAvailable = useMetaEnvironmentsAvailable(); | ||
| const isViewerUser = useIsViewerUser(); | ||
|
|
||
| const [savedHomePageTab, saveHomePageTab] = useSetting<string | undefined>( |
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.
please check this place carefully after rebase with Anton's PR with settings finish
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.
Rebased, everything is fine
| } | ||
|
|
||
| return ( | ||
| <div> |
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.
if this wrapper is really needed please add comment, why
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.
Added comment
18ed6f9 to
8d0dc1c
Compare
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.
Additional Comments (7)
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)logic: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 153 (link)logic: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 164 (link)logic: hardcoded column header must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 178 (link)logic: hardcoded column header must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 202 (link)logic: hardcoded button text must be moved to i18n file
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)logic: hardcoded empty state message must be moved to i18n file
-
src/containers/Tenants/TenantsTable.tsx, line 54-68 (link)logic: hardcoded state display strings (
'Unspecified'and'Pending') must be moved to i18n file for proper localization
32 files reviewed, 7 comments
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.
Additional Comments (6)
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 153 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 164 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 178 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 202 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)syntax: hardcoded string must be moved to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
32 files reviewed, 6 comments
213c73a to
6b61f2e
Compare
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.
Additional Comments (7)
-
src/containers/Tenants/TenantsTable.tsx, line 146 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 153 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 164 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 202 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 324 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 62 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
src/containers/Tenants/TenantsTable.tsx, line 64 (link)logic: hardcoded string must be extracted to i18n file
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
30 files reviewed, 7 comments
Closes #2975
Stand with environments: https://nda.ya.ru/t/xM88_qV27Q9XJJ
Stand without environments: https://nda.ya.ru/t/BbdRxL5C7Q9XKo
Config example: https://nda.ya.ru/t/kBkE7rlj7Q9XfE
CI Results
Test Status: ❌ FAILED
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: 🔺
Current: 62.61 MB | Main: 62.59 MB
Diff: +0.02 MB (0.03%)
ℹ️ CI Information
Issues Found
TenantsTable.tsxincluding column headers, labels, and error messages (6 instances)Confidence Score: 3/5
TenantsTable.tsxthat violate the project's mandatory i18n rule. These must be fixed before merging as they affect localization support.src/containers/Tenants/TenantsTable.tsx- all hardcoded strings must be moved to i18n files before mergingImportant Files Changed
Sequence Diagram
sequenceDiagram participant User participant HomePage participant useMetaEnvironments participant useDatabasesPageEnv participant TenantsTable participant tenantsApi participant MetaAPI User->>HomePage: Navigate to home HomePage->>useMetaEnvironments: Check environments capability alt Environments Available HomePage->>useMetaEnvironments: Fetch environments useMetaEnvironments->>MetaAPI: getMetaEnvironments() MetaAPI-->>useMetaEnvironments: Return environments list useMetaEnvironments-->>HomePage: environments data HomePage->>useDatabasesPageEnv: Get selected environment useDatabasesPageEnv-->>HomePage: databasesPageEnvironment alt Is Viewer User HomePage->>User: Show tabs (Clusters | Databases) User->>HomePage: Select "Databases" tab else Regular User HomePage->>User: Show "My Databases" title end HomePage->>TenantsTable: Render with environmentName TenantsTable->>tenantsApi: getTenantsV2({environmentName}) tenantsApi->>MetaAPI: getTenantsV2({environmentName}) MetaAPI-->>tenantsApi: Return tenant list tenantsApi-->>TenantsTable: Prepared tenant data TenantsTable->>User: Display database table else No Environments HomePage->>User: Show "Clusters" only endContext used:
dashboard- All code comments should be in English. Russian comments should be translated to English or removed ... (source)Greptile Summary
This PR adds a new home page with role-based navigation that adapts to user permissions and environment configurations. The implementation introduces tabbed navigation between "All Clusters" and "My Databases" for viewer users, while regular users see only "My Databases". The feature includes multi-environment support with environment tabs that persist selections via URL parameters and localStorage.
Key changes include:
HomePagecomponent with role-based UI rendering based onisViewerUserpermissionTenantsTableto support both cluster-specific and environment-specific database listings via newenvironmentNamepropgetHomePagePath,getDatabasesPath,getClustersPath) withactiveTabparametergetTenantsV2API endpoint for environment-filtered database listingsCritical Issue:
TenantsTable.tsxcontains 7 hardcoded user-facing strings that violate the project's mandatory i18n convention. These must be extracted to the i18n translation files before merging:"Database name"(search placeholder)"Databases"(entities count label)"Database"(column header)"Show shared"(button text)"No such tenants"(empty state message)"Unspecified","Pending"(state labels)The rest of the implementation follows React best practices with proper hook usage, state management, memoization, and component architecture.
Confidence Score: 3/5
TenantsTable.tsxthat violate mandatory i18n requirements and must be fixed before mergingsrc/containers/Tenants/TenantsTable.tsx- all 7 hardcoded strings must be moved to i18n files before mergingImportant Files Changed
Sequence Diagram
sequenceDiagram participant User participant HomePage participant useMetaEnvironments participant useDatabasesPageEnv participant TenantsTable participant tenantsApi participant MetaAPI User->>HomePage: Navigate to home HomePage->>useMetaEnvironments: Check environments capability alt Environments Available HomePage->>useMetaEnvironments: Fetch environments useMetaEnvironments->>MetaAPI: getMetaEnvironments() MetaAPI-->>useMetaEnvironments: Return environments list useMetaEnvironments-->>HomePage: environments data HomePage->>useDatabasesPageEnv: Get selected environment useDatabasesPageEnv-->>HomePage: databasesPageEnvironment alt Is Viewer User HomePage->>User: Show tabs (Clusters | Databases) User->>HomePage: Select "Databases" tab else Regular User HomePage->>User: Show "My Databases" title end HomePage->>TenantsTable: Render with environmentName TenantsTable->>tenantsApi: getTenantsV2({environmentName}) tenantsApi->>MetaAPI: getTenantsV2({environmentName}) MetaAPI-->>tenantsApi: Return tenant list tenantsApi-->>TenantsTable: Prepared tenant data TenantsTable->>User: Display database table else No Environments HomePage->>User: Show "Clusters" only end