diff --git a/pkg/ui/workspaces/cluster-ui/.eslintrc.json b/pkg/ui/workspaces/cluster-ui/.eslintrc.json index 3c0499ea40c8..4e6fe2794cff 100644 --- a/pkg/ui/workspaces/cluster-ui/.eslintrc.json +++ b/pkg/ui/workspaces/cluster-ui/.eslintrc.json @@ -43,6 +43,10 @@ "import/order": [ "error", { + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, "newlines-between": "always", "groups": [ "builtin", diff --git a/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx b/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx index 883296aadaf9..872df3ec9fd8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { FunctionComponent } from "react"; -import classnames from "classnames/bind"; import { Badge, BadgeIntent, FuzzyTime } from "@cockroachlabs/ui-components"; +import classnames from "classnames/bind"; +import React, { FunctionComponent } from "react"; import { NotificationTypeProp, diff --git a/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts b/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts index 99226f4c1698..23a0006af4cf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts +++ b/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts @@ -10,8 +10,8 @@ // This is a placeholder for real implementation (likely in Redux?) of notifications -import { notificationTypes, NotificationProps } from "../Notifications"; import { NotificationMessageProps } from "../NotificationMessage"; +import { notificationTypes, NotificationProps } from "../Notifications"; export const generateNotificationProps = ( notifications: Array, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts index 60e060e7ad30..53ed541dd713 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts @@ -9,11 +9,18 @@ // licenses/APL.txt. import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import Long from "long"; +import moment from "moment-timezone"; import { TimestampToMoment } from "../util"; +import { + getActiveExecutionsFromSessions, + getAppsFromActiveExecutions, + filterActiveStatements, + filterActiveTransactions, + INTERNAL_APP_NAME_PREFIX, +} from "./activeStatementUtils"; import { ActiveStatementPhase, SessionsResponse, @@ -24,13 +31,6 @@ import { ActiveTransactionFilters, ExecutionStatus, } from "./types"; -import { - getActiveExecutionsFromSessions, - getAppsFromActiveExecutions, - filterActiveStatements, - filterActiveTransactions, - INTERNAL_APP_NAME_PREFIX, -} from "./activeStatementUtils"; type ActiveQuery = protos.cockroach.server.serverpb.ActiveQuery; const Timestamp = protos.google.protobuf.Timestamp; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts index 46af442d5489..2edf590c60e5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts @@ -10,9 +10,9 @@ import moment from "moment-timezone"; +import { ClusterLocksResponse, ClusterLockState } from "src/api"; import { byteArrayToUuid } from "src/sessions"; import { TimestampToMoment, unset } from "src/util"; -import { ClusterLocksResponse, ClusterLockState } from "src/api"; import { DurationToMomentDuration } from "src/util/convert"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx index 40281dda1df0..b112543cc323 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import { ActiveStatement, @@ -18,12 +18,12 @@ import { import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; +import { isSelectedColumn } from "src/columnsSelector/utils"; +import { calculateActiveFilters } from "src/queryFilter/filter"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import { EmptyStatementsPlaceholder } from "src/statementsPage/emptyStatementsPlaceholder"; -import { TableStatistics } from "src/tableStatistics"; import { StatementViewType } from "src/statementsPage/statementPageTypes"; -import { calculateActiveFilters } from "src/queryFilter/filter"; -import { isSelectedColumn } from "src/columnsSelector/utils"; +import { TableStatistics } from "src/tableStatistics"; import { ISortedTablePagination, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx index 761c8143d7d3..61ada2daa684 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { isSelectedColumn } from "../../columnsSelector/utils"; import { ColumnDescriptor } from "../../sortedtable"; +import { limitText } from "../../util"; import { activeStatementColumnsFromCommon, ExecutionsColumn, @@ -21,7 +22,6 @@ import { getLabel, } from "../execTableCommon"; import { ActiveStatement } from "../types"; -import { limitText } from "../../util"; export function makeActiveStatementsColumns( isTenant: boolean, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx index c7882323afa9..da0fd24346bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import { ActiveTransaction, @@ -18,13 +18,13 @@ import { import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; +import { isSelectedColumn } from "src/columnsSelector/utils"; +import { calculateActiveFilters } from "src/queryFilter/filter"; +import { SortedTable } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { EmptyTransactionsPlaceholder } from "src/transactionsPage/emptyTransactionsPlaceholder"; import { TableStatistics } from "src/tableStatistics"; +import { EmptyTransactionsPlaceholder } from "src/transactionsPage/emptyTransactionsPlaceholder"; import { TransactionViewType } from "src/transactionsPage/transactionsPageTypes"; -import { calculateActiveFilters } from "src/queryFilter/filter"; -import { isSelectedColumn } from "src/columnsSelector/utils"; -import { SortedTable } from "src/sortedtable"; import { ISortedTablePagination, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx index 8488b3f4fb83..b4640e0cc814 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { isSelectedColumn } from "../../columnsSelector/utils"; import { ColumnDescriptor } from "../../sortedtable"; +import { limitText } from "../../util"; import { activeTransactionColumnsFromCommon, ExecutionsColumn, @@ -21,7 +22,6 @@ import { getLabel, } from "../execTableCommon"; import { ActiveTransaction, ExecutionType } from "../types"; -import { limitText } from "../../util"; export function makeActiveTransactionsColumns( isTenant: boolean, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx index 85eefa0006c0..3f7868fe7a52 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { ColumnDescriptor, SortedTable } from "../../sortedtable"; -import { ContendedExecution, ExecutionType } from "../types"; -import { StatusIcon } from "../statusIcon"; -import { executionsTableTitles } from "../execTableCommon"; -import { DATE_FORMAT_24_TZ, Duration, limitText } from "../../util"; import { Timestamp } from "../../timestamp"; +import { DATE_FORMAT_24_TZ, Duration, limitText } from "../../util"; +import { executionsTableTitles } from "../execTableCommon"; +import { StatusIcon } from "../statusIcon"; +import { ContendedExecution, ExecutionType } from "../types"; const getID = (item: ContendedExecution, execType: ExecutionType) => execType === "transaction" diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx index daba9398f5c5..c80175cb74f8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React from "react"; import { Link } from "react-router-dom"; import { ColumnDescriptor } from "src/sortedtable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx index 8122a75afac8..e82230cdbe66 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { Switch } from "antd"; -import React from "react"; import classNames from "classnames/bind"; import { Moment } from "moment-timezone"; +import React from "react"; import RefreshIcon from "src/icon/refreshIcon"; import { Timestamp } from "src/timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx index e70207e7465b..b2fbb9955505 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { CircleFilled } from "src/icon"; -import { ExecutionStatus } from "./types"; import styles from "./executionStatusIcon.module.scss"; +import { ExecutionStatus } from "./types"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx b/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx index 9804ad85be0e..4037f08fc3db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./anchor.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts index 37585b9ee1c4..c75c5ed48362 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts @@ -33,12 +33,12 @@ import { sqlResultsAreEmpty, } from "./sqlApi"; import { TxnInsightDetailsRequest } from "./txnInsightDetailsApi"; -import { makeInsightsSqlRequest } from "./txnInsightsUtils"; import { FingerprintStmtsResponseColumns, TxnStmtFingerprintsResponseColumns, TxnWithStmtFingerprints, } from "./txnInsightsApi"; +import { makeInsightsSqlRequest } from "./txnInsightsUtils"; export type ContentionFilters = { waitingTxnID?: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts index 52250426470d..9205f13115cf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { IndexUsageStatistic, recommendDropUnusedIndex } from "../insights"; import { getLogger, indexUnusedDuration, maybeError } from "../util"; +import { Format, Identifier, QualifiedIdentifier } from "./safesql"; import { combineQueryErrors, createSqlExecutionRequest, @@ -30,7 +31,6 @@ import { SqlTxnResult, txnResultIsEmpty, } from "./sqlApi"; -import { Format, Identifier, QualifiedIdentifier } from "./safesql"; import { fromHexString, withTimeout } from "./util"; const { ZoneConfig } = cockroach.config.zonepb; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts index cd06096be4ae..4cfce867e021 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts @@ -23,9 +23,9 @@ import { StatementRawFormat, } from "src/api"; -import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; -import { AggregateStatistics } from "../statementsTable"; import { INTERNAL_APP_NAME_PREFIX } from "../activeExecutions/activeStatementUtils"; +import { AggregateStatistics } from "../statementsTable"; +import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; export type TableIndexStatsRequest = cockroach.server.serverpb.TableIndexStatsRequest; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts index 24a4cfeafcc7..21746e1d65c2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts @@ -15,6 +15,7 @@ import { } from "../insights"; import { HexStringToInt64String, indexUnusedDuration } from "../util"; +import { QuoteIdentifier } from "./safesql"; import { SqlExecutionRequest, SqlTxnResult, @@ -25,7 +26,6 @@ import { SqlApiResponse, formatApiResult, } from "./sqlApi"; -import { QuoteIdentifier } from "./safesql"; // Export for db-console import from clusterUiApi. export type { InsightRecommendation } from "../insights"; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts index c13cddd2df59..5fa5c307228d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts @@ -10,7 +10,6 @@ import moment from "moment-timezone"; -import { Duration } from "src/util/format"; import { createSqlExecutionRequest, executeInternalSql, @@ -19,6 +18,7 @@ import { SqlTxnResult, txnResultSetIsEmpty, } from "src/api"; +import { Duration } from "src/util/format"; export type StatementDiagnosticsReport = { id: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts index 44c89809728f..94813fab0776 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts @@ -18,8 +18,8 @@ import { } from "src/insights/types"; import { INTERNAL_APP_NAME_PREFIX } from "src/util/constants"; -import { FixFingerprintHexValue } from "../util"; import { getInsightsFromProblemsAndCauses } from "../insights/utils"; +import { FixFingerprintHexValue } from "../util"; import { getContentionDetailsApi } from "./contentionApi"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts index 5801c2df480d..e00883906031 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts @@ -8,14 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { IndexUsageStatistic, recommendDropUnusedIndex } from "../insights"; import { getLogger, indexUnusedDuration, maybeError } from "../util"; import { Format, Identifier, Join, SQL } from "./safesql"; -import { fromHexString, withTimeout } from "./util"; import { combineQueryErrors, executeInternalSql, @@ -30,6 +29,7 @@ import { SqlTxnResult, txnResultIsEmpty, } from "./sqlApi"; +import { fromHexString, withTimeout } from "./util"; const { ZoneConfig } = cockroach.config.zonepb; const { ZoneConfigurationLevel } = cockroach.server.serverpb; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts index 973644673721..6fc18b2e1c03 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts @@ -17,6 +17,7 @@ import { } from "../insights"; import { maybeError } from "../util"; +import { getTxnInsightsContentionDetailsApi } from "./contentionApi"; import { executeInternalSql, isMaxSizeError, @@ -34,7 +35,6 @@ import { TxnInsightsResponseRow, } from "./txnInsightsApi"; import { makeInsightsSqlRequest } from "./txnInsightsUtils"; -import { getTxnInsightsContentionDetailsApi } from "./contentionApi"; export type TxnInsightDetailsRequest = { txnExecutionID: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts index 841a337511d6..4e1be475ea13 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts @@ -17,16 +17,16 @@ import { } from "../insights"; import { MockSqlResponse } from "../util/testing"; -import { - TxnStmtFingerprintsResponseColumns, - FingerprintStmtsResponseColumns, -} from "./txnInsightsApi"; -import * as sqlApi from "./sqlApi"; -import { SqlExecutionResponse } from "./sqlApi"; import { ContentionResponseColumns, getTxnInsightsContentionDetailsApi, } from "./contentionApi"; +import * as sqlApi from "./sqlApi"; +import { SqlExecutionResponse } from "./sqlApi"; +import { + TxnStmtFingerprintsResponseColumns, + FingerprintStmtsResponseColumns, +} from "./txnInsightsApi"; type TxnContentionDetailsTests = { name: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx index 7e73160d557d..d56071b97fc0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Badge } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx b/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx index 20ec6b002c22..ec70fb5db118 100644 --- a/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames/bind"; +import * as React from "react"; import styles from "./badge.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx index 047c1ab95310..c28dfc8aea0d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { scaleLinear } from "d3-scale"; -import { extent as d3Extent } from "d3-array"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import sum from "lodash/sum"; +import { extent as d3Extent } from "d3-array"; +import { scaleLinear } from "d3-scale"; import map from "lodash/map"; +import sum from "lodash/sum"; +import React from "react"; import styles from "./barCharts.module.scss"; import { NumericStatLegend } from "./numericStatLegend"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx index 77862cc1093b..a294564f05bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf, DecoratorFn } from "@storybook/react"; import Long from "long"; +import React from "react"; import statementsPagePropsFixture from "src/statementsPage/statementsPage.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx index 1c4624d9de14..36cfdd66de9b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx @@ -11,13 +11,13 @@ import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; +import { AggregateStatistics } from "src/statementsTable/statementsTable"; import { stdDevLong, longToInt } from "src/util"; import { Duration, Bytes, PercentageCustom } from "src/util/format"; -import { AggregateStatistics } from "src/statementsTable/statementsTable"; +import { barChartFactory, BarChartOptions } from "./barChartFactory"; import styles from "./barCharts.module.scss"; import { bar, approximify } from "./utils"; -import { barChartFactory, BarChartOptions } from "./barChartFactory"; type StatementStatistics = protos.cockroach.server.serverpb.StatementsResponse.ICollectedStatementStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx index 593c7e4c286a..98014de8507d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { scaleLinear } from "d3-scale"; import { format as d3Format } from "d3-format"; -import { Tooltip } from "@cockroachlabs/ui-components"; +import { scaleLinear } from "d3-scale"; +import React from "react"; import { stdDevLong, longToInt, NumericStat } from "src/util"; -import { clamp, normalizeClosedDomain } from "./utils"; import styles from "./barCharts.module.scss"; +import { clamp, normalizeClosedDomain } from "./utils"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx index 380b4c3880c4..8ee34f72887f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { scaleLinear } from "d3-scale"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import { scaleLinear } from "d3-scale"; +import React from "react"; -import { Duration } from "src/util/format"; import { stdDevLong } from "src/util"; +import { Duration } from "src/util/format"; -import { NumericStatLegend } from "./numericStatLegend"; import styles from "./barCharts.module.scss"; +import { NumericStatLegend } from "./numericStatLegend"; import { clamp, normalizeClosedDomain } from "./utils"; type StatementStatistics = diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx index dbf4eca4ed3d..f1a5b7bcfcac 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { longToInt } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts b/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts index c8c9d57b0a5b..0d3cd39c629c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { scaleLinear } from "d3-scale"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { scaleLinear } from "d3-scale"; import { stdDevLong } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts b/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts index 3b930bedfc13..73b02eff04aa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { format as d3Format } from "d3-format"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { format as d3Format } from "d3-format"; import { TransactionInfo } from "../transactionsTable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx b/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx index 87c01cdfe537..ea3c575f9751 100644 --- a/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames/bind"; import React, { FunctionComponent, ReactElement } from "react"; import { Link } from "react-router-dom"; -import classnames from "classnames/bind"; import styles from "./breadcrumbs.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx index 12843ec2ccbb..17f221bf321f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. /* eslint-disable react/jsx-key */ -import React from "react"; -import { storiesOf } from "@storybook/react"; import { CaretDown } from "@cockroachlabs/icons"; +import { storiesOf } from "@storybook/react"; +import React from "react"; import { Button, ButtonProps } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/button/button.tsx b/pkg/ui/workspaces/cluster-ui/src/button/button.tsx index 0c07d9ffae21..67f7200db55c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/button/button.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/button/button.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ButtonHTMLAttributes } from "react"; import classNames from "classnames/bind"; +import React, { ButtonHTMLAttributes } from "react"; import styles from "./button.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx b/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx index 88a368af6262..f880fcfb5ae8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Select, { components, OptionsType, ActionMeta } from "react-select"; -import React from "react"; -import classNames from "classnames/bind"; import { Gear } from "@cockroachlabs/icons"; +import classNames from "classnames/bind"; +import React from "react"; +import Select, { components, OptionsType, ActionMeta } from "react-select"; import { Button } from "../button"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts index 1bda541b3daf..61d48913ecc5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts @@ -15,18 +15,16 @@ import { Dispatch } from "redux"; import { databaseNameCCAttr } from "src/util/constants"; import { getMatchParamByName } from "src/util/query"; +import { deriveTableDetailsMemoized } from "../databases"; +import { Filters } from "../queryFilter"; import { AppState } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; +import { + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, +} from "../store/clusterSettings/clusterSettings.selectors"; import { databaseDetailsReducer } from "../store/databaseDetails"; const databaseDetailsActions = databaseDetailsReducer.actions; -import { - actions as localStorageActions, - LocalStorageKeys, -} from "../store/localStorage"; -import { actions as tableDetailsActions } from "../store/databaseTableDetails"; -import { actions as analyticsActions } from "../store/analytics"; -import { Filters } from "../queryFilter"; -import { nodeRegionsByIDSelector } from "../store/nodes"; -import { selectIsTenant } from "../store/uiConfig"; import { selectDatabaseDetailsGrantsSortSetting, selectDatabaseDetailsTablesFiltersSetting, @@ -34,19 +32,21 @@ import { selectDatabaseDetailsTablesSortSetting, selectDatabaseDetailsViewModeSetting, } from "../store/databaseDetails/databaseDetails.selectors"; -import { deriveTableDetailsMemoized } from "../databases"; +import { actions as tableDetailsActions } from "../store/databaseTableDetails"; import { - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, -} from "../store/clusterSettings/clusterSettings.selectors"; + actions as localStorageActions, + LocalStorageKeys, +} from "../store/localStorage"; +import { nodeRegionsByIDSelector } from "../store/nodes"; import { actions as nodesActions } from "../store/nodes/nodes.reducer"; +import { selectIsTenant } from "../store/uiConfig"; -import { ViewMode } from "./types"; import { DatabaseDetailsPage, DatabaseDetailsPageActions, DatabaseDetailsPageData, } from "./databaseDetailsPage"; +import { ViewMode } from "./types"; const mapStateToProps = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx index 84e98f15a605..947750339c06 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; import { defaultFilters } from "../queryFilter"; import { indexUnusedDuration } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx index 8687c34d6f55..00c2bacfdac8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx @@ -8,20 +8,20 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import * as H from "history"; import random from "lodash/random"; import uniq from "lodash/uniq"; -import * as H from "history"; import moment from "moment-timezone"; +import React from "react"; +import { defaultFilters } from "src/queryFilter"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName, randomRole, randomTablePrivilege, } from "src/storybook/fixtures"; -import { defaultFilters } from "src/queryFilter"; import { indexUnusedDuration } from "src/util/constants"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx index 4599b41b0dfa..e6e4901cb555 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx @@ -8,35 +8,36 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link, RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; +import { Link, RouteComponentProps } from "react-router-dom"; import { Dropdown, DropdownOption } from "src/dropdown"; import { DatabaseIcon } from "src/icon/databaseIcon"; import { StackIcon } from "src/icon/stackIcon"; import { PageConfig, PageConfigItem } from "src/pageConfig"; import { Pagination } from "src/pagination"; +import { + calculateActiveFilters, + defaultFilters, + Filter, + Filters, +} from "src/queryFilter"; import { ColumnDescriptor, ISortedTablePagination, SortedTable, SortSetting, } from "src/sortedtable"; -import { DATE_FORMAT, EncodeDatabaseTableUri } from "src/util/format"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; -import { - calculateActiveFilters, - defaultFilters, - Filter, - Filters, -} from "src/queryFilter"; import { UIConfigState } from "src/store"; import { TableStatistics } from "src/tableStatistics"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; +import { DATE_FORMAT, EncodeDatabaseTableUri } from "src/util/format"; +import { Anchor } from "../anchor"; import { isMaxSizeError, SqlApiQueryResponse, @@ -48,13 +49,13 @@ import { TableSpanStatsRow, } from "../api"; import { LoadingCell } from "../databases"; -import { Timestamp, Timezone } from "../timestamp"; -import { Search } from "../search"; import { Loading } from "../loading"; +import { Search } from "../search"; import LoadingError from "../sqlActivity/errorComponent"; -import { Anchor } from "../anchor"; +import { Timestamp, Timezone } from "../timestamp"; import { mvccGarbage, syncHistory, unique } from "../util"; +import styles from "./databaseDetailsPage.module.scss"; import { DbDetailsBreadcrumbs, DiskSizeCell, @@ -63,7 +64,6 @@ import { TableNameCell, } from "./tableCells"; import { ViewMode } from "./types"; -import styles from "./databaseDetailsPage.module.scss"; const cx = classNames.bind(styles); const sortableTableCx = classNames.bind(sortableTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx index 14f9e56a99ab..3175d45c14c1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx @@ -8,12 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Caution } from "@cockroachlabs/icons"; +import { Tooltip } from "antd"; +import classNames from "classnames/bind"; import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import classNames from "classnames/bind"; -import { Tooltip } from "antd"; -import { Caution } from "@cockroachlabs/icons"; +import { Breadcrumbs } from "../breadcrumbs"; +import { CockroachCloudContext } from "../contexts"; +import { LoadingCell, getNetworkErrorMessage } from "../databases"; +import { CaretRight } from "../icon/caretRight"; +import { DatabaseIcon } from "../icon/databaseIcon"; import { EncodeDatabaseTableUri, EncodeDatabaseUri, @@ -22,18 +27,13 @@ import { schemaNameAttr, } from "../util"; import * as format from "../util/format"; -import { Breadcrumbs } from "../breadcrumbs"; -import { CaretRight } from "../icon/caretRight"; -import { CockroachCloudContext } from "../contexts"; -import { LoadingCell, getNetworkErrorMessage } from "../databases"; -import { DatabaseIcon } from "../icon/databaseIcon"; -import styles from "./databaseDetailsPage.module.scss"; import { DatabaseDetailsPageDataTable, DatabaseDetailsPageDataTableDetails, DatabaseDetailsPageProps, } from "./databaseDetailsPage"; +import styles from "./databaseDetailsPage.module.scss"; import { ViewMode } from "./types"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx index e4ae88e61306..95a8cf783c3e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; -import { indexUnusedDuration } from "../util"; import { util } from "../index"; +import { indexUnusedDuration } from "../util"; import { DatabaseTablePage, DatabaseTablePageProps } from "./databaseTablePage"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx index ca6fa5169438..df36ccf72e33 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import * as H from "history"; import random from "lodash/random"; import uniq from "lodash/uniq"; import moment from "moment-timezone"; -import * as H from "history"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx index f88834c1409e..723785677408 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row, Tabs, Tooltip } from "antd"; -import { RouteComponentProps } from "react-router-dom"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; import { Moment } from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; import { Anchor } from "src/anchor"; +import { commonStyles } from "src/common"; import { StackIcon } from "src/icon/stackIcon"; -import { SqlBox } from "src/sql"; import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; +import { SqlBox } from "src/sql"; import { SummaryCard, SummaryCardItem, SummaryCardItemBoolSetting, } from "src/summaryCard"; -import * as format from "src/util/format"; -import { DATE_FORMAT_24_TZ } from "src/util/format"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { ascendingAttr, columnTitleAttr, @@ -33,16 +33,9 @@ import { tabAttr, tableStatsClusterSetting, } from "src/util"; -import { commonStyles } from "src/common"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; +import * as format from "src/util/format"; +import { DATE_FORMAT_24_TZ } from "src/util/format"; -import booleanSettingStyles from "../settings/booleanSetting.module.scss"; -import { CockroachCloudContext } from "../contexts"; -import { RecommendationType } from "../indexDetailsPage"; -import LoadingError from "../sqlActivity/errorComponent"; -import { Loading } from "../loading"; -import { UIConfigState } from "../store"; -import { Timestamp, Timezone } from "../timestamp"; import { SqlApiQueryResponse, SqlExecutionErrorMessage, @@ -52,8 +45,16 @@ import { TableSchemaDetailsRow, TableSpanStatsRow, } from "../api"; +import { CockroachCloudContext } from "../contexts"; import { LoadingCell } from "../databases"; +import { RecommendationType } from "../indexDetailsPage"; +import { Loading } from "../loading"; +import booleanSettingStyles from "../settings/booleanSetting.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; +import { UIConfigState } from "../store"; +import { Timestamp, Timezone } from "../timestamp"; +import styles from "./databaseTablePage.module.scss"; import { ActionCell, DbTablesBreadcrumbs, @@ -64,7 +65,6 @@ import { LastUsed, NameCell, } from "./helperComponents"; -import styles from "./databaseTablePage.module.scss"; const cx = classNames.bind(styles); const booleanSettingCx = classNames.bind(booleanSettingStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts index d13a23715542..a3b21e21728a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts @@ -8,13 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { Dispatch } from "redux"; -import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; +import { Dispatch } from "redux"; import { AppState, uiConfigActions } from "src/store"; +import { actions as analyticsActions } from "src/store/analytics"; +import { actions as clusterSettingsActions } from "src/store/clusterSettings"; +import { + selectAutomaticStatsCollectionEnabled, + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, + selectIndexUsageStatsEnabled, +} from "src/store/clusterSettings/clusterSettings.selectors"; +import { actions as tableDetailsActions } from "src/store/databaseTableDetails"; +import { actions as indexStatsActions } from "src/store/indexStats"; +import { + actions as nodesActions, + nodeRegionsByIDSelector, +} from "src/store/nodes"; +import { selectHasAdminRole, selectIsTenant } from "src/store/uiConfig"; import { databaseNameCCAttr, generateTableID, @@ -24,21 +39,6 @@ import { tableNameCCAttr, TimestampToMoment, } from "src/util"; -import { - actions as nodesActions, - nodeRegionsByIDSelector, -} from "src/store/nodes"; -import { - selectAutomaticStatsCollectionEnabled, - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, - selectIndexUsageStatsEnabled, -} from "src/store/clusterSettings/clusterSettings.selectors"; -import { selectHasAdminRole, selectIsTenant } from "src/store/uiConfig"; -import { actions as tableDetailsActions } from "src/store/databaseTableDetails"; -import { actions as indexStatsActions } from "src/store/indexStats"; -import { actions as analyticsActions } from "src/store/analytics"; -import { actions as clusterSettingsActions } from "src/store/clusterSettings"; import { deriveIndexDetailsMemoized, diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx index 5b9643250f5b..379b82ef3c23 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; -import { Moment } from "moment-timezone"; +import { Search as IndexIcon } from "@cockroachlabs/icons"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import { Moment } from "moment-timezone"; +import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import { Search as IndexIcon } from "@cockroachlabs/icons"; import { Anchor } from "../anchor"; -import * as format from "../util/format"; -import IdxRecAction from "../insights/indexActionBtn"; +import { sqlApiErrorMessage } from "../api"; import { QuoteIdentifier } from "../api/safesql"; -import { CircleFilled } from "../icon"; import { Breadcrumbs } from "../breadcrumbs"; -import { CaretRight } from "../icon/caretRight"; import { CockroachCloudContext } from "../contexts"; -import { sqlApiErrorMessage } from "../api"; +import { CircleFilled } from "../icon"; +import { CaretRight } from "../icon/caretRight"; +import IdxRecAction from "../insights/indexActionBtn"; +import { Timestamp } from "../timestamp"; import { DATE_FORMAT, DATE_FORMAT_24_TZ, @@ -33,10 +33,10 @@ import { minDate, performanceTuningRecipes, } from "../util"; -import { Timestamp } from "../timestamp"; +import * as format from "../util/format"; -import styles from "./databaseTablePage.module.scss"; import { DatabaseTablePageDataDetails, IndexStat } from "./databaseTablePage"; +import styles from "./databaseTablePage.module.scss"; const cx = classNames.bind(styles); export const NameCell = ({ diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts b/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts index 49472c497439..df43662c52af 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; import { DatabaseDetailsPageDataTable } from "src/databaseDetailsPage"; +import { DatabasesListResponse, TableNameParts } from "../api"; +import { DatabasesPageDataDatabase } from "../databasesPage"; +import { DatabaseTablePageDataDetails, IndexStat } from "../databaseTablePage"; +import { RecommendationType as RecType } from "../indexDetailsPage"; import { DatabaseDetailsSpanStatsState, DatabaseDetailsState, } from "../store/databaseDetails"; import { TableDetailsState } from "../store/databaseTableDetails"; -import { generateTableID, longToInt, TimestampToMoment } from "../util"; -import { DatabaseTablePageDataDetails, IndexStat } from "../databaseTablePage"; import { IndexStatsState } from "../store/indexStats"; -import { DatabasesPageDataDatabase } from "../databasesPage"; -import { DatabasesListResponse, TableNameParts } from "../api"; -import { RecommendationType as RecType } from "../indexDetailsPage"; +import { generateTableID, longToInt, TimestampToMoment } from "../util"; import { Nodes, diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx index 234a8a37be51..a14b656f8530 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render } from "@testing-library/react"; +import React from "react"; import { INodeStatus } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx b/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx index e7be98df2d33..514156f8f8dc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import React from "react"; -import { Skeleton, Tooltip } from "antd"; import { Caution } from "@cockroachlabs/icons"; +import { Skeleton, Tooltip } from "antd"; +import React from "react"; import { isMaxSizeError, diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx index 7fb06cad6c38..a3c0b237b3a2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; +import { Caution } from "@cockroachlabs/icons"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import { Caution } from "@cockroachlabs/icons"; -import { CircleFilled } from "../icon"; -import { EncodeDatabaseUri } from "../util"; -import { StackIcon } from "../icon/stackIcon"; import { CockroachCloudContext } from "../contexts"; import { LoadingCell, getNetworkErrorMessage, getQueryErrorMessage, } from "../databases"; +import { CircleFilled } from "../icon"; +import { StackIcon } from "../icon/stackIcon"; +import { EncodeDatabaseUri } from "../util"; import * as format from "../util/format"; -import styles from "./databasesPage.module.scss"; import { DatabasesPageDataDatabase } from "./databasesPage"; +import styles from "./databasesPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx index 0db1a7d2b923..6423616efdd0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; import { defaultFilters } from "../queryFilter"; import { indexUnusedDuration } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx index 8fa96e9fff92..d543e5a69335 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import random from "lodash/random"; import * as H from "history"; +import random from "lodash/random"; +import React from "react"; +import { defaultFilters } from "src/queryFilter"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName } from "src/storybook/fixtures"; -import { defaultFilters } from "src/queryFilter"; import { indexUnusedDuration } from "src/util/constants"; import { DatabasesPage, DatabasesPageProps } from "./databasesPage"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx index fb004c1fcde5..fc469d1bd78d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; import merge from "lodash/merge"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; import { Anchor } from "src/anchor"; import { StackIcon } from "src/icon/stackIcon"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { Pagination } from "src/pagination"; import { BooleanSetting } from "src/settings/booleanSetting"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; import { ColumnDescriptor, handleSortSettingFromQueryString, @@ -28,14 +28,19 @@ import { SortSetting, } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; +import { UIConfigState } from "src/store"; import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { syncHistory, tableStatsClusterSetting, unique } from "src/util"; -import { UIConfigState } from "src/store"; -import booleanSettingStyles from "../settings/booleanSetting.module.scss"; -import LoadingError from "../sqlActivity/errorComponent"; +import { + DatabaseSpanStatsRow, + DatabaseTablesResponse, + isMaxSizeError, + SqlApiQueryResponse, + SqlExecutionErrorMessage, +} from "../api"; +import { LoadingCell } from "../databases"; import { Loading } from "../loading"; -import { Search } from "../search"; import { calculateActiveFilters, defaultFilters, @@ -43,22 +48,17 @@ import { Filters, handleFiltersFromQueryString, } from "../queryFilter"; +import { Search } from "../search"; +import booleanSettingStyles from "../settings/booleanSetting.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; import { TableStatistics } from "../tableStatistics"; -import { - DatabaseSpanStatsRow, - DatabaseTablesResponse, - isMaxSizeError, - SqlApiQueryResponse, - SqlExecutionErrorMessage, -} from "../api"; -import { LoadingCell } from "../databases"; +import styles from "./databasesPage.module.scss"; import { DatabaseNameCell, IndexRecCell, DiskSizeCell, } from "./databaseTableCells"; -import styles from "./databasesPage.module.scss"; const cx = classNames.bind(styles); const sortableTableCx = classNames.bind(sortableTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts index a179596b155d..21746832fb5b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts @@ -8,40 +8,40 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { selectIsTenant } from "../store/uiConfig"; +import { deriveDatabaseDetailsMemoized } from "../databases"; +import { Filters } from "../queryFilter"; +import { AppState } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; +import { actions as clusterSettingsActions } from "../store/clusterSettings"; import { - actions as nodesActions, - nodeRegionsByIDSelector, -} from "../store/nodes"; + selectAutomaticStatsCollectionEnabled, + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, +} from "../store/clusterSettings/clusterSettings.selectors"; +import { + databaseDetailsReducer, + databaseDetailsSpanStatsReducer, +} from "../store/databaseDetails"; +import { actions as databasesListActions } from "../store/databasesList"; import { databasesListSelector, selectDatabasesFilters, selectDatabasesSearch, selectDatabasesSortSetting, } from "../store/databasesList/databasesList.selectors"; -import { AppState } from "../store"; -import { actions as clusterSettingsActions } from "../store/clusterSettings"; -import { actions as databasesListActions } from "../store/databasesList"; -import { - databaseDetailsReducer, - databaseDetailsSpanStatsReducer, -} from "../store/databaseDetails"; import { actions as localStorageActions, LocalStorageKeys, } from "../store/localStorage"; -import { Filters } from "../queryFilter"; -import { actions as analyticsActions } from "../store/analytics"; import { - selectAutomaticStatsCollectionEnabled, - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, -} from "../store/clusterSettings/clusterSettings.selectors"; -import { deriveDatabaseDetailsMemoized } from "../databases"; + actions as nodesActions, + nodeRegionsByIDSelector, +} from "../store/nodes"; +import { selectIsTenant } from "../store/uiConfig"; import { DatabasesPage, diff --git a/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx b/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx index 931078194482..1af951e27e28 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; -import { Alert, DatePicker as AntDatePicker } from "antd"; import ArrowLeftOutlined from "@ant-design/icons/ArrowLeftOutlined"; +import { Time as TimeIcon, ErrorCircleFilled } from "@cockroachlabs/icons"; +import { Alert, DatePicker as AntDatePicker } from "antd"; +import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; import momentGenerateConfig from "rc-picker/lib/generate/moment"; -import classNames from "classnames/bind"; -import { Time as TimeIcon, ErrorCircleFilled } from "@cockroachlabs/icons"; +import React, { useContext, useState } from "react"; import { Button } from "src/button"; import { Text, TextTypes } from "src/text"; diff --git a/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx b/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx index aea34b68e21f..3354718883ef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; import { fetchData } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx index ed02a9c83cf8..9e09ce600ef8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; +import React from "react"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ContendedExecution, ExecutionType } from "src/activeExecutions"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import { capitalize, Duration, NO_SAMPLES_FOUND } from "../util"; import { ExecutionContentionTable } from "../activeExecutions/activeTransactionsTable/execContentionTable"; import styles from "../statementDetails/statementDetails.module.scss"; +import { capitalize, Duration, NO_SAMPLES_FOUND } from "../util"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx index 4725b9128d35..2398691404ed 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Download } from "@cockroachlabs/icons"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; -import { Download } from "@cockroachlabs/icons"; +import React from "react"; import { Button } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx index 1079d38d086e..0c08435ef0aa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { CaretDown } from "@cockroachlabs/icons"; +import classnames from "classnames/bind"; +import React from "react"; import { Button, ButtonProps } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx index 0e8064fa6973..4d151d5e622e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { Heading, Text, Button } from "@cockroachlabs/ui-components"; +import classnames from "classnames/bind"; +import React from "react"; import { Anchor } from "../../anchor"; import heroBannerLp from "../../assets/heroBannerLp.png"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx index 0906ea5dbdff..fac1159fc2b1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Button } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx index d55f7cdbd6fa..ad1635425742 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading, Text } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import isString from "lodash/isString"; -import { Heading, Text } from "@cockroachlabs/ui-components"; +import React from "react"; import styles from "./emptyTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx index 4756365fdc9c..4821a8f520a1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import noop from "lodash/noop"; import React from "react"; import Select, { Props, OptionsType } from "react-select"; -import noop from "lodash/noop"; import { StylesConfig } from "react-select/src/styles"; import { CheckboxOption } from "../multiSelectCheckbox/multiSelectCheckbox"; diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx index f0f725def900..024e404f47e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; -import { FilterDropdown } from "./filterDropdown"; import { FilterCheckboxOption } from "./filterCheckboxOption"; +import { FilterDropdown } from "./filterDropdown"; import { FilterSearchOption } from "./filterSearchOption"; storiesOf("FilterDropdown", module) diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx index a0dfa689a6f7..2bd09043923b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; +import { Button } from "../button"; import { DropdownButton } from "../dropdown"; -import { OutsideEventHandler } from "../outsideEventHandler"; import styles from "../dropdown/dropdown.module.scss"; +import { OutsideEventHandler } from "../outsideEventHandler"; import { applyBtn } from "../queryFilter/filterClasses"; -import { Button } from "../button"; const cx = classnames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx index faeed0bfd4d3..a752700e08ae 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx @@ -10,8 +10,8 @@ import React from "react"; -import { Search } from "../search"; import { filterLabel } from "../queryFilter/filterClasses"; +import { Search } from "../search"; export type FilterSearchOptionProps = { label: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx index 04216968ec23..fee54596adc7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { AlignedData, Options } from "uplot"; import { AxisUnits } from "../utils/domain"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx index de874463a227..7eeb4fbe80a3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useEffect, useRef } from "react"; import classNames from "classnames/bind"; +import React, { useContext, useEffect, useRef } from "react"; import uPlot, { AlignedData, Options } from "uplot"; -import { Visualization } from "../visualization"; +import { TimezoneContext } from "../../contexts"; import { AxisUnits, calculateXAxisDomainBarChart, calculateYAxisDomain, } from "../utils/domain"; -import { TimezoneContext } from "../../contexts"; +import { Visualization } from "../visualization"; import styles from "./bargraph.module.scss"; import { getStackedBarOpts, stack } from "./bars"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts index 8d91914c5779..9fd73edd7309 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts @@ -8,10 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import uPlot, { Plugin } from "uplot"; import moment from "moment-timezone"; +import uPlot, { Plugin } from "uplot"; -import { AxisUnits } from "../utils/domain"; import { Bytes, Duration, @@ -20,6 +19,7 @@ import { FormatWithTimezone, DATE_WITH_SECONDS_FORMAT_24_TZ, } from "../../util"; +import { AxisUnits } from "../utils/domain"; // Fallback color for series stroke if one is not defined. const DEFAULT_STROKE = "#7e89a9"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts b/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts index 342fec20bff6..7a31e38cc894 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import sortedIndex from "lodash/sortedIndex"; -import min from "lodash/min"; import max from "lodash/max"; +import min from "lodash/min"; +import sortedIndex from "lodash/sortedIndex"; import moment from "moment-timezone"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx index 6de5b458b075..326b364df73b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; import spinner from "src/assets/spinner.gif"; diff --git a/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx b/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx index 611153c546b9..4b1ac0fa91b3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. /* eslint-disable no-useless-escape */ -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./highlightedText.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx b/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx index bba1d293ba16..dc149939ee6b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import Back from "./back-arrow.svg"; import styles from "./backIcon.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/index.ts b/pkg/ui/workspaces/cluster-ui/src/index.ts index 1f8dcd806d8e..31f8e7ff7a98 100644 --- a/pkg/ui/workspaces/cluster-ui/src/index.ts +++ b/pkg/ui/workspaces/cluster-ui/src/index.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import "./protobufInit"; -import * as util from "./util"; import * as api from "./api"; +import * as util from "./util"; export * from "./anchor"; export * from "./badge"; export * from "./barCharts"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx index c57af3e0a697..78131d14c17a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; import { shallow } from "enzyme"; import moment from "moment"; +import React from "react"; import { IndexDetailsPage, IndexDetailsPageProps, util } from "../index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts index 2af1cef98fdb..09cb1590fa2a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts @@ -8,21 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { connect } from "react-redux"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { actions as indexStatsActions } from "src/store/indexStats/indexStats.reducer"; +import { BreadcrumbItem } from "../breadcrumbs"; import { AppState, uiConfigActions } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; import { actions as nodesActions, nodeRegionsByIDSelector, } from "../store/nodes"; -import { TimeScale } from "../timeScaleDropdown"; import { actions as sqlStatsActions } from "../store/sqlStats"; -import { actions as analyticsActions } from "../store/analytics"; +import { + selectHasAdminRole, + selectHasViewActivityRedactedRole, + selectIsTenant, +} from "../store/uiConfig"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; import { databaseNameAttr, generateTableID, @@ -33,13 +40,6 @@ import { tableNameAttr, TimestampToMoment, } from "../util"; -import { BreadcrumbItem } from "../breadcrumbs"; -import { - selectHasAdminRole, - selectHasViewActivityRedactedRole, - selectIsTenant, -} from "../store/uiConfig"; -import { selectTimeScale } from "../store/utils/selectors"; import { IndexDetailPageActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx index 6f45589a9afa..39c06aa54326 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import moment from "moment-timezone"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName } from "src/storybook/fixtures"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx index 7d803c46657d..9c6401296407 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx @@ -8,72 +8,72 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import flatMap from "lodash/flatMap"; import { Caution, Search as IndexIcon } from "@cockroachlabs/icons"; -import moment, { Moment } from "moment-timezone"; import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row, Tooltip } from "antd"; +import classNames from "classnames/bind"; +import flatMap from "lodash/flatMap"; +import moment, { Moment } from "moment-timezone"; +import React from "react"; import { Loading } from "src/loading"; -import { Timestamp } from "src/timestamp"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { ISortedTablePagination, SortedTable, SortSetting, } from "src/sortedtable"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { SqlBox, SqlBoxSize } from "src/sql"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Timestamp } from "src/timestamp"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { INTERNAL_APP_NAME_PREFIX } from "src/util/constants"; -import { CaretRight } from "../icon/caretRight"; -import { BreadcrumbItem, Breadcrumbs } from "../breadcrumbs"; -import { SummaryCard } from "../summaryCard"; import { Anchor } from "../anchor"; -import { - calculateTotalWorkload, - Count, - DATE_FORMAT_24_TZ, - EncodeDatabaseTableIndexUri, - EncodeDatabaseTableUri, - EncodeDatabaseUri, - performanceTuningRecipes, - unique, - unset, -} from "../util"; import { getStatementsUsingIndex, StatementsListRequestFromDetails, StatementsUsingIndexRequest, } from "../api/indexDetailsApi"; +import { BreadcrumbItem, Breadcrumbs } from "../breadcrumbs"; +import { commonStyles } from "../common"; +import { CaretRight } from "../icon/caretRight"; +import { Pagination } from "../pagination"; +import { + calculateActiveFilters, + defaultFilters, + Filter, + Filters, +} from "../queryFilter"; +import { Search } from "../search"; +import LoadingError from "../sqlActivity/errorComponent"; +import { filterStatementsData } from "../sqlActivity/util"; +import { EmptyStatementsPlaceholder } from "../statementsPage/emptyStatementsPlaceholder"; +import { StatementViewType } from "../statementsPage/statementPageTypes"; +import statementsStyles from "../statementsPage/statementsPage.module.scss"; import { AggregateStatistics, makeStatementsColumns, populateRegionNodeForStatements, } from "../statementsTable"; import { UIConfigState } from "../store"; -import statementsStyles from "../statementsPage/statementsPage.module.scss"; -import { Pagination } from "../pagination"; +import { SummaryCard } from "../summaryCard"; import { TableStatistics } from "../tableStatistics"; -import LoadingError from "../sqlActivity/errorComponent"; -import { filterStatementsData } from "../sqlActivity/util"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "../timeScaleDropdown"; -import { Search } from "../search"; import { - calculateActiveFilters, - defaultFilters, - Filter, - Filters, -} from "../queryFilter"; -import { commonStyles } from "../common"; -import { EmptyStatementsPlaceholder } from "../statementsPage/emptyStatementsPlaceholder"; -import { StatementViewType } from "../statementsPage/statementPageTypes"; + calculateTotalWorkload, + Count, + DATE_FORMAT_24_TZ, + EncodeDatabaseTableIndexUri, + EncodeDatabaseTableUri, + EncodeDatabaseUri, + performanceTuningRecipes, + unique, + unset, +} from "../util"; import styles from "./indexDetailsPage.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx index 6bdb4cba3e3c..4a0ffb5b53b1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useState } from "react"; -import copy from "copy-to-clipboard"; -import { message } from "antd"; import CopyOutlined from "@ant-design/icons/CopyOutlined"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import { message } from "antd"; import classNames from "classnames/bind"; +import copy from "copy-to-clipboard"; +import React, { useCallback, useState } from "react"; -import { Modal } from "../modal"; -import { Text, TextTypes } from "../text"; -import { Button } from "../button"; +import { Anchor } from "../anchor"; import { executeIndexRecAction, IndexActionResponse, } from "../api/indexActionsApi"; +import { Button } from "../button"; +import { Modal } from "../modal"; +import { Text, TextTypes } from "../text"; import { alterIndex, createIndex, dropIndex, onlineSchemaChanges, } from "../util"; -import { Anchor } from "../anchor"; import styles from "./indexActionBtn.module.scss"; import { InsightType } from "./types"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx index 35f903f5e92d..bf53e9697b31 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./workloadInsights/util/workloadInsights.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx index cf29d8049398..165c4b64a83e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx @@ -10,9 +10,9 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "../../anchor"; import { insights } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx index 43c5b8645531..233170d25e76 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx @@ -12,6 +12,9 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { SortSetting } from "src/sortedtable"; +import { AppState, uiConfigActions } from "src/store"; +import { selectDropUnusedIndexDuration } from "src/store/clusterSettings/clusterSettings.selectors"; import { actions, selectSchemaInsights, @@ -22,14 +25,11 @@ import { selectFilters, selectSortSetting, } from "src/store/schemaInsights"; -import { AppState, uiConfigActions } from "src/store"; -import { SortSetting } from "src/sortedtable"; -import { selectDropUnusedIndexDuration } from "src/store/clusterSettings/clusterSettings.selectors"; -import { SchemaInsightEventFilters } from "../types"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as localStorageActions } from "../../store/localStorage"; import { selectHasAdminRole } from "../../store/uiConfig"; -import { actions as analyticsActions } from "../../store/analytics"; +import { SchemaInsightEventFilters } from "../types"; import { SchemaInsightsView, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx index 11aeb607b481..d1b158cbb53e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx @@ -8,23 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { useContext, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Anchor } from "src/anchor"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import styles from "src/statementsPage/statementsPage.module.scss"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; -import { ISortedTablePagination, SortSetting } from "../../sortedtable"; -import { PageConfig, PageConfigItem } from "../../pageConfig"; -import { Loading } from "../../loading"; +import { CockroachCloudContext } from "../../contexts"; import { InsightsSortedTable, makeInsightsColumns, } from "../../insightsTable/insightsTable"; +import insightTableStyles from "../../insightsTable/insightsTable.module.scss"; +import { Loading } from "../../loading"; +import { PageConfig, PageConfigItem } from "../../pageConfig"; +import { Pagination } from "../../pagination"; import { calculateActiveFilters, defaultFilters, @@ -32,17 +34,15 @@ import { getFullFiltersAsStringRecord, SelectedFilters, } from "../../queryFilter"; -import { queryByName, syncHistory } from "../../util"; +import { getSchemaInsightEventFiltersFromURL } from "../../queryFilter/utils"; +import { Search } from "../../search"; +import { ISortedTablePagination, SortSetting } from "../../sortedtable"; import { getTableSortFromURL } from "../../sortedtable/getTableSortFromURL"; import { TableStatistics } from "../../tableStatistics"; +import { queryByName, syncHistory } from "../../util"; +import { InsightsError } from "../insightsErrorComponent"; import { InsightRecommendation, SchemaInsightEventFilters } from "../types"; -import { getSchemaInsightEventFiltersFromURL } from "../../queryFilter/utils"; import { filterSchemaInsights } from "../utils"; -import { Search } from "../../search"; -import { InsightsError } from "../insightsErrorComponent"; -import { Pagination } from "../../pagination"; -import { CockroachCloudContext } from "../../contexts"; -import insightTableStyles from "../../insightsTable/insightsTable.module.scss"; import { EmptySchemaInsightsTablePlaceholder } from "./emptySchemaInsightsTablePlaceholder"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts index 79eea5e16f4f..145c7c24ae7e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment, { Moment } from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment, { Moment } from "moment-timezone"; import { Filters } from "../queryFilter"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts index 096f28448dea..ecb241e008cb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts @@ -10,14 +10,6 @@ import moment from "moment-timezone"; -import { - filterStatementInsights, - filterTransactionInsights, - getAppsFromStatementInsights, - getAppsFromTransactionInsights, - getInsightsFromProblemsAndCauses, - mergeTxnInsightDetails, -} from "./utils"; import { ContentionDetails, failedExecutionInsight, @@ -34,6 +26,14 @@ import { TxnInsightDetails, TxnInsightEvent, } from "./types"; +import { + filterStatementInsights, + filterTransactionInsights, + getAppsFromStatementInsights, + getAppsFromTransactionInsights, + getInsightsFromProblemsAndCauses, + mergeTxnInsightDetails, +} from "./utils"; const INTERNAL_APP_PREFIX = "$ internal"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx index 76dec7be637f..ba70bdb3f9d1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Col, Row } from "antd"; -import "antd/lib/row/style"; -import "antd/lib/col/style"; import { Heading } from "@cockroachlabs/ui-components"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import "antd/lib/col/style"; +import React from "react"; -import { SummaryCard, SummaryCardItem } from "../../summaryCard"; // TODO (xinhaoz) we should organize these common page details styles into its own file. import styles from "../../statementDetails/statementDetails.module.scss"; -import { TransactionDetailsLink } from "../workloadInsights/util"; +import { SummaryCard, SummaryCardItem } from "../../summaryCard"; import { ContentionDetails } from "../types"; +import { TransactionDetailsLink } from "../workloadInsights/util"; +import "antd/lib/row/style"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts index bb7f4f5d1855..1636756d2823 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { createMemoryHistory } from "history"; import noop from "lodash/noop"; +import moment from "moment-timezone"; import { InsightEventBase, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx index 3f95d21b3a66..900bf22586ce 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import * as sqlApi from "../../api/sqlApi"; -import * as stmtInsightsApi from "../../api/stmtInsightsApi"; import { SqlApiResponse } from "../../api/sqlApi"; -import { StmtInsightEvent } from "../types"; +import * as stmtInsightsApi from "../../api/stmtInsightsApi"; import { CollapseWhitespace, MockSqlResponse } from "../../util/testing"; +import { StmtInsightEvent } from "../types"; import { getStatementInsightPropsFixture } from "./insightDetails.fixture"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx index 3bccb16cf066..97b06b208929 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx @@ -13,6 +13,8 @@ import React, { useState } from "react"; import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT, Duration } from "src/util"; +import { TimeScale } from "../../timeScaleDropdown"; +import { Timestamp } from "../../timestamp"; import { ContentionDetails, ContentionEvent, InsightExecEnum } from "../types"; import { insightsTableTitles, @@ -20,8 +22,6 @@ import { StatementDetailsLink, TransactionDetailsLink, } from "../workloadInsights/util"; -import { TimeScale } from "../../timeScaleDropdown"; -import { Timestamp } from "../../timestamp"; interface InsightDetailsTableProps { data: ContentionEvent[]; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx index d5bb1dbb313c..93cf91610d5b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx @@ -7,25 +7,25 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; -import Helmet from "react-helmet"; -import { RouteComponentProps } from "react-router-dom"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Row, Col, Tabs } from "antd"; import classNames from "classnames/bind"; +import React, { useEffect, useState } from "react"; +import Helmet from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; +import { getExplainPlanFromGist } from "src/api/decodePlanGistApi"; +import { getStmtInsightsApi } from "src/api/stmtInsightsApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; import { getMatchParamByName, idAttr } from "src/util"; -import { getExplainPlanFromGist } from "src/api/decodePlanGistApi"; -import { getStmtInsightsApi } from "src/api/stmtInsightsApi"; // Styles -import { commonStyles } from "src/common"; -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; -import { InsightsError } from "../insightsErrorComponent"; import { TimeScale, toDateRange } from "../../timeScaleDropdown"; +import { InsightsError } from "../insightsErrorComponent"; import { StmtInsightEvent } from "../types"; import { StatementInsightDetailsOverviewTab } from "./statementInsightDetailsOverviewTab"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx index 7f75f6195add..640017a03408 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { connect } from "react-redux"; -import { Dispatch } from "redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; +import { Dispatch } from "redux"; import { AppState, uiConfigActions } from "src/store"; import { @@ -18,10 +18,10 @@ import { } from "src/store/insights/statementInsights"; import { selectHasAdminRole } from "src/store/uiConfig"; -import { TimeScale } from "../../timeScaleDropdown"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as sqlStatsActions } from "../../store/sqlStats"; import { selectTimeScale } from "../../store/utils/selectors"; -import { actions as analyticsActions } from "../../store/analytics"; +import { TimeScale } from "../../timeScaleDropdown"; import { StatementInsightDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx index fc34e306a89a..bbb2c6051480 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx @@ -7,36 +7,36 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useMemo, useState } from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; +import React, { useContext, useMemo, useState } from "react"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; import { InsightsSortedTable, makeInsightsColumns, } from "src/insightsTable/insightsTable"; +import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; import { capitalize, Duration } from "src/util"; import { Count, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, } from "src/util/format"; // Styles -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; +import { CockroachCloudContext } from "../../contexts"; import { WaitTimeInsightsLabels } from "../../detailsPanels/waitTimeInsightsPanel"; +import { SortSetting } from "../../sortedtable"; +import { Timestamp } from "../../timestamp"; +import { StmtInsightEvent } from "../types"; import { getStmtInsightRecommendations } from "../utils"; import { StatementDetailsLink, TransactionDetailsLink, } from "../workloadInsights/util"; -import { CockroachCloudContext } from "../../contexts"; -import { StmtInsightEvent } from "../types"; -import { SortSetting } from "../../sortedtable"; -import { Timestamp } from "../../timestamp"; import { ContentionStatementDetailsTable } from "./insightDetailsTables"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx index 70b4a78c76cd..73dfe2c6f941 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx @@ -7,20 +7,20 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { ArrowLeft } from "@cockroachlabs/icons"; +import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Tabs } from "antd"; import React, { useEffect, useRef } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import { ArrowLeft } from "@cockroachlabs/icons"; -import { Tabs } from "antd"; -import { InlineAlert } from "@cockroachlabs/ui-components"; -import { Button } from "src/button"; -import { getMatchParamByName } from "src/util/query"; +import { Anchor } from "src/anchor"; import { TxnInsightDetailsRequest, TxnInsightDetailsReqErrs } from "src/api"; +import { Button } from "src/button"; import { commonStyles } from "src/common"; -import { idAttr, insights } from "src/util"; import { timeScaleRangeToObj } from "src/timeScaleDropdown/utils"; -import { Anchor } from "src/anchor"; +import { idAttr, insights } from "src/util"; +import { getMatchParamByName } from "src/util/query"; import { TimeScale } from "../../timeScaleDropdown"; import { @@ -29,8 +29,8 @@ import { TxnInsightDetails, } from "../types"; -import { TransactionInsightsDetailsStmtsTab } from "./transactionInsightDetailsStmtsTab"; import { TransactionInsightDetailsOverviewTab } from "./transactionInsightDetailsOverviewTab"; +import { TransactionInsightsDetailsStmtsTab } from "./transactionInsightDetailsStmtsTab"; export interface TransactionInsightDetailsStateProps { insightDetails: TxnInsightDetails; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx index 1bccde930f58..56fd789f5bf1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx @@ -11,6 +11,7 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { TxnInsightDetailsRequest } from "src/api"; import { AppState, uiConfigActions } from "src/store"; import { selectTransactionInsightDetails, @@ -18,13 +19,12 @@ import { actions, selectTransactionInsightDetailsMaxSizeReached, } from "src/store/insightDetails/transactionInsightDetails"; -import { TxnInsightDetailsRequest } from "src/api"; -import { TimeScale } from "../../timeScaleDropdown"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as sqlStatsActions } from "../../store/sqlStats"; -import { selectTimeScale } from "../../store/utils/selectors"; import { selectHasAdminRole } from "../../store/uiConfig"; -import { actions as analyticsActions } from "../../store/analytics"; +import { selectTimeScale } from "../../store/utils/selectors"; +import { TimeScale } from "../../timeScaleDropdown"; import { TransactionInsightDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx index 64bf3c081e76..8d46572348cd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx @@ -8,29 +8,34 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React, { useContext, useState } from "react"; +import { TxnInsightDetailsReqErrs } from "src/api"; +import { WaitTimeInsightsLabels } from "src/detailsPanels/waitTimeInsightsPanel"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; +import { + InsightsSortedTable, + makeInsightsColumns, +} from "src/insightsTable/insightsTable"; +import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; +import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import { NO_SAMPLES_FOUND } from "src/util"; import { Count, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, Duration, } from "src/util/format"; -import { WaitTimeInsightsLabels } from "src/detailsPanels/waitTimeInsightsPanel"; -import { NO_SAMPLES_FOUND } from "src/util"; -import { - InsightsSortedTable, - makeInsightsColumns, -} from "src/insightsTable/insightsTable"; -import { TxnInsightDetailsReqErrs } from "src/api"; -import { Loading } from "src/loading"; -import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; +import { CockroachCloudContext } from "../../contexts"; +import { SortSetting } from "../../sortedtable"; +import { TimeScale } from "../../timeScaleDropdown"; +import { Timestamp } from "../../timestamp"; +import { InsightsError } from "../insightsErrorComponent"; import { ContentionDetails, ContentionEvent, @@ -39,16 +44,11 @@ import { StmtInsightEvent, TxnInsightEvent, } from "../types"; -import { CockroachCloudContext } from "../../contexts"; -import { TransactionDetailsLink } from "../workloadInsights/util"; -import { TimeScale } from "../../timeScaleDropdown"; import { getTxnInsightRecommendations } from "../utils"; -import { SortSetting } from "../../sortedtable"; -import { InsightsError } from "../insightsErrorComponent"; -import { Timestamp } from "../../timestamp"; +import { TransactionDetailsLink } from "../workloadInsights/util"; -import { WaitTimeDetailsTable } from "./insightDetailsTables"; import { FailedInsightDetailsPanel } from "./failedInsightDetailsPanel"; +import { WaitTimeDetailsTable } from "./insightDetailsTables"; const cx = classNames.bind(insightsDetailsStyles); const tableCx = classNames.bind(insightTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx index 5bf0976d358b..d7962636fce9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx @@ -11,18 +11,18 @@ import React from "react"; import { Link } from "react-router-dom"; +import { Loading } from "src/loading"; import { ColumnDescriptor, SortedTable } from "src/sortedtable"; import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT, Duration, limitText, } from "src/util"; -import { Loading } from "src/loading"; +import { Timestamp, Timezone } from "../../timestamp"; +import { InsightsError } from "../insightsErrorComponent"; import { StmtInsightEvent } from "../types"; import { InsightCell } from "../workloadInsights/util/insightCell"; -import { InsightsError } from "../insightsErrorComponent"; -import { Timestamp, Timezone } from "../../timestamp"; const stmtColumns: ColumnDescriptor[] = [ { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx index 84044d752e3f..dbc3c63e69df 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx @@ -8,11 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; -import { Link } from "react-router-dom"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; +import { Badge } from "src/badge"; +import { + InsightExecEnum, + StatementStatus, + StmtInsightEvent, +} from "src/insights"; import { ColumnDescriptor, ISortedTablePagination, @@ -26,20 +32,14 @@ import { limitText, NO_SAMPLES_FOUND, } from "src/util"; -import { - InsightExecEnum, - StatementStatus, - StmtInsightEvent, -} from "src/insights"; -import { Badge } from "src/badge"; -import styles from "../util/workloadInsights.module.scss"; +import { Timestamp } from "../../../timestamp"; import { InsightCell, insightsTableTitles, StatementDetailsLink, } from "../util"; -import { Timestamp } from "../../../timestamp"; +import styles from "../util/workloadInsights.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx index 3109bdc311dc..5688ccf5622f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx @@ -8,19 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState, useCallback } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import moment from "moment-timezone"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React, { useEffect, useState, useCallback } from "react"; +import { useHistory } from "react-router-dom"; +import { Anchor } from "src/anchor"; +import { StmtInsightsReq } from "src/api/stmtInsightsApi"; +import { isSelectedColumn } from "src/columnsSelector/utils"; import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; + filterStatementInsights, + StmtInsightEvent, + getAppsFromStatementInsights, + makeStatementInsightsColumns, + WorkloadInsightEventFilters, +} from "src/insights"; import { Loading } from "src/loading/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; +import { Pagination } from "src/pagination"; import { calculateActiveFilters, defaultFilters, @@ -29,34 +35,28 @@ import { SelectedFilters, } from "src/queryFilter/filter"; import { getWorkloadInsightEventFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; +import { Search } from "src/search/search"; import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; -import { TableStatistics } from "src/tableStatistics"; -import { isSelectedColumn } from "src/columnsSelector/utils"; import { - filterStatementInsights, - StmtInsightEvent, - getAppsFromStatementInsights, - makeStatementInsightsColumns, - WorkloadInsightEventFilters, -} from "src/insights"; -import { StmtInsightsReq } from "src/api/stmtInsightsApi"; -import styles from "src/statementsPage/statementsPage.module.scss"; + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { useScheduleFunction } from "src/util/hooks"; +import styles from "src/statementsPage/statementsPage.module.scss"; +import { TableStatistics } from "src/tableStatistics"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; +import { useScheduleFunction } from "src/util/hooks"; +import { queryByName, syncHistory } from "src/util/query"; +import ColumnsSelector from "../../../columnsSelector/columnsSelector"; import { commonStyles } from "../../../common"; +import { SelectOption } from "../../../multiSelectCheckbox/multiSelectCheckbox"; import { defaultTimeScaleOptions, TimeScale, TimeScaleDropdown, timeScaleRangeToObj, } from "../../../timeScaleDropdown"; -import { SelectOption } from "../../../multiSelectCheckbox/multiSelectCheckbox"; -import ColumnsSelector from "../../../columnsSelector/columnsSelector"; import { InsightsError } from "../../insightsErrorComponent"; import { EmptyInsightsTablePlaceholder } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx index 01850ed091e5..97eb0128b783 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx @@ -11,6 +11,12 @@ import React from "react"; import { Link } from "react-router-dom"; +import { Badge } from "src/badge"; +import { + InsightExecEnum, + TransactionStatus, + TxnInsightEvent, +} from "src/insights"; import { ColumnDescriptor, ISortedTablePagination, @@ -21,21 +27,15 @@ import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, Duration, } from "src/util"; -import { - InsightExecEnum, - TransactionStatus, - TxnInsightEvent, -} from "src/insights"; -import { Badge } from "src/badge"; +import { TimeScale } from "../../../timeScaleDropdown"; +import { Timestamp } from "../../../timestamp"; import { InsightCell, insightsTableTitles, QueriesCell, TransactionDetailsLink, } from "../util"; -import { TimeScale } from "../../../timeScaleDropdown"; -import { Timestamp } from "../../../timestamp"; function txnStatusToString(status: TransactionStatus) { switch (status) { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx index b9b6fbe2b5a8..2e97f5661c6e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx @@ -8,18 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { useCallback, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Anchor } from "src/anchor"; +import { TxnInsightsRequest } from "src/api"; import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; + filterTransactionInsights, + getAppsFromTransactionInsights, + WorkloadInsightEventFilters, + TxnInsightEvent, +} from "src/insights"; import { Loading } from "src/loading/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; +import { Pagination } from "src/pagination"; import { calculateActiveFilters, defaultFilters, @@ -28,22 +32,18 @@ import { SelectedFilters, } from "src/queryFilter/filter"; import { getWorkloadInsightEventFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; +import { Search } from "src/search/search"; import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; -import { TableStatistics } from "src/tableStatistics"; import { - filterTransactionInsights, - getAppsFromTransactionInsights, - WorkloadInsightEventFilters, - TxnInsightEvent, -} from "src/insights"; -import { TxnInsightsRequest } from "src/api"; -import styles from "src/statementsPage/statementsPage.module.scss"; + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { useScheduleFunction } from "src/util/hooks"; +import styles from "src/statementsPage/statementsPage.module.scss"; +import { TableStatistics } from "src/tableStatistics"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; +import { useScheduleFunction } from "src/util/hooks"; +import { queryByName, syncHistory } from "src/util/query"; import { commonStyles } from "../../../common"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx index dfeebee3d877..5b3a30a986a6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx @@ -11,10 +11,10 @@ import React from "react"; import { Link } from "react-router-dom"; -import { StmtInsightEvent } from "../../types"; -import { HexStringToInt64String } from "../../../util"; import { StatementLinkTarget } from "../../../statementsTable"; import { TransactionLinkTarget } from "../../../transactionsTable"; +import { HexStringToInt64String } from "../../../util"; +import { StmtInsightEvent } from "../../types"; export function TransactionDetailsLink( transactionFingerprintID: string, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx index 29af21842f95..a848f261780b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx @@ -10,11 +10,11 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "src/anchor"; -import { insights } from "src/util"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; +import { insights } from "src/util"; const footer = ( diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx index fabb5ea3b8e1..3726e28ea8c2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import React from "react"; import { Insight } from "src/insights"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx index 9be71118d858..fa9a4fa36a91 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactElement } from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React, { ReactElement } from "react"; import { InsightExecEnum } from "src/insights/types"; import { Timezone } from "src/timestamp"; -import { contentModifiers } from "../../../statsTableUtil/statsTableUtil"; import { Anchor } from "../../../anchor"; +import { contentModifiers } from "../../../statsTableUtil/statsTableUtil"; import { contentionTime, readFromDisk, writtenToDisk } from "../../../util"; export const insightsColumnLabels = { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx index acf81f7bc56d..4829cd8b6357 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; import { limitStringArray } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx index 2afbac18a38f..304a60323feb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx @@ -16,15 +16,15 @@ import { queryByName } from "src/util/query"; import { InsightExecEnum, InsightExecOptions } from "../types"; -import { DropDownSelect } from "./util"; -import { - TransactionInsightsView, - TransactionInsightsViewProps, -} from "./transactionInsights"; import { StatementInsightsView, StatementInsightsViewProps, } from "./statementInsights"; +import { + TransactionInsightsView, + TransactionInsightsViewProps, +} from "./transactionInsights"; +import { DropDownSelect } from "./util"; export type WorkloadInsightsViewProps = { transactionInsightsViewProps: TransactionInsightsViewProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx index 2cf73b50e6d2..83aa05b86712 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx @@ -12,15 +12,14 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { AppState } from "src/store"; -import { actions as localStorageActions } from "src/store/localStorage"; -import { actions as sqlActions } from "src/store/sqlStats"; +import { StmtInsightsReq, TxnInsightsRequest } from "src/api"; +import { selectStmtInsights } from "src/selectors/common"; import { SortSetting } from "src/sortedtable"; +import { AppState } from "src/store"; import { actions as statementInsights, selectColumns, selectInsightTypes, - selectStmtInsights, selectStmtInsightsError, selectStmtInsightsLoading, selectStmtInsightsMaxApiReached, @@ -34,17 +33,14 @@ import { selectTransactionInsightsLoading, selectTransactionInsightsMaxApiReached, } from "src/store/insights/transactionInsights"; -import { StmtInsightsReq, TxnInsightsRequest } from "src/api"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlActions } from "src/store/sqlStats"; +import { actions as analyticsActions } from "../../store/analytics"; +import { selectTimeScale } from "../../store/utils/selectors"; import { TimeScale } from "../../timeScaleDropdown"; import { WorkloadInsightEventFilters } from "../types"; -import { selectTimeScale } from "../../store/utils/selectors"; -import { actions as analyticsActions } from "../../store/analytics"; -import { - WorkloadInsightsViewProps, - WorkloadInsightsRootControl, -} from "./workloadInsightRootControl"; import { StatementInsightsViewDispatchProps, StatementInsightsViewStateProps, @@ -53,6 +49,10 @@ import { TransactionInsightsViewDispatchProps, TransactionInsightsViewStateProps, } from "./transactionInsights"; +import { + WorkloadInsightsViewProps, + WorkloadInsightsRootControl, +} from "./workloadInsightRootControl"; const transactionMapStateToProps = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx index 45b63c44a909..73f5a1eb4537 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx @@ -9,12 +9,20 @@ // licenses/APL.txt. import { Tooltip } from "@cockroachlabs/ui-components"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Link } from "react-router-dom"; -import { StatementLink } from "../statementsTable"; +import { Anchor } from "../anchor"; import IdxRecAction from "../insights/indexActionBtn"; +import { + InsightExecEnum, + InsightRecommendation, + InsightType, +} from "../insights/types"; +import { insightType } from "../insights/utils"; +import { ColumnDescriptor, SortedTable } from "../sortedtable"; +import { StatementLink } from "../statementsTable"; import { clusterSettings, computeOrUseStmtSummary, @@ -26,14 +34,6 @@ import { statementsRetries, stmtPerformanceRules, } from "../util"; -import { Anchor } from "../anchor"; -import { ColumnDescriptor, SortedTable } from "../sortedtable"; -import { - InsightExecEnum, - InsightRecommendation, - InsightType, -} from "../insights/types"; -import { insightType } from "../insights/utils"; import styles from "./insightsTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx index e3198dac52a9..06b0d59710f6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx @@ -7,34 +7,34 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row, Tabs } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; -import moment from "moment-timezone"; import { JobRequest, JobResponse } from "src/api/jobsApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { CockroachCloudContext } from "src/contexts"; +import jobStyles from "src/jobs/jobs.module.scss"; +import { HighwaterTimestamp } from "src/jobs/util/highwaterTimestamp"; +import { JobStatusCell } from "src/jobs/util/jobStatusCell"; import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; +import { UIConfigState } from "src/store"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; import { TimestampToMoment, idAttr, getMatchParamByName, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, } from "src/util"; -import { HighwaterTimestamp } from "src/jobs/util/highwaterTimestamp"; -import { JobStatusCell } from "src/jobs/util/jobStatusCell"; -import { commonStyles } from "src/common"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import jobStyles from "src/jobs/jobs.module.scss"; -import { CockroachCloudContext } from "src/contexts"; -import { UIConfigState } from "src/store"; import { GetJobProfilerExecutionDetailRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx index ab5fba383266..656c41e74f37 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import long from "long"; -import { AppState, uiConfigActions } from "src/store"; -import { JobRequest, JobResponse } from "src/api/jobsApi"; -import { actions as jobActions } from "src/store/jobDetails"; import { ListJobProfilerExecutionDetailsRequest, createInitialState, getExecutionDetailFile, } from "src/api"; +import { JobRequest, JobResponse } from "src/api/jobsApi"; +import { AppState, uiConfigActions } from "src/store"; +import { actions as jobActions } from "src/store/jobDetails"; import { initialState, actions as jobProfilerActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx index fd147fb4094a..bfe26ffda57f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useMemo, useState } from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Button, InlineAlert, Icon } from "@cockroachlabs/ui-components"; -import moment from "moment-timezone"; import { Space } from "antd"; import classNames from "classnames"; -import long from "long"; import classnames from "classnames/bind"; +import long from "long"; +import moment from "moment-timezone"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import { RequestState } from "src/api"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; -import { EmptyTable } from "src/empty"; -import { useScheduleFunction } from "src/util/hooks"; -import { DownloadFile, DownloadFileRef } from "src/downloadFile"; import { GetJobProfilerExecutionDetailRequest, GetJobProfilerExecutionDetailResponse, ListJobProfilerExecutionDetailsRequest, ListJobProfilerExecutionDetailsResponse, } from "src/api/jobProfilerApi"; +import { DownloadFile, DownloadFileRef } from "src/downloadFile"; +import { EmptyTable } from "src/empty"; +import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import { useScheduleFunction } from "src/util/hooks"; import styles from "./jobProfilerView.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx index 6c25d5f93089..0bffc9693580 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import React from "react"; import { Link } from "react-router-dom"; -import classNames from "classnames/bind"; import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx index 7809b28a3bb4..d22decad418e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render } from "@testing-library/react"; +import * as H from "history"; +import moment from "moment-timezone"; import React from "react"; import { MemoryRouter } from "react-router-dom"; -import * as H from "history"; import { formatDuration } from "../util/duration"; -import { allJobsFixture, earliestRetainedTime } from "./jobsPage.fixture"; import { JobsPage, JobsPageProps } from "./jobsPage"; +import { allJobsFixture, earliestRetainedTime } from "./jobsPage.fixture"; import Job = cockroach.server.serverpb.IJobResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx index c7fc7c9d3c94..c4c4818eecc5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx @@ -7,8 +7,8 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx index 37c444afec3f..dddd927819e4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx @@ -9,28 +9,29 @@ // licenses/APL.txt. import { cockroach, google } from "@cockroachlabs/crdb-protobuf-client"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment from "moment-timezone"; import React from "react"; import { Helmet } from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { JobsRequest, JobsResponse } from "src/api/jobsApi"; import { RequestState } from "src/api/types"; -import { Delayed } from "src/delayed"; -import { Dropdown } from "src/dropdown"; -import { Loading } from "src/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; -import { ISortedTablePagination, SortSetting } from "src/sortedtable"; import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; -import { Pagination, ResultsPerPageLabel } from "src/pagination"; import { isSelectedColumn } from "src/columnsSelector/utils"; -import { DATE_FORMAT_24_TZ, syncHistory, TimestampToMoment } from "src/util"; import { commonStyles } from "src/common"; +import { Delayed } from "src/delayed"; +import { Dropdown } from "src/dropdown"; +import { Loading } from "src/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Pagination, ResultsPerPageLabel } from "src/pagination"; +import { ISortedTablePagination, SortSetting } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; +import { DATE_FORMAT_24_TZ, syncHistory, TimestampToMoment } from "src/util"; +import { Timestamp } from "../../timestamp"; import styles from "../jobs.module.scss"; import { showOptions, @@ -40,7 +41,6 @@ import { defaultRequestOptions, isValidJobType, } from "../util"; -import { Timestamp } from "../../timestamp"; import { jobsColumnLabels, JobsTable, makeJobsColumns } from "./jobsTable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx index 8bc82b17e12c..0ee8d35264bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx @@ -12,6 +12,7 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { JobsRequest } from "src/api/jobsApi"; import { AppState } from "src/store"; import { selectShowSetting, @@ -22,11 +23,10 @@ import { initialState, actions as jobsActions, } from "src/store/jobs"; -import { JobsRequest } from "src/api/jobsApi"; -import { actions as localStorageActions } from "../../store/localStorage"; import { SortSetting } from "../../sortedtable"; import { actions as analyticsActions } from "../../store/analytics"; +import { actions as localStorageActions } from "../../store/localStorage"; import { JobsPageStateProps, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx index 60ff20f7dd54..8a20b4490bfb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Anchor } from "src/anchor"; import { EmptyTable } from "src/empty"; @@ -30,9 +30,9 @@ import { } from "src/util/docs"; import { DATE_WITH_SECONDS_FORMAT } from "src/util/format"; -import { HighwaterTimestamp, JobStatusCell } from "../util"; -import styles from "../jobs.module.scss"; import { Timestamp, Timezone } from "../../timestamp"; +import styles from "../jobs.module.scss"; +import { HighwaterTimestamp, JobStatusCell } from "../util"; import { JobDescriptionCell } from "./jobDescriptionCell"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx index 9a4b00aa1ed0..a09deaa8c741 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render, screen } from "@testing-library/react"; +import React from "react"; import { makeTimestamp } from "src/util"; +import { Duration } from "./duration"; import { JOB_STATUS_RUNNING, JOB_STATUS_SUCCEEDED, @@ -26,7 +27,6 @@ import { JOB_STATUS_REVERTING, JOB_STATUS_REVERT_FAILED, } from "./jobOptions"; -import { Duration } from "./duration"; // Job running for 10 minutes const START_SECONDS = 0; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx index c824e2585363..96de0a4f6c39 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import classNames from "classnames/bind"; import { Line } from "rc-progress"; import React from "react"; -import classNames from "classnames/bind"; import { Badge } from "src/badge"; diff --git a/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx index fc2d1432d5b9..64a8faeb7121 100644 --- a/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Spinner, InlineAlert } from "@cockroachlabs/ui-components"; import { assert } from "chai"; import { mount } from "enzyme"; -import { Spinner, InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; import { Loading } from "./loading"; diff --git a/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx b/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx index 871e6e4d7f0b..387a91da381d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { InlineAlert, InlineAlertProps, Spinner, InlineAlertIntent, } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import groupBy from "lodash/groupBy"; import map from "lodash/map"; +import React from "react"; import { adminUIAccess, getLogger, isForbiddenRequestError } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx b/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx index 1a5eabbd5e27..153e376a5841 100644 --- a/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Modal as AntModal, Space } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; import { Button } from "../button"; -import { Text, TextTypes } from "../text"; import SpinIcon from "../icon/spin"; +import { Text, TextTypes } from "../text"; import styles from "./modal.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx b/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx index 7ccb056a8f72..f9d363745ca5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import React from "react"; import Select, { components, OptionsType } from "react-select"; -import classNames from "classnames/bind"; import { Filter } from "../queryFilter"; diff --git a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx index f038ae3582a6..7ea5dccd4489 100644 --- a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./outsideEventHandler.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx index 13db0a603e77..bbc9b04694a2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { createRef } from "react"; import { render, waitFor } from "@testing-library/react"; +import React, { createRef } from "react"; import { OutsideEventHandler } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx b/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx index f06a84b88468..3ca4f736d727 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import classnames from "classnames/bind"; +import React, { useContext } from "react"; import { CockroachCloudContext } from "../contexts"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx b/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx index 5cda0b33c29e..2c0461a77804 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Pagination as AntPagination, PaginationProps as AntPaginationProps, } from "antd"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./pagination.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx index 9d208c76b286..04f699bad70a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { assert } from "chai"; import { shallow } from "enzyme"; +import React from "react"; import { ResultsPerPageLabel, diff --git a/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts b/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts index a425e7f1fbed..db6eb404acf1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts +++ b/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as protobuf from "protobufjs/minimal"; import Long from "long"; +import * as protobuf from "protobufjs/minimal"; protobuf.util.Long = Long; protobuf.configure(); diff --git a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx index c78a1cad3f6f..59f0cf503515 100644 --- a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import Select from "react-select"; -import { History } from "history"; import { CaretDown, Cancel } from "@cockroachlabs/icons"; import { Input } from "antd"; +import { History } from "history"; import isEqual from "lodash/isEqual"; +import React from "react"; +import Select from "react-select"; +import { Button } from "../button"; +import { selectCustomStyles } from "../common"; import { MultiSelectCheckbox } from "../multiSelectCheckbox/multiSelectCheckbox"; import { syncHistory } from "../util"; -import { selectCustomStyles } from "../common"; -import { Button } from "../button"; import { dropdownButton, diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx index 87ba1686560a..520e8ee1f1dd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx @@ -9,21 +9,21 @@ // licenses/APL.txt. import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; import React, { useEffect } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { Schedule } from "src/api/schedulesApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; import { Loading } from "src/loading"; +import scheduleStyles from "src/schedules/schedules.module.scss"; import { SqlBox, SqlBoxSize } from "src/sql"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import { DATE_FORMAT_24_TZ, idAttr, getMatchParamByName } from "src/util"; -import { commonStyles } from "src/common"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import scheduleStyles from "src/schedules/schedules.module.scss"; +import { DATE_FORMAT_24_TZ, idAttr, getMatchParamByName } from "src/util"; import { Timestamp } from "../../timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx index dbf499cf584d..bdcb35be862e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx @@ -7,11 +7,11 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; +import React from "react"; -import { ScheduleTable, ScheduleTableProps } from "./scheduleTable"; import { allSchedulesFixture } from "./schedulesPage.fixture"; +import { ScheduleTable, ScheduleTableProps } from "./scheduleTable"; describe("", () => { it("should reset page to 1 after schedule list prop changes", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx index f69a52e29378..dfb0a0d97dc7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx @@ -7,13 +7,13 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { Nodes, MagnifyingGlass } from "@cockroachlabs/icons"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { Link } from "react-router-dom"; -import map from "lodash/map"; import isEqual from "lodash/isEqual"; +import map from "lodash/map"; +import React from "react"; +import { Link } from "react-router-dom"; import { Anchor } from "src/anchor"; import { Schedule, Schedules } from "src/api/schedulesApi"; @@ -23,8 +23,8 @@ import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { dropSchedules, pauseSchedules, resumeSchedules } from "src/util/docs"; import { DATE_FORMAT } from "src/util/format"; -import styles from "../schedules.module.scss"; import { Timestamp, Timezone } from "../../timestamp"; +import styles from "../schedules.module.scss"; const cx = classNames.bind(styles); class SchedulesSortedTable extends SortedTable {} diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx index 8bf05febac46..dda53981e91a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx @@ -9,14 +9,14 @@ // licenses/APL.txt. import { render } from "@testing-library/react"; +import * as H from "history"; import React from "react"; import { MemoryRouter } from "react-router-dom"; -import * as H from "history"; import { Schedule } from "src/api/schedulesApi"; -import { allSchedulesFixture } from "./schedulesPage.fixture"; import { SchedulesPage, SchedulesPageProps } from "./schedulesPage"; +import { allSchedulesFixture } from "./schedulesPage.fixture"; const getMockSchedulesPageProps = ( schedules: Array, diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx index bd606a8bda90..cd3f15b994c8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx @@ -7,8 +7,8 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx index 42a219f4a368..fbc9c03bbf7e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment from "moment-timezone"; import React, { useEffect } from "react"; import { Helmet } from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { Schedules } from "src/api/schedulesApi"; +import { commonStyles } from "src/common"; import { Delayed } from "src/delayed"; import { Dropdown } from "src/dropdown"; import { Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; import { SortSetting } from "src/sortedtable"; import { syncHistory } from "src/util"; -import { commonStyles } from "src/common"; import styles from "../schedules.module.scss"; -import { ScheduleTable } from "./scheduleTable"; import { statusOptions, showOptions } from "./scheduleOptions"; +import { ScheduleTable } from "./scheduleTable"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx index bc84dc934a2f..92f8b6702793 100644 --- a/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Search } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/search/search.tsx b/pkg/ui/workspaces/cluster-ui/src/search/search.tsx index ad3eedbd2aff..9ce9c7a689bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/search/search.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/search/search.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Button, Input, ConfigProvider } from "antd"; -import classNames from "classnames/bind"; -import noop from "lodash/noop"; import { Cancel as CancelIcon, Search as SearchIcon, } from "@cockroachlabs/icons"; +import { Button, Input, ConfigProvider } from "antd"; +import classNames from "classnames/bind"; +import noop from "lodash/noop"; +import React from "react"; import { crlTheme } from "../antdTheme"; diff --git a/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx b/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx index 7844f0661aa6..a941426f2552 100644 --- a/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx @@ -8,22 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import { Menu, Dropdown } from "antd"; import { CaretDown } from "@cockroachlabs/icons"; +import { Menu, Dropdown } from "antd"; +import classNames from "classnames/bind"; import { MenuClickEventHandler } from "rc-menu/es/interface"; +import React from "react"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; import { Button } from "src/button"; import { commonStyles } from "src/common"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "src/timeScaleDropdown"; -import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; +import { applyBtn } from "../queryFilter/filterClasses"; import { limitOptions, limitMoreOptions, @@ -33,7 +34,6 @@ import { stmtRequestSortMoreOptions, txnRequestSortMoreOptions, } from "../util/sqlActivityConstants"; -import { applyBtn } from "../queryFilter/filterClasses"; import styles from "./searchCriteria.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx b/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx index dcb5929ed916..05471da229d8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; -import classNames from "classnames/bind"; import { CaretUp, CaretDown } from "@cockroachlabs/icons"; import { Radio } from "antd"; +import classNames from "classnames/bind"; +import React, { useState } from "react"; import { Button } from "../button"; import styles from "../statementsPage/statementTypeSelect.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts index 96853f5c69a2..d48be32b8008 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts @@ -10,15 +10,15 @@ import { createSelector } from "reselect"; -import { ActiveExecutions } from "src/activeExecutions/types"; -import { AppState } from "src/store"; -import { selectActiveExecutionsCombiner } from "src/selectors/activeExecutionsCommon.selectors"; -import { selectExecutionID } from "src/selectors/common"; import { getActiveTransaction, getContentionDetailsFromLocksAndTxns, getActiveStatement, } from "src/activeExecutions/activeStatementUtils"; +import { ActiveExecutions } from "src/activeExecutions/types"; +import { selectActiveExecutionsCombiner } from "src/selectors/activeExecutionsCommon.selectors"; +import { selectExecutionID } from "src/selectors/common"; +import { AppState } from "src/store"; // This file contains selector functions used across active execution // pages that are specific to cluster-ui. diff --git a/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts b/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts index a7bc587ae68c..20acbe2e3d78 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts +++ b/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts @@ -18,6 +18,9 @@ import { txnFingerprintIdAttr, } from "src/util"; +import { StmtInsightEvent } from "../insights"; +import { AppState } from "../store"; + // The functions in this file are agnostic to the different shape of each // state in db-console and cluster-ui. This file contains selector functions // and combiners that can be reused across both packages. @@ -47,3 +50,6 @@ export const selectTransactionFingerprintID = ( _state: unknown, props: RouteComponentProps, ): string | null => getMatchParamByName(props.match, txnFingerprintIdAttr); + +export const selectStmtInsights = (state: AppState): StmtInsightEvent[] => + state.adminUI?.stmtInsights?.data?.results; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx index 3aeb3b7e0e9f..2e64f2aff5d5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx @@ -10,10 +10,10 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; -import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; import { Anchor } from "src/anchor"; +import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; import { sessionsTable } from "src/util"; const footer = ( diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx index fb66b15886c9..14d3d1cfa5db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx @@ -8,51 +8,51 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Helmet } from "react-helmet"; -import { RouteComponentProps } from "react-router-dom"; -import { Col, Row } from "antd"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import moment from "moment-timezone"; import isNil from "lodash/isNil"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; -import { DurationToMomentDuration, TimestampToMoment } from "src/util/convert"; -import { Bytes, DATE_FORMAT_24_TZ, Count } from "src/util/format"; +import { commonStyles } from "src/common"; import { SqlBox, SqlBoxSize } from "src/sql/box"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { NodeLink } from "src/statementsTable/statementsTableContent"; +import { UIConfigState } from "src/store"; import { ICancelQueryRequest, ICancelSessionRequest, } from "src/store/terminateQuery"; -import { UIConfigState } from "src/store"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; -import { commonStyles } from "src/common"; import { createTimeScaleFromDateRange, TimeScale } from "src/timeScaleDropdown"; -import { getMatchParamByName } from "src/util/query"; import { sessionAttr } from "src/util/constants"; +import { DurationToMomentDuration, TimestampToMoment } from "src/util/convert"; +import { Bytes, DATE_FORMAT_24_TZ, Count } from "src/util/format"; +import { getMatchParamByName } from "src/util/query"; -import { CircleFilled } from "../icon"; -import { Text, TextTypes } from "../text"; import { Button } from "../button"; -import { SummaryCard, SummaryCardItem } from "../summaryCard"; -import LoadingError from "../sqlActivity/errorComponent"; +import { CircleFilled } from "../icon"; import { Loading } from "../loading"; +import LoadingError from "../sqlActivity/errorComponent"; +import { SummaryCard, SummaryCardItem } from "../summaryCard"; +import { Text, TextTypes } from "../text"; import { Timestamp } from "../timestamp"; import { FixLong } from "../util"; import styles from "./sessionDetails.module.scss"; +import { + getStatusClassname, + getStatusString, + SessionInfo, +} from "./sessionsTable"; import TerminateQueryModal, { TerminateQueryModalRef, } from "./terminateQueryModal"; import TerminateSessionModal, { TerminateSessionModalRef, } from "./terminateSessionModal"; -import { - getStatusClassname, - getStatusString, - SessionInfo, -} from "./sessionsTable"; const cx = classNames.bind(styles); const statementsPageCx = classNames.bind(statementsPageStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx index e6259f9a20b7..3624b3fa6d1f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx @@ -12,18 +12,18 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { analyticsActions, AppState } from "src/store"; +import { actions as nodesLivenessActions } from "src/store/liveness"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { + actions as nodesActions, + nodeDisplayNameByIDSelector, +} from "src/store/nodes"; import { actions as sessionsActions, selectSession, selectSessionDetailsUiConfig, } from "src/store/sessions"; import { actions as terminateQueryActions } from "src/store/terminateQuery"; -import { - actions as nodesActions, - nodeDisplayNameByIDSelector, -} from "src/store/nodes"; -import { actions as localStorageActions } from "src/store/localStorage"; -import { actions as nodesLivenessActions } from "src/store/liveness"; import { TimeScale } from "src/timeScaleDropdown"; import { selectIsTenant } from "../store/uiConfig"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts index 076d241f1af7..0961b0d021ed 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts @@ -10,11 +10,11 @@ import { createMemoryHistory } from "history"; -import { sessionAttr } from "src/util/constants"; import { CancelSessionRequestMessage, CancelQueryRequestMessage, } from "src/api/terminateQueryApi"; +import { sessionAttr } from "src/util/constants"; import { SessionDetailsProps } from "./sessionDetails"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx index 436c09c905ed..00541a33e40e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx index 5beb92ad8d7d..9400ee3c4f6e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; +import { Route } from "react-router-dom"; import { applyMiddleware, combineReducers, @@ -26,7 +26,7 @@ import { Store, StoreEnhancer, } from "redux"; -import { Route } from "react-router-dom"; +import createSagaMiddleware from "redux-saga"; import { AppState, sagas, rootReducer } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts index 760d15c4a260..feebf499e6de 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import Long from "long"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { util } from "protobufjs"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx index 94bd29c76557..7994be5a84dc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx index c83b237915eb..66ea73dc03ef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import classNames from "classnames/bind"; import isNil from "lodash/isNil"; import merge from "lodash/merge"; -import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { syncHistory } from "src/util/query"; +import { Loading } from "src/loading"; import { Pagination } from "src/pagination"; import { SortSetting, @@ -23,13 +23,13 @@ import { updateSortSettingQueryParamsOnTab, ColumnDescriptor, } from "src/sortedtable"; -import { Loading } from "src/loading"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { ICancelSessionRequest, ICancelQueryRequest, } from "src/store/terminateQuery"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { TimestampToMoment, unset } from "src/util"; +import { syncHistory } from "src/util/query"; import ColumnsSelector, { SelectOption, @@ -50,20 +50,20 @@ import { } from "../statsTableUtil/statsTableUtil"; import { TableStatistics } from "../tableStatistics"; +import { EmptySessionsTablePlaceholder } from "./emptySessionsTablePlaceholder"; import sessionPageStyles from "./sessionPage.module.scss"; -import TerminateQueryModal, { - TerminateQueryModalRef, -} from "./terminateQueryModal"; -import TerminateSessionModal, { - TerminateSessionModalRef, -} from "./terminateSessionModal"; import { getStatusString, makeSessionsColumns, SessionInfo, SessionsSortedTable, } from "./sessionsTable"; -import { EmptySessionsTablePlaceholder } from "./emptySessionsTablePlaceholder"; +import TerminateQueryModal, { + TerminateQueryModalRef, +} from "./terminateQueryModal"; +import TerminateSessionModal, { + TerminateSessionModalRef, +} from "./terminateSessionModal"; const statementsPageCx = classNames.bind(statementsPageStyles); const sessionsPageCx = classNames.bind(sessionPageStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx index 9eef9413c6ac..56bea07c3be0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -25,6 +24,7 @@ import { createStore, Store, } from "redux"; +import createSagaMiddleware from "redux-saga"; import { AppState, rootReducer, sagas } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx index 8aaa16533d25..f71999f84961 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { createSelector } from "reselect"; import { analyticsActions, AppState } from "src/store"; -import { SessionsState, actions as sessionsActions } from "src/store/sessions"; import { actions as localStorageActions } from "src/store/localStorage"; +import { SessionsState, actions as sessionsActions } from "src/store/sessions"; import { actions as terminateQueryActions, ICancelQueryRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx index 91a3adc98f16..97e3c4c0a679 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx @@ -8,26 +8,26 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import moment from "moment-timezone"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Icon, Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import { Button } from "src/button/button"; +import { + Dropdown, + DropdownOption as DropdownItem, +} from "src/dropdown/dropdown"; +import { CircleFilled } from "src/icon/circleFilled"; +import { ColumnDescriptor, SortedTable } from "src/sortedtable/sortedtable"; import { DurationToMomentDuration, DurationToNumber, TimestampToMoment, } from "src/util/convert"; import { BytesWithPrecision, Count, DATE_FORMAT } from "src/util/format"; -import { ColumnDescriptor, SortedTable } from "src/sortedtable/sortedtable"; -import { CircleFilled } from "src/icon/circleFilled"; -import { - Dropdown, - DropdownOption as DropdownItem, -} from "src/dropdown/dropdown"; -import { Button } from "src/button/button"; import { statisticsTableTitles, @@ -36,9 +36,9 @@ import { import { Timestamp } from "../timestamp"; import { computeOrUseStmtSummary, FixLong } from "../util"; +import styles from "./sessionsTable.module.scss"; import { TerminateQueryModalRef } from "./terminateQueryModal"; import { TerminateSessionModalRef } from "./terminateSessionModal"; -import styles from "./sessionsTable.module.scss"; type ISession = cockroach.server.serverpb.ISession; type Status = cockroach.server.serverpb.Session.Status; diff --git a/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx b/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx index 37a7cff5c215..ff46da78e629 100644 --- a/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import * as React from "react"; import { CircleFilled } from "src/icon"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx index 1a13e408058f..786bc983d72e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { assert } from "chai"; -import { mount, ReactWrapper } from "enzyme"; import classNames from "classnames/bind"; -import sumBy from "lodash/sumBy"; +import { mount, ReactWrapper } from "enzyme"; import each from "lodash/each"; import sortBy from "lodash/sortBy"; +import sumBy from "lodash/sumBy"; +import React from "react"; import styles from "src/sortabletable/sortabletable.module.scss"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx index 10ed25673591..6fd5a9b01226 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { SortedTable } from "./"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx index 156d67d37ff1..710b8639f64e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import * as Long from "long"; +import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import { History } from "history"; +import orderBy from "lodash/orderBy"; +import times from "lodash/times"; +import * as Long from "long"; import { Moment } from "moment-timezone"; +import React from "react"; import { createSelector } from "reselect"; -import times from "lodash/times"; -import classNames from "classnames/bind"; -import { Tooltip } from "@cockroachlabs/ui-components"; -import orderBy from "lodash/orderBy"; import { EmptyPanel, EmptyPanelProps } from "../empty"; import styles from "./sortedtable.module.scss"; -import { TableSpinner } from "./tableSpinner"; import { TableHead } from "./tableHead"; import { TableRow } from "./tableRow"; +import { TableSpinner } from "./tableSpinner"; export interface ISortedTablePagination { current: number; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx index ccc331e75d0b..abedc80a937f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { ExpandableConfig, SortableColumn, SortSetting } from "../sortedtable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx index 4daddd116dcf..85473d90d05e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { ExpandableConfig, SortableColumn } from "../sortedtable"; -import styles from "./tableRow.module.scss"; import { RowCell } from "./rowCell"; +import styles from "./tableRow.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx index 82ea917d9194..9693f1ec70f8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Spinner } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./tableSpinner.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx b/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx index 3f907912040c..8ce62b1d7cfa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { FormatQuery } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx b/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx index f933426bfce9..5b89d7653897 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import hljs from "highlight.js/lib/core"; import sqlLangSyntax from "highlight.js/lib/languages/pgsql"; import React from "react"; -import classNames from "classnames/bind"; -import styles from "./sqlhighlight.module.scss"; import { SqlBoxProps } from "./box"; +import styles from "./sqlhighlight.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx index b615e44658f2..1743e3bbe02c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useState } from "react"; import classNames from "classnames/bind"; +import React, { useCallback, useState } from "react"; -import { StatisticType } from "../statsTableUtil/statsTableUtil"; import { Modal } from "../modal"; +import { StatisticType } from "../statsTableUtil/statsTableUtil"; import { Text } from "../text"; import styles from "./sqlActivity.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx index e77452c6779c..d233cacde984 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; import { isRequestError, RequestError } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx index 9f8a6cbed0b0..3717e1b78bda 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import { mockStmtStats, Stmt } from "src/api/testUtils"; +import { Filters } from "src/queryFilter/filter"; import { convertRawStmtsToAggregateStatistics, filterStatementsData, getAppsFromStmtsResponse, } from "src/sqlActivity/util"; -import { mockStmtStats, Stmt } from "src/api/testUtils"; -import { Filters } from "src/queryFilter/filter"; import { INTERNAL_APP_NAME_PREFIX, unset } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx index 564fcf3f6fe0..1db1e596df8b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx @@ -10,16 +10,16 @@ import { createSelector } from "@reduxjs/toolkit"; -import { containAny } from "src/util/arrays"; +import { SqlStatsResponse } from "src/api/statementsApi"; +import { Filters, getTimeValueInSeconds } from "src/queryFilter"; +import { AggregateStatistics } from "src/statementsTable"; import { CollectedStatementStatistics, flattenStatementStats, } from "src/util/appStats/appStats"; -import { FixFingerprintHexValue } from "src/util/format"; +import { containAny } from "src/util/arrays"; import { INTERNAL_APP_NAME_PREFIX, unset } from "src/util/constants"; -import { SqlStatsResponse } from "src/api/statementsApi"; -import { Filters, getTimeValueInSeconds } from "src/queryFilter"; -import { AggregateStatistics } from "src/statementsTable"; +import { FixFingerprintHexValue } from "src/util/format"; // filterBySearchQuery returns true if a search query matches the statement. export function filterBySearchQuery( diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx index c81c364edafd..719f62d1bd96 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx @@ -11,12 +11,12 @@ import React from "react"; import { useHistory, useLocation } from "react-router-dom"; -import { viewAttr, tabAttr } from "src/util"; -import { queryByName } from "src/util/query"; import { SelectWithDescription, Option, } from "src/selectWithDescription/selectWithDescription"; +import { viewAttr, tabAttr } from "src/util"; +import { queryByName } from "src/util/query"; export type SQLActivityRootControlsProps = { options: Option[]; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts index 218c72f45dff..3d03eac83957 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import noop from "lodash/noop"; +import moment from "moment-timezone"; import { ExecutionStatus } from "../activeExecutions"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx index b979cc09281e..8babc5c06d81 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import * as sqlApi from "../api/sqlApi"; import { MockSqlResponse } from "../util/testing"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx index e1242a890a71..cb6eef37ed3d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; import { ArrowLeft } from "@cockroachlabs/icons"; -import Helmet from "react-helmet"; +import { Col, Row, Tabs } from "antd"; import classNames from "classnames/bind"; +import React, { useEffect, useState } from "react"; +import Helmet from "react-helmet"; import { useHistory, match } from "react-router-dom"; -import { Col, Row, Tabs } from "antd"; -import { commonStyles } from "src/common"; -import { Button } from "src/button"; -import { SqlBox, SqlBoxSize } from "src/sql/box"; -import { getMatchParamByName } from "src/util/query"; import { ActiveStatement, ExecutionContentionDetails, } from "src/activeExecutions"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { SqlBox, SqlBoxSize } from "src/sql/box"; +import { getMatchParamByName } from "src/util/query"; -import LoadingError from "../sqlActivity/errorComponent"; -import { Loading } from "../loading"; +import { getExplainPlanFromGist } from "../api/decodePlanGistApi"; import { getIdxRecommendationsFromExecution } from "../api/idxRecForStatementApi"; +import { Loading } from "../loading"; import { SortSetting } from "../sortedtable"; +import LoadingError from "../sqlActivity/errorComponent"; import { executionIdAttr } from "../util"; -import { getExplainPlanFromGist } from "../api/decodePlanGistApi"; import { ActiveStatementDetailsOverviewTab } from "./activeStatementDetailsOverviewTab"; import { Insights } from "./planDetails"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx index 95cd04c62acb..2e196941d2c8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sessionsActions } from "src/store/sessions"; import { selecteActiveStatement, selectContentionDetailsForStatement, } from "src/selectors/activeExecutions.selectors"; +import { actions as sessionsActions } from "src/store/sessions"; import { selectHasAdminRole } from "src/store/uiConfig"; import { AppState } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx index c4e53ec75173..a499350cd64a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React from "react"; import { Link } from "react-router-dom"; -import { Col, Row } from "antd"; import "antd/lib/col/style"; import "antd/lib/row/style"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ActiveStatement, ExecutionContentionDetails, } from "src/activeExecutions"; -import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; import { StatusIcon } from "src/activeExecutions/statusIcon"; -import { DATE_FORMAT_24_TZ, Duration } from "src/util"; +import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import { DATE_FORMAT_24_TZ, Duration } from "src/util"; import { Timestamp } from "../timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts index ab84b6d1ff4c..38f669a03ddb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts @@ -10,8 +10,8 @@ import moment from "moment-timezone"; -import { TimeScale, toDateRange } from "src/timeScaleDropdown"; import { DiagnosticStatuses } from "src/statementsDiagnostics"; +import { TimeScale, toDateRange } from "src/timeScaleDropdown"; import { StatementDiagnosticsReport } from "../../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx index 586249b4884c..073c5caf5c82 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Button } from "@cockroachlabs/ui-components"; import { assert } from "chai"; import { mount, ReactWrapper } from "enzyme"; -import { MemoryRouter } from "react-router-dom"; -import { Button } from "@cockroachlabs/ui-components"; import moment from "moment-timezone"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; -import { TestStoreProvider } from "src/test-utils"; import { SortedTable } from "src/sortedtable"; +import { TestStoreProvider } from "src/test-utils"; import { TimeScale } from "src/timeScaleDropdown"; import { StatementDiagnosticsReport } from "../../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx index 6fc15fd90eae..f7ad2e269f71 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx @@ -8,36 +8,36 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import classnames from "classnames/bind"; import { Button, Icon, InlineAlert } from "@cockroachlabs/ui-components"; -import moment from "moment-timezone"; +import classnames from "classnames/bind"; import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import emptyListResultsImg from "src/assets/emptyState/empty-list-results.svg"; import { Button as CancelButton } from "src/button"; -import { SummaryCard } from "src/summaryCard"; +import { EmptyTable } from "src/empty"; +import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import { ActivateDiagnosticsModalRef, DiagnosticStatusBadge, } from "src/statementsDiagnostics"; -import emptyListResultsImg from "src/assets/emptyState/empty-list-results.svg"; -import { EmptyTable } from "src/empty"; +import { SummaryCard } from "src/summaryCard"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "src/timeScaleDropdown"; -import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; -import { DATE_FORMAT_24_TZ } from "../../util"; -import { Timestamp } from "../../timestamp"; -import { FormattedTimescale } from "../../timeScaleDropdown/formattedTimeScale"; import { StatementDiagnosticsReport, withBasePath } from "../../api"; +import { FormattedTimescale } from "../../timeScaleDropdown/formattedTimeScale"; +import { Timestamp } from "../../timestamp"; +import { DATE_FORMAT_24_TZ } from "../../util"; -import styles from "./diagnosticsView.module.scss"; import { filterByTimeScale, getDiagnosticsStatus } from "./diagnosticsUtils"; +import styles from "./diagnosticsView.module.scss"; const timeScaleStylesCx = classNames.bind(timeScaleStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx index a6df85199aae..913ced9051fd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx @@ -8,23 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; -import { Helmet } from "react-helmet"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React, { useContext, useState } from "react"; +import { Helmet } from "react-helmet"; import { Button } from "../../button"; -import { SqlBox, SqlBoxSize } from "../../sql"; -import { SortSetting } from "../../sortedtable"; +import { CockroachCloudContext } from "../../contexts"; +import { InsightRecommendation, InsightType } from "../../insights"; import { InsightsSortedTable, makeInsightsColumns, } from "../../insightsTable/insightsTable"; -import styles from "../statementDetails.module.scss"; -import { CockroachCloudContext } from "../../contexts"; -import { InsightRecommendation, InsightType } from "../../insights"; +import { SortSetting } from "../../sortedtable"; +import { SqlBox, SqlBoxSize } from "../../sql"; import { SummaryCard, SummaryCardItem } from "../../summaryCard"; +import { Timestamp } from "../../timestamp"; import { Count, DATE_FORMAT_24_TZ, @@ -34,7 +34,7 @@ import { RenderCount, TimestampToMoment, } from "../../util"; -import { Timestamp } from "../../timestamp"; +import styles from "../statementDetails.module.scss"; import { formatIndexes, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx index 6f5f34b5c745..fcaa46cf60fd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx @@ -8,14 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactNode } from "react"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { ReactNode } from "react"; import { Link } from "react-router-dom"; import { ColumnDescriptor, SortedTable } from "src/sortedtable"; +import { Anchor } from "../../anchor"; +import { Timestamp, Timezone } from "../../timestamp"; import { Duration, formatNumberForDisplay, @@ -30,8 +32,6 @@ import { EncodeDatabaseTableIndexUri, EncodeDatabaseTableUri, } from "../../util"; -import { Anchor } from "../../anchor"; -import { Timestamp, Timezone } from "../../timestamp"; import styles from "./plansTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx index bdab06c4a327..09a2748150d3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { assert } from "chai"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { assert } from "chai"; import { FlatPlanNode, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx index 88c75acd3132..edd38511d1e8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { PlanView } from "./planView"; import { logicalPlan, globalProperties } from "./planView.fixtures"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx index 4b0047c72109..4dabb2ebddaa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { Fragment } from "react"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; -import values from "lodash/values"; +import classNames from "classnames/bind"; import sortBy from "lodash/sortBy"; +import values from "lodash/values"; +import React, { Fragment } from "react"; import { getAttributeTooltip, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts index dd0a981a5619..b54c0c795681 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; -import Long from "long"; import { createMemoryHistory } from "history"; import noop from "lodash/noop"; +import Long from "long"; +import moment from "moment-timezone"; import { StatementDetailsResponse } from "../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts index 125cb5c2c6c7..7c7ca18a661b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts @@ -8,13 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import { createSelector } from "@reduxjs/toolkit"; -import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; import { AppState } from "../store"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; import { appNamesAttr, statementAttr, @@ -22,8 +24,6 @@ import { queryByName, generateStmtDetailsToID, } from "../util"; -import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; -import { selectTimeScale } from "../store/utils/selectors"; type StatementDetailsResponseMessage = cockroach.server.serverpb.StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx index 093c0197b893..44b30138a092 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; import { assert } from "chai"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import { StatementDetails, StatementDetailsProps } from "./statementDetails"; import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx index 4fb6860433fa..4b3230968535 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -23,12 +24,11 @@ import { createStore, Store, } from "redux"; -import { Provider } from "react-redux"; import { AppState, rootReducer } from "../store"; -import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; import { StatementDetails } from "./statementDetails"; +import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx index 1caa7ce303f7..a638d472a528 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx @@ -8,21 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactNode, useContext } from "react"; -import { Col, Row, Tabs } from "antd"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { InlineAlert, Text } from "@cockroachlabs/ui-components"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { InlineAlert, Text } from "@cockroachlabs/ui-components"; +import { Col, Row, Tabs } from "antd"; +import classNames from "classnames/bind"; import isNil from "lodash/isNil"; import Long from "long"; +import moment from "moment-timezone"; +import React, { ReactNode, useContext } from "react"; import { Helmet } from "react-helmet"; import { Link, RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { AlignedData, Options } from "uplot"; -import moment from "moment-timezone"; import { Anchor } from "src/anchor"; +import { StatementDetailsRequest } from "src/api/statementsApi"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { getValidErrorsList, Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SqlBox, SqlBoxSize } from "src/sql"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; import { appAttr, appNamesAttr, @@ -39,36 +48,17 @@ import { Count, longToInt, } from "src/util"; -import { getValidErrorsList, Loading } from "src/loading"; -import { Button } from "src/button"; -import { SqlBox, SqlBoxSize } from "src/sql"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; -import { commonStyles } from "src/common"; -import { StatementDetailsRequest } from "src/api/statementsApi"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { UIConfigState } from "../store"; -import { - getValidOption, - TimeScale, - timeScale1hMinOptions, - TimeScaleDropdown, - toRoundedDateRange, -} from "../timeScaleDropdown"; -import LoadingError from "../sqlActivity/errorComponent"; -import { - ActivateDiagnosticsModalRef, - ActivateStatementDiagnosticsModal, -} from "../statementsDiagnostics"; -import { Delayed } from "../delayed"; import { InsertStmtDiagnosticRequest, InsightRecommendation, StatementDiagnosticsReport, StmtInsightsReq, } from "../api"; +import { CockroachCloudContext } from "../contexts"; +import { Delayed } from "../delayed"; +import { AxisUnits } from "../graphs"; +import { BarGraphTimeSeries, XScale } from "../graphs/bargraph"; import { getStmtInsightRecommendations, InsightType, @@ -78,14 +68,27 @@ import { InsightsSortedTable, makeInsightsColumns, } from "../insightsTable/insightsTable"; -import { CockroachCloudContext } from "../contexts"; +import insightTableStyles from "../insightsTable/insightsTable.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; +import { + ActivateDiagnosticsModalRef, + ActivateStatementDiagnosticsModal, +} from "../statementsDiagnostics"; +import { UIConfigState } from "../store"; +import { + getValidOption, + TimeScale, + timeScale1hMinOptions, + TimeScaleDropdown, + toRoundedDateRange, +} from "../timeScaleDropdown"; import { FormattedTimescale } from "../timeScaleDropdown/formattedTimeScale"; import { Timestamp } from "../timestamp"; -import insightTableStyles from "../insightsTable/insightsTable.module.scss"; -import { AxisUnits } from "../graphs"; -import { BarGraphTimeSeries, XScale } from "../graphs/bargraph"; import { filterByTimeScale } from "./diagnostics/diagnosticsUtils"; +import { DiagnosticsView } from "./diagnostics/diagnosticsView"; +import { PlanDetails } from "./planDetails"; +import styles from "./statementDetails.module.scss"; import { generateContentionTimeseries, generateExecCountTimeseries, @@ -95,9 +98,6 @@ import { generateCPUTimeseries, generateClientWaitTimeseries, } from "./timeseriesUtils"; -import styles from "./statementDetails.module.scss"; -import { DiagnosticsView } from "./diagnostics/diagnosticsView"; -import { PlanDetails } from "./planDetails"; type StatementDetailsResponse = cockroach.server.serverpb.StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts index 54cbdb28a2c4..fb0f70bff27f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts @@ -8,53 +8,53 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { withRouter, RouteComponentProps } from "react-router-dom"; import { connect } from "react-redux"; +import { withRouter, RouteComponentProps } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sqlDetailsStatsActions } from "src/store/statementDetails"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; import { - actions as statementDiagnosticsActions, - selectDiagnosticsReportsByStatementFingerprint, -} from "src/store/statementDiagnostics"; + StmtInsightsReq, + InsertStmtDiagnosticRequest, + StatementDetailsRequest, + StatementDiagnosticsReport, +} from "src/api"; +import { selectRequestTime } from "src/statementsPage/statementsPage.selectors"; import { actions as analyticsActions } from "src/store/analytics"; -import { actions as localStorageActions } from "src/store/localStorage"; import { actions as statementFingerprintInsightActions, selectStatementFingerprintInsights, } from "src/store/insights/statementFingerprintInsights"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; +import { actions as sqlDetailsStatsActions } from "src/store/statementDetails"; import { - StmtInsightsReq, - InsertStmtDiagnosticRequest, - StatementDetailsRequest, - StatementDiagnosticsReport, -} from "src/api"; + actions as statementDiagnosticsActions, + selectDiagnosticsReportsByStatementFingerprint, +} from "src/store/statementDiagnostics"; import { getMatchParamByName, statementAttr } from "src/util"; -import { selectRequestTime } from "src/statementsPage/statementsPage.selectors"; -import { TimeScale } from "../timeScaleDropdown"; +import { AppState, uiConfigActions } from "../store"; import { actions as nodeLivenessActions } from "../store/liveness"; import { nodeRegionsByIDSelector, actions as nodesActions, } from "../store/nodes"; -import { selectTimeScale } from "../store/utils/selectors"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { AppState, uiConfigActions } from "../store"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; -import { - selectStatementDetails, - selectStatementDetailsUiConfig, -} from "./statementDetails.selectors"; import { StatementDetails, StatementDetailsDispatchProps, } from "./statementDetails"; +import { + selectStatementDetails, + selectStatementDetailsUiConfig, +} from "./statementDetails.selectors"; // For tenant cases, we don't show information about node, regions and // diagnostics. diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx index 861ad1e387ce..fecfd88ef5a4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; import { Button } from "../button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx index c5200496d91b..fa6327fc803c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Checkbox, Divider, @@ -19,17 +20,16 @@ import { Row, Col, } from "antd"; -import React, { useCallback, useImperativeHandle, useState } from "react"; import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React, { useCallback, useImperativeHandle, useState } from "react"; -import { Modal } from "src/modal"; import { Anchor } from "src/anchor"; +import { Modal } from "src/modal"; import { Text, TextTypes } from "src/text"; import { statementDiagnostics, statementsSql } from "src/util"; -import { InsertStmtDiagnosticRequest } from "../api"; import { crlTheme } from "../antdTheme"; +import { InsertStmtDiagnosticRequest } from "../api"; import styles from "./activateStatementDiagnosticsModal.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx index 1bd2771cc75f..f0bc0b7241a8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import React from "react"; -import { Badge } from "src/badge"; import { Anchor } from "src/anchor"; +import { Badge } from "src/badge"; import { statementDiagnostics } from "src/util"; -import { DiagnosticStatuses } from "./diagnosticStatuses"; import styles from "./diagnosticStatusBadge.module.scss"; +import { DiagnosticStatuses } from "./diagnosticStatuses"; interface OwnProps { status: DiagnosticStatuses; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx index ca282630d9ad..6b6350665ec3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx @@ -8,31 +8,32 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; +import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; -import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; -import { Loading } from "src/loading/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; import { ActiveStatement, ActiveStatementFilters, ExecutionStatus, } from "src/activeExecutions"; +import RefreshControl from "src/activeExecutions/refreshControl/refreshControl"; +import { Loading } from "src/loading/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; +import { Pagination } from "src/pagination"; import { Filter } from "src/queryFilter"; +import { getActiveStatementFiltersFromURL } from "src/queryFilter/utils"; +import { Search } from "src/search/search"; +import { + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import LoadingError from "src/sqlActivity/errorComponent"; import { queryByName, syncHistory } from "src/util/query"; -import { getActiveStatementFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import RefreshControl from "src/activeExecutions/refreshControl/refreshControl"; +import { ActiveStatementsSection } from "../activeExecutions/activeStatementsSection"; import { ACTIVE_STATEMENT_SEARCH_PARAM, getAppsFromActiveExecutions, @@ -43,7 +44,6 @@ import { defaultFilters, getFullFiltersAsStringRecord, } from "../queryFilter"; -import { ActiveStatementsSection } from "../activeExecutions/activeStatementsSection"; import { getTableSortFromURL } from "../sortedtable/getTableSortFromURL"; import styles from "./statementsPage.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx index 9de8fe78b38d..46db08f13922 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx @@ -11,13 +11,13 @@ import React from "react"; import { Link } from "react-router-dom"; -import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "src/anchor"; -import { statementsTable, tabAttr, viewAttr } from "src/util"; import { commonStyles } from "src/common"; +import { EmptyTable, EmptyTableProps } from "src/empty"; +import { statementsTable, tabAttr, viewAttr } from "src/util"; -import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "../assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import { StatementViewType } from "./statementPageTypes"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts index 63ffe6b5250b..a0eac866f660 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts @@ -9,16 +9,16 @@ // licenses/APL.txt. /* eslint-disable prettier/prettier */ -import moment from "moment-timezone"; -import { createMemoryHistory } from "history"; -import Long from "long"; -import noop from "lodash/noop"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; +import noop from "lodash/noop"; +import Long from "long"; +import moment from "moment-timezone"; -import { RequestError } from "src/util"; import { DEFAULT_STATS_REQ_OPTIONS } from "src/api/statementsApi"; import { mockStmtStats } from "src/api/testUtils"; +import { RequestError } from "src/util"; import { StatementDiagnosticsReport } from "../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx index 4d8caeb6d79e..ce0d98fd1c1a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx @@ -12,8 +12,8 @@ import { assert } from "chai"; import { filterBySearchQuery } from "src/sqlActivity/util"; -import { AggregateStatistics } from "../statementsTable"; import { FlatPlanNode } from "../statementDetails"; +import { AggregateStatistics } from "../statementsTable"; describe("StatementsPage", () => { test("filterBySearchQuery", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx index 2659ecf5b3b8..f604f19579f9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import cloneDeep from "lodash/cloneDeep"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { StatementsPage } from "./statementsPage"; import statementsPagePropsFixture, { diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx index cb933196d138..157d4a01d823 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx @@ -8,39 +8,42 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import flatMap from "lodash/flatMap"; -import merge from "lodash/merge"; import groupBy from "lodash/groupBy"; import isString from "lodash/isString"; -import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import merge from "lodash/merge"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { getValidErrorsList, Loading } from "src/loading"; +import { + SqlStatsSortType, + StatementsRequest, + createCombinedStmtsRequest, + SqlStatsSortOptions, +} from "src/api/statementsApi"; +import { RequestState } from "src/api/types"; +import { isSelectedColumn } from "src/columnsSelector/utils"; import { Delayed } from "src/delayed"; +import { getValidErrorsList, Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Pagination, ResultsPerPageLabel } from "src/pagination"; +import { Search } from "src/search"; +import { SearchCriteria } from "src/searchCriteria/searchCriteria"; import { handleSortSettingFromQueryString, SortSetting, updateSortSettingQueryParamsOnTab, } from "src/sortedtable"; -import { Search } from "src/search"; -import { Pagination, ResultsPerPageLabel } from "src/pagination"; -import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; +import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import { ActivateDiagnosticsModalRef, ActivateStatementDiagnosticsModal, } from "src/statementsDiagnostics"; -import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { - SqlStatsSortType, - StatementsRequest, - createCombinedStmtsRequest, - SqlStatsSortOptions, -} from "src/api/statementsApi"; -import { isSelectedColumn } from "src/columnsSelector/utils"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { STATS_LONG_LOADING_DURATION, getSortLabel, @@ -48,45 +51,16 @@ import { getSubsetWarning, getReqSortColumn, } from "src/util/sqlActivityConstants"; -import { SearchCriteria } from "src/searchCriteria/searchCriteria"; -import { RequestState } from "src/api/types"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { - filterStatementsData, - convertRawStmtsToAggregateStatisticsMemoized, - getAppsFromStmtsResponseMemoized, -} from "../sqlActivity/util"; import { InsertStmtDiagnosticRequest, StatementDiagnosticsReport, SqlStatsResponse, StatementDiagnosticsResponse, } from "../api"; +import ColumnsSelector from "../columnsSelector/columnsSelector"; import { commonStyles } from "../common"; -import { - getValidOption, - TimeScale, - timeScale1hMinOptions, - toRoundedDateRange, -} from "../timeScaleDropdown"; -import LoadingError from "../sqlActivity/errorComponent"; -import ClearStats from "../sqlActivity/clearStats"; -import { UIConfigState } from "../store"; import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; -import ColumnsSelector from "../columnsSelector/columnsSelector"; -import { ISortedTablePagination } from "../sortedtable"; -import { - getLabel, - StatisticTableColumnKeys, -} from "../statsTableUtil/statsTableUtil"; -import { - AggregateStatistics, - makeStatementsColumns, - populateRegionNodeForStatements, - StatementsSortedTable, -} from "../statementsTable"; import { calculateActiveFilters, defaultFilters, @@ -96,9 +70,35 @@ import { SelectedFilters, updateFiltersQueryParamsOnTab, } from "../queryFilter"; +import { ISortedTablePagination } from "../sortedtable"; +import ClearStats from "../sqlActivity/clearStats"; +import LoadingError from "../sqlActivity/errorComponent"; +import { + filterStatementsData, + convertRawStmtsToAggregateStatisticsMemoized, + getAppsFromStmtsResponseMemoized, +} from "../sqlActivity/util"; +import { + AggregateStatistics, + makeStatementsColumns, + populateRegionNodeForStatements, + StatementsSortedTable, +} from "../statementsTable"; +import { + getLabel, + StatisticTableColumnKeys, +} from "../statsTableUtil/statsTableUtil"; +import { UIConfigState } from "../store"; +import { + getValidOption, + TimeScale, + timeScale1hMinOptions, + toRoundedDateRange, +} from "../timeScaleDropdown"; +import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { StatementViewType } from "./statementPageTypes"; import { EmptyStatementsPlaceholder } from "./emptyStatementsPlaceholder"; +import { StatementViewType } from "./statementPageTypes"; import styles from "./statementsPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx index 19a829d2c60e..aa34fcc7c0bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -25,6 +24,7 @@ import { createStore, Store, } from "redux"; +import createSagaMiddleware from "redux-saga"; import { AppState, rootReducer, sagas } from "src/store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx index 793bc6d572d0..68b399246718 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx @@ -12,39 +12,47 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; -import { actions as statementDiagnosticsActions } from "src/store/statementDiagnostics"; import { actions as analyticsActions } from "src/store/analytics"; +import { actions as databasesListActions } from "src/store/databasesList"; import { actions as localStorageActions, updateStmtsPageLimitAction, updateStmsPageReqSortAction, } from "src/store/localStorage"; import { actions as sqlStatsActions } from "src/store/sqlStats"; -import { actions as databasesListActions } from "src/store/databasesList"; -import { StatementsRequest } from "src/api/statementsApi"; +import { actions as statementDiagnosticsActions } from "src/store/statementDiagnostics"; +import { + InsertStmtDiagnosticRequest, + StatementDiagnosticsReport, + SqlStatsSortType, +} from "../api"; import { actions as nodesActions, nodeRegionsByIDSelector, } from "../store/nodes"; -import { - selectTimeScale, - selectStmtsPageLimit, - selectStmtsPageReqSort, -} from "../store/utils/selectors"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { TimeScale } from "../timeScaleDropdown"; import { - InsertStmtDiagnosticRequest, - StatementDiagnosticsReport, - SqlStatsSortType, -} from "../api"; + selectTimeScale, + selectStmtsPageLimit, + selectStmtsPageReqSort, +} from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; +import { + mapDispatchToActiveStatementsPageProps, + mapStateToActiveStatementsPageProps, +} from "./activeStatementsPage.selectors"; +import { + ActiveStatementsViewDispatchProps, + ActiveStatementsViewStateProps, +} from "./activeStatementsView"; import { StatementsPageDispatchProps, StatementsPageStateProps, @@ -61,14 +69,6 @@ import { StatementsPageRoot, StatementsPageRootProps, } from "./statementsPageRoot"; -import { - ActiveStatementsViewDispatchProps, - ActiveStatementsViewStateProps, -} from "./activeStatementsView"; -import { - mapDispatchToActiveStatementsPageProps, - mapStateToActiveStatementsPageProps, -} from "./activeStatementsPage.selectors"; type StateProps = { fingerprintsPageProps: StatementsPageStateProps & RouteComponentProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx index 9441a5bdafd6..d3e611d2be02 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx @@ -10,6 +10,7 @@ import React from "react"; +import { Anchor } from "src/anchor"; import { Option } from "src/selectWithDescription/selectWithDescription"; import { SQLActivityRootControls } from "src/sqlActivityRootControls/sqlActivityRootControls"; import { @@ -17,7 +18,6 @@ import { StatementsPageProps, } from "src/statementsPage/statementsPage"; import { statementsSql } from "src/util/docs"; -import { Anchor } from "src/anchor"; import { ActiveStatementsView, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx index c46893cab475..0b92c302a42d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { MemoryRouter } from "react-router-dom"; import statementsPagePropsFixture from "src/statementsPage/statementsPage.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx index ab274e3eac14..f05e95143506 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx @@ -8,22 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import classNames from "classnames/bind"; +import React from "react"; -import { - FixLong, - longToInt, - StatementSummary, - StatementStatistics, - Count, - TimestampToNumber, - TimestampToMoment, - unset, - DurationCheckSample, -} from "src/util"; -import { DATE_FORMAT, Duration } from "src/util/format"; import { countBarChart, bytesReadBarChart, @@ -35,19 +23,31 @@ import { retryBarChart, workloadPctBarChart, } from "src/barCharts"; -import { ActivateDiagnosticsModalRef } from "src/statementsDiagnostics"; +import { BarChartOptions } from "src/barCharts/barChartFactory"; import { ColumnDescriptor, longListWithTooltip, SortedTable, } from "src/sortedtable"; -import { BarChartOptions } from "src/barCharts/barChartFactory"; +import { ActivateDiagnosticsModalRef } from "src/statementsDiagnostics"; +import { + FixLong, + longToInt, + StatementSummary, + StatementStatistics, + Count, + TimestampToNumber, + TimestampToMoment, + unset, + DurationCheckSample, +} from "src/util"; +import { DATE_FORMAT, Duration } from "src/util/format"; +import { StatementDiagnosticsReport } from "../api"; import { statisticsTableTitles, StatisticType, } from "../statsTableUtil/statsTableUtil"; -import { StatementDiagnosticsReport } from "../api"; import { Timestamp } from "../timestamp"; import styles from "./statementsTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx index 08e1732d8294..31dd79187625 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx @@ -8,30 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; +import { EllipsisVertical } from "@cockroachlabs/icons"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import noop from "lodash/noop"; -import { Tooltip } from "@cockroachlabs/ui-components"; -import { EllipsisVertical } from "@cockroachlabs/icons"; import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import { withBasePath } from "src/api/basePath"; +import { StatementDiagnosticsReport } from "src/api/statementDiagnosticsApi"; +import { Button } from "src/button"; +import { Dropdown } from "src/dropdown"; +import { getHighlightedText } from "src/highlightedText"; import { ActivateDiagnosticsModalRef, DiagnosticStatusBadge, } from "src/statementsDiagnostics"; -import { getHighlightedText } from "src/highlightedText"; import { AggregateStatistics } from "src/statementsTable"; -import { Dropdown } from "src/dropdown"; -import { Button } from "src/button"; import { propsToQueryString, computeOrUseStmtSummary, appNamesAttr, unset, } from "src/util"; -import { withBasePath } from "src/api/basePath"; -import { StatementDiagnosticsReport } from "src/api/statementDiagnosticsApi"; import styles from "./statementsTableContent.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx b/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx index 8871cdba4e0d..5180a6dbc897 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx @@ -8,10 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React from "react"; import { Anchor } from "src/anchor"; +import { Timezone } from "src/timestamp"; import { contentionTime, planningExecutionTime, @@ -22,7 +23,6 @@ import { statementsSql, writtenToDisk, } from "src/util"; -import { Timezone } from "src/timestamp"; // Single place for column names. Used in table columns and in columns selector. export const statisticsColumnLabels = { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts index 21c3bf2fe233..5f00cdb54f6c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts @@ -10,11 +10,11 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME } from "../utils"; import { SettingsRequestMessage, SettingsResponseMessage, } from "../../api/clusterSettingsApi"; +import { DOMAIN_NAME } from "../utils"; export type ClusterSettingsState = { data: SettingsResponseMessage; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts index b75f466ca0e8..731a5e0b5368 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts @@ -10,13 +10,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { getClusterSettings, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts index eed038984dc1..5803df2e7da9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getClusterSettings, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts index 937ef0418c65..108b1048b2bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { AppState } from "../reducers"; import { greaterOrEqualThanVersion, indexUnusedDuration } from "../../util"; +import { AppState } from "../reducers"; export const selectAutomaticStatsCollectionEnabled = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts index be6580c55b95..e28158579edd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts @@ -10,13 +10,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { indexUnusedDuration } from "src/util/constants"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts index 7adade519b88..8d196ce774cd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; -import moment from "moment"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { DatabaseDetailsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts index c32b3b058bbb..f19f5e54f3cb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { localStorageSelector } from "../utils/selectors"; import { LocalStorageKeys } from "../localStorage"; import { AppState } from "../reducers"; +import { localStorageSelector } from "../utils/selectors"; export const selectDatabaseDetailsViewModeSetting = (state: AppState) => { const localStorage = localStorageSelector(state); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts index 65f6c2d1df68..f7da818c4d75 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts @@ -9,13 +9,13 @@ // licenses/APL.txt. import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { DatabaseDetailsSpanStatsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts index 7952ed0b8afb..4dfc94611b1d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { DatabaseDetailsSpanStatsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts index 14902a8f77d3..784c8d120dbc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts @@ -16,8 +16,8 @@ import { TableDetailsReqParams, TableDetailsResponse, } from "../../api"; -import { DOMAIN_NAME } from "../utils"; import { generateTableID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; type TableDetailsWithKey = { tableDetailsResponse: SqlApiResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts index c06a49e400b9..13dbef6546d8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts @@ -10,22 +10,22 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; -import moment from "moment"; -import { generateTableID, indexUnusedDuration } from "../../util"; import { TableDetailsResponse, getTableDetails, SqlApiResponse, TableDetailsReqParams, } from "../../api"; +import { generateTableID, indexUnusedDuration } from "../../util"; import { actions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts index a355271fe466..6265ee41a0a8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; -import moment from "moment"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { ErrorWithKey, getTableDetails, TableDetailsReqParams } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts index be4dc2daf75d..a60ed58d09b3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { DatabasesListResponse, getDatabasesList } from "../../api"; +import { actions, DatabasesListState, reducer } from "./databasesList.reducers"; import { refreshDatabasesListSaga, requestDatabasesListSaga, } from "./databasesList.saga"; -import { actions, DatabasesListState, reducer } from "./databasesList.reducers"; describe("DatabasesList sagas", () => { const databasesListResponse: DatabasesListResponse = { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts index 9dfffb3a19f2..db3b17976247 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import moment from "moment-timezone"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getDatabasesList } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts index 4740dc2dc8d8..0574c57ce132 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts @@ -10,11 +10,11 @@ import { createSelector } from "reselect"; -import { adminUISelector, localStorageSelector } from "../utils/selectors"; -import { LocalStorageKeys } from "../localStorage"; +import { Filters } from "../../queryFilter"; import { SortSetting } from "../../sortedtable"; +import { LocalStorageKeys } from "../localStorage"; import { AppState } from "../reducers"; -import { Filters } from "../../queryFilter"; +import { adminUISelector, localStorageSelector } from "../utils/selectors"; export const databasesListSelector = createSelector( adminUISelector, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts index 24dd1f9b434e..8a8b277684e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts @@ -10,14 +10,14 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME } from "../utils"; import { ErrorWithKey } from "../../api"; -import { generateTableID } from "../../util"; import { TableIndexStatsRequest, TableIndexStatsResponse, TableIndexStatsResponseWithKey, } from "../../api/indexDetailsApi"; +import { generateTableID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; export type IndexStatsState = { data?: TableIndexStatsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts index c518f7c7d583..1ed886a81c49 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts @@ -11,13 +11,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import Long from "long"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { getIndexStats, @@ -26,17 +26,17 @@ import { } from "../../api/indexDetailsApi"; import { generateTableID } from "../../util"; -import { - refreshIndexStatsSaga, - requestIndexStatsSaga, - resetIndexStatsSaga, -} from "./indexStats.sagas"; import { actions, IndexStatsReducerState, reducer, ResetIndexUsageStatsPayload, } from "./indexStats.reducer"; +import { + refreshIndexStatsSaga, + requestIndexStatsSaga, + resetIndexStatsSaga, +} from "./indexStats.sagas"; import RecommendationType = cockroach.sql.IndexRecommendation.RecommendationType; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts index 147f5c722edc..1ac4d2e84426 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, @@ -17,19 +18,17 @@ import { takeLatest, takeEvery, } from "redux-saga/effects"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ErrorWithKey } from "src/api/statementsApi"; import { CACHE_INVALIDATION_PERIOD } from "src/store/utils"; -import { generateTableID } from "../../util"; import { getIndexStats, resetIndexStats, TableIndexStatsRequest, TableIndexStatsResponseWithKey, } from "../../api/indexDetailsApi"; -import { maybeError } from "../../util"; +import { generateTableID, maybeError } from "../../util"; import { actions as indexStatsActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts index 65a1785b6bf9..2ba4e752ca0f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts @@ -11,10 +11,10 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; -import { DOMAIN_NAME } from "src/store/utils"; +import { SqlApiResponse, TxnInsightDetailsReqErrs } from "src/api"; import { ErrorWithKey } from "src/api/statementsApi"; import { TxnInsightDetails } from "src/insights"; -import { SqlApiResponse, TxnInsightDetailsReqErrs } from "src/api"; +import { DOMAIN_NAME } from "src/store/utils"; import { TxnInsightDetailsRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts index d3a037873783..c5b3367fbb41 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; import { ErrorWithKey, SqlApiResponse } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts index c327a1e15c1b..1fc97668872e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts @@ -10,11 +10,10 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; -import { selectID } from "src/selectors/common"; -import { selectTxnInsightDetailsCombiner } from "src/selectors/insightsCommon.selectors"; import { TxnInsightEvent } from "src/insights"; -import { selectStmtInsights } from "src/store/insights/statementInsights"; +import { selectID, selectStmtInsights } from "src/selectors/common"; +import { selectTxnInsightDetailsCombiner } from "src/selectors/insightsCommon.selectors"; +import { AppState } from "src/store/reducers"; const selectTxnContentionInsightsDetails = createSelector( (state: AppState) => state.adminUI?.txnInsightDetails.cachedData, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts index 97abc6a8404b..8e7d91c1a888 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts @@ -13,8 +13,8 @@ import moment, { Moment } from "moment-timezone"; import { SqlApiResponse, ErrorWithKey, StmtInsightsReq } from "src/api"; -import { DOMAIN_NAME } from "../../utils"; import { StmtInsightEvent } from "../../../insights"; +import { DOMAIN_NAME } from "../../utils"; export type StatementFingerprintInsightsState = { data: SqlApiResponse | null; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts index d986858787ac..59cd8aa6e516 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { ErrorWithKey, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts index b07bc2449b3e..0ab67ef5d5e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; import { selectStatementFingerprintID } from "src/selectors/common"; +import { AppState } from "src/store/reducers"; export const selectStatementFingerprintInsights = createSelector( (state: AppState) => state.adminUI?.statementFingerprintInsights?.cachedData, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts index f13647f1da21..d310098ed679 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts @@ -11,8 +11,8 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; -import { StmtInsightEvent } from "src/insights"; import { SqlApiResponse, StmtInsightsReq } from "src/api"; +import { StmtInsightEvent } from "src/insights"; import { DOMAIN_NAME } from "../../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts index 0ec4c29ae0ec..8f6b80c9e2cc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { StmtInsightsReq, getStmtInsightsApi } from "src/api/stmtInsightsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts index 263e15b4aac8..c4a00708f25f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts @@ -10,17 +10,18 @@ import { createSelector } from "reselect"; -import { localStorageSelector } from "src/store/utils/selectors"; -import { AppState } from "src/store/reducers"; +import { InsightEnumToLabel } from "src/insights"; +import { + selectStatementFingerprintID, + selectID, + selectStmtInsights, +} from "src/selectors/common"; import { selectStatementInsightDetailsCombiner, selectStatementInsightDetailsCombinerByFingerprint, } from "src/selectors/insightsCommon.selectors"; -import { selectStatementFingerprintID, selectID } from "src/selectors/common"; -import { InsightEnumToLabel, StmtInsightEvent } from "src/insights"; - -export const selectStmtInsights = (state: AppState): StmtInsightEvent[] => - state.adminUI?.stmtInsights?.data?.results; +import { AppState } from "src/store/reducers"; +import { localStorageSelector } from "src/store/utils/selectors"; export const selectStmtInsightsError = (state: AppState): Error | null => state.adminUI?.stmtInsights?.lastError; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts index 1d3ef642b45f..c60ad7235d3f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts @@ -11,8 +11,8 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; -import { TxnInsightEvent } from "src/insights"; import { SqlApiResponse, TxnInsightsRequest } from "src/api"; +import { TxnInsightEvent } from "src/insights"; import { DOMAIN_NAME } from "../../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts index 8dcb868bc438..a141aeb8be47 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getTxnInsightsApi, TxnInsightsRequest } from "src/api/txnInsightsApi"; -import { actions as txnActions } from "../transactionInsights/transactionInsights.reducer"; import { maybeError } from "../../../util"; +import { actions as txnActions } from "../transactionInsights/transactionInsights.reducer"; export function* refreshTransactionInsightsSaga( action?: PayloadAction, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts index 8865beb721ec..3c2c865f67dd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts @@ -10,10 +10,10 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; -import { localStorageSelector } from "src/store/utils/selectors"; import { TxnInsightEvent } from "src/insights"; import { selectTransactionFingerprintID } from "src/selectors/common"; +import { AppState } from "src/store/reducers"; +import { localStorageSelector } from "src/store/utils/selectors"; import { FixFingerprintHexValue } from "../../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts index 8be54ae3e4a4..ab1138d9ad58 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts @@ -18,8 +18,8 @@ import { JobResponseWithKey, } from "src/api/jobsApi"; -import { DOMAIN_NAME } from "../utils"; import { RequestState } from "../../api"; +import { DOMAIN_NAME } from "../utils"; export type JobState = RequestState; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts index ef12ebdaf3f1..f04c9c638eca 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { PayloadAction } from "@reduxjs/toolkit"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import { PayloadAction } from "@reduxjs/toolkit"; -import moment from "moment-timezone"; import { ErrorWithKey, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts index 6fde7ba742b5..a875ed7824be 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getJob, JobRequest, JobResponseWithKey } from "src/api/jobsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts index 59ac3975581f..4fbfdebbd263 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts @@ -11,12 +11,12 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; -import { createInitialState, RequestState } from "src/api/types"; import { CollectExecutionDetailsRequest, ListJobProfilerExecutionDetailsRequest, ListJobProfilerExecutionDetailsResponse, } from "src/api"; +import { createInitialState, RequestState } from "src/api/types"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts index 6cbcefb0f16b..cb1745a4b5bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import { getJobs } from "src/api/jobsApi"; @@ -25,8 +25,8 @@ import { earliestRetainedTime, } from "../../jobs/jobsPage/jobsPage.fixture"; -import { refreshJobsSaga, requestJobsSaga } from "./jobs.sagas"; import { actions, reducer, JobsState } from "./jobs.reducer"; +import { refreshJobsSaga, requestJobsSaga } from "./jobs.sagas"; describe("jobs sagas", () => { const lastUpdated = moment.utc(new Date("2023-02-21T12:00:00.000Z")); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts index d7c9806af326..8c31d72022db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { getJobs, JobsRequest } from "src/api/jobsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts index 4daa0edd041c..93b36c7776f0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; import { NodeLivenessStatus } from "./nodeLivenessStatus"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts index a1a78e7f3e3d..1d10f95c13e5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts index 65c8c0f82d64..9bc7f0dad854 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts @@ -9,18 +9,18 @@ // licenses/APL.txt. import { expectSaga } from "redux-saga-test-plan"; -import { throwError } from "redux-saga-test-plan/providers"; import * as matchers from "redux-saga-test-plan/matchers"; +import { throwError } from "redux-saga-test-plan/providers"; import { getLiveness } from "src/api/livenessApi"; +import { getLivenessResponse } from "./liveness.fixtures"; +import { actions, reducer, LivenessState } from "./liveness.reducer"; import { receivedLivenessSaga, refreshLivenessSaga, requestLivenessSaga, } from "./liveness.sagas"; -import { actions, reducer, LivenessState } from "./liveness.reducer"; -import { getLivenessResponse } from "./liveness.fixtures"; describe("Liveness sagas", () => { const livenessResponse = getLivenessResponse(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts index 275b5838af6c..4bef8503bfd2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts @@ -13,8 +13,8 @@ import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { getLiveness } from "src/api/livenessApi"; import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "src/store/utils"; -import { rootActions } from "../rootActions"; import { maybeError } from "../../util"; +import { rootActions } from "../rootActions"; import { actions } from "./liveness.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts index fb046a5875fe..6bb107a82d23 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts @@ -10,13 +10,13 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { defaultFilters, Filters } from "src/queryFilter/"; -import { WorkloadInsightEventFilters } from "src/insights"; import { SqlStatsSortType, DEFAULT_STATS_REQ_OPTIONS, } from "src/api/statementsApi"; import { ViewMode } from "src/databaseDetailsPage/types"; +import { WorkloadInsightEventFilters } from "src/insights"; +import { defaultFilters, Filters } from "src/queryFilter/"; import { TimeScale, defaultTimeScaleSelected } from "../../timeScaleDropdown"; import { DOMAIN_NAME } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts index 9669e41fca8c..0ab3934e8e8a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { expectSaga, testSaga } from "redux-saga-test-plan"; import { takeEvery, takeLatest } from "redux-saga/effects"; +import { expectSaga, testSaga } from "redux-saga-test-plan"; import { actions as stmtInsightActions } from "src/store/insights/statementInsights/statementInsights.reducer"; import { actions as txnInsightActions } from "src/store/insights/transactionInsights/transactionInsights.reducer"; @@ -18,12 +18,12 @@ import { actions as txnStatsActions } from "src/store/transactionStats"; import { defaultTimeScaleSelected } from "../../timeScaleDropdown"; +import { actions } from "./localStorage.reducer"; import { localStorageSaga, updateLocalStorageItemSaga, updateTimeScale, } from "./localStorage.saga"; -import { actions } from "./localStorage.reducer"; const ts = defaultTimeScaleSelected; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts index fd238131f5c8..f631b294b31b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { PayloadAction } from "@reduxjs/toolkit"; import { AnyAction } from "redux"; import { all, call, takeEvery, takeLatest, put } from "redux-saga/effects"; -import { PayloadAction } from "@reduxjs/toolkit"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as stmtInsightActions } from "src/store/insights/statementInsights"; import { actions as txnInsightActions } from "src/store/insights/transactionInsights"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as txnStatsActions } from "src/store/transactionStats"; import { TimeScale } from "src/timeScaleDropdown"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts index aeea0ff2ce2b..5cf144f80e54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; import { INodeStatus } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts index 1c5e0a1244f8..e684534f1220 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts index 49a6b1c684a5..e9dacede1aef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts @@ -9,20 +9,20 @@ // licenses/APL.txt. import { expectSaga } from "redux-saga-test-plan"; -import { throwError } from "redux-saga-test-plan/providers"; import * as matchers from "redux-saga-test-plan/matchers"; +import { throwError } from "redux-saga-test-plan/providers"; import { getNodes } from "src/api/nodesApi"; import { accumulateMetrics } from "../../util"; +import { getNodesResponse } from "./nodes.fixtures"; +import { actions, reducer, NodesState } from "./nodes.reducer"; import { receivedNodesSaga, requestNodesSaga, refreshNodesSaga, } from "./nodes.sagas"; -import { actions, reducer, NodesState } from "./nodes.reducer"; -import { getNodesResponse } from "./nodes.fixtures"; describe("Nodes sagas", () => { const nodesResponse = getNodesResponse(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts index 4e4c2d0666a7..f486f986190f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { getNodes } from "src/api/nodesApi"; import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "src/store/utils"; -import { rootActions } from "../rootActions"; import { maybeError } from "../../util"; +import { rootActions } from "../rootActions"; import { actions } from "./nodes.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts index eb83adc01221..8eec20f9040d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; import isEmpty from "lodash/isEmpty"; import { accumulateMetrics } from "src/util/proto"; -import { AppState } from "../reducers"; import { getDisplayName } from "../../nodes"; import { livenessStatusByNodeIDSelector } from "../liveness"; +import { AppState } from "../reducers"; type ILocality = cockroach.roachpb.ILocality; export const nodeStatusesSelector = (state: AppState) => diff --git a/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts index 6873d23c73ee..4da2d1c88221 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts @@ -12,8 +12,8 @@ import { assert } from "chai"; import { createStore } from "redux"; import { rootReducer } from "./reducers"; -import { actions as sqlStatsActions } from "./sqlStats"; import { rootActions } from "./rootActions"; +import { actions as sqlStatsActions } from "./sqlStats"; describe("rootReducer", () => { it("resets redux state on RESET_STATE action", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts b/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts index 96c9a33f4792..20ab065e7170 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts @@ -15,10 +15,24 @@ import { ClusterLocksReqState, reducer as clusterLocks, } from "./clusterLocks/clusterLocks.reducer"; +import { + ClusterSettingsState, + reducer as clusterSettings, +} from "./clusterSettings/clusterSettings.reducer"; +import { + KeyedDatabaseDetailsState, + KeyedDatabaseDetailsSpanStatsState, + databaseDetailsReducer, + databaseDetailsSpanStatsReducer, +} from "./databaseDetails"; import { DatabasesListState, reducer as databasesList, } from "./databasesList/databasesList.reducers"; +import { + KeyedTableDetailsState, + reducer as tableDetails, +} from "./databaseTableDetails/tableDetails.reducer"; import { IndexStatsReducerState, reducer as indexStats, @@ -27,6 +41,10 @@ import { reducer as txnInsightDetails, TxnInsightDetailsCachedState, } from "./insightDetails/transactionInsightDetails"; +import { + reducer as statementFingerprintInsights, + StatementFingerprintInsightsCachedState, +} from "./insights/statementFingerprintInsights"; import { reducer as stmtInsights, StmtInsightsState, @@ -37,9 +55,14 @@ import { } from "./insights/transactionInsights"; import { JobDetailsReducerState, reducer as job } from "./jobDetails"; import { JobsState, reducer as jobs } from "./jobs"; +import { + JobProfilerExecutionDetailFilesState, + reducer as executionDetailFiles, +} from "./jobs/jobProfiler.reducer"; import { LivenessState, reducer as liveness } from "./liveness"; import { LocalStorageState, reducer as localStorage } from "./localStorage"; import { NodesState, reducer as nodes } from "./nodes"; +import { rootActions } from "./rootActions"; import { reducer as schemaInsights, SchemaInsightsState, @@ -58,31 +81,8 @@ import { reducer as terminateQuery, TerminateQueryState, } from "./terminateQuery"; -import { reducer as uiConfig, UIConfigState } from "./uiConfig"; -import { - reducer as statementFingerprintInsights, - StatementFingerprintInsightsCachedState, -} from "./insights/statementFingerprintInsights"; import { reducer as txnStats, TxnStatsState } from "./transactionStats"; -import { - ClusterSettingsState, - reducer as clusterSettings, -} from "./clusterSettings/clusterSettings.reducer"; -import { - KeyedDatabaseDetailsState, - KeyedDatabaseDetailsSpanStatsState, - databaseDetailsReducer, - databaseDetailsSpanStatsReducer, -} from "./databaseDetails"; -import { - KeyedTableDetailsState, - reducer as tableDetails, -} from "./databaseTableDetails/tableDetails.reducer"; -import { - JobProfilerExecutionDetailFilesState, - reducer as executionDetailFiles, -} from "./jobs/jobProfiler.reducer"; -import { rootActions } from "./rootActions"; +import { reducer as uiConfig, UIConfigState } from "./uiConfig"; export type AdminUiState = { statementDiagnostics: StatementDiagnosticsState; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts index 50f2b008bc4f..e6cd083c7418 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts @@ -11,31 +11,31 @@ import { SagaIterator } from "redux-saga"; import { all, fork } from "redux-saga/effects"; -import { localStorageSaga } from "./localStorage"; -import { statementsDiagnosticsSagas } from "./statementDiagnostics"; -import { nodesSaga } from "./nodes"; -import { jobsSaga } from "./jobs"; -import { jobSaga } from "./jobDetails"; -import { livenessSaga } from "./liveness"; +import { clusterLocksSaga } from "./clusterLocks/clusterLocks.saga"; +import { clusterSettingsSaga } from "./clusterSettings/clusterSettings.saga"; +import { databaseDetailsSaga } from "./databaseDetails"; +import { databaseDetailsSpanStatsSaga } from "./databaseDetails/databaseDetailsSpanStats.saga"; import { databasesListSaga } from "./databasesList"; -import { sessionsSaga } from "./sessions"; -import { terminateSaga } from "./terminateQuery"; -import { notifificationsSaga } from "./notifications"; -import { sqlStatsSaga } from "./sqlStats"; -import { sqlDetailsStatsSaga } from "./statementDetails"; +import { tableDetailsSaga } from "./databaseTableDetails"; import { indexStatsSaga } from "./indexStats"; -import { clusterLocksSaga } from "./clusterLocks/clusterLocks.saga"; -import { transactionInsightsSaga } from "./insights/transactionInsights/transactionInsights.sagas"; import { transactionInsightDetailsSaga } from "./insightDetails/transactionInsightDetails"; +import { statementFingerprintInsightsSaga } from "./insights/statementFingerprintInsights"; import { statementInsightsSaga } from "./insights/statementInsights"; +import { transactionInsightsSaga } from "./insights/transactionInsights/transactionInsights.sagas"; +import { jobSaga } from "./jobDetails"; +import { jobsSaga } from "./jobs"; +import { livenessSaga } from "./liveness"; +import { localStorageSaga } from "./localStorage"; +import { nodesSaga } from "./nodes"; +import { notifificationsSaga } from "./notifications"; import { schemaInsightsSaga } from "./schemaInsights"; -import { uiConfigSaga } from "./uiConfig"; -import { statementFingerprintInsightsSaga } from "./insights/statementFingerprintInsights"; +import { sessionsSaga } from "./sessions"; +import { sqlStatsSaga } from "./sqlStats"; +import { sqlDetailsStatsSaga } from "./statementDetails"; +import { statementsDiagnosticsSagas } from "./statementDiagnostics"; +import { terminateSaga } from "./terminateQuery"; import { txnStatsSaga } from "./transactionStats"; -import { clusterSettingsSaga } from "./clusterSettings/clusterSettings.saga"; -import { databaseDetailsSaga } from "./databaseDetails"; -import { tableDetailsSaga } from "./databaseTableDetails"; -import { databaseDetailsSpanStatsSaga } from "./databaseDetails/databaseDetailsSpanStats.saga"; +import { uiConfigSaga } from "./uiConfig"; export function* sagas(cacheInvalidationPeriod?: number): SagaIterator { yield all([ diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts index ddd1a5974205..0266a1ed5fdb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts @@ -13,8 +13,8 @@ import moment, { Moment } from "moment-timezone"; import { SchemaInsightReqParams, SqlApiResponse } from "src/api"; -import { DOMAIN_NAME } from "../utils"; import { InsightRecommendation } from "../../insights"; +import { DOMAIN_NAME } from "../utils"; export type SchemaInsightsState = { data: SqlApiResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts index 0e334389eb60..ceb2824d1f2a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import moment from "moment-timezone"; import { getSchemaInsights, SqlApiResponse } from "../../api"; import { InsightRecommendation } from "../../insights"; -import { - refreshSchemaInsightsSaga, - requestSchemaInsightsSaga, -} from "./schemaInsights.sagas"; import { actions, reducer, SchemaInsightsState, } from "./schemaInsights.reducer"; +import { + refreshSchemaInsightsSaga, + requestSchemaInsightsSaga, +} from "./schemaInsights.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts index 0d011c3bfdcd..0e313d09a7b6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { SchemaInsightReqParams, getSchemaInsights } from "../../api"; import { maybeError } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts index c8d49993e773..84e30f762e3b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { adminUISelector, localStorageSelector } from "../utils/selectors"; import { insightType } from "../../insights"; +import { adminUISelector, localStorageSelector } from "../utils/selectors"; const selectSchemaInsightState = createSelector( adminUISelector, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts index 8a51880a95af..5b9faf0a5be0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts index a4e19dcdda5a..0472fb83bd1a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts @@ -21,9 +21,9 @@ import { import { getSessions } from "src/api/sessionsApi"; +import { maybeError } from "../../util"; import { actions as clusterLockActions } from "../clusterLocks/clusterLocks.reducer"; import { selectIsTenant } from "../uiConfig"; -import { maybeError } from "../../util"; import { actions } from "./sessions.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts index 3c9bb56d6b15..e5ed63dbe8cc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { RouteComponentProps } from "react-router-dom"; +import { createSelector } from "reselect"; +import { byteArrayToUuid } from "src/sessions/sessionsTable"; import { AppState } from "src/store"; import { SessionsState } from "src/store/sessions"; import { sessionAttr } from "src/util/constants"; import { getMatchParamByName } from "src/util/query"; -import { byteArrayToUuid } from "src/sessions/sessionsTable"; export const selectSession = createSelector( (state: AppState) => state.adminUI?.sessions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts index 264ad865bc3f..18ad15c6ffb5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; import { StatementsRequest } from "src/api/statementsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts index f25780cf0ac6..69e227306946 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import moment from "moment-timezone"; -import { getCombinedStatements } from "src/api/statementsApi"; import { resetSQLStats } from "src/api/sqlStatsApi"; +import { getCombinedStatements } from "src/api/statementsApi"; import { actions as sqlDetailsStatsActions } from "../statementDetails/statementDetails.reducer"; +import { actions, reducer, SQLStatsState } from "./sqlStats.reducer"; import { refreshSQLStatsSaga, requestSQLStatsSaga, resetSQLStatsSaga, } from "./sqlStats.sagas"; -import { actions, reducer, SQLStatsState } from "./sqlStats.reducer"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts index 7a20a3f9a1c3..4f868217f307 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts @@ -11,16 +11,16 @@ import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; +import { resetSQLStats } from "src/api/sqlStatsApi"; import { getCombinedStatements, StatementsRequest, } from "src/api/statementsApi"; -import { resetSQLStats } from "src/api/sqlStatsApi"; import { actions as localStorageActions } from "src/store/localStorage"; import { maybeError } from "../../util"; -import { actions as txnStatsActions } from "../transactionStats"; import { actions as sqlDetailsStatsActions } from "../statementDetails/statementDetails.reducer"; +import { actions as txnStatsActions } from "../transactionStats"; import { actions as sqlStatsActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts index 20aac5fc043c..8ec4b381999d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts @@ -18,8 +18,8 @@ import { StatementDetailsResponseWithKey, } from "src/api/statementsApi"; -import { DOMAIN_NAME } from "../utils"; import { generateStmtDetailsToID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; export type SQLDetailsStatsState = { data: StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts index 797833d15608..a426e3a70126 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts @@ -8,29 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; -import { expectSaga } from "redux-saga-test-plan"; import Long from "long"; +import moment from "moment-timezone"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import { getStatementDetails } from "src/api/statementsApi"; -import { - refreshSQLDetailsStatsSaga, - requestSQLDetailsStatsSaga, -} from "./statementDetails.sagas"; import { actions, reducer, SQLDetailsStatsReducerState, } from "./statementDetails.reducer"; +import { + refreshSQLDetailsStatsSaga, + requestSQLDetailsStatsSaga, +} from "./statementDetails.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts index 8520746b68c8..cc3f310e8a65 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts @@ -10,12 +10,12 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME, noopReducer } from "../utils"; import { CancelStmtDiagnosticRequest, InsertStmtDiagnosticRequest, StatementDiagnosticsResponse, } from "../../api"; +import { DOMAIN_NAME, noopReducer } from "../utils"; export type StatementDiagnosticsState = { data: StatementDiagnosticsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts index 9a352e3b4b1b..d6f50f68bbca 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts @@ -8,19 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; +import { call } from "redux-saga/effects"; import { expectSaga } from "redux-saga-test-plan"; import { throwError } from "redux-saga-test-plan/providers"; -import { call } from "redux-saga/effects"; -import moment from "moment-timezone"; -import { - createDiagnosticsReportSaga, - requestStatementsDiagnosticsSaga, - cancelDiagnosticsReportSaga, - StatementDiagnosticsState, - actions, - reducer, -} from "src/store/statementDiagnostics"; import { createStatementDiagnosticsReport, cancelStatementDiagnosticsReport, @@ -31,6 +23,14 @@ import { CancelStmtDiagnosticRequest, CancelStmtDiagnosticResponse, } from "src/api/statementDiagnosticsApi"; +import { + createDiagnosticsReportSaga, + requestStatementsDiagnosticsSaga, + cancelDiagnosticsReportSaga, + StatementDiagnosticsState, + actions, + reducer, +} from "src/store/statementDiagnostics"; describe("statementsDiagnostics sagas", () => { describe("createDiagnosticsReportSaga", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts index 47370f791137..c0796d2b09e8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts @@ -24,8 +24,8 @@ import { } from "src/api/statementDiagnosticsApi"; import { maybeError } from "src/util"; -import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { rootActions } from "../rootActions"; +import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { actions } from "./statementDiagnostics.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts index bbd9fcd9cb21..5ad2ac89cca7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; -import orderBy from "lodash/orderBy"; import groupBy from "lodash/groupBy"; import mapValues from "lodash/mapValues"; +import orderBy from "lodash/orderBy"; import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { AppState } from "../reducers"; import { StatementDiagnosticsReport } from "../../api"; +import { AppState } from "../reducers"; export const statementDiagnostics = createSelector( (state: AppState) => state.adminUI, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts index 1d3f55b320dd..36348e72aa54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts index 463209699d02..f6b839d26971 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeEvery } from "redux-saga/effects"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { terminateQuery, terminateSession } from "src/api/terminateQueryApi"; import { actions as sessionsActions } from "src/store/sessions"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts index 45ae67a7b124..d51ba6247f54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import moment from "moment-timezone"; import { getFlushedTxnStatsApi } from "src/api/statementsApi"; -import { refreshTxnStatsSaga, requestTxnStatsSaga } from "./txnStats.sagas"; import { actions, reducer, TxnStatsState } from "./txnStats.reducer"; +import { refreshTxnStatsSaga, requestTxnStatsSaga } from "./txnStats.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts index 2fcfa9de5f14..031008efb16e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import merge from "lodash/merge"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { DOMAIN_NAME, noopReducer } from "../utils"; export type UserSQLRolesRequest = cockroach.server.serverpb.UserSQLRolesRequest; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts index 4cac194ddede..d244dc8b5d22 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, delay, put, takeLatest } from "redux-saga/effects"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { all, call, delay, put, takeLatest } from "redux-saga/effects"; import { getUserSQLRoles } from "../../api/userApi"; -import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { maybeError, getLogger } from "../../util"; import { rootActions } from "../rootActions"; +import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { actions } from "./uiConfig.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts b/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts index 094077b28637..0601ca204df3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts @@ -8,8 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { ActionPattern } from "@redux-saga/types"; import { ForkEffect } from "@redux-saga/core/effects"; +import { ActionPattern } from "@redux-saga/types"; +import { Action } from "redux"; +import { buffers, Task } from "redux-saga"; import { actionChannel, cancel, @@ -18,8 +20,6 @@ import { race, take, } from "redux-saga/effects"; -import { buffers, Task } from "redux-saga"; -import { Action } from "redux"; /*** * Extended version of default `redux-saga/effects/throttle` effect implementation diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx index 6faaf8e8673b..43947b914eb7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { PartialStoryFn, StoryContext } from "@storybook/addons"; +import React from "react"; export const withBackground = ( storyFn: PartialStoryFn, diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx index f5a90121f68a..43e7818c4851 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Provider } from "react-redux"; +import { PartialStoryFn, StoryContext } from "@storybook/addons"; import { ConnectedRouter, connectRouter } from "connected-react-router"; import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { createStore, combineReducers } from "redux"; -import { PartialStoryFn, StoryContext } from "@storybook/addons"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts b/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts index 0c49d628cca6..109b609d5aa8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import join from "lodash/join"; -import sample from "lodash/sample"; import random from "lodash/random"; +import sample from "lodash/sample"; export function randomName(): string { // Add more! Have fun. diff --git a/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx b/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx index 28f4d2422db4..66febf5b39ea 100644 --- a/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { Tooltip } from "antd"; +import classnames from "classnames/bind"; +import React from "react"; import { CircleFilled } from "src/icon"; diff --git a/pkg/ui/workspaces/cluster-ui/src/table/table.tsx b/pkg/ui/workspaces/cluster-ui/src/table/table.tsx index 24fea61b73b8..2085f8347975 100644 --- a/pkg/ui/workspaces/cluster-ui/src/table/table.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/table/table.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { CaretDownOutlined, CaretRightOutlined } from "@ant-design/icons"; import { Table as AntTable, ConfigProvider } from "antd"; import classnames from "classnames/bind"; import isArray from "lodash/isArray"; -import { CaretDownOutlined, CaretRightOutlined } from "@ant-design/icons"; +import React from "react"; import styles from "./table.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx b/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx index 43f4189f9ff4..32d578bdf333 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; import { Button } from "src/button"; import { ResultsPerPageLabel } from "src/pagination"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; import { TimeScale } from "src/timeScaleDropdown"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; import { ISortedTablePagination } from "../sortedtable"; +import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; import { statisticsClasses } from "../transactionsPage/transactionsPageClasses"; const { statistic, countTitle } = statisticsClasses; diff --git a/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx b/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx index d9785194fcf6..f862ccd2138b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx @@ -8,7 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + ConnectedRouter, + connectRouter, + routerMiddleware, +} from "connected-react-router"; +import { createMemoryHistory } from "history"; import React from "react"; +import { Provider } from "react-redux"; import { Action, Store, @@ -16,13 +23,6 @@ import { combineReducers, applyMiddleware, } from "redux"; -import { Provider } from "react-redux"; -import { - ConnectedRouter, - connectRouter, - routerMiddleware, -} from "connected-react-router"; -import { createMemoryHistory } from "history"; import { AppState, rootReducer } from "src/store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/text/text.tsx b/pkg/ui/workspaces/cluster-ui/src/text/text.tsx index cc7afe112700..13348552e8ac 100644 --- a/pkg/ui/workspaces/cluster-ui/src/text/text.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/text/text.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames/bind"; +import * as React from "react"; import styles from "./text.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx index 848f22e25571..2e67d469e98e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import moment from "moment-timezone"; +import React, { useContext } from "react"; import { Timezone } from "src/timestamp"; import { TimezoneContext } from "../contexts"; import { dateFormat, timeFormat } from "./timeScaleDropdown"; -import { toRoundedDateRange } from "./utils"; import { TimeScale } from "./timeScaleTypes"; +import { toRoundedDateRange } from "./utils"; export const FormattedTimescale = (props: { ts: TimeScale; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx index a7a811188c6d..d152cbcc967e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState, useRef } from "react"; import { Button, Dropdown } from "antd"; -import moment, { Moment } from "moment-timezone"; import classNames from "classnames/bind"; +import moment, { Moment } from "moment-timezone"; +import React, { useState, useRef } from "react"; import { DateRangeMenu } from "src/dateRangeMenu"; import { CaretDown } from "src/icon/caretDown"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx index 7d73c50d91bb..899cadda0ae7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import { Button, Tooltip } from "antd"; import { CaretLeft, CaretRight } from "@cockroachlabs/icons"; +import { Button, Tooltip } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; -import { ArrowDirection } from "./timeScaleTypes"; import styles from "./timeFrameControls.module.scss"; +import { ArrowDirection } from "./timeScaleTypes"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx index 50f3fceb3fa4..39db82b402b5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx @@ -8,16 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; +import { render } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { assert } from "chai"; import { mount } from "enzyme"; import moment from "moment-timezone"; +import React, { useState } from "react"; import { MemoryRouter } from "react-router"; -import { assert } from "chai"; -import { render } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; import { timeFormat as customMenuTimeFormat } from "../dateRangeMenu"; +import RangeSelect from "./rangeSelect"; +import { TimeFrameControls } from "./timeFrameControls"; import { formatRangeSelectSelected, generateDisabledArrows, @@ -27,8 +29,6 @@ import { TimeScaleDropdown, } from "./timeScaleDropdown"; import * as timescale from "./timeScaleTypes"; -import { TimeFrameControls } from "./timeFrameControls"; -import RangeSelect from "./rangeSelect"; import { TimeWindow, ArrowDirection, TimeScale } from "./timeScaleTypes"; /** diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx index e8337f5a9aaf..27edf40fb236 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; import { storiesOf } from "@storybook/react"; import moment from "moment-timezone"; +import React, { useState } from "react"; import { TimeScaleDropdown } from "./timeScaleDropdown"; import { defaultTimeScaleOptions, defaultTimeScaleSelected } from "./utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx index 92d781b7b990..7c2be368c642 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx @@ -8,26 +8,26 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useMemo } from "react"; -import moment from "moment-timezone"; import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useContext, useMemo } from "react"; import { TimezoneContext } from "../contexts"; import { FormatWithTimezone, getLogger } from "../util"; +import RangeSelect, { + RangeOption, + Selected as RangeSelectSelected, +} from "./rangeSelect"; +import { TimeFrameControls } from "./timeFrameControls"; +import styles from "./timeScale.module.scss"; import { ArrowDirection, TimeScale, TimeScaleOptions, TimeWindow, } from "./timeScaleTypes"; -import { TimeFrameControls } from "./timeFrameControls"; -import RangeSelect, { - RangeOption, - Selected as RangeSelectSelected, -} from "./rangeSelect"; import { defaultTimeScaleOptions, findClosestTimeScale } from "./utils"; -import styles from "./timeScale.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx index 76af4b7b9f53..6a4a0450c7ad 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; -import moment from "moment-timezone"; -import classNames from "classnames/bind"; import { Icon } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; -import { Timezone } from "src/timestamp"; import { TimezoneContext } from "src/contexts/timezoneContext"; +import { Timezone } from "src/timestamp"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { dateFormat, timeFormat } from "./timeScaleDropdown"; import { FormattedTimescale } from "./formattedTimeScale"; +import { dateFormat, timeFormat } from "./timeScaleDropdown"; import { TimeScale } from "./timeScaleTypes"; import { toRoundedDateRange } from "./utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx index 7a8f7238b8de..4a5eeee6e28c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { assert } from "chai"; +import moment from "moment-timezone"; import { TimeScale } from "./timeScaleTypes"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx b/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx index 05485767de39..3b38f68303ec 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx @@ -11,8 +11,8 @@ import { Moment } from "moment-timezone"; import React, { useContext } from "react"; -import { FormatWithTimezone } from "../util"; import { CoordinatedUniversalTime, TimezoneContext } from "../contexts"; +import { FormatWithTimezone } from "../util"; export function Timezone() { const timezone = useContext(TimezoneContext); diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx index df145ce6bddb..bef2cd6db3e2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import Long from "long"; import React, { useEffect } from "react"; -import classNames from "classnames/bind"; -import { Loading } from "src/loading"; import { GetTraceResponse } from "src/api"; +import { Loading } from "src/loading"; import styles from "../snapshot.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx index e53a628c1c78..a31cd38a6e1c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx @@ -8,23 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Helmet } from "react-helmet"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Button, Icon } from "@cockroachlabs/ui-components"; -import React, { useMemo } from "react"; import classNames from "classnames/bind"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React, { useMemo } from "react"; +import { Helmet } from "react-helmet"; -import { commonStyles } from "src/common"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; -import { Dropdown } from "src/dropdown"; -import { Loading } from "src/loading"; -import { TimestampToMoment } from "src/util"; -import { SortSetting } from "src/sortedtable"; import { GetTracingSnapshotResponse, ListTracingSnapshotsResponse, } from "src/api"; +import { commonStyles } from "src/common"; +import { Dropdown } from "src/dropdown"; +import { Loading } from "src/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SortSetting } from "src/sortedtable"; +import { TimestampToMoment } from "src/util"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx index ba73d4506b90..927dd5e13dad 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render } from "@testing-library/react"; -import React from "react"; -import { MemoryRouter } from "react-router-dom"; import * as H from "history"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { RecordingMode, diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx index b414df184bd5..9db2df53589a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx @@ -10,10 +10,10 @@ import { join } from "path"; -import React, { useCallback, useEffect } from "react"; -import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React, { useCallback, useEffect } from "react"; +import { RouteComponentProps } from "react-router-dom"; import { ListTracingSnapshotsResponse, @@ -23,13 +23,13 @@ import { RecordingMode, GetTraceResponse, } from "src/api/tracezApi"; +import { Breadcrumbs } from "src/breadcrumbs"; import { SortSetting } from "src/sortedtable"; import { getMatchParamByName, syncHistory } from "src/util"; -import { Breadcrumbs } from "src/breadcrumbs"; +import { RawTraceComponent } from "./rawTraceComponent"; import { SnapshotComponent } from "./snapshotComponent"; import { SpanComponent } from "./spanComponent"; -import { RawTraceComponent } from "./rawTraceComponent"; // This component does some manual route management and navigation. // This is because the data model doesn't match the ideal route form. diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx index 554aef0adb6b..a6431d20111e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx @@ -8,31 +8,31 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useMemo, useState } from "react"; -import moment from "moment-timezone"; -import { Helmet } from "react-helmet"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Switch } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useCallback, useMemo, useState } from "react"; +import { Helmet } from "react-helmet"; import { useHistory } from "react-router-dom"; -import { commonStyles } from "src/common"; -import { Loading } from "src/loading"; -import { TimestampToMoment } from "src/util"; -import { SortSetting } from "src/sortedtable"; import { GetTracingSnapshotResponse, SetTraceRecordingTypeResponse, Span, } from "src/api"; -import { CircleFilled } from "src/icon"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { CircleFilled } from "src/icon"; +import { Loading } from "src/loading"; +import { SortSetting } from "src/sortedtable"; +import { TimestampToMoment } from "src/util"; import styles from "../snapshot.module.scss"; -import { SpanTable, formatDurationHours, TagCell } from "./spanTable"; import { SpanMetadataTable } from "./spanMetadataTable"; +import { SpanTable, formatDurationHours, TagCell } from "./spanTable"; import RecordingMode = cockroach.util.tracing.tracingpb.RecordingMode; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx index 59e0b97f9bab..76db9845862c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx @@ -7,16 +7,16 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; -import React, { useState } from "react"; import { Nodes } from "@cockroachlabs/icons"; -import classNames from "classnames/bind"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useState } from "react"; import { NamedOperationMetadata } from "src/api/tracezApi"; import { EmptyTable } from "src/empty"; -import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { CircleFilled } from "src/icon"; +import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx index 78c2ca9d6bac..ca9788cc61f3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx @@ -7,20 +7,20 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; -import React, { useState } from "react"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Nodes, Caution, Plus, Minus } from "@cockroachlabs/icons"; import classNames from "classnames/bind"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { Link } from "react-router-dom"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useState } from "react"; +import { Link } from "react-router-dom"; import { Span, Snapshot } from "src/api/tracezApi"; +import { Dropdown } from "src/dropdown"; import { EmptyTable } from "src/empty"; +import { CircleFilled } from "src/icon"; import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { TimestampToMoment } from "src/util"; -import { CircleFilled } from "src/icon"; -import { Dropdown } from "src/dropdown"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx index fe9edc821c4d..5c92e730ce53 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx @@ -15,23 +15,23 @@ import React, { useEffect } from "react"; import Helmet from "react-helmet"; import { Link, match, useHistory } from "react-router-dom"; -import { Button } from "src/button"; -import { commonStyles } from "src/common"; -import { SqlBox, SqlBoxSize } from "src/sql/box"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ActiveTransaction, ExecutionContentionDetails, } from "src/activeExecutions"; import { StatusIcon } from "src/activeExecutions/statusIcon"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { SqlBox, SqlBoxSize } from "src/sql/box"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import { getMatchParamByName } from "src/util/query"; import { executionIdAttr, DATE_FORMAT_24_TZ } from "src/util"; -import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { getMatchParamByName } from "src/util/query"; import styles from "../statementDetails/statementDetails.module.scss"; -import { capitalize, Duration } from "../util/format"; import { Timestamp } from "../timestamp"; +import { capitalize, Duration } from "../util/format"; const cx = classNames.bind(styles); const summaryCardStylesCx = classNames.bind(summaryCardStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx index 19fae2946d46..aacee27ac1c0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sessionsActions } from "src/store/sessions"; import { selectActiveTransaction, selectContentionDetailsForTransaction, } from "src/selectors/activeExecutions.selectors"; +import { actions as sessionsActions } from "src/store/sessions"; import { AppState } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts index 1b592541e4b7..89c66350c104 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { StatementsResponse } from "src/store/sqlStats/sqlStats.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx index 6a2954a05b0c..1efcd3b0abb3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import noop from "lodash/noop"; import moment from "moment-timezone"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { nodeRegions, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx index 2dd02c065e8d..52bb678ce69d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx @@ -7,12 +7,8 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import classNames from "classnames/bind"; -import { RouteComponentProps } from "react-router-dom"; -import { Helmet } from "react-helmet"; -import moment from "moment-timezone"; +import { ArrowLeft } from "@cockroachlabs/icons"; import { InlineAlert, Tooltip, @@ -20,12 +16,22 @@ import { Heading, } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; -import { ArrowLeft } from "@cockroachlabs/icons"; -import Long from "long"; +import classNames from "classnames/bind"; import get from "lodash/get"; +import Long from "long"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; +import { Helmet } from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; import { SqlStatsSortType } from "src/api/statementsApi"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { + populateRegionNodeForStatements, + makeStatementsColumns, +} from "src/statementsTable/statementsTable"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Transaction } from "src/transactionsTable"; import { Bytes, calculateTotalWorkload, @@ -36,30 +42,7 @@ import { appNamesAttr, unset, } from "src/util"; -import { Transaction } from "src/transactionsTable"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { - populateRegionNodeForStatements, - makeStatementsColumns, -} from "src/statementsTable/statementsTable"; -import { - SortedTable, - ISortedTablePagination, - SortSetting, -} from "../sortedtable"; -import { Pagination } from "../pagination"; -import { TableStatistics } from "../tableStatistics"; -import { baseHeadingClasses } from "../transactionsPage/transactionsPageClasses"; -import { Button } from "../button"; -import { tableClasses } from "../transactionsTable/transactionsTableClasses"; -import { SqlBox } from "../sql"; -import { aggregateStatements } from "../transactionsPage/utils"; -import { Loading } from "../loading"; -import { SummaryCard, SummaryCardItem } from "../summaryCard"; -import { UIConfigState } from "../store"; -import LoadingError from "../sqlActivity/errorComponent"; -import { formatTwoPlaces } from "../barCharts"; import { createCombinedStmtsRequest, InsightRecommendation, @@ -68,11 +51,33 @@ import { StatementsRequest, TxnInsightsRequest, } from "../api"; +import { formatTwoPlaces } from "../barCharts"; +import { Button } from "../button"; +import { CockroachCloudContext } from "../contexts"; import { getTxnInsightRecommendations, InsightType, TxnInsightEvent, } from "../insights"; +import { + InsightsSortedTable, + makeInsightsColumns, +} from "../insightsTable/insightsTable"; +import insightTableStyles from "../insightsTable/insightsTable.module.scss"; +import { Loading } from "../loading"; +import { Pagination } from "../pagination"; +import { + SortedTable, + ISortedTablePagination, + SortSetting, +} from "../sortedtable"; +import { SqlBox } from "../sql"; +import LoadingError from "../sqlActivity/errorComponent"; +import statementsStyles from "../statementsPage/statementsPage.module.scss"; +import { UIConfigState } from "../store"; +import { SummaryCard, SummaryCardItem } from "../summaryCard"; +import summaryCardStyles from "../summaryCard/summaryCard.module.scss"; +import { TableStatistics } from "../tableStatistics"; import { getValidOption, TimeScale, @@ -81,15 +86,10 @@ import { timeScaleRangeToObj, toRoundedDateRange, } from "../timeScaleDropdown"; -import { - InsightsSortedTable, - makeInsightsColumns, -} from "../insightsTable/insightsTable"; -import { CockroachCloudContext } from "../contexts"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import insightTableStyles from "../insightsTable/insightsTable.module.scss"; -import statementsStyles from "../statementsPage/statementsPage.module.scss"; -import summaryCardStyles from "../summaryCard/summaryCard.module.scss"; +import { baseHeadingClasses } from "../transactionsPage/transactionsPageClasses"; +import { aggregateStatements } from "../transactionsPage/utils"; +import { tableClasses } from "../transactionsTable/transactionsTableClasses"; import transactionDetailsStyles from "./transactionDetails.modules.scss"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx index 52ec6c365ef0..aae7f0c2da9e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx @@ -12,35 +12,35 @@ import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as localStorageActions } from "src/store/localStorage"; +import { StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; -import { actions as txnStatsActions } from "src/store/transactionStats"; import { actions as transactionInsights, selectTxnInsightsByFingerprint, } from "src/store/insights/transactionInsights"; -import { StatementsRequest } from "src/api/statementsApi"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; +import { actions as txnStatsActions } from "src/store/transactionStats"; import { selectRequestTime } from "src/transactionsPage/transactionsPage.selectors"; +import { TxnInsightsRequest } from "../api"; +import { actions as analyticsActions } from "../store/analytics"; +import { + nodeRegionsByIDSelector, + actions as nodesActions, +} from "../store/nodes"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { - nodeRegionsByIDSelector, - actions as nodesActions, -} from "../store/nodes"; import { selectTimeScale, selectTxnsPageLimit, selectTxnsPageReqSort, } from "../store/utils/selectors"; -import { txnFingerprintIdAttr, getMatchParamByName } from "../util"; import { TimeScale } from "../timeScaleDropdown"; -import { actions as analyticsActions } from "../store/analytics"; -import { TxnInsightsRequest } from "../api"; +import { txnFingerprintIdAttr, getMatchParamByName } from "../util"; import { TransactionDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx index be3d7b138caa..f7290b872f5f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { match } from "react-router"; +import { createSelector } from "@reduxjs/toolkit"; import { Location } from "history"; import cloneDeep from "lodash/cloneDeep"; +import { match } from "react-router"; -import { statementFingerprintIdsToText } from "../transactionsPage/utils"; import { SqlStatsResponse } from "../api"; +import { statementFingerprintIdsToText } from "../transactionsPage/utils"; import { addExecStats, aggregateNumericStats, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx index e6b673605ef7..13b7caefda94 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx @@ -24,13 +24,13 @@ import { selectActiveTransactions, selectClusterLocksMaxApiSizeReached, } from "src/selectors/activeExecutions.selectors"; +import { selectIsAutoRefreshEnabled } from "src/statementsPage/activeStatementsPage.selectors"; import { LocalStorageKeys, actions as localStorageActions, } from "src/store/localStorage"; import { actions as sessionsActions } from "src/store/sessions"; import { selectIsTenant } from "src/store/uiConfig"; -import { selectIsAutoRefreshEnabled } from "src/statementsPage/activeStatementsPage.selectors"; import { localStorageSelector } from "../store/utils/selectors"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx index 06485f23370b..5939b51e5e0e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx @@ -8,44 +8,44 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; -import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; +import React, { useEffect, useState } from "react"; +import { useHistory } from "react-router-dom"; -import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; -import { Loading } from "src/loading/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; import { ActiveTransaction, ActiveStatementFilters, ActiveTransactionFilters, ExecutionStatus, } from "src/activeExecutions"; -import LoadingError from "src/sqlActivity/errorComponent"; import { ActiveTransactionsSection } from "src/activeExecutions/activeTransactionsSection"; +import { RefreshControl } from "src/activeExecutions/refreshControl"; +import { Loading } from "src/loading/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; -import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; import { getActiveTransactionFiltersFromURL } from "src/queryFilter/utils"; -import { RefreshControl } from "src/activeExecutions/refreshControl"; +import { Search } from "src/search/search"; +import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; +import { + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; +import LoadingError from "src/sqlActivity/errorComponent"; +import { queryByName, syncHistory } from "src/util/query"; import { filterActiveTransactions, getAppsFromActiveExecutions, } from "../activeExecutions/activeStatementUtils"; -import styles from "../statementsPage/statementsPage.module.scss"; import { calculateActiveFilters, Filter, getFullFiltersAsStringRecord, inactiveFiltersState, } from "../queryFilter"; +import styles from "../statementsPage/statementsPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx index 50d555aff7b7..e72717e6d453 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx @@ -11,14 +11,14 @@ import React from "react"; import { Link } from "react-router-dom"; -import { tabAttr, viewAttr } from "src/util"; import { commonStyles } from "src/common"; +import { tabAttr, viewAttr } from "src/util"; -import { EmptyTable, EmptyTableProps } from "../empty"; import { Anchor } from "../anchor"; -import { transactionsTable } from "../util"; -import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "../assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "../empty"; +import { transactionsTable } from "../util"; import { TransactionViewType } from "./transactionsPageTypes"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts index c5c06ab40a0e..2086933e2dcf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; import Long from "long"; import moment from "moment-timezone"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { SortSetting } from "../sortedtable"; import { Filters } from "../queryFilter"; +import { SortSetting } from "../sortedtable"; import { TimeScale } from "../timeScaleDropdown"; const history = createMemoryHistory({ initialEntries: ["/transactions"] }); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx index 71598bf47fb0..fcf64a472cd0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import cloneDeep from "lodash/cloneDeep"; import extend from "lodash/extend"; import noop from "lodash/noop"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; -import { RequestError } from "../util"; import { RequestState, SqlStatsResponse, SqlStatsSortOptions } from "../api"; +import { RequestError } from "../util"; import { columns, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx index 1c38a3924b43..1abe19966696 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { RouteComponentProps } from "react-router-dom"; import flatMap from "lodash/flatMap"; -import merge from "lodash/merge"; import isString from "lodash/isString"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import merge from "lodash/merge"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { SqlStatsSortType, createCombinedStmtsRequest, @@ -25,6 +24,9 @@ import { SqlStatsSortOptions, SqlStatsResponse, } from "src/api/statementsApi"; +import { SearchCriteria } from "src/searchCriteria/searchCriteria"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { STATS_LONG_LOADING_DURATION, getSortLabel, @@ -32,13 +34,16 @@ import { getSubsetWarning, getReqSortColumn, } from "src/util/sqlActivityConstants"; -import { SearchCriteria } from "src/searchCriteria/searchCriteria"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { Loading } from "../loading"; +import { RequestState } from "../api"; +import ColumnsSelector from "../columnsSelector/columnsSelector"; +import { isSelectedColumn } from "../columnsSelector/utils"; +import { commonStyles } from "../common"; import { Delayed } from "../delayed"; +import { Loading } from "../loading"; +import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; import { PageConfig, PageConfigItem } from "../pageConfig"; -import { Search } from "../search"; +import { Pagination, ResultsPerPageLabel } from "../pagination"; import { Filter, Filters, @@ -47,41 +52,37 @@ import { updateFiltersQueryParamsOnTab, SelectedFilters, } from "../queryFilter"; -import { UIConfigState } from "../store"; -import ColumnsSelector from "../columnsSelector/columnsSelector"; -import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; +import { Search } from "../search"; +import { + handleSortSettingFromQueryString, + ISortedTablePagination, + SortSetting, + updateSortSettingQueryParamsOnTab, +} from "../sortedtable"; +import ClearStats from "../sqlActivity/clearStats"; +import LoadingError from "../sqlActivity/errorComponent"; +import styles from "../statementsPage/statementsPage.module.scss"; import { getLabel, StatisticTableColumnKeys, } from "../statsTableUtil/statsTableUtil"; -import ClearStats from "../sqlActivity/clearStats"; -import LoadingError from "../sqlActivity/errorComponent"; -import { commonStyles } from "../common"; +import { UIConfigState } from "../store"; import { TimeScale, timeScale1hMinOptions, getValidOption, toRoundedDateRange, } from "../timeScaleDropdown"; -import { isSelectedColumn } from "../columnsSelector/utils"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { RequestState } from "../api"; -import { Pagination, ResultsPerPageLabel } from "../pagination"; -import { - handleSortSettingFromQueryString, - ISortedTablePagination, - SortSetting, - updateSortSettingQueryParamsOnTab, -} from "../sortedtable"; import { makeTransactionsColumns, TransactionInfo, TransactionsTable, } from "../transactionsTable"; -import styles from "../statementsPage/statementsPage.module.scss"; -import { TransactionViewType } from "./transactionsPageTypes"; import { EmptyTransactionsPlaceholder } from "./emptyTransactionsPlaceholder"; +import { statisticsClasses } from "./transactionsPageClasses"; +import { TransactionViewType } from "./transactionsPageTypes"; import { generateRegion, generateRegionNode, @@ -89,7 +90,6 @@ import { searchTransactionsData, filterTransactions, } from "./utils"; -import { statisticsClasses } from "./transactionsPageClasses"; const cx = classNames.bind(styles); const timeScaleStylesCx = classNames.bind(timeScaleStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts index 2bfc2163d166..9b8605393ebf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts @@ -10,8 +10,8 @@ import classNames from "classnames/bind"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { commonStyles } from "../common"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx index cd8f0fe6ae35..2b601047ebe0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx @@ -12,28 +12,40 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { SqlStatsSortType, StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; import { actions as nodesActions } from "src/store/nodes"; import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as txnStatsActions } from "src/store/transactionStats"; -import { SqlStatsSortType, StatementsRequest } from "src/api/statementsApi"; -import { selectHasAdminRole, selectIsTenant } from "../store/uiConfig"; +import { Filters } from "../queryFilter"; +import { actions as analyticsActions } from "../store/analytics"; +import { + actions as localStorageActions, + updateTxnsPageLimitAction, + updateTxnsPageReqSortAction, +} from "../store/localStorage"; import { nodeRegionsByIDSelector } from "../store/nodes"; +import { selectHasAdminRole, selectIsTenant } from "../store/uiConfig"; import { selectTxnsPageLimit, selectTxnsPageReqSort, selectTimeScale, } from "../store/utils/selectors"; -import { - actions as localStorageActions, - updateTxnsPageLimitAction, - updateTxnsPageReqSortAction, -} from "../store/localStorage"; -import { Filters } from "../queryFilter"; -import { actions as analyticsActions } from "../store/analytics"; import { TimeScale } from "../timeScaleDropdown"; +import { + mapStateToActiveTransactionsPageProps, + mapDispatchToActiveTransactionsPageProps, +} from "./activeTransactionsPage.selectors"; +import { + ActiveTransactionsViewStateProps, + ActiveTransactionsViewDispatchProps, +} from "./activeTransactionsView"; +import { + TransactionsPageStateProps, + TransactionsPageDispatchProps, +} from "./transactionsPage"; import { selectTxnColumns, selectSortSetting, @@ -41,22 +53,10 @@ import { selectSearch, selectRequestTime, } from "./transactionsPage.selectors"; -import { - TransactionsPageStateProps, - TransactionsPageDispatchProps, -} from "./transactionsPage"; import { TransactionsPageRoot, TransactionsPageRootProps, } from "./transactionsPageRoot"; -import { - mapStateToActiveTransactionsPageProps, - mapDispatchToActiveTransactionsPageProps, -} from "./activeTransactionsPage.selectors"; -import { - ActiveTransactionsViewStateProps, - ActiveTransactionsViewDispatchProps, -} from "./activeTransactionsView"; type StateProps = { fingerprintsPageProps: TransactionsPageStateProps & RouteComponentProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx index cb9b077a218a..fc9ab35a7987 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx @@ -10,18 +10,18 @@ import React from "react"; +import { Anchor } from "src/anchor"; import { Option } from "src/selectWithDescription/selectWithDescription"; import { SQLActivityRootControls } from "src/sqlActivityRootControls/sqlActivityRootControls"; -import { Anchor } from "src/anchor"; import { statementsSql } from "../util/docs"; -import { TransactionViewType } from "./transactionsPageTypes"; -import { TransactionsPageProps } from "./transactionsPage"; import { ActiveTransactionsView, ActiveTransactionsViewProps, } from "./activeTransactionsView"; +import { TransactionsPageProps } from "./transactionsPage"; +import { TransactionViewType } from "./transactionsPageTypes"; import { TransactionsPage } from "."; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts index 0a59da983376..02062d779a2e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { assert } from "chai"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { Filters } from "../queryFilter"; +import { data, nodeRegions } from "./transactions.fixture"; import { filterTransactions, generateRegion, getStatementsByFingerprintId, statementFingerprintIdsToText, } from "./utils"; -import { data, nodeRegions } from "./transactions.fixture"; type Statement = protos.cockroach.server.serverpb.StatementsResponse.ICollectedStatementStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts index 9c5474bc43e6..1b80c95138e2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts @@ -11,9 +11,9 @@ import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; -import { stdDevLong, Duration, Bytes, longToInt } from "src/util"; import { barChartFactory } from "src/barCharts/barChartFactory"; import { bar, approximify } from "src/barCharts/utils"; +import { stdDevLong, Duration, Bytes, longToInt } from "src/util"; import styles from "../barCharts/barCharts.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx index f534ac82daa3..23e3cb5dbac6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; import { getHighlightedText } from "src/highlightedText"; import { limitText } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx index 595dd40a34fa..b90d51149545 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx @@ -8,10 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; +import React from "react"; +import statsTablePageStyles from "src/statementsTable/statementsTableContent.module.scss"; import { FixFingerprintHexValue, Count, @@ -21,8 +22,8 @@ import { appNamesAttr, propsToQueryString, } from "src/util"; -import statsTablePageStyles from "src/statementsTable/statementsTableContent.module.scss"; +import { BarChartOptions } from "../barCharts/barChartFactory"; import { SortedTable, ISortedTablePagination, @@ -37,7 +38,6 @@ import { statementFingerprintIdsToText, statementFingerprintIdsToSummarizedText, } from "../transactionsPage/utils"; -import { BarChartOptions } from "../barCharts/barChartFactory"; import { transactionsCountBarChart, @@ -49,8 +49,8 @@ import { transactionsNetworkBytesBarChart, transactionsRetryBarChart, } from "./transactionsBarCharts"; -import { tableClasses } from "./transactionsTableClasses"; import { transactionLink } from "./transactionsCells"; +import { tableClasses } from "./transactionsTableClasses"; export type Transaction = protos.cockroach.server.serverpb.StatementsResponse.IExtendedCollectedTransactionStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts index 37b87270db58..48810f83e93b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts @@ -10,9 +10,9 @@ import classNames from "classnames/bind"; +import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import statementsTableStyles from "src/statementsTable/statementsTableContent.module.scss"; -import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; const sortedTableCx = classNames.bind(sortedTableStyles); const statementsTableCx = classNames.bind(statementsTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts b/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts index 7b5210a723e8..61789860f824 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts @@ -11,9 +11,9 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import { uniqueLong, unique } from "src/util/arrays"; import { TimestampToNumber, DurationToNumber } from "src/util/convert"; import { FixLong } from "src/util/fixLong"; -import { uniqueLong, unique } from "src/util/arrays"; export type StatementStatistics = cockroach.sql.IStatementStatistics; export type ExecStats = cockroach.sql.IExecStats; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts b/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts index 7ac915b3c009..c30a4502d6f4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { fromNumber } from "long"; +import moment from "moment-timezone"; import { NanoToMilli, diff --git a/pkg/ui/workspaces/cluster-ui/src/util/convert.ts b/pkg/ui/workspaces/cluster-ui/src/util/convert.ts index d1b0a5950284..b284ba043be1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/convert.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/convert.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { fromNumber } from "long"; +import moment from "moment-timezone"; export type Timestamp = protos.google.protobuf.ITimestamp; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx index c302b2265fbf..075f5051c639 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, cleanup, @@ -17,6 +16,7 @@ import { waitFor, } from "@testing-library/react"; import moment from "moment-timezone"; +import React from "react"; import { useScheduleFunction } from "./hooks"; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts b/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts index 9d47839d42d9..78949ecd60ec 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { useEffect, useCallback, useRef } from "react"; import moment from "moment/moment"; +import { useEffect, useCallback, useRef } from "react"; export const usePrevious = (value: T): T | undefined => { const ref = useRef(); diff --git a/pkg/ui/workspaces/cluster-ui/src/util/proto.ts b/pkg/ui/workspaces/cluster-ui/src/util/proto.ts index f4ec7f1a61a9..da051a875131 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/proto.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/proto.ts @@ -7,9 +7,9 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import has from "lodash/has"; import sumBy from "lodash/sumBy"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; export type INodeStatus = cockroach.server.status.statuspb.INodeStatus; const nodeStatus: INodeStatus = null; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx index 0b125e31a779..f30d4e984f68 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { duration } from "moment-timezone"; import classNames from "classnames/bind"; +import { duration } from "moment-timezone"; +import React from "react"; import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; import styles from "src/sqlActivity/sqlActivity.module.scss"; diff --git a/pkg/ui/workspaces/db-console/.eslintrc.json b/pkg/ui/workspaces/db-console/.eslintrc.json index 2a38f15ec5b8..d67c6208b79a 100644 --- a/pkg/ui/workspaces/db-console/.eslintrc.json +++ b/pkg/ui/workspaces/db-console/.eslintrc.json @@ -50,6 +50,10 @@ "import/order": [ "error", { + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, "newlines-between": "always", "groups": [ "builtin", diff --git a/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx b/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx index a9e26bf186cf..3450747bfa30 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx @@ -8,9 +8,9 @@ import React from "react"; import { Redirect, Route, Switch } from "react-router-dom"; +import ClusterOverview from "src/views/cluster/containers/clusterOverview"; import ClusterViz from "src/views/clusterviz/containers/map"; import NodeList from "src/views/clusterviz/containers/map/nodeList"; -import ClusterOverview from "src/views/cluster/containers/clusterOverview"; export const CLUSTERVIZ_ROOT = "/overview/map"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx index 07c4419b0123..92a47fcfd8f4 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx @@ -6,22 +6,22 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import classNames from "classnames"; import React from "react"; import { connect } from "react-redux"; import { Link } from "react-router-dom"; -import classNames from "classnames"; import nodeMapScreenshot from "assets/nodeMapSteps/3-seeMap.png"; import questionMap from "assets/questionMap.svg"; -import { allNodesHaveLocality } from "src/util/localities"; import { instructionsBoxCollapsedSelector, setInstructionsBoxCollapsed, } from "src/redux/alerts"; -import { AdminUIState, AppDispatch } from "src/redux/state"; -import { nodeStatusesSelector } from "src/redux/nodes"; import { LocalityTier } from "src/redux/localities"; +import { nodeStatusesSelector } from "src/redux/nodes"; +import { AdminUIState, AppDispatch } from "src/redux/state"; import * as docsURL from "src/util/docs"; +import { allNodesHaveLocality } from "src/util/localities"; import "./instructionsBox.styl"; interface InstructionsBoxProps { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts index f13216bebf62..842e1ee4c7f2 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts @@ -5,8 +5,8 @@ // the License. You may obtain a copy of the License at // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import { showInstructionsBox } from "src/views/clusterviz/components/instructionsBox"; import { LocalityTier } from "src/redux/localities"; +import { showInstructionsBox } from "src/views/clusterviz/components/instructionsBox"; describe("InstructionsBox component", () => { describe("showInstructionsBox", () => { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx index eee429012649..42b7d509d033 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx @@ -6,9 +6,14 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import { util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { + NodeArcPercentageTooltip, + NodeArcUsedCapacityTooltip, + NodeArcTotalCapacityTooltip, +} from "src/views/clusterviz/components/nodeOrLocality/tooltips"; import * as PathMath from "src/views/clusterviz/util/pathmath"; import { BACKGROUND_BLUE, @@ -16,11 +21,6 @@ import { LIGHT_TEXT_BLUE, MAIN_BLUE, } from "src/views/shared/colors"; -import { - NodeArcPercentageTooltip, - NodeArcUsedCapacityTooltip, - NodeArcTotalCapacityTooltip, -} from "src/views/clusterviz/components/nodeOrLocality/tooltips"; const ARC_INNER_RADIUS = 56; const ARC_WIDTH = 6; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx index d4c0789fe25d..d2ac7e9f2164 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx @@ -9,11 +9,11 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { howAreCapacityMetricsCalculatedOverview, clusterStore, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export const NodeArcPercentageTooltip: React.FC< TooltipProps & { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx index c28b0a0eaf2b..3212e2230951 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx @@ -6,15 +6,15 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; -import { Link } from "react-router-dom"; import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; +import React from "react"; +import { Link } from "react-router-dom"; -import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; import { LocalityTier } from "src/redux/localities"; -import { trustIcon } from "src/util/trust"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; +import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; +import { trustIcon } from "src/util/trust"; import mapPinIcon from "!!raw-loader!assets/mapPin.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx index eae21852e73e..b91a99fd101e 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx @@ -8,10 +8,10 @@ import React from "react"; +import { cockroach } from "src/js/protos"; import { LocalityTree } from "src/redux/localities"; -import { getChildLocalities } from "src/util/localities"; import { LivenessStatus } from "src/redux/nodes"; -import { cockroach } from "src/js/protos"; +import { getChildLocalities } from "src/util/localities"; import { LocalityView } from "./localityView"; import { NodeView } from "./nodeView"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx index 9ed504d66d3a..19a98aed57b5 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx @@ -6,9 +6,9 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import { shallow } from "enzyme"; import { createMemoryHistory, History } from "history"; +import React from "react"; import { match as Match } from "react-router-dom"; import { refreshCluster } from "src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx index f7952681395d..a36133ac5593 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx @@ -6,23 +6,23 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { Loading } from "@cockroachlabs/cluster-ui"; +import cn from "classnames"; import React from "react"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import cn from "classnames"; -import { Loading } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { Dropdown } from "src/components/dropdown"; +import { refreshCluster } from "src/redux/apiReducers"; +import { selectEnterpriseEnabled } from "src/redux/license"; +import { AdminUIState } from "src/redux/state"; +import { parseLocalityRoute } from "src/util/localities"; +import { parseSplatParams } from "src/util/parseSplatParams"; +import TimeScaleDropdown from "src/views/cluster/containers/timeScaleDropdownWithSearchParams"; import { Breadcrumbs } from "src/views/clusterviz/containers/map/breadcrumbs"; import NeedEnterpriseLicense from "src/views/clusterviz/containers/map/needEnterpriseLicense"; import NodeCanvasContainer from "src/views/clusterviz/containers/map/nodeCanvasContainer"; -import TimeScaleDropdown from "src/views/cluster/containers/timeScaleDropdownWithSearchParams"; import swapByLicense from "src/views/shared/containers/licenseSwap"; -import { parseLocalityRoute } from "src/util/localities"; -import { AdminUIState } from "src/redux/state"; -import { selectEnterpriseEnabled } from "src/redux/license"; -import { Dropdown } from "src/components/dropdown"; -import { parseSplatParams } from "src/util/parseSplatParams"; -import { refreshCluster } from "src/redux/apiReducers"; const NodeCanvasContent = swapByLicense( NeedEnterpriseLicense, diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx index ac8b01cb3534..5cc96f5ef904 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx @@ -11,18 +11,18 @@ import { RouteComponentProps } from "react-router"; import { withRouter } from "react-router-dom"; import { LocalityTree } from "src/redux/localities"; +import { sumNodeStats, LivenessStatus } from "src/redux/nodes"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; import { generateLocalityRoute, getLocalityLabel, getLeaves, } from "src/util/localities"; -import { sumNodeStats, LivenessStatus } from "src/redux/nodes"; import { pluralize } from "src/util/pluralize"; import { trustIcon } from "src/util/trust"; -import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; import { CapacityArc } from "src/views/clusterviz/components/nodeOrLocality/capacityArc"; import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; +import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; import liveIcon from "!!raw-loader!assets/livenessIcons/live.svg"; import localityIcon from "!!raw-loader!assets/localityIcon.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx index 189698551de2..ad61e32fb1f1 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx @@ -6,19 +6,19 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import * as d3 from "d3"; -import isEqual from "lodash/isEqual"; import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; import map from "lodash/map"; +import React from "react"; import * as protos from "src/js/protos"; import { LocalityTree } from "src/redux/localities"; import { LocationTree } from "src/redux/locations"; +import { LivenessStatus } from "src/redux/nodes"; import { getChildLocalities } from "src/util/localities"; import { findOrCalculateLocation } from "src/util/locations"; import * as vector from "src/util/vector"; -import { LivenessStatus } from "src/redux/nodes"; import { LocalityView } from "./localityView"; import { WorldMap } from "./worldmap"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx index 0dfb6ecc0dc8..164abd84f10a 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx @@ -11,8 +11,8 @@ import React from "react"; import step1Img from "assets/nodeMapSteps/1-getLicense.png"; import step2Img from "assets/nodeMapSteps/2-setKey.svg"; import step3Img from "assets/nodeMapSteps/3-seeMap.png"; -import { NodeCanvasContainerOwnProps } from "src/views/clusterviz/containers/map/nodeCanvasContainer"; import * as docsURL from "src/util/docs"; +import { NodeCanvasContainerOwnProps } from "src/views/clusterviz/containers/map/nodeCanvasContainer"; import "./needEnterpriseLicense.styl"; // This takes the same props as the NodeCanvasContainer which it is swapped out with. diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx index e6f85e3565fb..ad59a4e0516b 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx @@ -6,25 +6,25 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import debounce from "lodash/debounce"; import isEmpty from "lodash/isEmpty"; +import React from "react"; import { Link } from "react-router-dom"; -import { LivenessStatus } from "src/redux/nodes"; +import { cockroach } from "src/js/protos"; import { LocalityTier, LocalityTree } from "src/redux/localities"; import { LocationTree } from "src/redux/locations"; +import { LivenessStatus } from "src/redux/nodes"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; import { trustIcon } from "src/util/trust"; -import { cockroach } from "src/js/protos"; import InstructionsBox, { showInstructionsBox, } from "src/views/clusterviz/components/instructionsBox"; -import { MapLayout } from "./mapLayout"; -import { renderAsMap } from "./layout"; import { CircleLayout } from "./circleLayout"; +import { renderAsMap } from "./layout"; +import { MapLayout } from "./mapLayout"; import arrowUpIcon from "!!raw-loader!assets/arrowUp.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx index 6bad44ec81a1..2367da3c5de2 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx @@ -6,12 +6,12 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { Loading } from "@cockroachlabs/cluster-ui"; import isNil from "lodash/isNil"; import React from "react"; import { connect } from "react-redux"; import { withRouter, RouteComponentProps } from "react-router-dom"; import { createSelector } from "reselect"; -import { Loading } from "@cockroachlabs/cluster-ui"; import { cockroach } from "src/js/protos"; import { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx index 20029b7b822b..c65ca021af74 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx @@ -9,8 +9,8 @@ import React from "react"; import { RouteComponentProps } from "react-router-dom"; -import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import { Dropdown } from "src/components/dropdown"; +import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import "./nodesList.styl"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx index afdb9a21c173..11352a59d4ea 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx @@ -6,24 +6,24 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; +import { util } from "@cockroachlabs/cluster-ui"; import moment from "moment-timezone"; +import React from "react"; import { Link } from "react-router-dom"; -import { util } from "@cockroachlabs/cluster-ui"; -import { INodeStatus } from "src/util/proto"; +import { cockroach } from "src/js/protos"; import { nodeCapacityStats, livenessNomenclature } from "src/redux/nodes"; +import { INodeStatus } from "src/util/proto"; import { trustIcon } from "src/util/trust"; -import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; import { CapacityArc } from "src/views/clusterviz/components/nodeOrLocality/capacityArc"; +import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; -import { cockroach } from "src/js/protos"; -import nodeIcon from "!!raw-loader!assets/nodeIcon.svg"; +import NodeLivenessStatus = cockroach.kv.kvserver.liveness.livenesspb.NodeLivenessStatus; import deadIcon from "!!raw-loader!assets/livenessIcons/dead.svg"; -import suspectIcon from "!!raw-loader!assets/livenessIcons/suspect.svg"; import liveIcon from "!!raw-loader!assets/livenessIcons/live.svg"; -import NodeLivenessStatus = cockroach.kv.kvserver.liveness.livenesspb.NodeLivenessStatus; +import suspectIcon from "!!raw-loader!assets/livenessIcons/suspect.svg"; +import nodeIcon from "!!raw-loader!assets/nodeIcon.svg"; type ILiveness = cockroach.kv.kvserver.liveness.livenesspb.ILiveness; interface NodeViewProps { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx index 6e1496a468a6..dd1b5392e8be 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx @@ -6,13 +6,13 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { util } from "@cockroachlabs/cluster-ui"; import d3 from "d3"; import React from "react"; -import { util } from "@cockroachlabs/cluster-ui"; +import { BACKGROUND_BLUE, MAIN_BLUE } from "src/views/shared/colors"; import { MetricsDataComponentProps } from "src/views/shared/components/metricQuery"; import createChartComponent from "src/views/shared/util/d3-react"; -import { BACKGROUND_BLUE, MAIN_BLUE } from "src/views/shared/colors"; interface SparklineConfig { width: number; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx index 29c9fae458de..6b1dc929ca7d 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx @@ -6,8 +6,8 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import * as d3 from "d3"; +import React from "react"; import shapes from "./world.json"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts index 27f3d792a1e2..8a352cf74521 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts @@ -7,8 +7,8 @@ // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt import * as d3 from "d3"; -import isEmpty from "lodash/isEmpty"; import clone from "lodash/clone"; +import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; import * as vector from "src/util/vector"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx index 0636588ae6e8..8829f8e57030 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx @@ -6,15 +6,15 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; -import Long from "long"; -import moment from "moment-timezone"; -import * as protosccl from "@cockroachlabs/crdb-protobuf-client-ccl"; import { util } from "@cockroachlabs/cluster-ui"; +import * as protosccl from "@cockroachlabs/crdb-protobuf-client-ccl"; import isEmpty from "lodash/isEmpty"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; -import * as protos from "src/js/protos"; import { EncryptionStatusProps } from "oss/src/views/reports/containers/stores/encryption"; +import * as protos from "src/js/protos"; import { FixLong } from "src/util/fixLong"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx index 2720f5d913e6..561c111b11a0 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx @@ -8,9 +8,9 @@ import React from "react"; +import OSSLicenseType from "oss/src/views/shared/components/licenseType"; import DebugAnnotation from "src/views/shared/components/debugAnnotation"; import swapByLicense from "src/views/shared/containers/licenseSwap"; -import OSSLicenseType from "oss/src/views/shared/components/licenseType"; export class CCLLicenseType extends React.Component<{}, {}> { render() { diff --git a/pkg/ui/workspaces/db-console/src/app.spec.tsx b/pkg/ui/workspaces/db-console/src/app.spec.tsx index 1c0fffc5e25a..6314e03ee83f 100644 --- a/pkg/ui/workspaces/db-console/src/app.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/app.spec.tsx @@ -60,10 +60,10 @@ stubComponentInModule( ); // NOTE: All imports should go after `stubComponentInModule` functions calls. +import { screen, render } from "@testing-library/react"; +import { createMemoryHistory, MemoryHistory } from "history"; import React from "react"; import { Action, Store } from "redux"; -import { createMemoryHistory, MemoryHistory } from "history"; -import { screen, render } from "@testing-library/react"; import { App } from "src/app"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/app.tsx b/pkg/ui/workspaces/db-console/src/app.tsx index efc46fd4a503..5df22507d0bd 100644 --- a/pkg/ui/workspaces/db-console/src/app.tsx +++ b/pkg/ui/workspaces/db-console/src/app.tsx @@ -8,6 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + CockroachCloudContext, + crlTheme, + ConfigProvider as ClusterUIConfigProvider, +} from "@cockroachlabs/cluster-ui"; +import { ConfigProvider } from "antd"; import { ConnectedRouter } from "connected-react-router"; import { History } from "history"; import "nvd3/build/nv.d3.min.css"; @@ -16,11 +22,11 @@ import { Provider, ReactReduxContext } from "react-redux"; import { Redirect, Route, Switch } from "react-router-dom"; import "react-select/dist/react-select.css"; import { Action, Store } from "redux"; -import { CockroachCloudContext , crlTheme, ConfigProvider as ClusterUIConfigProvider } from "@cockroachlabs/cluster-ui"; -import { ConfigProvider } from "antd"; +import { TimezoneProvider } from "src/contexts/timezoneProvider"; import { AdminUIState } from "src/redux/state"; import { createLoginRoute, createLogoutRoute } from "src/routes/login"; +import { RedirectToStatementDetails } from "src/routes/RedirectToStatementDetails"; import visualizationRoutes from "src/routes/visualization"; import { aggregatedTsAttr, @@ -49,49 +55,47 @@ import { EventPage } from "src/views/cluster/containers/events"; import NodeGraphs from "src/views/cluster/containers/nodeGraphs"; import NodeLogs from "src/views/cluster/containers/nodeLogs"; import NodeOverview from "src/views/cluster/containers/nodeOverview"; -import { DatabasesPage } from "src/views/databases/databasesPage"; import { DatabaseDetailsPage } from "src/views/databases/databaseDetailsPage"; +import { DatabasesPage } from "src/views/databases/databasesPage"; import { DatabaseTablePage } from "src/views/databases/databaseTablePage"; import { IndexDetailsPage } from "src/views/databases/indexDetailsPage"; import Raft from "src/views/devtools/containers/raft"; import RaftMessages from "src/views/devtools/containers/raftMessages"; import RaftRanges from "src/views/devtools/containers/raftRanges"; -import JobsPage from "src/views/jobs/jobsPage"; +import HotRangesPage from "src/views/hotRanges/index"; import JobDetails from "src/views/jobs/jobDetails"; +import JobsPage from "src/views/jobs/jobsPage"; +import KeyVisualizerPage from "src/views/keyVisualizer"; import { ConnectedDecommissionedNodeHistory } from "src/views/reports"; import Certificates from "src/views/reports/containers/certificates"; import CustomChart from "src/views/reports/containers/customChart"; import Debug from "src/views/reports/containers/debug"; import EnqueueRange from "src/views/reports/containers/enqueueRange"; +import HotRanges from "src/views/reports/containers/hotranges"; import Localities from "src/views/reports/containers/localities"; import Network from "src/views/reports/containers/network"; import Nodes from "src/views/reports/containers/nodes"; import ProblemRanges from "src/views/reports/containers/problemRanges"; import Range from "src/views/reports/containers/range"; import ReduxDebug from "src/views/reports/containers/redux"; -import HotRanges from "src/views/reports/containers/hotranges"; -import SchedulesPage from "src/views/schedules/schedulesPage"; -import ScheduleDetails from "src/views/schedules/scheduleDetails"; import Settings from "src/views/reports/containers/settings"; +import StatementsDiagnosticsHistoryView from "src/views/reports/containers/statementDiagnosticsHistory"; import Stores from "src/views/reports/containers/stores"; +import ScheduleDetails from "src/views/schedules/scheduleDetails"; +import SchedulesPage from "src/views/schedules/schedulesPage"; +import SessionDetails from "src/views/sessions/sessionDetails"; import SQLActivityPage from "src/views/sqlActivity/sqlActivityPage"; import StatementDetails from "src/views/statements/statementDetails"; -import SessionDetails from "src/views/sessions/sessionDetails"; -import TransactionDetails from "src/views/transactions/transactionDetails"; -import StatementsDiagnosticsHistoryView from "src/views/reports/containers/statementDiagnosticsHistory"; -import { RedirectToStatementDetails } from "src/routes/RedirectToStatementDetails"; -import HotRangesPage from "src/views/hotRanges/index"; import { SnapshotRouter } from "src/views/tracez_v2/snapshotRoutes"; -import KeyVisualizerPage from "src/views/keyVisualizer"; -import { TimezoneProvider } from "src/contexts/timezoneProvider"; +import TransactionDetails from "src/views/transactions/transactionDetails"; import "styl/app.styl"; -import ActiveStatementDetails from "./views/statements/activeStatementDetailsConnected"; -import ActiveTransactionDetails from "./views/transactions/activeTransactionDetailsConnected"; import InsightsOverviewPage from "./views/insights/insightsOverview"; -import TransactionInsightDetailsPage from "./views/insights/transactionInsightDetailsPage"; import StatementInsightDetailsPage from "./views/insights/statementInsightDetailsPage"; +import TransactionInsightDetailsPage from "./views/insights/transactionInsightDetailsPage"; import { JwtAuthTokenPage } from "./views/jwt/jwtAuthToken"; +import ActiveStatementDetails from "./views/statements/activeStatementDetailsConnected"; +import ActiveTransactionDetails from "./views/transactions/activeTransactionDetailsConnected"; // NOTE: If you are adding a new path to the router, and that path contains any // components that are personally identifying information, you MUST update the @@ -119,380 +123,414 @@ export const App: React.FC = (props: AppProps) => { {/* Apply CRL theme twice, with ConfigProvider instance from Db Console and imported instance from Cluster UI as it applies theme imported components only. */} - - - {/* login */} - {createLoginRoute()} - {createLogoutRoute(store)} - - - - - - {/* overview page */} - {visualizationRoutes()} + + + {/* login */} + {createLoginRoute()} + {createLogoutRoute(store)} + + + + + + {/* overview page */} + {visualizationRoutes()} - {/* time series metrics */} - - - - - - - + {/* time series metrics */} + + + + + + + - {/* node details */} - - - + {/* node details */} + + + - {/* events & jobs */} - - - + {/* events & jobs */} + + + - - + + - {/* databases */} - - - - + {/* databases */} + + + + - - - - - - + + + + + + - {/* data distribution */} - + {/* data distribution */} + - {/* SQL activity */} - + {/* SQL activity */} + - {/* Active executions */} - + {/* Active executions */} + - + - {/* statement statistics */} - - - - - - - - - + {/* statement statistics */} + + + + + + + + + - {/* sessions */} - - + {/* sessions */} + + - {/* transactions */} - - - + {/* transactions */} + + + - {/* Insights */} - - - + {/* Insights */} + + + - {/* debug pages */} - - - - - - - - - - - - - - - - - - + {/* debug pages */} + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - {/* hot ranges */} - - {/* old route redirects */} - - - - - - - + + + + + + + + + + + + + {/* hot ranges */} + + {/* old route redirects */} + + + + + + + - + - {/* 404 */} - - - - - - + {/* 404 */} + + + + + + - + diff --git a/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx b/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx index 96b54969e781..8ee06e212f28 100644 --- a/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx +++ b/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./anchor.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/button/button.tsx b/pkg/ui/workspaces/db-console/src/components/button/button.tsx index dabe48b4cc91..1af4177fb5a4 100644 --- a/pkg/ui/workspaces/db-console/src/components/button/button.tsx +++ b/pkg/ui/workspaces/db-console/src/components/button/button.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ButtonHTMLAttributes } from "react"; import classNames from "classnames/bind"; +import React, { ButtonHTMLAttributes } from "react"; import styles from "./button.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx b/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx index a607f80eb0b4..181990678f4d 100644 --- a/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx +++ b/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import cn from "classnames"; import { CaretDownOutlined } from "@ant-design/icons"; +import cn from "classnames"; +import React from "react"; import { Button } from "src/components/button"; diff --git a/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx b/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx index 7c045616712c..45f1546fba77 100644 --- a/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx +++ b/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import heroBannerLp from "assets/heroBannerLp.png"; import { Anchor, Button, Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx index c7459a29ec27..c6e802d16b1a 100644 --- a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; -import { styledWrapper } from "src/util/decorators"; import { Anchor } from "src/components"; +import { styledWrapper } from "src/util/decorators"; import { InlineAlert } from "./inlineAlert"; diff --git a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx index afc6991477c2..8d4c276868e3 100644 --- a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx +++ b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import ErrorIcon from "assets/error-circle.svg"; import InfoIcon from "assets/info-filled-circle.svg"; diff --git a/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx b/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx index 49ddddc03e92..2f16371751da 100644 --- a/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx +++ b/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import cn from "classnames"; +import React from "react"; import { Text, TextTypes } from "src/components"; import "./input.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/link/link.tsx b/pkg/ui/workspaces/db-console/src/components/link/link.tsx index 3da3ae82180e..3d0f750c24e9 100644 --- a/pkg/ui/workspaces/db-console/src/components/link/link.tsx +++ b/pkg/ui/workspaces/db-console/src/components/link/link.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames/bind"; import React from "react"; import { Link as LinkTo, LinkProps } from "react-router-dom"; -import classnames from "classnames/bind"; import styles from "./link.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx b/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx index d4bd9a785928..e3639357c796 100644 --- a/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx +++ b/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Modal as AntModal } from "antd"; +import React from "react"; import "antd/lib/modal/style"; import { Button, Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx b/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx index 8546c8c2faae..314ef2808f70 100644 --- a/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx +++ b/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import "./outsideEventHandler.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx b/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx index 30b70afef833..b9e481845d40 100644 --- a/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx +++ b/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Moment } from "moment-timezone"; +import React from "react"; import { Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/select/select.tsx b/pkg/ui/workspaces/db-console/src/components/select/select.tsx index 5b477f6976d9..f1c4f76c48d4 100644 --- a/pkg/ui/workspaces/db-console/src/components/select/select.tsx +++ b/pkg/ui/workspaces/db-console/src/components/select/select.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { default as AntSelect, SelectProps as AntSelectProps, } from "antd/es/select"; import cn from "classnames"; +import * as React from "react"; import "./select.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx b/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx index c552cd417bb7..5612490e78f3 100644 --- a/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx +++ b/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import cn from "classnames"; +import * as React from "react"; import { Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/text/text.tsx b/pkg/ui/workspaces/db-console/src/components/text/text.tsx index 1a8341e62475..283495e3d575 100644 --- a/pkg/ui/workspaces/db-console/src/components/text/text.tsx +++ b/pkg/ui/workspaces/db-console/src/components/text/text.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import cn from "classnames"; +import * as React from "react"; import "./text.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx index 390c44368eba..d4d33cd0d23e 100644 --- a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; +import { Tooltip } from "src/components/tooltip/tooltip"; +import { nodeLocalityFixture } from "src/components/tooltip/tooltip.fixtures"; +import { LivenessStatus } from "src/redux/nodes"; +import { styledWrapper } from "src/util/decorators"; import * as ClusterTooltips from "src/views/cluster/containers/clusterOverview/tooltips"; -import * as NodeOverviewTooltips from "src/views/cluster/containers/nodeOverview/tooltips"; -import * as CapacityArkTooltips from "src/views/clusterviz/components/nodeOrLocality/tooltips"; import * as GraphTooltips from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; -import { ToolTipWrapper } from "src/views/shared/components/toolTip"; +import * as NodeOverviewTooltips from "src/views/cluster/containers/nodeOverview/tooltips"; +import { AggregatedNodeStatus } from "src/views/cluster/containers/nodesOverview"; import { plainNodeTooltips, getNodeStatusDescription, getStatusDescription, NodeLocalityColumn, } from "src/views/cluster/containers/nodesOverview/tooltips"; -import { AggregatedNodeStatus } from "src/views/cluster/containers/nodesOverview"; -import { LivenessStatus } from "src/redux/nodes"; -import { Tooltip } from "src/components/tooltip/tooltip"; -import { styledWrapper } from "src/util/decorators"; -import { nodeLocalityFixture } from "src/components/tooltip/tooltip.fixtures"; +import * as CapacityArkTooltips from "src/views/clusterviz/components/nodeOrLocality/tooltips"; +import { ToolTipWrapper } from "src/views/shared/components/toolTip"; const triggerStyle: React.CSSProperties = { width: "300px", diff --git a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx index b7e0c2a0e019..4e3e3ee254a9 100644 --- a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx +++ b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { default as AntTooltip, TooltipProps as AntTooltipProps, } from "antd/es/tooltip"; import cn from "classnames"; +import * as React from "react"; import "./tooltip.styl"; diff --git a/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx b/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx index 3713d3583dd0..91e2b14f8ef8 100644 --- a/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx +++ b/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimezoneContext } from "@cockroachlabs/cluster-ui"; import React, { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { TimezoneContext } from "@cockroachlabs/cluster-ui"; +import { refreshSettings } from "src/redux/apiReducers"; import { selectClusterSettings, selectTimezoneSetting, } from "src/redux/clusterSettings"; -import { refreshSettings } from "src/redux/apiReducers"; export const TimezoneProvider = (props: any) => { // Refresh cluster settings if needed. diff --git a/pkg/ui/workspaces/db-console/src/index.tsx b/pkg/ui/workspaces/db-console/src/index.tsx index 87ec91fed83e..3f61dbe000dc 100644 --- a/pkg/ui/workspaces/db-console/src/index.tsx +++ b/pkg/ui/workspaces/db-console/src/index.tsx @@ -12,8 +12,8 @@ import * as ReactDOM from "react-dom"; import "src/polyfills"; import "src/protobufInit"; -import { alertDataSync } from "src/redux/alerts"; import { App } from "src/app"; +import { alertDataSync } from "src/redux/alerts"; import { history } from "src/redux/history"; import { createAdminUIStore } from "src/redux/state"; import "src/redux/analytics"; diff --git a/pkg/ui/workspaces/db-console/src/protobufInit.ts b/pkg/ui/workspaces/db-console/src/protobufInit.ts index 977d64116c83..f36fb5ab305c 100644 --- a/pkg/ui/workspaces/db-console/src/protobufInit.ts +++ b/pkg/ui/workspaces/db-console/src/protobufInit.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as protobuf from "protobufjs/minimal"; import Long from "long"; +import * as protobuf from "protobufjs/minimal"; protobuf.util.Long = Long as any; protobuf.configure(); diff --git a/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts b/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts index 3a58e5e6798b..aaa21830c8f5 100644 --- a/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts @@ -8,18 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Store } from "redux"; -import moment from "moment-timezone"; import { createHashHistory } from "history"; import Long from "long"; +import moment from "moment-timezone"; +import { Store } from "redux"; import * as protos from "src/js/protos"; import { cockroach } from "src/js/protos"; +import { versionsSelector } from "src/redux/nodes"; import { API_PREFIX } from "src/util/api"; import fetchMock from "src/util/fetch-mock"; -import { versionsSelector } from "src/redux/nodes"; -import { AdminUIState, AppDispatch, createAdminUIStore } from "./state"; import { AlertLevel, alertDataSync, @@ -34,12 +33,6 @@ import { clusterPreserveDowngradeOptionDismissedSetting, clusterPreserveDowngradeOptionOvertimeSelector, } from "./alerts"; -import { - VERSION_DISMISSED_KEY, - INSTRUCTIONS_BOX_COLLAPSED_KEY, - setUIDataKey, - isInFlight, -} from "./uiData"; import { livenessReducerObj, versionReducerObj, @@ -49,6 +42,13 @@ import { settingsReducerObj, } from "./apiReducers"; import { loginSuccess } from "./login"; +import { AdminUIState, AppDispatch, createAdminUIStore } from "./state"; +import { + VERSION_DISMISSED_KEY, + INSTRUCTIONS_BOX_COLLAPSED_KEY, + setUIDataKey, + isInFlight, +} from "./uiData"; import MembershipStatus = cockroach.kv.kvserver.liveness.livenesspb.MembershipStatus; diff --git a/pkg/ui/workspaces/db-console/src/redux/alerts.ts b/pkg/ui/workspaces/db-console/src/redux/alerts.ts index c6c369415eba..22b24c796a45 100644 --- a/pkg/ui/workspaces/db-console/src/redux/alerts.ts +++ b/pkg/ui/workspaces/db-console/src/redux/alerts.ts @@ -13,36 +13,26 @@ * to display based on the current redux state. */ -import moment from "moment-timezone"; -import { createSelector } from "reselect"; -import { Store, Dispatch, Action, AnyAction } from "redux"; -import { ThunkAction } from "redux-thunk"; +import filter from "lodash/filter"; import has from "lodash/has"; -import without from "lodash/without"; import isEmpty from "lodash/isEmpty"; -import filter from "lodash/filter"; import isNil from "lodash/isNil"; +import without from "lodash/without"; +import moment from "moment-timezone"; +import { Store, Dispatch, Action, AnyAction } from "redux"; +import { ThunkAction } from "redux-thunk"; +import { createSelector } from "reselect"; -import { longToInt } from "src/util/fixLong"; -import * as docsURL from "src/util/docs"; import { singleVersionSelector, numNodesByVersionsTagSelector, numNodesByVersionsSelector, } from "src/redux/nodes"; +import * as docsURL from "src/util/docs"; +import { longToInt } from "src/util/fixLong"; import { getDataFromServer } from "../util/dataFromServer"; -import { LocalSetting } from "./localsettings"; -import { - VERSION_DISMISSED_KEY, - INSTRUCTIONS_BOX_COLLAPSED_KEY, - saveUIData, - loadUIData, - isInFlight, - UIDataState, - UIDataStatus, -} from "./uiData"; import { refreshCluster, refreshNodes, @@ -50,11 +40,21 @@ import { refreshHealth, refreshSettings, } from "./apiReducers"; -import { AdminUIState, AppDispatch } from "./state"; import { selectClusterSettings, selectClusterSettingVersion, } from "./clusterSettings"; +import { LocalSetting } from "./localsettings"; +import { AdminUIState, AppDispatch } from "./state"; +import { + VERSION_DISMISSED_KEY, + INSTRUCTIONS_BOX_COLLAPSED_KEY, + saveUIData, + loadUIData, + isInFlight, + UIDataState, + UIDataStatus, +} from "./uiData"; export enum AlertLevel { NOTIFICATION, diff --git a/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts b/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts index 0b63de0b0939..f57b7ac79ccd 100644 --- a/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts @@ -15,9 +15,9 @@ import { Store } from "redux"; import * as protos from "src/js/protos"; -import { history } from "./history"; import { AnalyticsSync, defaultRedactions } from "./analytics"; import { clusterReducerObj, nodesReducerObj } from "./apiReducers"; +import { history } from "./history"; import { AdminUIState, createAdminUIStore } from "./state"; describe("analytics listener", function () { diff --git a/pkg/ui/workspaces/db-console/src/redux/analytics.ts b/pkg/ui/workspaces/db-console/src/redux/analytics.ts index 415619dafee0..48ff5fc65a29 100644 --- a/pkg/ui/workspaces/db-console/src/redux/analytics.ts +++ b/pkg/ui/workspaces/db-console/src/redux/analytics.ts @@ -10,14 +10,14 @@ import Analytics from "analytics-node"; import { Location } from "history"; -import { Store } from "redux"; import each from "lodash/each"; import isEmpty from "lodash/isEmpty"; +import { Store } from "redux"; import * as protos from "src/js/protos"; +import { history } from "src/redux/history"; import { versionsSelector } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; -import { history } from "src/redux/history"; import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; type ClusterResponse = protos.cockroach.server.serverpb.IClusterResponse; diff --git a/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts b/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts index ec69a368316b..fda5db1fae9f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts @@ -9,10 +9,10 @@ // licenses/APL.txt. import { api as clusterUiApi, util } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import merge from "lodash/merge"; import moment from "moment-timezone"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { RouteComponentProps } from "react-router"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts b/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts index 7707906e3aa9..b6078e368aa1 100644 --- a/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts +++ b/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts @@ -8,29 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action, combineReducers } from "redux"; -import { ThunkAction, ThunkDispatch } from "redux-thunk"; -import moment from "moment-timezone"; import { api as clusterUiApi, util, StmtInsightEvent, TxnInsightEvent, } from "@cockroachlabs/cluster-ui"; -import Long from "long"; -import { createSelector, ParametricSelector } from "reselect"; -import { RouteComponentProps } from "react-router"; -import map from "lodash/map"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; +import map from "lodash/map"; +import Long from "long"; +import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router"; +import { Action, combineReducers } from "redux"; +import { ThunkAction, ThunkDispatch } from "redux-thunk"; +import { createSelector, ParametricSelector } from "reselect"; -import * as protos from "src/js/protos"; -import { INodeStatus, RollupStoreMetrics } from "src/util/proto"; -import { versionCheck } from "src/util/cockroachlabsAPI"; import { VersionList } from "src/interfaces/cockroachlabs"; +import * as protos from "src/js/protos"; import * as api from "src/util/api"; +import { versionCheck } from "src/util/cockroachlabsAPI"; +import { INodeStatus, RollupStoreMetrics } from "src/util/proto"; -import { AdminUIState } from "./state"; import { CachedDataReducer, CachedDataReducerState, @@ -39,6 +38,7 @@ import { PaginatedCachedDataReducer, PaginatedCachedDataReducerState, } from "./cachedDataReducer"; +import { AdminUIState } from "./state"; const { generateStmtDetailsToID, HexStringToInt64String, generateTableID } = util; diff --git a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts index 6eef799e5864..488b5bbaec5f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import isError from "lodash/isError" -import { Action } from "redux"; import moment from "moment-timezone"; +import { Action } from "redux"; import { CachedDataReducer, diff --git a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts index 784f58b36a19..82e12e26d598 100644 --- a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts +++ b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts @@ -16,18 +16,18 @@ import assert from "assert"; -import isNil from "lodash/isNil"; +import { util as clusterUiUtil } from "@cockroachlabs/cluster-ui"; +import { push } from "connected-react-router"; +import { createHashHistory } from "history"; import clone from "lodash/clone"; -import { Action } from "redux"; +import isNil from "lodash/isNil"; import moment from "moment-timezone"; -import { push } from "connected-react-router"; +import { Action } from "redux"; import { ThunkAction, ThunkDispatch } from "redux-thunk"; -import { createHashHistory } from "history"; -import { util as clusterUiUtil } from "@cockroachlabs/cluster-ui"; +import { PayloadAction, WithRequest } from "src/interfaces/action"; import { getLoginPage } from "src/redux/login"; import { APIRequestFn } from "src/util/api"; -import { PayloadAction, WithRequest } from "src/interfaces/action"; import { clearTenantCookie } from "./cookies"; diff --git a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts index 1ab09041f4a5..b73d48519474 100644 --- a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts +++ b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; -import moment from "moment-timezone"; import { CoordinatedUniversalTime, util } from "@cockroachlabs/cluster-ui"; +import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; import { cockroach } from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; import { indexUnusedDuration } from "src/util/constants"; export const selectClusterSettings = createSelector( diff --git a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts index a8a03d6d8e5d..7d72e8227362 100644 --- a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { expectSaga } from "redux-saga-test-plan"; import Analytics from "analytics-node"; +import { expectSaga } from "redux-saga-test-plan"; import { signUpEmailSubscription } from "./customAnalyticsSagas"; import { signUpForEmailSubscription } from "./customAnanlyticsActions"; diff --git a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts index 76bf98ed545f..19118f4d675a 100644 --- a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { call, put, takeEvery } from "redux-saga/effects"; import Analytics from "analytics-node"; +import { call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "src/interfaces/action"; -import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; +import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; import { EMAIL_SUBSCRIPTION_SIGN_UP, diff --git a/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts b/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts index 3c3f33e43009..751465497153 100644 --- a/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts +++ b/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; import { cockroach } from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; import { LocalSetting } from "./localsettings"; diff --git a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts index decf21445f64..a491180e290d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts @@ -12,18 +12,18 @@ import { expectSaga } from "redux-saga-test-plan"; import { call, select } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { resetIndexUsageStats } from "src/util/api"; import { cockroach } from "src/js/protos"; +import { resetIndexUsageStats } from "src/util/api"; -import { - resetIndexUsageStatsSaga, - selectIndexStatsKeys, -} from "./indexUsageStatsSagas"; import { resetIndexUsageStatsFailedAction, resetIndexUsageStatsCompleteAction, resetIndexUsageStatsAction, } from "./indexUsageStatsActions"; +import { + resetIndexUsageStatsSaga, + selectIndexStatsKeys, +} from "./indexUsageStatsSagas"; describe("Index Usage Stats sagas", () => { describe("resetIndexUsageStatsSaga", () => { diff --git a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts index 34de36835b1a..fe3f20bb27f0 100644 --- a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts @@ -11,15 +11,15 @@ import { all, call, put, takeEvery, select } from "redux-saga/effects"; import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import { cockroach } from "src/js/protos"; import { invalidateIndexStats, KeyedCachedDataReducerState, refreshIndexStats, } from "src/redux/apiReducers"; -import { IndexStatsResponseMessage, resetIndexUsageStats } from "src/util/api"; import { AdminUIState } from "src/redux/state"; -import { PayloadAction } from "src/interfaces/action"; +import { IndexStatsResponseMessage, resetIndexUsageStats } from "src/util/api"; import { RESET_INDEX_USAGE_STATS, diff --git a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts index f04925559db0..600ae50bda57 100644 --- a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts +++ b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action } from "redux"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts index 481a2610d57d..be980dc4cb8d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeEvery } from "redux-saga/effects"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { refreshListExecutionDetailFiles } from "oss/src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts b/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts index 802379e7cc9e..c6da2ec31e61 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import merge from "lodash/merge"; import { createMemoryHistory } from "history"; +import merge from "lodash/merge"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localities.ts b/pkg/ui/workspaces/db-console/src/redux/localities.ts index bbd1275213ff..5de1ff03d78e 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localities.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localities.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import groupBy from "lodash/groupBy"; import isEmpty from "lodash/isEmpty"; import mapValues from "lodash/mapValues"; -import groupBy from "lodash/groupBy"; import partition from "lodash/partition"; import { createSelector } from "reselect"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localsettings.ts b/pkg/ui/workspaces/db-console/src/redux/localsettings.ts index bb6fe8744447..542743855873 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localsettings.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localsettings.ts @@ -19,12 +19,12 @@ * it should be given the full redux treatment with unique modification actions. */ -import { createSelector, Selector } from "reselect"; -import { Action } from "redux"; -import { call, takeEvery } from "redux-saga/effects"; +import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; import isNil from "lodash/isNil"; -import { util } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; +import { call, takeEvery } from "redux-saga/effects"; +import { createSelector, Selector } from "reselect"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/login.ts b/pkg/ui/workspaces/db-console/src/redux/login.ts index 03c22d31d8ed..70909dcad563 100644 --- a/pkg/ui/workspaces/db-console/src/redux/login.ts +++ b/pkg/ui/workspaces/db-console/src/redux/login.ts @@ -13,10 +13,10 @@ import { Action } from "redux"; import { ThunkAction } from "redux-thunk"; import { createSelector } from "reselect"; -import { userLogin, userLogout } from "src/util/api"; +import { cockroach } from "src/js/protos"; import { AdminUIState } from "src/redux/state"; import { LOGIN_PAGE, LOGOUT_PAGE } from "src/routes/login"; -import { cockroach } from "src/js/protos"; +import { userLogin, userLogout } from "src/util/api"; import { getDataFromServer } from "src/util/dataFromServer"; import { clearTenantCookie } from "./cookies"; diff --git a/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts b/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts index 77f111a4dcb9..b732e2165cbc 100644 --- a/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts @@ -9,15 +9,15 @@ // licenses/APL.txt. import {keys} from "d3"; -import map from "lodash/map"; import flatMap from "lodash/flatMap"; +import map from "lodash/map"; import Long from "long"; +import { call, put, delay } from "redux-saga/effects"; import { expectSaga, testSaga } from "redux-saga-test-plan"; import * as matchers from "redux-saga-test-plan/matchers"; -import { call, put, delay } from "redux-saga/effects"; -import { queryTimeSeries, TimeSeriesQueryRequestMessage } from "src/util/api"; import * as protos from "src/js/protos"; +import { queryTimeSeries, TimeSeriesQueryRequestMessage } from "src/util/api"; import * as metrics from "./metrics"; diff --git a/pkg/ui/workspaces/db-console/src/redux/metrics.ts b/pkg/ui/workspaces/db-console/src/redux/metrics.ts index b86211104476..b4ca22063870 100644 --- a/pkg/ui/workspaces/db-console/src/redux/metrics.ts +++ b/pkg/ui/workspaces/db-console/src/redux/metrics.ts @@ -15,17 +15,17 @@ * in the reducer by a unique ID. */ -import { Action } from "redux"; -import { delay, take, fork, call, all, put } from "redux-saga/effects"; +import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; +import flatMap from "lodash/flatMap"; import groupBy from "lodash/groupBy"; import map from "lodash/map"; -import flatMap from "lodash/flatMap"; -import { util } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; +import { delay, take, fork, call, all, put } from "redux-saga/effects"; -import { queryTimeSeries } from "src/util/api"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { queryTimeSeries } from "src/util/api"; type TSRequest = protos.cockroach.ts.tspb.TimeSeriesQueryRequest; type TSResponse = protos.cockroach.ts.tspb.TimeSeriesQueryResponse; diff --git a/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts b/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts index 565eefbcffff..f34032f47fd1 100644 --- a/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts @@ -11,9 +11,10 @@ import { createHashHistory, createMemoryHistory } from "history"; import merge from "lodash/merge"; -import { MetricConstants, INodeStatus } from "src/util/proto"; import * as protos from "src/js/protos"; +import { MetricConstants, INodeStatus } from "src/util/proto"; +import { nodesReducerObj, livenessReducerObj } from "./apiReducers"; import { nodeDisplayNameByIDSelector, selectCommissionedNodeStatuses, @@ -22,7 +23,6 @@ import { sumNodeStats, numNodesByVersionsTagSelector, } from "./nodes"; -import { nodesReducerObj, livenessReducerObj } from "./apiReducers"; import { AdminUIState, createAdminUIStore } from "./state"; function makeNodesState( diff --git a/pkg/ui/workspaces/db-console/src/redux/nodes.ts b/pkg/ui/workspaces/db-console/src/redux/nodes.ts index 153eb8eeee39..0a5187d2c798 100644 --- a/pkg/ui/workspaces/db-console/src/redux/nodes.ts +++ b/pkg/ui/workspaces/db-console/src/redux/nodes.ts @@ -8,9 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import countBy from "lodash/countBy" import each from "lodash/each" import filter from "lodash/filter" +import first from "lodash/first" +import flow from "lodash/flow" +import groupBy from "lodash/groupBy" import head from "lodash/head" import isArray from "lodash/isArray" import isEmpty from "lodash/isEmpty" @@ -18,20 +22,16 @@ import isNil from "lodash/isNil" import isUndefined from "lodash/isUndefined" import keyBy from "lodash/keyBy" import map from "lodash/map" -import uniqBy from "lodash/uniqBy" -import uniq from "lodash/uniq" -import first from "lodash/first" import sortBy from "lodash/sortBy" -import groupBy from "lodash/groupBy" -import flow from "lodash/flow" +import uniq from "lodash/uniq" +import uniqBy from "lodash/uniqBy" import { createSelector } from "reselect"; -import { util } from "@cockroachlabs/cluster-ui"; import * as protos from "src/js/protos"; +import { cockroach } from "src/js/protos"; import { Pick } from "src/util/pick"; -import { NoConnection } from "src/views/reports/containers/network"; import { nullOfReturnType } from "src/util/types"; -import { cockroach } from "src/js/protos"; +import { NoConnection } from "src/views/reports/containers/network"; import { AdminUIState } from "./state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts index 8e3fe9adba6e..ae62d4eaeda6 100644 --- a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts @@ -13,6 +13,7 @@ import { channel } from "redux-saga"; import { delay, call } from "redux-saga/effects"; import { expectSaga, testSaga } from "redux-saga-test-plan"; +import { queryManagerReducer } from "./reducer"; import { refresh, autoRefresh, @@ -25,7 +26,6 @@ import { DEFAULT_REFRESH_INTERVAL, DEFAULT_RETRY_DELAY, } from "./saga"; -import { queryManagerReducer } from "./reducer"; describe("Query Management Saga", function () { let queryCounterCalled = 0; diff --git a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts index 4a6728e88ed5..67d595da821f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts +++ b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import moment from "moment-timezone"; import { Action } from "redux"; import { channel, Task, Channel } from "redux-saga"; @@ -21,7 +22,6 @@ import { take, delay, } from "redux-saga/effects"; -import { util } from "@cockroachlabs/cluster-ui"; import { queryBegin, queryComplete, queryError } from "./reducer"; diff --git a/pkg/ui/workspaces/db-console/src/redux/sagas.ts b/pkg/ui/workspaces/db-console/src/redux/sagas.ts index 1b5c3fdf8066..5d352e94f224 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sagas.ts @@ -12,15 +12,15 @@ import { all, fork } from "redux-saga/effects"; import { timeScaleSaga } from "src/redux/timeScale"; -import { queryMetricsSaga } from "./metrics"; -import { localSettingsSaga } from "./localsettings"; -import { customAnalyticsSaga } from "./customAnalytics"; -import { statementsSaga } from "./statements"; import { analyticsSaga } from "./analyticsSagas"; -import { sessionsSaga } from "./sessions"; -import { sqlStatsSaga } from "./sqlStats"; +import { customAnalyticsSaga } from "./customAnalytics"; import { indexUsageStatsSaga } from "./indexUsageStats"; import { jobsSaga } from "./jobs/jobsSagas"; +import { localSettingsSaga } from "./localsettings"; +import { queryMetricsSaga } from "./metrics"; +import { sessionsSaga } from "./sessions"; +import { sqlStatsSaga } from "./sqlStats"; +import { statementsSaga } from "./statements"; export default function* rootSaga() { yield all([ diff --git a/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx b/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx index 38c6cd9b6cf5..3b884a17d43b 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx +++ b/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { Action } from "redux"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "src/interfaces/action"; -import { terminateQuery, terminateSession } from "src/util/api"; -import { invalidateSessions, refreshSessions } from "src/redux/apiReducers"; +import { cockroach } from "src/js/protos"; import { terminateQueryAlertLocalSetting, terminateSessionAlertLocalSetting, } from "src/redux/alerts"; -import { cockroach } from "src/js/protos"; +import { invalidateSessions, refreshSessions } from "src/redux/apiReducers"; +import { terminateQuery, terminateSession } from "src/util/api"; import ICancelSessionRequest = cockroach.server.serverpb.ICancelSessionRequest; diff --git a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts index dafe44659444..df7ba30017ed 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts @@ -12,16 +12,16 @@ import { expectSaga } from "redux-saga-test-plan"; import { call } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { resetSQLStats } from "src/util/api"; +import { cockroach } from "src/js/protos"; import { apiReducersReducer, invalidateStatements, invalidateAllStatementDetails, } from "src/redux/apiReducers"; -import { cockroach } from "src/js/protos"; +import { resetSQLStats } from "src/util/api"; -import { resetSQLStatsSaga } from "./sqlStatsSagas"; import { resetSQLStatsFailedAction } from "./sqlStatsActions"; +import { resetSQLStatsSaga } from "./sqlStatsSagas"; describe("SQL Stats sagas", () => { describe("resetSQLStatsSaga", () => { diff --git a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts index 65764853dc97..cd01254ae948 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts @@ -11,11 +11,11 @@ import { all, call, put, takeEvery } from "redux-saga/effects"; import { cockroach } from "src/js/protos"; -import { resetSQLStats } from "src/util/api"; import { invalidateAllStatementDetails, invalidateStatements, } from "src/redux/apiReducers"; +import { resetSQLStats } from "src/util/api"; import { RESET_SQL_STATS, resetSQLStatsFailedAction } from "./sqlStatsActions"; diff --git a/pkg/ui/workspaces/db-console/src/redux/state.ts b/pkg/ui/workspaces/db-console/src/redux/state.ts index f2123dd87a6a..6cafe8fd389c 100644 --- a/pkg/ui/workspaces/db-console/src/redux/state.ts +++ b/pkg/ui/workspaces/db-console/src/redux/state.ts @@ -8,6 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { + connectRouter, + routerMiddleware, + RouterState, +} from "connected-react-router"; +import { History } from "history"; import identity from "lodash/identity"; import { createStore, @@ -19,27 +26,20 @@ import { } from "redux"; import createSagaMiddleware from "redux-saga"; import thunk, { ThunkDispatch } from "redux-thunk"; -import { - connectRouter, - routerMiddleware, - RouterState, -} from "connected-react-router"; -import { History } from "history"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createSelector } from "reselect"; import { DataFromServer } from "src/util/dataFromServer"; +import { initializeAnalytics } from "./analytics"; import { apiReducersReducer, APIReducersState } from "./apiReducers"; import { hoverReducer, HoverState } from "./hover"; import { localSettingsReducer, LocalSettingsState } from "./localsettings"; +import { loginReducer, LoginAPIState } from "./login"; import { metricsReducer, MetricsState } from "./metrics"; import { queryManagerReducer, QueryManagerState } from "./queryManager/reducer"; +import rootSaga from "./sagas"; import { timeScaleReducer, TimeScaleState } from "./timeScale"; import { uiDataReducer, UIDataState } from "./uiData"; -import { loginReducer, LoginAPIState } from "./login"; -import rootSaga from "./sagas"; -import { initializeAnalytics } from "./analytics"; import FeatureFlags = cockroach.server.serverpb.FeatureFlags; diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts index a4199a876dd7..a81c6e4c702d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action } from "redux"; import { TimeScale, api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts index e864b2094c46..f7439e2af2ff 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { expectSaga } from "redux-saga-test-plan"; import { call } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { PayloadAction, WithRequest } from "src/interfaces/action"; import { diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts index f55a5c0987dd..c608831603c7 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts @@ -8,6 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + TimeScale, + api as clusterApi, + api as clusterUiApi, +} from "@cockroachlabs/cluster-ui"; import { all, call, @@ -16,23 +21,18 @@ import { takeEvery, takeLatest, } from "redux-saga/effects"; -import { - TimeScale, - api as clusterApi, - api as clusterUiApi, -} from "@cockroachlabs/cluster-ui"; import { PayloadAction, WithRequest } from "src/interfaces/action"; +import { + createStatementDiagnosticsAlertLocalSetting, + cancelStatementDiagnosticsAlertLocalSetting, +} from "src/redux/alerts"; import { invalidateStatementDiagnosticsRequests, RECEIVE_STATEMENT_DIAGNOSTICS_REPORT, refreshStatementDiagnosticsRequests, statementDiagnosticInvalidationPeriod, } from "src/redux/apiReducers"; -import { - createStatementDiagnosticsAlertLocalSetting, - cancelStatementDiagnosticsAlertLocalSetting, -} from "src/redux/alerts"; import { setTimeScale } from "src/redux/timeScale"; import { diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts index f3ebc42e29a0..df0438e13d0a 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import orderBy from "lodash/orderBy"; +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import flow from "lodash/flow"; import groupBy from "lodash/groupBy"; import mapValues from "lodash/mapValues"; -import flow from "lodash/flow"; -import { createSelector } from "reselect"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import orderBy from "lodash/orderBy"; import moment from "moment-timezone"; +import { createSelector } from "reselect"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/timeScale.ts b/pkg/ui/workspaces/db-console/src/redux/timeScale.ts index 3ebc67f52696..48c0b7f30e68 100644 --- a/pkg/ui/workspaces/db-console/src/redux/timeScale.ts +++ b/pkg/ui/workspaces/db-console/src/redux/timeScale.ts @@ -13,19 +13,19 @@ * metrics graphs in the ui. */ -import { Action } from "redux"; -import { put, takeEvery, all } from "redux-saga/effects"; -import cloneDeep from "lodash/cloneDeep"; import { defaultTimeScaleOptions, TimeScale } from "@cockroachlabs/cluster-ui"; +import cloneDeep from "lodash/cloneDeep"; import moment from "moment-timezone"; +import { Action } from "redux"; +import { put, takeEvery, all } from "redux-saga/effects"; import { createSelector } from "reselect"; import { PayloadAction } from "src/interfaces/action"; -import { AdminUIState } from "src/redux/state"; import { getValueFromSessionStorage, setLocalSetting, } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { invalidateExecutionInsights, diff --git a/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts b/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts index 1ba25000302d..4ac744bdd7ed 100644 --- a/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts @@ -9,12 +9,12 @@ // licenses/APL.txt. import keys from "lodash/keys" -import { Action } from "redux"; import * as protobuf from "protobufjs/minimal"; +import { Action } from "redux"; -import fetchMock from "src/util/fetch-mock"; import * as protos from "src/js/protos"; import * as api from "src/util/api"; +import fetchMock from "src/util/fetch-mock"; import * as uidata from "./uiData"; diff --git a/pkg/ui/workspaces/db-console/src/redux/uiData.ts b/pkg/ui/workspaces/db-console/src/redux/uiData.ts index 5583d134ac62..7286006a19fc 100644 --- a/pkg/ui/workspaces/db-console/src/redux/uiData.ts +++ b/pkg/ui/workspaces/db-console/src/redux/uiData.ts @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action, Dispatch } from "redux"; -import * as protobuf from "protobufjs/minimal"; -import isNil from "lodash/isNil"; import clone from "lodash/clone"; import each from "lodash/each"; import filter from "lodash/filter"; -import map from "lodash/map"; import has from "lodash/has"; +import isNil from "lodash/isNil"; +import map from "lodash/map"; +import * as protobuf from "protobufjs/minimal"; +import { Action, Dispatch } from "redux"; -import { getUIData, setUIData } from "src/util/api"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { getUIData, setUIData } from "src/util/api"; import { AdminUIState } from "./state"; diff --git a/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx b/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx index 6ae89210162f..6e625918bcf7 100644 --- a/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { StatementLinkTarget } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Redirect, match as Match } from "react-router-dom"; -import { StatementLinkTarget } from "@cockroachlabs/cluster-ui"; -import { getMatchParamByName } from "src/util/query"; import { appAttr, databaseAttr, implicitTxnAttr, statementAttr, } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; type Props = { match: Match; diff --git a/pkg/ui/workspaces/db-console/src/routes/visualization.tsx b/pkg/ui/workspaces/db-console/src/routes/visualization.tsx index bab0c6361572..b5575659ebfb 100644 --- a/pkg/ui/workspaces/db-console/src/routes/visualization.tsx +++ b/pkg/ui/workspaces/db-console/src/routes/visualization.tsx @@ -11,8 +11,8 @@ import React from "react"; import { Route, Switch, Redirect } from "react-router-dom"; -import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import ClusterOverview from "src/views/cluster/containers/clusterOverview"; +import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; class NodesWrapper extends React.Component<{}, {}> { render() { diff --git a/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx b/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx index 320fc88321fc..06836c31d2d7 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx +++ b/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { mount, ReactWrapper } from "enzyme"; -import { Action, Store } from "redux"; -import { Provider } from "react-redux"; import { ConnectedRouter } from "connected-react-router"; +import { mount, ReactWrapper } from "enzyme"; import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; +import { Action, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts b/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts index d3f46ed1a7d4..32a2d10c8f98 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts +++ b/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Store, Action, Dispatch } from "redux"; -import Long from "long"; import clone from "lodash/clone"; +import Long from "long"; +import { Store, Action, Dispatch } from "redux"; -import { AdminUIState } from "src/redux/state"; -import { RECEIVE, RequestWithResponse, WithID } from "src/redux/metrics"; import { PayloadAction } from "src/interfaces/action"; import { cockroach } from "src/js/protos"; +import { RECEIVE, RequestWithResponse, WithID } from "src/redux/metrics"; +import { AdminUIState } from "src/redux/state"; import ITimeSeriesDatapoint = cockroach.ts.tspb.ITimeSeriesDatapoint; diff --git a/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx b/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx index 524ce90c30a4..17e5ae2f81f7 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx +++ b/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { configureStore } from "@reduxjs/toolkit"; -import { Provider } from "react-redux"; -import { createMemoryHistory } from "history"; import { connectRouter } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; -import { AdminUIState, flagsReducer } from "src/redux/state"; import { apiReducersReducer } from "src/redux/apiReducers"; import { hoverReducer } from "src/redux/hover"; import { localSettingsReducer } from "src/redux/localsettings"; +import { loginReducer } from "src/redux/login"; import { metricsReducer } from "src/redux/metrics"; import { queryManagerReducer } from "src/redux/queryManager/reducer"; +import { AdminUIState, flagsReducer } from "src/redux/state"; import { timeScaleReducer } from "src/redux/timeScale"; import { uiDataReducer } from "src/redux/uiData"; -import { loginReducer } from "src/redux/login"; import type { PreloadedState } from "@reduxjs/toolkit"; diff --git a/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts b/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts index 194fc4baab75..5f3b9aa5ccc6 100644 --- a/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import get from "lodash/get"; -import isString from "lodash/isString"; import isNumber from "lodash/isNumber"; +import isString from "lodash/isString"; import { track } from "./trackPaginate"; diff --git a/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts b/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts index 82323d17c3d8..f19a6ad1499d 100644 --- a/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import get from "lodash/get"; -import isString from "lodash/isString"; import isNumber from "lodash/isNumber"; +import isString from "lodash/isString"; import { track } from "./trackSearch"; diff --git a/pkg/ui/workspaces/db-console/src/util/api.spec.ts b/pkg/ui/workspaces/db-console/src/util/api.spec.ts index 363394489e32..958b86918b8b 100644 --- a/pkg/ui/workspaces/db-console/src/util/api.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/api.spec.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import isError from "lodash/isError"; import startsWith from "lodash/startsWith"; -import moment from "moment-timezone"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import moment from "moment-timezone"; import { REMOTE_DEBUGGING_ERROR_TEXT, diff --git a/pkg/ui/workspaces/db-console/src/util/decorators.tsx b/pkg/ui/workspaces/db-console/src/util/decorators.tsx index 765bd6fa6ef8..01cf8250ff42 100644 --- a/pkg/ui/workspaces/db-console/src/util/decorators.tsx +++ b/pkg/ui/workspaces/db-console/src/util/decorators.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { ConnectedRouter, connectRouter } from "connected-react-router"; +import { createMemoryHistory } from "history"; import React from "react"; -import { RenderFunction } from "storybook__react"; import { Provider } from "react-redux"; import { combineReducers, createStore } from "redux"; -import { ConnectedRouter, connectRouter } from "connected-react-router"; -import { createMemoryHistory } from "history"; +import { RenderFunction } from "storybook__react"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/db-console/src/util/fakeApi.ts b/pkg/ui/workspaces/db-console/src/util/fakeApi.ts index 1f12924efb29..00578ca5185d 100644 --- a/pkg/ui/workspaces/db-console/src/util/fakeApi.ts +++ b/pkg/ui/workspaces/db-console/src/util/fakeApi.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as $protobuf from "protobufjs"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; -import moment from "moment-timezone"; import { SqlTxnResult } from "@cockroachlabs/cluster-ui/dist/types/api"; +import moment from "moment-timezone"; +import * as $protobuf from "protobufjs"; import { cockroach } from "src/js/protos"; import { API_PREFIX, STATUS_PREFIX } from "src/util/api"; diff --git a/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx b/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx index 0aeaeb273b1f..d46a89fc826b 100644 --- a/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx +++ b/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./highlightedText.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/util/localities.spec.ts b/pkg/ui/workspaces/db-console/src/util/localities.spec.ts index 44294e8cb6a5..675c5859f07c 100644 --- a/pkg/ui/workspaces/db-console/src/util/localities.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/localities.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import * as protos from "src/js/protos"; -import { LocalityTier, LocalityTree } from "src/redux/localities"; import { cockroach } from "src/js/protos"; +import { LocalityTier, LocalityTree } from "src/redux/localities"; import { generateLocalityRoute, diff --git a/pkg/ui/workspaces/db-console/src/util/localities.ts b/pkg/ui/workspaces/db-console/src/util/localities.ts index 65a1f1cfe56d..f9c1d36f7d67 100644 --- a/pkg/ui/workspaces/db-console/src/util/localities.ts +++ b/pkg/ui/workspaces/db-console/src/util/localities.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import forEach from "lodash/forEach"; -import isNil from "lodash/isNil"; import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import values from "lodash/values"; import { LocalityTier, LocalityTree } from "src/redux/localities"; diff --git a/pkg/ui/workspaces/db-console/src/util/locations.ts b/pkg/ui/workspaces/db-console/src/util/locations.ts index e4503bc86076..600197e29784 100644 --- a/pkg/ui/workspaces/db-console/src/util/locations.ts +++ b/pkg/ui/workspaces/db-console/src/util/locations.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import some from "lodash/some"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; +import some from "lodash/some"; import values from "lodash/values"; import { LocalityTier, LocalityTree } from "src/redux/localities"; diff --git a/pkg/ui/workspaces/db-console/src/util/query.spec.ts b/pkg/ui/workspaces/db-console/src/util/query.spec.ts index 284a1f19112c..9cc176838d91 100644 --- a/pkg/ui/workspaces/db-console/src/util/query.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/query.spec.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Location } from "history"; import mapValues from "lodash/mapValues"; import toString from "lodash/toString"; -import { Location } from "history"; import Long from "long"; import { propsToQueryString, queryByName } from "./query"; diff --git a/pkg/ui/workspaces/db-console/src/util/query.ts b/pkg/ui/workspaces/db-console/src/util/query.ts index 220ae483965a..650e29536334 100644 --- a/pkg/ui/workspaces/db-console/src/util/query.ts +++ b/pkg/ui/workspaces/db-console/src/util/query.ts @@ -9,9 +9,9 @@ // licenses/APL.txt. import { Location } from "history"; +import compact from "lodash/compact"; import isNull from "lodash/isNull"; import isUndefined from "lodash/isUndefined"; -import compact from "lodash/compact"; import map from "lodash/map"; import { match as Match } from "react-router-dom"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx index 6292cfb5fb99..77c540705654 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { Button, Form, Input } from "antd"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import CancelIcon from "assets/cancel.svg"; import SearchIcon from "assets/search.svg"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx index bc84dc934a2f..92f8b6702793 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Search } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx index f145992a9048..f608e13c6202 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx @@ -14,8 +14,8 @@ import { Link, withRouter, RouteComponentProps } from "react-router-dom"; import { SideNavigation } from "src/components"; import "./navigation-bar.styl"; -import { AdminUIState } from "src/redux/state"; import { isSingleNodeCluster } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; interface RouteParam { path: string; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx index b26673a1aea6..738c49063557 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; import { createMemoryHistory, History } from "history"; +import React from "react"; import { match as Match } from "react-router"; import { Sidebar } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx index caeb19bfb459..d2239f4b8bc7 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx @@ -11,12 +11,12 @@ import React from "react"; import { connect } from "react-redux"; +import { doLogout, LoginState, selectLoginState } from "src/redux/login"; import { AdminUIState, AppDispatch } from "src/redux/state"; import { trustIcon } from "src/util/trust"; +import UserMenu from "src/views/app/components/userMenu"; import Popover from "src/views/shared/components/popover"; import UserAvatar from "src/views/shared/components/userAvatar"; -import UserMenu from "src/views/app/components/userMenu"; -import { doLogout, LoginState, selectLoginState } from "src/redux/login"; import unlockedIcon from "!!raw-loader!assets/unlocked.svg"; import "./loginIndicator.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx index 8caf84320b96..2573c750e07b 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx @@ -7,9 +7,9 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; import fetchMock from "fetch-mock"; +import React from "react"; import { getCookieValue } from "src/redux/cookies"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx index 9e41e4182ea3..3941b48a95c4 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx @@ -7,8 +7,8 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Dropdown } from "@cockroachlabs/cluster-ui"; +import React from "react"; import { getCookieValue, setCookie } from "src/redux/cookies"; import { isSystemTenant } from "src/redux/tenants"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx index db06caa362c5..be2043d9014a 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx @@ -9,12 +9,12 @@ // licenses/APL.txt. import React from "react"; -import { Action, Dispatch, bindActionCreators } from "redux"; import { connect } from "react-redux"; +import { Action, Dispatch, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; import { Alert, bannerAlertsSelector } from "src/redux/alerts"; import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; import { AlertMessage } from "src/views/shared/components/alertMessage"; import "./alertbanner.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx index 5603c0325a7d..f95f32213eda 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx @@ -8,24 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Badge } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Helmet } from "react-helmet"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import { Badge } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import NavigationBar from "src/views/app/components/layoutSidebar"; -import ErrorBoundary from "src/views/app/components/errorMessage/errorBoundary"; -import TimeWindowManager from "src/views/app/containers/metricsTimeManager"; -import AlertBanner from "src/views/app/containers/alertBanner"; -import RequireLogin from "src/views/login/requireLogin"; -import { - clusterIdSelector, - clusterNameSelector, - clusterVersionLabelSelector, -} from "src/redux/nodes"; -import { AdminUIState } from "src/redux/state"; -import LoginIndicator from "src/views/app/components/loginIndicator"; import { GlobalNavigation, CockroachLabsLockupIcon, @@ -35,7 +23,19 @@ import { Text, TextTypes, } from "src/components"; +import { + clusterIdSelector, + clusterNameSelector, + clusterVersionLabelSelector, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { getDataFromServer } from "src/util/dataFromServer"; +import ErrorBoundary from "src/views/app/components/errorMessage/errorBoundary"; +import NavigationBar from "src/views/app/components/layoutSidebar"; +import LoginIndicator from "src/views/app/components/loginIndicator"; +import AlertBanner from "src/views/app/containers/alertBanner"; +import TimeWindowManager from "src/views/app/containers/metricsTimeManager"; +import RequireLogin from "src/views/login/requireLogin"; import "./layout.styl"; import "./layoutPanel.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx index c4bd786b02e2..f9d3b37f9de8 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "antd"; -import { useSelector } from "react-redux"; import classNames from "classnames/bind"; import moment from "moment"; +import React from "react"; +import { useSelector } from "react-redux"; import ErrorIcon from "assets/error-circle.svg"; import InfoIcon from "assets/info-filled-circle.svg"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx index 27aa0547b3e3..ececd9ee571a 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import isEqual from "lodash/isEqual"; +import moment from "moment-timezone"; import React from "react"; import { connect } from "react-redux"; -import moment from "moment-timezone"; -import isEqual from "lodash/isEqual"; import { AdminUIState } from "src/redux/state"; import * as timewindow from "src/redux/timeScale"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx index 80dab4baba59..52fe6e6bf615 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; -import moment from "moment-timezone"; import clone from "lodash/clone"; +import moment from "moment-timezone"; +import React from "react"; import * as timewindow from "src/redux/timeScale"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx index bf5f2def85d6..9b025b9c9e1a 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import moment from "moment-timezone"; -import { createSelector } from "reselect"; import { calculateXAxisDomain, calculateYAxisDomain, @@ -24,15 +21,20 @@ import { TimeWindow, WithTimezone, } from "@cockroachlabs/cluster-ui"; -import uPlot from "uplot"; -import "uplot/dist/uPlot.min.css"; -import Long from "long"; import { Tooltip } from "antd"; -import flatMap from "lodash/flatMap"; import filter from "lodash/filter"; +import flatMap from "lodash/flatMap"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { createSelector } from "reselect"; +import uPlot from "uplot"; +import "uplot/dist/uPlot.min.css"; import * as protos from "src/js/protos"; import { hoverOff, hoverOn, HoverState } from "src/redux/hover"; +import { isSecondaryTenant } from "src/redux/tenants"; +import { unique } from "src/util/arrays"; import { findChildrenOfType } from "src/util/find"; import { canShowMetric, @@ -40,6 +42,7 @@ import { formatMetricData, formattedSeries, } from "src/views/cluster/util/graphs"; +import { MonitoringIcon } from "src/views/shared/components/icons/monitoring"; import { Axis, AxisProps, @@ -48,9 +51,6 @@ import { MetricsDataComponentProps, QueryTimeInfo, } from "src/views/shared/components/metricQuery"; -import { isSecondaryTenant } from "src/redux/tenants"; -import { MonitoringIcon } from "src/views/shared/components/icons/monitoring"; -import { unique } from "src/util/arrays"; import "./linegraph.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx index b8bbe5dae8fc..34c1b0bccf9c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { shallow, ShallowWrapper } from "enzyme"; -import React from "react"; -import uPlot from "uplot"; -import isEmpty from "lodash/isEmpty"; -import flatMap from "lodash/flatMap"; import { calculateXAxisDomain, calculateYAxisDomain, util, } from "@cockroachlabs/cluster-ui"; +import { shallow, ShallowWrapper } from "enzyme"; +import flatMap from "lodash/flatMap"; +import isEmpty from "lodash/isEmpty"; import Long from "long"; +import React from "react"; +import uPlot from "uplot"; -import * as timewindow from "src/redux/timeScale"; import * as protos from "src/js/protos"; -import { Axis } from "src/views/shared/components/metricQuery"; +import * as timewindow from "src/redux/timeScale"; import { configureUPlotLineChart } from "src/views/cluster/util/graphs"; +import { Axis } from "src/views/shared/components/metricQuery"; import LineGraph, { fillGaps, InternalLineGraph, OwnProps } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx index 8ca81c7108cf..697fdaab85fa 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import d3 from "d3"; import { util } from "@cockroachlabs/cluster-ui"; +import d3 from "d3"; const LOW_DISK_SPACE_RATIO = 0.15; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx index a79ad6cfbc5b..6d67b10afa6d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import classNames from "classnames"; import d3 from "d3"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { createSelector } from "reselect"; -import { util } from "@cockroachlabs/cluster-ui"; import spinner from "assets/spinner.gif"; -import { AdminUIState } from "src/redux/state"; -import { nodeSumsSelector } from "src/redux/nodes"; -import createChartComponent from "src/views/shared/util/d3-react"; import { refreshNodes, refreshLiveness } from "src/redux/apiReducers"; -import OverviewListAlerts from "src/views/shared/containers/alerts/overviewListAlerts"; +import { nodeSumsSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import EmailSubscription from "src/views/dashboard/emailSubscription"; +import OverviewListAlerts from "src/views/shared/containers/alerts/overviewListAlerts"; +import createChartComponent from "src/views/shared/util/d3-react"; import capacityChart from "./capacity"; import "./cluster.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx index abd586e0ccd3..b0fc3cb4218c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx @@ -11,6 +11,7 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { clusterStore, nodeLivenessIssues, @@ -18,7 +19,6 @@ import { reviewOfCockroachTerminology, howAreCapacityMetricsCalculatedOverview, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export const CapacityUsageTooltip: React.FC = props => ( { name: string; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx index cd1a36e9f457..5f78ec1fb334 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { mount, shallow } from "enzyme"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { mount, shallow } from "enzyme"; import each from "lodash/each"; +import React from "react"; +import { refreshEvents } from "src/redux/apiReducers"; +import { allEvents } from "src/util/eventTypes"; import { EventBoxUnconnected as EventBox, EventRow, getEventInfo, } from "src/views/cluster/containers/events"; -import { refreshEvents } from "src/redux/apiReducers"; -import { allEvents } from "src/util/eventTypes"; import { ToolTipWrapper } from "src/views/shared/components/toolTip"; function makeEventBox( diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx index a50db1e14b68..e8d8643ae82d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx @@ -8,13 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; -import take from "lodash/take"; -import moment from "moment-timezone"; -import React, { useContext } from "react"; -import { Helmet } from "react-helmet"; -import { Link, RouteComponentProps, withRouter } from "react-router-dom"; -import { connect } from "react-redux"; import { Loading, SortSetting, @@ -25,6 +18,13 @@ import { WithTimezone, } from "@cockroachlabs/cluster-ui"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import map from "lodash/map"; +import take from "lodash/take"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { refreshEvents } from "src/redux/apiReducers"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx index e012dbaf3173..94404ba1456c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Axis, Metric } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx index d84e74fe1b21..2c40a16fa1f9 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits, util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import { cockroach } from "src/js/protos"; import { GraphDashboardProps } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx index 2e6877a01cdb..6d716e44e8d5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx index 29109f69e341..7d0a89a25ae4 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx @@ -10,8 +10,8 @@ import React from "react"; -import * as docsURL from "src/util/docs"; import { Anchor } from "src/components"; +import * as docsURL from "src/util/docs"; export const CapacityGraphTooltip: React.FC<{ tooltipSelection?: string }> = ({ tooltipSelection, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx index 9fa06bf0a79a..e5780cc2d76f 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { AvailableDiscCapacityGraphTooltip } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx index 3daa8477d3b6..eedd545c4ed5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits, util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import { cockroach } from "src/js/protos"; import { GraphDashboardProps, nodeDisplayName } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx index cf260e59b548..444d5ac7d143 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Axis, Metric } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx index a60437dbe06f..2f487618880a 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx index dd41ca41b44c..231ab23c4981 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { CapacityGraphTooltip } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx index ccb71b05a474..0773a435bc65 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx index 9d1b061f8994..91c3682abfd3 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { CircuitBreakerTrippedReplicasTooltip, LogicalBytesGraphTooltip, PausedFollowersTooltip, ReceiverSnapshotsQueuedTooltip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; -import { cockroach } from "src/js/protos"; +import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx index 786d76f162ef..9ba4790bca03 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx index 80c390cff037..1d2154dbdb59 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { StatementDenialsClusterSettingsTooltip, TransactionRestartsToolTip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, nodeDisplayName } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx index 54e1bbefbb43..5458b4a2f72f 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis, MetricProps } from "src/views/shared/components/metricQuery"; import { CapacityGraphTooltip, LiveBytesGraphTooltip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis, MetricProps } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx index 13bbce554c11..e50c8e445ab5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx index 4d6d2c3376d5..f6cb3be6c635 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx @@ -8,33 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; +import { Anchor, TimeScale } from "@cockroachlabs/cluster-ui"; import has from "lodash/has"; +import map from "lodash/map"; +import moment from "moment-timezone"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { withRouter, RouteComponentProps } from "react-router-dom"; -import { Anchor, TimeScale } from "@cockroachlabs/cluster-ui"; -import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { - nodeIDAttr, - dashboardNameAttr, - tenantNameAttr, -} from "src/util/constants"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; -import { - PageConfig, - PageConfigItem, -} from "src/views/shared/components/pageconfig"; -import { AdminUIState } from "src/redux/state"; +import { InlineAlert } from "src/components"; +import { PayloadAction } from "src/interfaces/action"; import { refreshNodes, refreshLiveness, refreshSettings, refreshTenantsList, } from "src/redux/apiReducers"; +import { + selectResolution10sStorageTTL, + selectResolution30mStorageTTL, +} from "src/redux/clusterSettings"; +import { getCookieValue } from "src/redux/cookies"; import { hoverStateSelector, HoverState, @@ -49,10 +45,12 @@ import { nodeIDsStringifiedSelector, selectStoreIDsByNodeID, } from "src/redux/nodes"; -import Alerts from "src/views/shared/containers/alerts"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { getMatchParamByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; +import { AdminUIState } from "src/redux/state"; +import { + containsApplicationTenants, + isSystemTenant, + tenantDropdownOptions, +} from "src/redux/tenants"; import { setMetricsFixedWindow, TimeWindow, @@ -60,41 +58,43 @@ import { setTimeScale, selectTimeScale, } from "src/redux/timeScale"; -import { InlineAlert } from "src/components"; -import { reduceStorageOfTimeSeriesDataOperationalFlags } from "src/util/docs"; import { - selectResolution10sStorageTTL, - selectResolution30mStorageTTL, -} from "src/redux/clusterSettings"; + nodeIDAttr, + dashboardNameAttr, + tenantNameAttr, +} from "src/util/constants"; import { getDataFromServer } from "src/util/dataFromServer"; -import { getCookieValue } from "src/redux/cookies"; +import { reduceStorageOfTimeSeriesDataOperationalFlags } from "src/util/docs"; +import { getMatchParamByName } from "src/util/query"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { - containsApplicationTenants, - isSystemTenant, - tenantDropdownOptions, -} from "src/redux/tenants"; + PageConfig, + PageConfigItem, +} from "src/views/shared/components/pageconfig"; +import Alerts from "src/views/shared/containers/alerts"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import TimeScaleDropdown from "../timeScaleDropdownWithSearchParams"; +import changefeedsDashboard from "./dashboards/changefeeds"; +import crossClusterReplicationDashboard from "./dashboards/crossClusterReplication"; import { GraphDashboardProps, storeIDsForNode, } from "./dashboards/dashboardUtils"; +import distributedDashboard from "./dashboards/distributed"; +import hardwareDashboard from "./dashboards/hardware"; +import logicalDataReplicationDashboard from "./dashboards/logicalDataReplication"; +import networkingDashboard from "./dashboards/networking"; +import overloadDashboard from "./dashboards/overload"; import overviewDashboard from "./dashboards/overview"; +import queuesDashboard from "./dashboards/queues"; +import replicationDashboard from "./dashboards/replication"; +import requestsDashboard from "./dashboards/requests"; import runtimeDashboard from "./dashboards/runtime"; import sqlDashboard from "./dashboards/sql"; import storageDashboard from "./dashboards/storage"; -import replicationDashboard from "./dashboards/replication"; -import distributedDashboard from "./dashboards/distributed"; -import queuesDashboard from "./dashboards/queues"; -import requestsDashboard from "./dashboards/requests"; -import hardwareDashboard from "./dashboards/hardware"; -import changefeedsDashboard from "./dashboards/changefeeds"; -import overloadDashboard from "./dashboards/overload"; import ttlDashboard from "./dashboards/ttl"; -import crossClusterReplicationDashboard from "./dashboards/crossClusterReplication"; -import logicalDataReplicationDashboard from "./dashboards/logicalDataReplication"; -import networkingDashboard from "./dashboards/networking"; import ClusterSummaryBar from "./summaryBar"; interface GraphDashboard { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx index ea92d184be00..783d3c318e4d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow, mount } from "enzyme"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; import { createSandbox } from "sinon"; -import { SummaryStatBreakdown } from "src/views/shared/components/summaryBar"; -import { renderWithProviders } from "src/test-utils/renderWithProviders"; import { NodeSummaryStats } from "src/redux/nodes"; import * as nodes from "src/redux/nodes"; +import { renderWithProviders } from "src/test-utils/renderWithProviders"; +import { SummaryStatBreakdown } from "src/views/shared/components/summaryBar"; import * as summaryBar from "./summaryBar"; import { ClusterNodeTotals } from "./summaryBar"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx index baeb019c0f54..7d2a361d987b 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx @@ -8,14 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; +import * as d3 from "d3"; import React from "react"; import { useSelector } from "react-redux"; import { Link } from "react-router-dom"; -import * as d3 from "d3"; -import { util } from "@cockroachlabs/cluster-ui"; import { createSelector } from "reselect"; +import { Tooltip, Anchor } from "src/components"; import { nodeStatusesSelector, nodeSumsSelector } from "src/redux/nodes"; +import { howAreCapacityMetricsCalculated } from "src/util/docs"; import { EventBox } from "src/views/cluster/containers/events"; import { Metric } from "src/views/shared/components/metricQuery"; import { @@ -27,8 +29,6 @@ import { SummaryStatMessage, SummaryMetricsAggregator, } from "src/views/shared/components/summaryBar"; -import { Tooltip, Anchor } from "src/components"; -import { howAreCapacityMetricsCalculated } from "src/util/docs"; /** * ClusterNodeTotals displays a high-level breakdown of the nodes on the cluster diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx index aead0307dad2..6e12e72394bd 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import sortBy from "lodash/sortBy"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, SortedTable, util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import sortBy from "lodash/sortBy"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; -import { INodeStatus } from "src/util/proto"; -import { nodeIDAttr } from "src/util/constants"; -import { LogEntriesResponseMessage } from "src/util/api"; -import { AdminUIState } from "src/redux/state"; import { refreshLogs, refreshNodes } from "src/redux/apiReducers"; -import { currentNode } from "src/views/cluster/containers/nodeOverview"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { getDisplayName } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { LogEntriesResponseMessage } from "src/util/api"; +import { nodeIDAttr } from "src/util/constants"; +import { INodeStatus } from "src/util/proto"; import { getMatchParamByName } from "src/util/query"; +import { currentNode } from "src/views/cluster/containers/nodeOverview"; import "./logs.styl"; type LogEntries = protos.cockroach.util.log.IEntry; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx index 64a86c8666c0..a2f8136f1baa 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; +import { Button, util, Timestamp } from "@cockroachlabs/cluster-ui"; +import { ArrowLeft } from "@cockroachlabs/icons"; import find from "lodash/find"; +import map from "lodash/map"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { Button, util, Timestamp } from "@cockroachlabs/cluster-ui"; -import { ArrowLeft } from "@cockroachlabs/icons"; import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx index 48acda2a520d..96c5b8dbb7b1 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx @@ -11,6 +11,7 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { keyValuePairs, writeIntents, @@ -18,7 +19,6 @@ import { clusterStore, capacityMetrics, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export type CellTooltipProps = { nodeName?: string; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx index 3f5b61a62a93..272abd7ecad7 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx @@ -8,24 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import { connect } from "react-redux"; -import moment, { Moment } from "moment-timezone"; -import { createSelector } from "reselect"; -import isUndefined from "lodash/isUndefined"; +import { Badge, BadgeProps, ColumnsConfig, SortSetting, Table, Timestamp, util, } from "@cockroachlabs/cluster-ui"; +import capitalize from "lodash/capitalize"; +import flow from "lodash/flow"; +import groupBy from "lodash/groupBy"; import head from "lodash/head"; import isEmpty from "lodash/isEmpty"; -import groupBy from "lodash/groupBy"; -import capitalize from "lodash/capitalize"; +import isUndefined from "lodash/isUndefined"; import last from "lodash/last"; import map from "lodash/map"; import orderBy from "lodash/orderBy"; -import take from "lodash/take"; import sum from "lodash/sum"; -import flow from "lodash/flow"; -import { Badge, BadgeProps, ColumnsConfig, SortSetting, Table, Timestamp, util, } from "@cockroachlabs/cluster-ui"; +import take from "lodash/take"; +import moment, { Moment } from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { Link } from "react-router-dom"; +import { createSelector } from "reselect"; +import { Text, TextTypes, Tooltip } from "src/components"; +import { cockroach } from "src/js/protos"; +import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; +import { LocalityTier } from "src/redux/localities"; +import { LocalSetting } from "src/redux/localsettings"; import { LivenessStatus, nodeCapacityStats, @@ -34,14 +39,9 @@ import { selectNodesSummaryValid, } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; -import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { INodeStatus, MetricConstants } from "src/util/proto"; -import { Text, TextTypes, Tooltip } from "src/components"; import { FixLong } from "src/util/fixLong"; import { getNodeLocalityTiers } from "src/util/localities"; -import { LocalityTier } from "src/redux/localities"; -import { cockroach } from "src/js/protos"; +import { INodeStatus, MetricConstants } from "src/util/proto"; import TableSection from "./tableSection"; import "./nodes.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx index 3e83f558c8b8..3136547bd68e 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { SortSetting } from "@cockroachlabs/cluster-ui"; import { ReactWrapper } from "enzyme"; import times from "lodash/times"; import Long from "long"; -import { SortSetting } from "@cockroachlabs/cluster-ui"; +import React from "react"; -import { AdminUIState } from "src/redux/state"; -import { LocalSetting } from "src/redux/localsettings"; -import { connectedMount } from "src/test-utils"; import { cockroach } from "src/js/protos"; +import { LocalSetting } from "src/redux/localsettings"; import { livenessByNodeIDSelector, LivenessStatus } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { connectedMount } from "src/test-utils"; import { decommissionedNodesTableDataSelector, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx index b9b5d4d6209d..19a20376caed 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { CaretLeftOutlined, CaretDownOutlined } from "@ant-design/icons"; +import cn from "classnames"; import * as React from "react"; import { connect } from "react-redux"; -import cn from "classnames"; -import { CaretLeftOutlined, CaretDownOutlined } from "@ant-design/icons"; import { Action, Dispatch } from "redux"; +import { Text, TextTypes } from "src/components"; import { LocalSetting, setLocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; -import { Text, TextTypes } from "src/components"; import "./tableSection.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx index 3be0cc930c09..f01780a7894d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx @@ -11,10 +11,10 @@ import React from "react"; import { Anchor, Tooltip, Text } from "src/components"; -import { nodeLivenessIssues, howItWork, capacityMetrics } from "src/util/docs"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { LivenessStatus } from "src/redux/nodes"; +import { nodeLivenessIssues, howItWork, capacityMetrics } from "src/util/docs"; import { NodeStatusRow } from "src/views/cluster/containers/nodesOverview/index"; -import { TooltipProps } from "src/components/tooltip/tooltip"; import { AggregatedNodeStatus } from "."; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx index f4270a6a8856..53fc7e13fdfd 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect } from "react"; -import { useHistory } from "react-router-dom"; -import { connect } from "react-redux"; import { defaultTimeScaleOptions, TimeScaleDropdown, @@ -19,12 +16,15 @@ import { TimeWindow, findClosestTimeScale, } from "@cockroachlabs/cluster-ui"; -import { createSelector } from "reselect"; import moment from "moment-timezone"; +import React, { useEffect } from "react"; +import { connect } from "react-redux"; +import { useHistory } from "react-router-dom"; +import { createSelector } from "reselect"; -import * as timewindow from "src/redux/timeScale"; -import { AdminUIState } from "src/redux/state"; import { PayloadAction } from "src/interfaces/action"; +import { AdminUIState } from "src/redux/state"; +import * as timewindow from "src/redux/timeScale"; // The time scale dropdown from cluster-ui that updates route params as // options are selected. diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts b/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts index a068151f5b37..700106d7da97 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts +++ b/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import isEmpty from "lodash/isEmpty"; +import { AxisDomain } from "@cockroachlabs/cluster-ui"; import each from "lodash/each"; +import isEmpty from "lodash/isEmpty"; import without from "lodash/without"; -import { AxisDomain } from "@cockroachlabs/cluster-ui"; +import React from "react"; import uPlot from "uplot"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx b/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx index d1b90f0b965a..1fe4232bf901 100644 --- a/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx +++ b/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx @@ -11,17 +11,17 @@ import React from "react"; import { connect } from "react-redux"; -import { EmailSubscriptionForm } from "src/views/shared/components/emailSubscriptionForm"; +import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; import { signUpForEmailSubscription } from "src/redux/customAnalytics"; -import { AdminUIState } from "src/redux/state"; import { clusterIdSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { loadUIData, RELEASE_NOTES_SIGNUP_DISMISSED_KEY, saveUIData, } from "src/redux/uiData"; import { dismissReleaseNotesSignupForm } from "src/redux/uiDataSelectors"; -import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; +import { EmailSubscriptionForm } from "src/views/shared/components/emailSubscriptionForm"; import "./emailSubscription.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts index 03b96ff03c71..bafe6cea0e78 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { DatabaseDetailsPage } from "@cockroachlabs/cluster-ui"; import { connect, ReactReduxContext } from "react-redux"; import { withRouter } from "react-router-dom"; -import { DatabaseDetailsPage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts index e2554610208a..52e7dbdc040b 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { DatabaseDetailsPageActions, DatabaseDetailsPageData, @@ -19,7 +16,10 @@ import { ViewMode, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { databaseNameAttr, indexUnusedDuration } from "src/util/constants"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts index aa4f93441361..92819e41f523 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { DatabaseDetailsPageData, defaultFilters, @@ -16,24 +15,25 @@ import { ViewMode, deriveTableDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps } from "react-router"; -import { LocalSetting } from "src/redux/localsettings"; import { refreshDatabaseDetails, refreshNodes, refreshTableDetails, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; -import { databaseNameAttr } from "src/util/constants"; -import { getMatchParamByName } from "src/util/query"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; import { selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, } from "src/redux/clusterSettings"; +import { LocalSetting } from "src/redux/localsettings"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { databaseNameAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; const sortSettingTablesLocalSetting = new LocalSetting( "sortSetting/DatabasesDetailsTablesPage", diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts index 80cc6f13debe..ae0bda7295fc 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { DatabaseTablePage } from "@cockroachlabs/cluster-ui"; import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import { DatabaseTablePage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts index e2687fe69916..2946cd439709 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts @@ -8,10 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import Long from "long"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { DatabaseTablePageActions, DatabaseTablePageData, @@ -20,7 +16,11 @@ import { util, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts index bccfd14260fc..25997c732a71 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { DatabaseTablePageData, util, deriveIndexDetailsMemoized, deriveTablePageDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps } from "react-router"; import { cockroach } from "src/js/protos"; import { @@ -24,21 +24,21 @@ import { refreshSettings, refreshUserSQLRoles, } from "src/redux/apiReducers"; -import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; -import { AdminUIState } from "src/redux/state"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; -import { selectHasAdminRole } from "src/redux/user"; import { selectAutomaticStatsCollectionEnabled, selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, selectIndexUsageStatsEnabled, } from "src/redux/clusterSettings"; -import { getMatchParamByName } from "src/util/query"; +import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { databaseNameAttr, tableNameAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; const { TableIndexStatsRequest } = cockroach.server.serverpb; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts index 16a068faf1c6..51a6ced1519d 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { DatabasesPage, DatabasesPageData, DatabasesPageActions, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts index bbb14d6c71eb..caad11fa2109 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import find from "lodash/find"; -import { bindActionCreators, Store } from "redux"; import { DatabasesPageActions, DatabasesPageData, @@ -19,10 +16,13 @@ import { api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; +import find from "lodash/find"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; -import * as fakeApi from "src/util/fakeApi"; import { indexUnusedDuration } from "src/util/constants"; +import * as fakeApi from "src/util/fakeApi"; import { mapDispatchToProps, mapStateToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts index f8a687f627f3..a5e3b27b8d2d 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts @@ -8,15 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { DatabasesPageData, defaultFilters, Filters, deriveDatabaseDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; -import { LocalSetting } from "src/redux/localsettings"; import { refreshDatabases, refreshDatabaseDetails, @@ -24,16 +23,17 @@ import { refreshSettings, refreshDatabaseDetailsSpanStats, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; import { selectAutomaticStatsCollectionEnabled, selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, } from "src/redux/clusterSettings"; +import { LocalSetting } from "src/redux/localsettings"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; const selectLoading = createSelector( (state: AdminUIState) => state.cachedData.databases, diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts index 1c4cc254dcc8..3cbc7e114846 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { IndexDetailsPage } from "@cockroachlabs/cluster-ui"; import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import { IndexDetailsPage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts index 387fe10f682a..199ed55cd9e7 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import Long from "long"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { IndexDetailPageActions, IndexDetailsPageData, util, TimeScale, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts index be3c22e4444c..772939e37989 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts @@ -15,28 +15,28 @@ import { } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router"; -import { AdminUIState } from "src/redux/state"; -import { getMatchParamByName } from "src/util/query"; -import { - databaseNameAttr, - tableNameAttr, - indexNameAttr, -} from "src/util/constants"; +import { cockroach } from "src/js/protos"; import { refreshIndexStats, refreshNodes, refreshUserSQLRoles, } from "src/redux/apiReducers"; import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; -import { longToInt } from "src/util/fixLong"; -import { cockroach } from "src/js/protos"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; import { selectHasViewActivityRedactedRole, selectHasAdminRole, } from "src/redux/user"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; +import { + databaseNameAttr, + tableNameAttr, + indexNameAttr, +} from "src/util/constants"; +import { longToInt } from "src/util/fixLong"; +import { getMatchParamByName } from "src/util/query"; import TableIndexStatsRequest = cockroach.server.serverpb.TableIndexStatsRequest; const { RecommendationType } = cockroach.sql.IndexRecommendation; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx index dd4bba7685d9..9e30c2139f21 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimeScale } from "@cockroachlabs/cluster-ui"; import isString from "lodash/isString"; import map from "lodash/map"; import React from "react"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { TimeScale } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { hoverOff as hoverOffAction, @@ -31,7 +32,9 @@ import { } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { TimeWindow, setMetricsFixedWindow } from "src/redux/timeScale"; import { nodeIDAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; import { GraphDashboardProps, storeIDsForNode, @@ -43,9 +46,6 @@ import { PageConfigItem, } from "src/views/shared/components/pageconfig"; import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { getMatchParamByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; -import { TimeWindow, setMetricsFixedWindow } from "src/redux/timeScale"; import messagesDashboard from "./messages"; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx index 519a8b780f5d..faf8b36eb337 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps } from "src/views/cluster/containers/nodeGraphs/dashboards/dashboardUtils"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; export default function (props: GraphDashboardProps) { const { nodeSources, tooltipSelection } = props; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx index db1400447e1d..461b77ff7e60 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import filter from "lodash/filter"; import flatMap from "lodash/flatMap"; +import flow from "lodash/flow"; import map from "lodash/map"; +import sortBy from "lodash/sortBy"; import uniq from "lodash/uniq"; import values from "lodash/values"; -import sortBy from "lodash/sortBy"; -import flow from "lodash/flow"; import React from "react"; import ReactPaginate from "react-paginate"; import { connect } from "react-redux"; import { Link, RouteComponentProps, withRouter } from "react-router-dom"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import * as protos from "src/js/protos"; import { refreshRaft } from "src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx index 83e6f19d0453..588ee4d801c9 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useState, useMemo } from "react"; -import ReactDOM from "react-dom"; import { Button, FilterCheckboxOption, @@ -19,12 +17,14 @@ import { FilterSearchOption, } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import isEmpty from "lodash/isEmpty"; +import classNames from "classnames/bind"; import isArray from "lodash/isArray"; +import isEmpty from "lodash/isEmpty"; import isString from "lodash/isString"; -import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import noop from "lodash/noop"; +import React, { useCallback, useEffect, useState, useMemo } from "react"; +import ReactDOM from "react-dom"; +import { useHistory } from "react-router-dom"; import styles from "./hotRanges.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx index da9493cb4d25..f4631353bf90 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import { Tooltip } from "antd"; import { ColumnDescriptor, SortedTable, @@ -21,19 +18,22 @@ import { EmptyTable, util, } from "@cockroachlabs/cluster-ui"; +import { Tooltip } from "antd"; import classNames from "classnames/bind"; import round from "lodash/round"; +import React, { useState } from "react"; import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import emptyTableResultsImg from "assets/emptyState/empty-table-results.svg"; +import { sortSettingLocalSetting } from "oss/src/redux/hotRanges"; +import { AdminUIState } from "oss/src/redux/state"; import { cockroach } from "src/js/protos"; import { performanceBestPracticesHotSpots, readsAndWritesOverviewPage, uiDebugPages, } from "src/util/docs"; -import { sortSettingLocalSetting } from "oss/src/redux/hotRanges"; -import { AdminUIState } from "oss/src/redux/state"; import styles from "./hotRanges.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx index 879221d31666..64cff3c8c43d 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { useDispatch, useSelector } from "react-redux"; -import React, { useRef, useEffect, useState, useContext } from "react"; -import { Helmet } from "react-helmet"; import { Loading, Text, @@ -19,9 +16,12 @@ import { TimezoneContext, } from "@cockroachlabs/cluster-ui"; import classNames from "classnames/bind"; +import React, { useRef, useEffect, useState, useContext } from "react"; +import { Helmet } from "react-helmet"; +import { useDispatch, useSelector } from "react-redux"; -import { refreshHotRanges } from "src/redux/apiReducers"; import { cockroach } from "src/js/protos"; +import { refreshHotRanges } from "src/redux/apiReducers"; import { hotRangesSelector, isLoadingSelector, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx b/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx index c80ca4af87f9..cf411f68a393 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx @@ -11,16 +11,16 @@ // All changes made on this file, should also be done on the equivalent // file on managed-service repo. +import { commonStyles, util } from "@cockroachlabs/cluster-ui"; +import { Tabs } from "antd"; import React, { useState } from "react"; import Helmet from "react-helmet"; -import { Tabs } from "antd"; -import { commonStyles, util } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router-dom"; import { tabAttr, viewAttr } from "src/util/constants"; -import WorkloadInsightsPage from "./workloadInsightsPage"; import SchemaInsightsPage from "./schemaInsightsPage"; +import WorkloadInsightsPage from "./workloadInsightsPage"; const { TabPane } = Tabs; diff --git a/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts b/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts index 6cd21f729bfc..4ce1c9917fb4 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts +++ b/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { defaultFilters, WorkloadInsightEventFilters, @@ -24,6 +23,7 @@ import { api, util, } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; import { LocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx index d3c276d34332..6ecaa1cd2e43 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { SchemaInsightEventFilters, SchemaInsightsView, @@ -17,12 +15,16 @@ import { SchemaInsightsViewStateProps, SortSetting, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { refreshSchemaInsights, refreshUserSQLRoles, } from "src/redux/apiReducers"; +import { selectDropUnusedIndexDuration } from "src/redux/clusterSettings"; import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { schemaInsightsFiltersLocalSetting, schemaInsightsSortLocalSetting, @@ -31,8 +33,6 @@ import { selectSchemaInsightsMaxApiReached, selectSchemaInsightsTypes, } from "src/views/insights/insightsSelectors"; -import { selectHasAdminRole } from "src/redux/user"; -import { selectDropUnusedIndexDuration } from "src/redux/clusterSettings"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx index 4e5a15d0c2fb..76f24c09daa3 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx @@ -15,12 +15,12 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshUserSQLRoles } from "src/redux/apiReducers"; -import { selectStatementInsightDetails } from "src/views/insights/insightsSelectors"; +import { AdminUIState } from "src/redux/state"; import { setGlobalTimeScaleAction } from "src/redux/statements"; import { selectTimeScale } from "src/redux/timeScale"; import { selectHasAdminRole } from "src/redux/user"; +import { selectStatementInsightDetails } from "src/views/insights/insightsSelectors"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx index 55ab6c755ba1..82d8ab76b131 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx @@ -20,14 +20,14 @@ import { refreshUserSQLRoles, } from "src/redux/apiReducers"; import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; +import { selectHasAdminRole } from "src/redux/user"; import { selectTxnInsightDetails, selectTransactionInsightDetailsError, selectTransactionInsightDetailsMaxSizeReached, } from "src/views/insights/insightsSelectors"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; -import { selectHasAdminRole } from "src/redux/user"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx index dae35edbb696..724ad1166551 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { WorkloadInsightEventFilters, SortSetting, @@ -20,10 +18,15 @@ import { WorkloadInsightsRootControl, WorkloadInsightsViewProps, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { bindActionCreators } from "redux"; import { refreshStmtInsights, refreshTxnInsights } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; import { filtersLocalSetting, selectStmtInsights, @@ -35,9 +38,6 @@ import { selectStmtInsightsMaxApiReached, selectTxnInsightsMaxApiReached, } from "src/views/insights/insightsSelectors"; -import { LocalSetting } from "src/redux/localsettings"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; export const insightStatementColumnsLocalSetting = new LocalSetting< AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx b/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx index c035e9e99c8e..9f34c8af9e98 100644 --- a/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx @@ -13,10 +13,11 @@ import { selectID, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import long from "long"; +import { collectExecutionDetailsAction } from "oss/src/redux/jobs/jobsActions"; import { createSelectorForKeyedCachedDataField, refreshListExecutionDetailFiles, @@ -24,9 +25,8 @@ import { refreshUserSQLRoles, } from "src/redux/apiReducers"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { ListJobProfilerExecutionDetailsResponseMessage } from "src/util/api"; -import { collectExecutionDetailsAction } from "oss/src/redux/jobs/jobsActions"; import { selectHasAdminRole } from "src/redux/user"; +import { ListJobProfilerExecutionDetailsResponseMessage } from "src/util/api"; const selectJob = createSelectorForKeyedCachedDataField("job", selectID); const selectExecutionDetailFiles = diff --git a/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx b/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx index e8db3d14f878..e5e1a1fa8404 100644 --- a/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx +++ b/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Spinner } from "@cockroachlabs/ui-components"; import React, { useEffect, useState } from "react"; import Helmet from "react-helmet"; import { useParams } from "react-router-dom"; import Select, { Option } from "react-select"; -import { Spinner } from "@cockroachlabs/ui-components"; import ErrorCircle from "assets/error-circle.svg"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx index 3d98f042c6c7..e69b682bec86 100644 --- a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { connect } from "react-redux"; import { TimeScale, TimeScaleDropdown, TimeScaleOptions, util, } from "@cockroachlabs/cluster-ui"; -import { RouteComponentProps } from "react-router-dom"; import moment from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; +import { selectClusterSettings } from "src/redux/clusterSettings"; +import { AdminUIState } from "src/redux/state"; +import { selectTimeScale, setTimeScale } from "src/redux/timeScale"; import { getKeyVisualizerSamples } from "src/util/api"; -import KeyVisualizer from "src/views/keyVisualizer/keyVisualizer"; import { KeyVisSample, KeyVisualizerProps, } from "src/views/keyVisualizer/interfaces"; -import { AdminUIState } from "src/redux/state"; -import { selectClusterSettings } from "src/redux/clusterSettings"; -import { selectTimeScale, setTimeScale } from "src/redux/timeScale"; -import { refreshSettings } from "src/redux/apiReducers"; +import KeyVisualizer from "src/views/keyVisualizer/keyVisualizer"; import { BackToAdvanceDebug } from "../reports/containers/util"; diff --git a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx index 5fd10aaa31b2..2bd38e6470cb 100644 --- a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx +++ b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import throttle from "lodash/throttle"; +import React from "react"; import { CanvasHeight, diff --git a/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx b/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx index 266201e36b54..e75a3fe65d36 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx @@ -14,9 +14,6 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import ErrorCircle from "assets/error-circle.svg"; -import { doLogin, LoginAPIState } from "src/redux/login"; -import { AdminUIState, AppDispatch } from "src/redux/state"; -import * as docsURL from "src/util/docs"; import { CockroachLabsLockupIcon, Button, @@ -25,6 +22,9 @@ import { Text, TextTypes, } from "src/components"; +import { doLogin, LoginAPIState } from "src/redux/login"; +import { AdminUIState, AppDispatch } from "src/redux/state"; +import * as docsURL from "src/util/docs"; import { OIDCGenerateJWTAuthTokenConnected, OIDCLoginConnected, diff --git a/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx b/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx index 1347ae5f0b49..d137800c6dbb 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx @@ -7,8 +7,8 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterDecorator } from "src/util/decorators"; diff --git a/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx b/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx index 93f2b7fadc42..d672045bb5a7 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx @@ -9,11 +9,11 @@ // licenses/APL.txt. import React from "react"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { selectLoginState, LoginState, getLoginPage } from "src/redux/login"; +import { AdminUIState } from "src/redux/state"; interface RequireLoginProps { loginState: LoginState; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx index b586c9c28ddd..790df9abeeb9 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Location } from "history"; -import isEmpty from "lodash/isEmpty"; import forEach from "lodash/forEach"; -import map from "lodash/map"; -import join from "lodash/join"; +import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; -import split from "lodash/split"; +import join from "lodash/join"; +import map from "lodash/map"; import sortBy from "lodash/sortBy"; +import split from "lodash/split"; +import React from "react"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx index 1d6526be266c..18037b224eeb 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { Fragment } from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, util } from "@cockroachlabs/cluster-ui"; -import map from "lodash/map"; -import isEqual from "lodash/isEqual"; import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNaN from "lodash/isNaN"; import join from "lodash/join"; +import map from "lodash/map"; import sortBy from "lodash/sortBy"; -import isNaN from "lodash/isNaN"; +import React, { Fragment } from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import { BackToAdvanceDebug } from "src/views/reports/containers/util"; -import { getMatchParamByName } from "src/util/query"; -import { nodeIDAttr } from "src/util/constants"; -import { AdminUIState } from "src/redux/state"; +import * as protos from "src/js/protos"; import { certificatesRequestKey, refreshCertificates, } from "src/redux/apiReducers"; -import * as protos from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; +import { nodeIDAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; +import { BackToAdvanceDebug } from "src/views/reports/containers/util"; interface CertificatesOwnProps { certificates: protos.cockroach.server.serverpb.CertificatesResponse; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx index 3654255e1dcf..ef6b21d76358 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { AxisUnits } from "@cockroachlabs/cluster-ui"; import assign from "lodash/assign"; import isEmpty from "lodash/isEmpty"; import * as React from "react"; import Select, { Option } from "react-select"; -import { AxisUnits } from "@cockroachlabs/cluster-ui"; import * as protos from "src/js/protos"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { isSystemTenant } from "src/redux/tenants"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { MetricOption } from "./metricOption"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts index 78cd2ee23531..bfbe31b275dc 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import * as protos from "src/js/protos"; import { NodesSummary } from "src/redux/nodes"; import { INodeStatus } from "src/util/proto"; -import { GetSources } from "src/views/reports/containers/customChart/index"; -import * as protos from "src/js/protos"; import { CustomMetricState } from "src/views/reports/containers/customChart/customMetric"; +import { GetSources } from "src/views/reports/containers/customChart/index"; import TimeSeriesQueryAggregator = protos.cockroach.ts.tspb.TimeSeriesQueryAggregator; import TimeSeriesQueryDerivative = protos.cockroach.ts.tspb.TimeSeriesQueryDerivative; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx index f0e5ec9cd102..67c304c02f1b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx @@ -8,53 +8,53 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; +import flatMap from "lodash/flatMap"; +import flow from "lodash/flow"; +import has from "lodash/has"; +import isEmpty from "lodash/isEmpty"; +import keys from "lodash/keys"; import map from "lodash/map"; import sortBy from "lodash/sortBy"; import startsWith from "lodash/startsWith"; -import isEmpty from "lodash/isEmpty"; -import keys from "lodash/keys"; -import flatMap from "lodash/flatMap"; -import has from "lodash/has"; -import flow from "lodash/flow"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; +import TimeScaleDropdown from "oss/src/views/cluster/containers/timeScaleDropdownWithSearchParams"; +import { PayloadAction } from "src/interfaces/action"; import { refreshMetricMetadata, refreshNodes, refreshTenantsList, } from "src/redux/apiReducers"; -import { nodesSummarySelector, NodesSummary } from "src/redux/nodes"; -import { AdminUIState } from "src/redux/state"; -import LineGraph from "src/views/cluster/components/linegraph"; -import { DropdownOption } from "src/views/shared/components/dropdown"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import TimeScaleDropdown from "oss/src/views/cluster/containers/timeScaleDropdownWithSearchParams"; -import { - PageConfig, - PageConfigItem, -} from "src/views/shared/components/pageconfig"; +import { getCookieValue } from "src/redux/cookies"; import { MetricsMetadata, metricsMetadataSelector, } from "src/redux/metricMetadata"; -import { INodeStatus } from "src/util/proto"; -import { queryByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; +import { nodesSummarySelector, NodesSummary } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { tenantDropdownOptions } from "src/redux/tenants"; import { TimeWindow, setMetricsFixedWindow, selectTimeScale, setTimeScale, } from "src/redux/timeScale"; +import { INodeStatus } from "src/util/proto"; +import { queryByName } from "src/util/query"; +import LineGraph from "src/views/cluster/components/linegraph"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; -import { getCookieValue } from "src/redux/cookies"; -import { tenantDropdownOptions } from "src/redux/tenants"; +import { DropdownOption } from "src/views/shared/components/dropdown"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; +import { + PageConfig, + PageConfigItem, +} from "src/views/shared/components/pageconfig"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import { CustomChartState, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx index 8f4a6cf5c7fa..34b525c73b3e 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames"; import React from "react"; import { OptionComponentProps } from "react-select"; -import classnames from "classnames"; import "./metricOption.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx index 3dcf93fde8df..2eb436984669 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx @@ -13,16 +13,16 @@ import React, { useEffect, useState } from "react"; import { Helmet } from "react-helmet"; import { connect, useSelector } from "react-redux"; +import { InlineAlert } from "src/components"; +import { refreshNodes, refreshUserSQLRoles } from "src/redux/apiReducers"; +import { getCookieValue, setCookie } from "src/redux/cookies"; +import { nodeIDsStringifiedSelector } from "src/redux/nodes"; +import { AdminUIState, featureFlagSelector } from "src/redux/state"; +import { selectHasViewActivityRedactedRole } from "src/redux/user"; import { getDataFromServer } from "src/util/dataFromServer"; import DebugAnnotation from "src/views/shared/components/debugAnnotation"; import InfoBox from "src/views/shared/components/infoBox"; import LicenseType from "src/views/shared/components/licenseType"; -import { AdminUIState, featureFlagSelector } from "src/redux/state"; -import { nodeIDsStringifiedSelector } from "src/redux/nodes"; -import { refreshNodes, refreshUserSQLRoles } from "src/redux/apiReducers"; -import { selectHasViewActivityRedactedRole } from "src/redux/user"; -import { getCookieValue, setCookie } from "src/redux/cookies"; -import { InlineAlert } from "src/components"; import { PanelSection, PanelTitle, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx index f2cdbd87c62a..3ffae2f81696 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; import React, { Fragment } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import moment from "moment-timezone"; -import { enqueueRange } from "src/util/api"; import { cockroach } from "src/js/protos"; +import { enqueueRange } from "src/util/api"; import Print from "src/views/reports/containers/range/print"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import "./index.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx index a9db34ef7a4b..6b1bfa2a3c30 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Button } from "@cockroachlabs/ui-components"; +import moment from "moment-timezone"; import React, { useCallback, useEffect, useState } from "react"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import moment from "moment-timezone"; -import { Button } from "@cockroachlabs/ui-components"; import { cockroach } from "src/js/protos"; import { getHotRanges } from "src/util/api"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx index 3c81c1e95bb4..31c23816bb6a 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Loading } from "@cockroachlabs/cluster-ui"; import isNil from "lodash/isNil"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { Loading } from "@cockroachlabs/cluster-ui"; import { refreshLocations, refreshNodes } from "src/redux/apiReducers"; +import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { LocalityTier, LocalityTree, @@ -31,7 +32,6 @@ import { AdminUIState } from "src/redux/state"; import { getNodeLocalityTiers } from "src/util/localities"; import { findMostSpecificLocation, hasLocation } from "src/util/locations"; import "./localities.styl"; -import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx index 1b02deaf8a84..e8df6f37ab29 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx @@ -9,11 +9,11 @@ // licenses/APL.txt. import { Checkbox, Select } from "antd"; -import React from "react"; import classNames from "classnames"; +import React from "react"; -import Dropdown, { arrowRenderer } from "src/views/shared/components/dropdown"; import { OutsideEventHandler } from "src/components/outsideEventHandler"; +import Dropdown, { arrowRenderer } from "src/views/shared/components/dropdown"; import { NetworkFilter, NetworkSort } from ".."; import "./filter.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx index bc9ed0d46e5d..db1b89bd934d 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx @@ -8,35 +8,37 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util, Loading } from "@cockroachlabs/cluster-ui"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { deviation as d3Deviation, mean as d3Mean } from "d3"; import capitalize from "lodash/capitalize"; +import filter from "lodash/filter"; +import flatMap from "lodash/flatMap"; import flow from "lodash/flow"; -import isUndefined from "lodash/isUndefined"; import isEmpty from "lodash/isEmpty"; -import sortBy from "lodash/sortBy"; +import isUndefined from "lodash/isUndefined"; +import map from "lodash/map"; import max from "lodash/max"; +import sortBy from "lodash/sortBy"; import union from "lodash/union"; import values from "lodash/values"; -import filter from "lodash/filter"; -import flatMap from "lodash/flatMap"; -import map from "lodash/map"; import moment from "moment-timezone"; +import { common } from "protobufjs"; import React, { Fragment } from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { withRouter, RouteComponentProps } from "react-router-dom"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { util, Loading } from "@cockroachlabs/cluster-ui"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { common } from "protobufjs"; +import { createSelector } from "reselect"; +import { InlineAlert } from "src/components"; import { CachedDataReducerState, refreshConnectivity, refreshLiveness, refreshNodes, } from "src/redux/apiReducers"; +import { connectivitySelector } from "src/redux/connectivity"; import { NodesSummary, nodesSummarySelector, @@ -45,16 +47,14 @@ import { } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; import { trackFilter, trackCollapseNodes } from "src/util/analytics"; +import { getDataFromServer } from "src/util/dataFromServer"; +import { getMatchParamByName } from "src/util/query"; import { getFilters, localityToString, NodeFilterList, NodeFilterListProps, } from "src/views/reports/components/nodeFilterList"; -import { getMatchParamByName } from "src/util/query"; -import { connectivitySelector } from "src/redux/connectivity"; -import { getDataFromServer } from "src/util/dataFromServer"; -import { InlineAlert } from "src/components"; import { Latency } from "./latency"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx index 763518497658..7d5699cecee5 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Badge, Divider, Tooltip } from "antd"; import { ExclamationCircleOutlined, StopOutlined } from "@ant-design/icons"; +import { util } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { Badge, Divider, Tooltip } from "antd"; +import { BadgeProps } from "antd/lib/badge"; import classNames from "classnames"; import map from "lodash/map"; -import { util } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Link } from "react-router-dom"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { BadgeProps } from "antd/lib/badge"; import { Empty } from "src/components/empty"; import { livenessNomenclature } from "src/redux/nodes"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts index 443fc53e95aa..6e9dd7309321 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { ILatencyProps } from "."; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx index fe30b484863a..976ac682d98f 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { RenderFunction } from "storybook__react"; import { withRouterDecorator } from "src/util/decorators"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx index 6f188d577b3b..13152082a0fe 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx @@ -11,8 +11,8 @@ import { Tooltip } from "antd"; import React from "react"; -import { Chip } from "src/views/app/components/chip"; import { Text, TextTypes } from "src/components"; +import { Chip } from "src/views/app/components/chip"; import "./legend.styl"; interface ILegendProps { diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx index fd7a358e376e..4b017325a3fa 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx @@ -12,9 +12,9 @@ import { Checkbox, Divider } from "antd"; import React from "react"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { trackNetworkSort } from "src/util/analytics"; import { getMatchParamByName } from "src/util/query"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { NetworkFilter, NetworkSort } from ".."; import { Filter } from "../filter"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx index df129e954b91..a587d998ea98 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx @@ -8,14 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; -import { Moment } from "moment-timezone"; -import flow from "lodash/flow"; -import orderBy from "lodash/orderBy"; -import map from "lodash/map"; import { ColumnsConfig, Table, @@ -23,14 +15,22 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import flow from "lodash/flow"; +import map from "lodash/map"; +import orderBy from "lodash/orderBy"; +import { Moment } from "moment-timezone"; +import * as React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; -import { nodesSummarySelector } from "src/redux/nodes"; -import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; +import { Text } from "src/components"; import { cockroach } from "src/js/protos"; +import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { LocalSetting } from "src/redux/localsettings"; -import { Text } from "src/components"; +import { nodesSummarySelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; import "./decommissionedNodeHistory.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx index b1d7cc20252e..e102691bcf69 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { withRouter, RouteComponentProps } from "react-router-dom"; import { util } from "@cockroachlabs/cluster-ui"; +import classNames from "classnames"; +import flow from "lodash/flow"; import get from "lodash/get"; -import join from "lodash/join"; import has from "lodash/has"; -import map from "lodash/map"; import isEmpty from "lodash/isEmpty"; import isEqual from "lodash/isEqual"; import isNil from "lodash/isNil"; -import flow from "lodash/flow"; -import uniq from "lodash/uniq"; +import join from "lodash/join"; +import map from "lodash/map"; import orderBy from "lodash/orderBy"; +import uniq from "lodash/uniq"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { withRouter, RouteComponentProps } from "react-router-dom"; import { InlineAlert } from "src/components"; import * as protos from "src/js/protos"; @@ -44,11 +44,11 @@ import { localityToString, NodeFilterList, } from "src/views/reports/components/nodeFilterList"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { PageConfig, PageConfigItem, } from "src/views/shared/components/pageconfig"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { BackToAdvanceDebug } from "../util"; @@ -352,7 +352,8 @@ export class Nodes extends React.Component { const inconsistent = !isNil(equality) && flow( - (nodeIds: string[]) => map(nodeIds, nodeID => this.props.nodeStatusByID[nodeID]), + (nodeIds: string[]) => + map(nodeIds, nodeID => this.props.nodeStatusByID[nodeID]), statuses => map(statuses, status => equality(status)), uniq, )(orderedNodeIDs).length > 1; @@ -435,8 +436,9 @@ export class Nodes extends React.Component { } // Sort the node IDs and then convert them back to string for lookups. - const orderedNodeIDs = orderBy(nodeIDsContext, nodeID => nodeID) - .map(nodeID => nodeID.toString()); + const orderedNodeIDs = orderBy(nodeIDsContext, nodeID => nodeID).map( + nodeID => nodeID.toString(), + ); const dropdownOptions: DropdownOption[] = [ { diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx index af3c1790ad41..b56960793b8a 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { Loading } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; -import flow from "lodash/flow"; import filter from "lodash/filter"; -import isEmpty from "lodash/isEmpty"; import flatMap from "lodash/flatMap"; -import map from "lodash/map"; -import sortBy from "lodash/sortBy"; -import sortedUniq from "lodash/sortedUniq"; +import flow from "lodash/flow"; +import isEmpty from "lodash/isEmpty"; import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; import keys from "lodash/keys"; +import map from "lodash/map"; import pickBy from "lodash/pickBy"; +import sortBy from "lodash/sortBy"; +import sortedUniq from "lodash/sortedUniq"; import values from "lodash/values"; +import Long from "long"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { @@ -36,8 +36,8 @@ import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { AdminUIState } from "src/redux/state"; import { nodeIDAttr } from "src/util/constants"; import { FixLong } from "src/util/fixLong"; -import ConnectionsTable from "src/views/reports/containers/problemRanges/connectionsTable"; import { getMatchParamByName } from "src/util/query"; +import ConnectionsTable from "src/views/reports/containers/problemRanges/connectionsTable"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; type NodeProblems$Properties = diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx index 026c1075c074..b21577d83c39 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Loading } from "@cockroachlabs/cluster-ui"; import isEmpty from "lodash/isEmpty"; import map from "lodash/map"; +import React from "react"; import * as protos from "src/js/protos"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx index 4a199e12a0e3..d820f7b4973b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import React from "react"; import { Loading } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; +import classNames from "classnames"; import flow from "lodash/flow"; +import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import keys from "lodash/keys"; import map from "lodash/map"; import sortBy from "lodash/sortBy"; -import isEmpty from "lodash/isEmpty"; +import React from "react"; -import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import * as protos from "src/js/protos"; +import { CachedDataReducerState } from "src/redux/cachedDataReducer"; interface ConnectionsTableProps { range: CachedDataReducerState; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx index f36c0c4d4d75..b504cab336e1 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; -import {cockroach} from "@cockroachlabs/crdb-protobuf-client"; import { Button, commonStyles } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ArrowLeft } from "@cockroachlabs/icons"; -import isEqual from "lodash/isEqual"; -import isNil from "lodash/isNil"; -import isEmpty from "lodash/isEmpty"; -import some from "lodash/some"; -import orderBy from "lodash/orderBy"; import flatMap from "lodash/flatMap"; -import sortedUniqBy from "lodash/sortedUniqBy"; import flow from "lodash/flow"; import head from "lodash/head"; +import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import orderBy from "lodash/orderBy"; +import some from "lodash/some"; import sortBy from "lodash/sortBy"; +import sortedUniqBy from "lodash/sortedUniqBy"; +import Long from "long"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { @@ -40,13 +40,13 @@ import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { AdminUIState } from "src/redux/state"; import { rangeIDAttr } from "src/util/constants"; import { FixLong } from "src/util/fixLong"; +import { getMatchParamByName } from "src/util/query"; +import AllocatorOutput from "src/views/reports/containers/range/allocator"; import ConnectionsTable from "src/views/reports/containers/range/connectionsTable"; -import RangeTable from "src/views/reports/containers/range/rangeTable"; +import LeaseTable from "src/views/reports/containers/range/leaseTable"; import LogTable from "src/views/reports/containers/range/logTable"; -import AllocatorOutput from "src/views/reports/containers/range/allocator"; import RangeInfo from "src/views/reports/containers/range/rangeInfo"; -import LeaseTable from "src/views/reports/containers/range/leaseTable"; -import { getMatchParamByName } from "src/util/query"; +import RangeTable from "src/views/reports/containers/range/rangeTable"; import IRangeInfo = cockroach.server.serverpb.IRangeInfo; @@ -162,9 +162,7 @@ export class Range extends React.Component { } // Did we get any responses? - if ( - !some(range.data.responses_by_node_id, resp => resp.infos.length > 0) - ) { + if (!some(range.data.responses_by_node_id, resp => resp.infos.length > 0)) { return ( { // Gather all replica IDs. const replicas = flow( - (infos: IRangeInfo[]) => flatMap(infos, info => info.state.state.desc.internal_replicas), + (infos: IRangeInfo[]) => + flatMap(infos, info => info.state.state.desc.internal_replicas), descriptors => sortBy(descriptors, d => d.replica_id), - descriptors => sortedUniqBy(descriptors, d => d.replica_id) + descriptors => sortedUniqBy(descriptors, d => d.replica_id), )(infos); return ( @@ -252,7 +251,12 @@ const mapDispatchToProps = { }; export default withRouter( - connect( + connect< + RangeStateProps, + RangeDispatchProps, + RouteComponentProps, + AdminUIState + >( mapStateToProps, mapDispatchToProps, )(Range), diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx index ec4a35752c5b..b8df883a63db 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx @@ -11,8 +11,8 @@ import head from "lodash/head"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; -import reverse from "lodash/reverse"; import map from "lodash/map"; +import reverse from "lodash/reverse"; import React from "react"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx index 06214ee90865..6dd7b81195b6 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Loading, util } from "@cockroachlabs/cluster-ui"; import isEmpty from "lodash/isEmpty"; -import orderBy from "lodash/orderBy"; import map from "lodash/map"; +import orderBy from "lodash/orderBy"; +import React from "react"; import * as protos from "src/js/protos"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts index e7db912fdd99..b6daa39ad70b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import moment from "moment-timezone"; import { util } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; import has from "lodash/has"; -import round from "lodash/round"; import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import join from "lodash/join"; +import round from "lodash/round"; +import Long from "long"; +import moment from "moment-timezone"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx index 925cfaac116a..d2ae58c44014 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx @@ -8,30 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import toLower from "lodash/toLower"; -import isNull from "lodash/isNull"; -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; import { util } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; +import classNames from "classnames"; import concat from "lodash/concat"; -import join from "lodash/join"; -import isEqual from "lodash/isEqual"; -import map from "lodash/map"; -import head from "lodash/head"; import flow from "lodash/flow"; -import sortBy from "lodash/sortBy"; import forEach from "lodash/forEach"; +import head from "lodash/head"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import isNull from "lodash/isNull"; +import join from "lodash/join"; +import map from "lodash/map"; import size from "lodash/size"; +import sortBy from "lodash/sortBy"; +import toLower from "lodash/toLower"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; -import RangeInfo from "src/views/reports/containers/range/rangeInfo"; -import Print from "src/views/reports/containers/range/print"; -import Lease from "src/views/reports/containers/range/lease"; -import { FixLong } from "src/util/fixLong"; import { cockroach } from "src/js/protos"; import * as protos from "src/js/protos"; +import { FixLong } from "src/util/fixLong"; +import Lease from "src/views/reports/containers/range/lease"; +import Print from "src/views/reports/containers/range/print"; +import RangeInfo from "src/views/reports/containers/range/rangeInfo"; import IRangeInfo = cockroach.server.serverpb.IRangeInfo; @@ -679,7 +679,7 @@ export default class RangeTable extends React.Component { // We want to display ordered by store ID. const sortedStoreIDs = flow( (infos: IRangeInfo[]) => map(infos, info => info.source_store_id), - (storeIds) => sortBy(storeIds, id => id) + storeIds => sortBy(storeIds, id => id), )(infos); const dormantStoreIDs: Set = new Set(); @@ -748,7 +748,9 @@ export default class RangeTable extends React.Component { ? "range-table__cell--lease-holder" : "range-table__cell--lease-follower", ), - leaseType: this.createContent(leaseEpoch ? "epoch" : leaseLeader ? "leader" : "expiration"), + leaseType: this.createContent( + leaseEpoch ? "epoch" : leaseLeader ? "leader" : "expiration", + ), leaseEpoch: leaseEpoch ? this.createContent(lease.epoch) : rangeTableEmptyContent, @@ -925,10 +927,7 @@ export default class RangeTable extends React.Component { info.state.circuit_breaker_error, ), locality: this.contentIf(size(info.locality.tiers) > 0, () => ({ - value: map( - info.locality.tiers, - tier => `${tier.key}: ${tier.value}`, - ), + value: map(info.locality.tiers, tier => `${tier.key}: ${tier.value}`), })), pausedFollowers: this.createContent( info.state.paused_replicas?.join(", "), diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx index 234cac8fd369..c84bba5612fd 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames"; import * as React from "react"; +import CopyToClipboard from "react-copy-to-clipboard"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import classNames from "classnames"; -import CopyToClipboard from "react-copy-to-clipboard"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx index 634a71b201c5..ef0e67bf27e5 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx @@ -8,11 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import isNil from "lodash/isNil"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, ColumnDescriptor, @@ -21,11 +16,16 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import isNil from "lodash/isNil"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { refreshSettings } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; +import { AdminUIState } from "src/redux/state"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx index a6d9d8b143ce..524b1c471af6 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx @@ -8,12 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import moment from "moment-timezone"; -import { Link } from "react-router-dom"; -import isUndefined from "lodash/isUndefined"; import { api as clusterUiApi, DownloadFile, @@ -28,25 +22,31 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import isUndefined from "lodash/isUndefined"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import { Anchor, Button, Text, TextTypes, Tooltip } from "src/components"; -import HeaderSection from "src/views/shared/components/headerSection"; +import { trackCancelDiagnosticsBundleAction } from "src/redux/analyticsActions"; +import { + invalidateStatementDiagnosticsRequests, + refreshStatementDiagnosticsRequests, +} from "src/redux/apiReducers"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { trustIcon } from "src/util/trust"; +import { cancelStatementDiagnosticsReportAction } from "src/redux/statements"; import { selectStatementDiagnosticsReports, selectStatementByFingerprint, statementDiagnosticsReportsInFlight, } from "src/redux/statements/statementsSelectors"; -import { - invalidateStatementDiagnosticsRequests, - refreshStatementDiagnosticsRequests, -} from "src/redux/apiReducers"; +import { trackDownloadDiagnosticsBundle } from "src/util/analytics"; import { statementDiagnostics } from "src/util/docs"; import { summarize } from "src/util/sql/summarize"; -import { trackDownloadDiagnosticsBundle } from "src/util/analytics"; -import { cancelStatementDiagnosticsReportAction } from "src/redux/statements"; -import { trackCancelDiagnosticsBundleAction } from "src/redux/analyticsActions"; +import { trustIcon } from "src/util/trust"; +import HeaderSection from "src/views/shared/components/headerSection"; import "./statementDiagnosticsHistoryView.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx index 26ef9934934d..d34a208d4a2d 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Loading } from "@cockroachlabs/cluster-ui"; +import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import map from "lodash/map"; +import sortBy from "lodash/sortBy"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { Loading } from "@cockroachlabs/cluster-ui"; -import isEqual from "lodash/isEqual"; -import isEmpty from "lodash/isEmpty"; -import map from "lodash/map"; -import isNil from "lodash/isNil"; -import sortBy from "lodash/sortBy"; import * as protos from "src/js/protos"; import { storesRequestKey, refreshStores } from "src/redux/apiReducers"; import { AdminUIState } from "src/redux/state"; import { nodeIDAttr } from "src/util/constants"; -import EncryptionStatus from "src/views/reports/containers/stores/encryption"; import { getMatchParamByName } from "src/util/query"; +import EncryptionStatus from "src/views/reports/containers/stores/encryption"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx index df1ce34f8a23..51de884b5fdc 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { History } from "history"; import { Button, commonStyles } from "@cockroachlabs/cluster-ui"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { History } from "history"; +import React from "react"; interface backProps { history: History; diff --git a/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx b/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx index 3b922f15968a..63cef9a4eb0f 100644 --- a/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx @@ -8,16 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { SessionDetails, byteArrayToUuid } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { connect } from "react-redux"; -import { SessionDetails, byteArrayToUuid } from "@cockroachlabs/cluster-ui"; -import { getMatchParamByName } from "src/util/query"; -import { sessionAttr } from "src/util/constants"; -import { Pick } from "src/util/pick"; -import { AdminUIState } from "src/redux/state"; -import { SessionsResponseMessage } from "src/util/api"; import { CachedDataReducerState, refreshLiveness, @@ -29,7 +24,12 @@ import { terminateQueryAction, terminateSessionAction, } from "src/redux/sessions/sessionsSagas"; +import { AdminUIState } from "src/redux/state"; import { setTimeScale } from "src/redux/timeScale"; +import { SessionsResponseMessage } from "src/util/api"; +import { sessionAttr } from "src/util/constants"; +import { Pick } from "src/util/pick"; +import { getMatchParamByName } from "src/util/query"; type SessionsState = Pick; diff --git a/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx b/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx index 07b3aa99d0ce..fc55b15c5087 100644 --- a/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; -import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { defaultFilters, Filters, SessionsPage, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { createSelector } from "reselect"; -import { Pick } from "src/util/pick"; -import { AdminUIState } from "src/redux/state"; -import { LocalSetting } from "src/redux/localsettings"; import { CachedDataReducerState, refreshSessions } from "src/redux/apiReducers"; -import { SessionsResponseMessage } from "src/util/api"; +import { LocalSetting } from "src/redux/localsettings"; import { terminateQueryAction, terminateSessionAction, } from "src/redux/sessions/sessionsSagas"; +import { AdminUIState } from "src/redux/state"; +import { SessionsResponseMessage } from "src/util/api"; +import { Pick } from "src/util/pick"; type SessionsState = Pick; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx index 644c14edb5d8..2974edf9aa59 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import { AlertInfo, AlertLevel } from "src/redux/alerts"; +import { trustIcon } from "src/util/trust"; import { warningIcon, notificationIcon, criticalIcon, } from "src/views/shared/components/icons"; -import { trustIcon } from "src/util/trust"; import "./alertbox.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx index 11c106505172..a3e951a760d5 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; -import { styledWrapper } from "src/util/decorators"; import { AlertLevel } from "src/redux/alerts"; +import { styledWrapper } from "src/util/decorators"; import { AlertMessage } from "./alertMessage"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx index 42e8928af90e..e61346d0406b 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Alert } from "antd"; import { CheckCircleFilled, CloseCircleFilled, InfoCircleFilled, WarningFilled, } from "@ant-design/icons"; +import { Alert } from "antd"; +import React from "react"; import { Link } from "react-router-dom"; import { AlertInfo, AlertLevel } from "src/redux/alerts"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx index 2736c9f7575f..e22c117cbc07 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Drawer, Button, Divider } from "antd"; -import { Link } from "react-router-dom"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; import styles from "./drawer.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx index 59df22aca824..012f98f08109 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx @@ -9,14 +9,14 @@ // licenses/APL.txt. import classNames from "classnames/bind"; -import Select from "react-select"; -import React from "react"; -import isNil from "lodash/isNil"; import includes from "lodash/includes"; +import isNil from "lodash/isNil"; +import React from "react"; +import Select from "react-select"; -import { leftArrow, rightArrow } from "src/views/shared/components/icons"; -import { trustIcon } from "src/util/trust"; import { CaretDown } from "src/components/icon/caretDown"; +import { trustIcon } from "src/util/trust"; +import { leftArrow, rightArrow } from "src/views/shared/components/icons"; import styles from "./dropdown.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx index 330dd3520d7c..1b0c7f387f5b 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { mount, ReactWrapper } from "enzyme"; +import React from "react"; import { EmailSubscriptionForm } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx index f8b6d0141eb4..5d658e24704d 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx @@ -29,15 +29,15 @@ * combine it with the result of a query to create some renderable output. */ -import React from "react"; -import Long from "long"; -import { History } from "history"; import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client-ccl"; +import { History } from "history"; +import Long from "long"; +import React from "react"; -import { TimeWindow } from "src/redux/timeScale"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { TimeWindow } from "src/redux/timeScale"; import TimeSeriesQueryDerivative = protos.cockroach.ts.tspb.TimeSeriesQueryDerivative; type TSResponse = protos.cockroach.ts.tspb.TimeSeriesQueryResponse; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx index a6311f05a52a..7980c4ee305f 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import { OutsideEventHandler } from "src/components/outsideEventHandler"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx index 91d11fe8befa..35be3d9f23dc 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Highlight } from "./highlight"; import styles from "./sqlhighlight.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx index 356a549184bf..65c6dea46d63 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import * as hljs from "highlight.js"; import React from "react"; -import classNames from "classnames/bind"; -import styles from "./sqlhighlight.module.styl"; import { SqlBoxProps } from "./box"; +import styles from "./sqlhighlight.module.styl"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx index 64166ec32f1c..e4abe940b052 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; import isNumber from "lodash/isNumber"; import last from "lodash/last"; import sum from "lodash/sum"; +import React from "react"; +import { InfoTooltip } from "src/components/infoTooltip"; import * as protos from "src/js/protos"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import { MetricsDataComponentProps } from "src/views/shared/components/metricQuery"; -import { InfoTooltip } from "src/components/infoTooltip"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import "./summarybar.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx index 22a7eb147c89..e82022df6d31 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./summaryCard.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx index 0df770ac3819..e0b6500a0607 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { Tooltip } from "antd"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./tooltip.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx index 1ff9fcec45c5..5f42803252a1 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames"; +import * as React from "react"; import "./userAvatar.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx index b9913acfc760..64b92ae6d3e0 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import map from "lodash/map"; import React from "react"; -import { Dispatch, Action, bindActionCreators } from "redux"; import { connect } from "react-redux"; -import map from "lodash/map"; +import { Dispatch, Action, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; -import { AdminUIState } from "src/redux/state"; import { Alert, panelAlertsSelector } from "src/redux/alerts"; +import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; interface AlertSectionProps { /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx index 797d13b270ea..66b59526d655 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import map from "lodash/map"; import React from "react"; -import { Dispatch, Action, bindActionCreators } from "redux"; import { connect } from "react-redux"; -import map from "lodash/map"; +import { Dispatch, Action, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; -import { AdminUIState } from "src/redux/state"; import { Alert, overviewListAlertsSelector } from "src/redux/alerts"; +import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; interface AlertSectionProps { /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx index 29327c1a6220..56882ebfac80 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx @@ -8,11 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; -import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { util, TimeWindow, @@ -21,17 +16,29 @@ import { defaultTimeScaleOptions, } from "@cockroachlabs/cluster-ui"; import { History } from "history"; -import isNil from "lodash/isNil"; -import map from "lodash/map"; import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; import isObject from "lodash/isObject"; +import map from "lodash/map"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; +import { + selectResolution10sStorageTTL, + selectResolution30mStorageTTL, +} from "src/redux/clusterSettings"; import { MetricsQuery, requestMetrics as requestMetricsAction, } from "src/redux/metrics"; import { AdminUIState } from "src/redux/state"; +import { adjustTimeScale, selectMetricsTime } from "src/redux/timeScale"; import { findChildrenOfType } from "src/util/find"; import { Metric, @@ -39,13 +46,6 @@ import { MetricsDataComponentProps, QueryTimeInfo, } from "src/views/shared/components/metricQuery"; -import { PayloadAction } from "src/interfaces/action"; -import { refreshSettings } from "src/redux/apiReducers"; -import { adjustTimeScale, selectMetricsTime } from "src/redux/timeScale"; -import { - selectResolution10sStorageTTL, - selectResolution30mStorageTTL, -} from "src/redux/clusterSettings"; /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx index 3e84048f54ac..dd2cb907cfab 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx @@ -15,6 +15,7 @@ import Long from "long"; import React, { Fragment } from "react"; import * as protos from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; import { MetricsQuery, requestMetrics } from "src/redux/metrics"; import { Axis, @@ -23,7 +24,6 @@ import { QueryTimeInfo, } from "src/views/shared/components/metricQuery"; import { MetricsDataProviderUnconnected as MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { refreshSettings } from "src/redux/apiReducers"; // TextGraph is a proof-of-concept component used to demonstrate that // MetricsDataProvider is working correctly. Used in tests. diff --git a/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx b/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx index df6df5c9e30c..0621c5a59b91 100644 --- a/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx @@ -11,16 +11,16 @@ // All changes made on this file, should also be done on the equivalent // file on managed-service repo. +import { commonStyles, util } from "@cockroachlabs/cluster-ui"; +import { Tabs } from "antd"; import React, { useState } from "react"; import Helmet from "react-helmet"; -import { Tabs } from "antd"; -import { commonStyles, util } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router-dom"; +import { tabAttr, viewAttr } from "src/util/constants"; import SessionsPageConnected from "src/views/sessions/sessionsPage"; -import TransactionsPageConnected from "src/views/transactions/transactionsPage"; import StatementsPageConnected from "src/views/statements/statementsPage"; -import { tabAttr, viewAttr } from "src/util/constants"; +import TransactionsPageConnected from "src/views/transactions/transactionsPage"; const { TabPane } = Tabs; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx index 7cedaf304b7c..54d8977d4e1f 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx @@ -16,13 +16,13 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { selectActiveStatement, selectContentionDetailsForStatement, } from "src/selectors"; -import { selectHasAdminRole } from "src/redux/user"; export default withRouter( connect< diff --git a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx index e6f02cdcce64..960dc03f49c2 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx @@ -14,14 +14,14 @@ import { SortSetting, } from "@cockroachlabs/cluster-ui"; +import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { selectActiveStatements, selectAppName, selectClusterLocksMaxApiSizeReached, } from "src/selectors"; -import { refreshLiveWorkload } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { AdminUIState } from "src/redux/state"; import { autoRefreshLocalSetting } from "../transactions/activeTransactionsSelectors"; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx index 95f5749c131b..515737328abc 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx @@ -7,11 +7,6 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { withRouter } from "react-router-dom"; -import { createSelector } from "reselect"; -import Long from "long"; -import { RouteComponentProps } from "react-router"; import { StatementDetails, StatementDetailsDispatchProps, @@ -20,8 +15,19 @@ import { util, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import Long from "long"; import moment from "moment-timezone"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; +import { createSelector } from "reselect"; +import { createStatementDiagnosticsAlertLocalSetting } from "src/redux/alerts"; +import { + trackCancelDiagnosticsBundleAction, + trackDownloadDiagnosticsBundleAction, + trackStatementDetailsSubnavSelectionAction, +} from "src/redux/analyticsActions"; import { refreshLiveness, refreshNodes, @@ -32,26 +38,20 @@ import { } from "src/redux/apiReducers"; import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { selectDiagnosticsReportsByStatementFingerprint } from "src/redux/statements/statementsSelectors"; import { cancelStatementDiagnosticsReportAction, createStatementDiagnosticsReportAction, setGlobalTimeScaleAction, } from "src/redux/statements"; -import { createStatementDiagnosticsAlertLocalSetting } from "src/redux/alerts"; +import { selectDiagnosticsReportsByStatementFingerprint } from "src/redux/statements/statementsSelectors"; +import { selectTimeScale } from "src/redux/timeScale"; import { selectHasAdminRole, selectHasViewActivityRedactedRole, } from "src/redux/user"; -import { - trackCancelDiagnosticsBundleAction, - trackDownloadDiagnosticsBundleAction, - trackStatementDetailsSubnavSelectionAction, -} from "src/redux/analyticsActions"; import { StatementDetailsResponseMessage } from "src/util/api"; -import { getMatchParamByName, queryByName } from "src/util/query"; import { appNamesAttr, statementAttr } from "src/util/constants"; -import { selectTimeScale } from "src/redux/timeScale"; +import { getMatchParamByName, queryByName } from "src/util/query"; import { requestTimeLocalSetting } from "./statementsPage"; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx index 495b557e996f..1e79ca5ad78f 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimeScale, toRoundedDateRange, util } from "@cockroachlabs/cluster-ui"; +import * as H from "history"; +import merge from "lodash/merge"; import Long from "long"; import moment from "moment-timezone"; import { RouteComponentProps } from "react-router-dom"; -import * as H from "history"; -import merge from "lodash/merge"; -import { TimeScale, toRoundedDateRange, util } from "@cockroachlabs/cluster-ui"; import "src/protobufInit"; import * as protos from "src/js/protos"; +import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { appAttr, appNamesAttr, statementAttr, unset, } from "src/util/constants"; -import { AdminUIState, createAdminUIStore } from "src/redux/state"; -import { selectLastReset } from "./statementsPage"; import { selectStatementDetails } from "./statementDetails"; +import { selectLastReset } from "./statementsPage"; import ISensitiveInfo = protos.cockroach.sql.ISensitiveInfo; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx index 6d9c718ea475..01899c54adec 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx @@ -8,10 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { bindActionCreators } from "redux"; -import { createSelector } from "reselect"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Filters, defaultFilters, @@ -24,7 +20,21 @@ import { StatementsPageRootProps, api, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { bindActionCreators } from "redux"; +import { createSelector } from "reselect"; +import { + createStatementDiagnosticsAlertLocalSetting, + cancelStatementDiagnosticsAlertLocalSetting, +} from "src/redux/alerts"; +import { + trackApplySearchCriteriaAction, + trackCancelDiagnosticsBundleAction, + trackDownloadDiagnosticsBundleAction, + trackStatementsPaginationAction, +} from "src/redux/analyticsActions"; import { refreshNodes, refreshDatabases, @@ -34,32 +44,22 @@ import { createSelectorForCachedDataField, } from "src/redux/apiReducers"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; +import { LocalSetting } from "src/redux/localsettings"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { resetSQLStatsAction } from "src/redux/sqlStats"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { PrintTime } from "src/views/reports/containers/range/print"; -import { - createStatementDiagnosticsAlertLocalSetting, - cancelStatementDiagnosticsAlertLocalSetting, -} from "src/redux/alerts"; -import { - selectHasViewActivityRedactedRole, - selectHasAdminRole, -} from "src/redux/user"; import { cancelStatementDiagnosticsReportAction, createOpenDiagnosticsModalAction, createStatementDiagnosticsReportAction, setGlobalTimeScaleAction, } from "src/redux/statements"; -import { - trackApplySearchCriteriaAction, - trackCancelDiagnosticsBundleAction, - trackDownloadDiagnosticsBundleAction, - trackStatementsPaginationAction, -} from "src/redux/analyticsActions"; -import { resetSQLStatsAction } from "src/redux/sqlStats"; -import { LocalSetting } from "src/redux/localsettings"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { selectTimeScale } from "src/redux/timeScale"; +import { + selectHasViewActivityRedactedRole, + selectHasAdminRole, +} from "src/redux/user"; +import { PrintTime } from "src/views/reports/containers/range/print"; import { activeStatementsViewActions, diff --git a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx index 86450c755ac0..bd9ecbecf80b 100644 --- a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx @@ -14,9 +14,9 @@ import { SortSetting, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import Long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import Long from "long"; import { rawTraceKey, diff --git a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx index 44070ac5a9ca..c0c9de239500 100644 --- a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx +++ b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx @@ -10,11 +10,11 @@ import { join } from "path"; -import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; import React, { useEffect } from "react"; +import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; -import SnapshotPage from "src/views/tracez_v2/snapshotPage"; import { getDataFromServer } from "src/util/dataFromServer"; +import SnapshotPage from "src/views/tracez_v2/snapshotPage"; const NodePicker: React.FC = () => { // If no node was provided, navigate explicitly to the local node. diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx index 9891cae17fad..d480c08f531d 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx @@ -16,8 +16,8 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { AdminUIState } from "src/redux/state"; import { selectActiveTransaction, selectContentionDetailsForTransaction, diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx index c5ca7ddb87f5..cb3689fdfe65 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx @@ -15,14 +15,14 @@ import { SortSetting, } from "@cockroachlabs/cluster-ui"; +import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { selectAppName, selectActiveTransactions, selectClusterLocksMaxApiSizeReached, } from "src/selectors"; -import { refreshLiveWorkload } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { AdminUIState } from "src/redux/state"; export const ACTIVE_EXECUTIONS_IS_AUTOREFRESH_ENABLED = "isAutoRefreshEnabled/ActiveExecutions"; diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx index 2e5b92a674e3..c5f2e0dd4bfc 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { withRouter } from "react-router-dom"; import { TransactionDetailsStateProps, TransactionDetailsDispatchProps, TransactionDetails, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; import { refreshNodes, @@ -23,20 +23,20 @@ import { refreshTxnInsights, refreshUserSQLRoles, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; +import { selectHasAdminRole } from "src/redux/user"; +import { txnFingerprintIdAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; +import { selectTxnInsightsByFingerprint } from "src/views/insights/insightsSelectors"; import { reqSortSetting, limitSetting, selectTxns, requestTimeLocalSetting, } from "src/views/transactions/transactionsPage"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; -import { selectTxnInsightsByFingerprint } from "src/views/insights/insightsSelectors"; -import { selectHasAdminRole } from "src/redux/user"; -import { getMatchParamByName } from "src/util/query"; -import { txnFingerprintIdAttr } from "src/util/constants"; export default withRouter( connect( diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx index 1505c7005a14..ece8ba837798 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { createSelector } from "reselect"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Filters, defaultFilters, @@ -23,23 +20,26 @@ import { TransactionsPageRootProps, api, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { bindActionCreators } from "redux"; +import { createSelector } from "reselect"; +import { trackApplySearchCriteriaAction } from "src/redux/analyticsActions"; import { createSelectorForCachedDataField, refreshNodes, refreshTxns, refreshUserSQLRoles, } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { resetSQLStatsAction } from "src/redux/sqlStats"; import { AdminUIState } from "src/redux/state"; -import { selectHasAdminRole } from "src/redux/user"; -import { PrintTime } from "src/views/reports/containers/range/print"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { LocalSetting } from "src/redux/localsettings"; import { selectTimeScale } from "src/redux/timeScale"; -import { trackApplySearchCriteriaAction } from "src/redux/analyticsActions"; +import { selectHasAdminRole } from "src/redux/user"; +import { PrintTime } from "src/views/reports/containers/range/print"; import { activeTransactionsPageActionCreators,