From a3535b95b06465c9fd84342765c100689f15de22 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Tue, 22 Aug 2023 10:31:19 -0400 Subject: [PATCH] cluster-ui: handle partial response errors on the databases page Part of: #102386 Prior to this change, any query error in the reponse payload for the databases page would cause the page to render an error. This was problematic as some queries used to power the databases page directly query `system` tables, meaning only `ADMIN` users could access the page. This change allows the databases page to handle network responses with query errors, consequently allowing non-admin users to view the data they are privy to. On the databases page, two types of requests are made: - a single request to fetch all database names - a request to fetch the database details for each database name The error handling for these requests has changed as such: - if we encounter a network or a non size-related query error when requesting database names, render a page error - if we encounter a 'max size' query error when requesting database names, render an alert that we're showing partial results - if we encounter any error requesting a database's details, render a `Caution` icon next to the database's name to indicate there was an issue getting results, the `Caution` icon has a tooltip providing a general explanation as to what the issue is - network errors when fetching database details provide no data for the database's table row, consequently the row of statistics for that database is `unavailable`, the network error message is provided in the `Caution` icon tooltip - query errors when fetching database details are scoped to the row cells for that query, which are `unavailable` - `unavailable` cells have a tooltip that highlight the error for that cell as well Release note (ui change): Allow non-admin users to view the databases page. --- .../workspaces/cluster-ui/src/databasesPage/databasesPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx index dd6da86dd8bb..8820914f9aee 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx @@ -44,7 +44,6 @@ import { } from "../queryFilter"; import { merge } from "lodash"; import { UIConfigState } from "src/store"; -import { TableStatistics } from "../tableStatistics"; import { DatabaseNameCell, IndexRecCell, @@ -60,6 +59,7 @@ import { import { InlineAlert } from "@cockroachlabs/ui-components"; import {checkInfoAvailable} from "../databases"; + const cx = classNames.bind(styles); const sortableTableCx = classNames.bind(sortableTableStyles); const booleanSettingCx = classnames.bind(booleanSettingStyles);