Skip to content

Commit ce3cd4b

Browse files
authored
Merge branch 'main' into astandrik.display-a-list-of-operations-1414
2 parents bfe4844 + e452f15 commit ce3cd4b

File tree

24 files changed

+307
-413
lines changed

24 files changed

+307
-413
lines changed

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,13 @@
112112
"^@gravity-ui/uikit/toaster-singleton-react-18$": "@gravity-ui/uikit/build/cjs/toaster-singleton-react-18.js"
113113
}
114114
},
115-
"browserslist": {
116-
"production": [
117-
">0.2%",
118-
"not dead",
119-
"not op_mini all"
120-
],
121-
"development": [
122-
"last 1 chrome version",
123-
"last 1 firefox version",
124-
"last 1 safari version"
125-
]
126-
},
115+
"browserslist": [
116+
"extends @gravity-ui/browserslist-config"
117+
],
127118
"devDependencies": {
128119
"@commitlint/cli": "^19.3.0",
129120
"@commitlint/config-conventional": "^19.2.2",
121+
"@gravity-ui/browserslist-config": "^4.3.0",
130122
"@gravity-ui/eslint-config": "^3.2.0",
131123
"@gravity-ui/prettier-config": "^1.1.0",
132124
"@gravity-ui/stylelint-config": "^4.0.1",

src/containers/Cluster/Cluster.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {InternalLink} from '../../components/InternalLink';
1111
import routes, {getLocationObjectFromHref} from '../../routes';
1212
import {
1313
clusterApi,
14+
selectClusterTabletsWithFqdn,
1415
selectClusterTitle,
1516
updateDefaultClusterTab,
1617
} from '../../store/reducers/cluster/cluster';
@@ -74,6 +75,10 @@ export function Cluster({
7475

7576
const clusterError = error && typeof error === 'object' ? error : undefined;
7677

78+
const clusterTablets = useTypedSelector((state) =>
79+
selectClusterTabletsWithFqdn(state, clusterName ?? undefined),
80+
);
81+
7782
React.useEffect(() => {
7883
dispatch(setHeaderBreadcrumbs('cluster', {}));
7984
}, [dispatch]);
@@ -162,7 +167,8 @@ export function Cluster({
162167
<div className={b('tablets')}>
163168
<div className={b('fake-block')} />
164169
<TabletsTable
165-
tablets={cluster.SystemTablets ?? []}
170+
loading={infoLoading}
171+
tablets={clusterTablets}
166172
className={b('tablets-table')}
167173
/>
168174
</div>

src/containers/Header/breadcrumbs.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ const getStorageGroupBreadcrumbs: GetBreadcrumbs<StorageGroupBreadcrumbsOptions>
178178
};
179179

180180
const getTabletBreadcrumbs: GetBreadcrumbs<TabletBreadcrumbsOptions> = (options, query = {}) => {
181-
const {tabletId, tabletType, nodeId, nodeRole, nodeActiveTab = TABLETS, tenantName} = options;
181+
const {tabletId, tabletType, tenantName} = options;
182182

183-
const breadcrumbs = getNodeBreadcrumbs({nodeId, nodeRole, nodeActiveTab, tenantName}, query);
183+
const breadcrumbs = tenantName
184+
? getTenantBreadcrumbs(options, query)
185+
: getClusterBreadcrumbs(options, query);
184186

185187
const lastItem = {
186188
text: tabletId || headerKeyset('breadcrumbs.tablet'),

src/containers/Tablet/Tablet.tsx

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ import {PageMetaWithAutorefresh} from '../../components/PageMeta/PageMeta';
1616
import {getTabletPagePath} from '../../routes';
1717
import {selectIsUserAllowedToMakeChanges} from '../../store/reducers/authentication/authentication';
1818
import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
19-
import {nodeApi} from '../../store/reducers/node/node';
2019
import {tabletApi} from '../../store/reducers/tablet';
2120
import {EFlag} from '../../types/api/enums';
2221
import type {TTabletStateInfo} from '../../types/api/tablet';
23-
import {EType} from '../../types/api/tablet';
2422
import type {ITabletPreparedHistoryItem} from '../../types/store/tablet';
2523
import {cn} from '../../utils/cn';
2624
import {CLUSTER_DEFAULT_TITLE} from '../../utils/constants';
@@ -59,12 +57,9 @@ const TABLET_PAGE_TABS = [
5957
];
6058

6159
const tabletTabSchema = z.nativeEnum(TABLET_TABS_IDS).catch(TABLET_TABS_IDS.history);
62-
const eTypeSchema = z.nativeEnum(EType).or(z.undefined()).catch(undefined);
6360

6461
const tabletQueryParams = {
65-
nodeId: StringParam,
6662
tenantName: StringParam,
67-
type: StringParam,
6863
clusterName: StringParam,
6964
activeTab: StringParam,
7065
};
@@ -74,18 +69,12 @@ export function Tablet() {
7469

7570
const {id} = useParams<{id: string}>();
7671

77-
const [
78-
{
79-
nodeId: queryNodeId,
80-
tenantName: queryDatabase,
81-
type: queryTabletType,
82-
clusterName: queryClusterName,
83-
},
84-
] = useQueryParams(tabletQueryParams);
72+
const [{tenantName: queryDatabase, clusterName: queryClusterName}] =
73+
useQueryParams(tabletQueryParams);
8574

8675
const [autoRefreshInterval] = useAutoRefreshInterval();
8776
const {currentData, isFetching, error} = tabletApi.useGetTabletQuery(
88-
{id, database: queryDatabase ?? undefined, nodeId: queryNodeId ?? undefined},
77+
{id, database: queryDatabase ?? undefined},
8978
{pollingInterval: autoRefreshInterval},
9079
);
9180

@@ -96,24 +85,19 @@ export function Tablet() {
9685
tablet.TenantId ? {tenantId: tablet.TenantId} : skipToken,
9786
);
9887

99-
const nodeId = tablet.NodeId ?? queryNodeId ?? undefined;
10088
const database = (tenantPath || queryDatabase) ?? undefined;
10189

102-
const nodeRole = useNodeRole(nodeId?.toString());
103-
104-
const tabletType = tablet.Type || eTypeSchema.parse(queryTabletType);
90+
const tabletType = tablet.Type;
10591

10692
React.useEffect(() => {
10793
dispatch(
10894
setHeaderBreadcrumbs('tablet', {
109-
nodeId,
110-
nodeRole,
11195
tenantName: queryDatabase ?? undefined,
11296
tabletId: id,
11397
tabletType,
11498
}),
11599
);
116-
}, [dispatch, queryDatabase, id, nodeId, nodeRole, tabletType]);
100+
}, [dispatch, queryDatabase, id, tabletType]);
117101

118102
const {Leader, Type} = tablet;
119103
const metaItems: string[] = [];
@@ -246,17 +230,3 @@ function Channels({id, hiveId}: {id: string; hiveId: string}) {
246230
</LoaderWrapper>
247231
);
248232
}
249-
250-
function useNodeRole(nodeId: string | undefined) {
251-
const {currentData: node} = nodeApi.useGetNodeInfoQuery(nodeId ? {nodeId} : skipToken);
252-
253-
let nodeRole: 'Storage' | 'Compute' | undefined;
254-
255-
if (node) {
256-
// Compute nodes have tenantName, storage nodes doesn't
257-
const isStorage = !node?.Tenants?.[0];
258-
nodeRole = isStorage ? 'Storage' : 'Compute';
259-
}
260-
261-
return nodeRole;
262-
}

src/containers/Tablets/Tablets.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {skipToken} from '@reduxjs/toolkit/query';
22

33
import {ResponseError} from '../../components/Errors/ResponseError';
4-
import {TableSkeleton} from '../../components/TableSkeleton/TableSkeleton';
54
import {selectTabletsWithFqdn, tabletsApi} from '../../store/reducers/tablets';
65
import type {TabletsApiRequestParams} from '../../types/store/tablets';
76
import {cn} from '../../utils/cn';
@@ -38,14 +37,12 @@ export function Tablets({nodeId, path, database, className}: TabletsProps) {
3837
const loading = isFetching && currentData === undefined;
3938
const tablets = useTypedSelector((state) => selectTabletsWithFqdn(state, params));
4039

41-
if (loading) {
42-
return <TableSkeleton />;
43-
}
44-
4540
return (
4641
<div className={b(null, className)}>
4742
{error ? <ResponseError error={error} /> : null}
48-
{currentData ? <TabletsTable tablets={tablets} database={database} /> : null}
43+
{currentData || loading ? (
44+
<TabletsTable tablets={tablets} database={database} loading={loading} />
45+
) : null}
4946
</div>
5047
);
5148
}

src/containers/Tablets/TabletsTable.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {DeveloperUILinkButton} from '../../components/DeveloperUILinkButton/Deve
77
import {EntityStatus} from '../../components/EntityStatus/EntityStatus';
88
import {InternalLink} from '../../components/InternalLink';
99
import {ResizeableDataTable} from '../../components/ResizeableDataTable/ResizeableDataTable';
10+
import {TableSkeleton} from '../../components/TableSkeleton/TableSkeleton';
1011
import {TabletState} from '../../components/TabletState/TabletState';
1112
import {getTabletPagePath} from '../../routes';
1213
import {selectIsUserAllowedToMakeChanges} from '../../store/reducers/authentication/authentication';
@@ -50,8 +51,6 @@ function getColumns({database}: {database?: string}) {
5051
}
5152

5253
const tabletPath = getTabletPagePath(row.TabletId, {
53-
nodeId: row.NodeId,
54-
type: row.Type,
5554
tenantName: database,
5655
});
5756

@@ -168,9 +167,13 @@ interface TabletsTableProps {
168167
fqdn?: string;
169168
})[];
170169
className?: string;
170+
loading?: boolean;
171171
}
172172

173-
export function TabletsTable({database, tablets, className}: TabletsTableProps) {
173+
export function TabletsTable({database, tablets, className, loading}: TabletsTableProps) {
174+
if (loading) {
175+
return <TableSkeleton />;
176+
}
174177
return (
175178
<ResizeableDataTable
176179
wrapperClassName={className}

src/containers/Tenant/ObjectSummary/ObjectSummary.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,11 @@
144144
background-color: transparent;
145145
}
146146
}
147+
&__overview-title {
148+
@include info-viewer-title();
149+
}
150+
&__overview-item-content {
151+
text-align: end;
152+
white-space: nowrap;
153+
}
147154
}

0 commit comments

Comments
 (0)