Skip to content

Commit e4a74b1

Browse files
committed
fix: merge fixes
1 parent ae07d11 commit e4a74b1

File tree

10 files changed

+29
-14
lines changed

10 files changed

+29
-14
lines changed

src/components/DiskStateProgressBar/DiskStateProgressBar.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
background-color: unset;
3636
}
3737

38-
&#{&}_compact#{&}_faded {
38+
&_inactive {
3939
opacity: 0.5;
4040
}
4141

src/components/DiskStateProgressBar/DiskStateProgressBar.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface DiskStateProgressBarProps {
1414
severity?: number;
1515
compact?: boolean;
1616
faded?: boolean;
17+
inactive?: boolean;
1718
empty?: boolean;
1819
content?: React.ReactNode;
1920
className?: string;
@@ -24,13 +25,14 @@ export function DiskStateProgressBar({
2425
severity,
2526
compact,
2627
faded,
28+
inactive,
2729
empty,
2830
content,
2931
className,
3032
}: DiskStateProgressBarProps) {
3133
const [inverted] = useSetting<boolean | undefined>(INVERTED_DISKS_KEY);
3234

33-
const mods: Record<string, boolean | undefined> = {inverted, compact, faded, empty};
35+
const mods: Record<string, boolean | undefined> = {inverted, compact, faded, empty, inactive};
3436

3537
const color = severity !== undefined && getSeverityColor(severity);
3638
if (color) {

src/components/VDisk/VDisk.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface VDiskProps {
2121
data?: PreparedVDisk;
2222
nodes?: NodesMap;
2323
compact?: boolean;
24+
inactive?: boolean;
2425
faded?: boolean;
2526
showPopup?: boolean;
2627
onShowPopup?: VoidFunction;
@@ -32,6 +33,7 @@ export const VDisk = ({
3233
data = {},
3334
nodes,
3435
compact,
36+
inactive,
3537
faded,
3638
showPopup,
3739
onShowPopup,
@@ -90,6 +92,7 @@ export const VDisk = ({
9092
severity={data.Severity}
9193
compact={compact}
9294
faded={faded}
95+
inactive={inactive}
9396
className={progressBarClassName}
9497
/>
9598
</InternalLink>

src/containers/Storage/PDisk/PDisk.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ const b = cn('pdisk-storage');
1919
interface PDiskProps {
2020
data?: PreparedPDisk;
2121
vDisks?: PreparedVDisk[];
22+
inactiveVdisks?: PreparedVDisk[];
2223
showPopup?: boolean;
2324
onShowPopup?: VoidFunction;
2425
onHidePopup?: VoidFunction;
2526
className?: string;
2627
progressBarClassName?: string;
27-
groupId?: string;
2828
}
2929

3030
export const PDisk = ({
3131
data = {},
3232
vDisks,
33+
inactiveVdisks,
3334
showPopup,
3435
onShowPopup,
3536
onHidePopup,
3637
className,
3738
progressBarClassName,
38-
groupId,
3939
}: PDiskProps) => {
4040
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
4141

@@ -76,9 +76,7 @@ export const PDisk = ({
7676
>
7777
<VDiskWithDonorsStack
7878
data={vdisk}
79-
faded={
80-
groupId ? groupId !== vdisk.VDiskId?.GroupID?.toString() : false
81-
}
79+
inactive={inactiveVdisks?.includes(vdisk)}
8280
stackClassName={b('donors-stack')}
8381
compact
8482
/>

src/containers/Storage/PaginatedStorage.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {useStorageNodesSelectedColumns} from './StorageNodes/columns/hooks';
1919
interface PaginatedStorageProps {
2020
database?: string;
2121
nodeId?: string;
22-
groupId: string;
22+
groupId?: string;
2323
parentContainer?: Element | null;
2424
}
2525

@@ -54,6 +54,7 @@ export const PaginatedStorage = ({
5454
additionalNodesProps,
5555
visibleEntities,
5656
database,
57+
groupId,
5758
});
5859

5960
const {

src/containers/Storage/Storage.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export const Storage = ({database, nodeId, groupId, pDiskId}: StorageProps) => {
112112
additionalNodesProps,
113113
visibleEntities,
114114
database,
115+
groupId: valueIsDefined(groupId) ? groupId.toString() : undefined,
115116
});
116117

117118
const {

src/containers/Storage/StorageNodes/columns/columns.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const b = cn('ydb-storage-nodes-columns');
1717
const getStorageNodesColumns = (
1818
additionalNodesProps: AdditionalNodesProps | undefined,
1919
database?: string,
20+
groupId?: string,
2021
) => {
2122
const getNodeRef = additionalNodesProps?.getNodeRef;
22-
const groupId = additionalNodesProps?.groupId;
2323

2424
const columns: StorageNodesColumn[] = [
2525
{
@@ -80,9 +80,17 @@ const getStorageNodesColumns = (
8080
(vdisk) => vdisk.PDiskId === pDisk.PDiskId,
8181
);
8282

83+
const inactiveVdisks = vDisks?.filter(
84+
(vdisk) => groupId && vdisk.VDiskId?.GroupID !== Number(groupId),
85+
);
86+
8387
return (
8488
<div className={b('pdisks-item')} key={pDisk.PDiskId}>
85-
<PDisk data={pDisk} vDisks={vDisks} groupId={groupId} />
89+
<PDisk
90+
data={pDisk}
91+
vDisks={vDisks}
92+
inactiveVdisks={inactiveVdisks}
93+
/>
8694
</div>
8795
);
8896
})}
@@ -102,8 +110,9 @@ const getStorageNodesColumns = (
102110
export const getPreparedStorageNodesColumns = ({
103111
additionalNodesProps,
104112
database,
113+
groupId,
105114
}: GetStorageNodesColumnsParams) => {
106-
const rawColumns = getStorageNodesColumns(additionalNodesProps, database);
115+
const rawColumns = getStorageNodesColumns(additionalNodesProps, database, groupId);
107116

108117
const sortableColumns = rawColumns.map((column) => ({
109118
...column,

src/containers/Storage/StorageNodes/columns/hooks.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export function useStorageNodesSelectedColumns({
1717
visibleEntities,
1818
database,
1919
additionalNodesProps,
20+
groupId,
2021
}: GetStorageNodesColumnsParams) {
2122
const columns = React.useMemo(() => {
22-
return getPreparedStorageNodesColumns({database, additionalNodesProps});
23-
}, [database, additionalNodesProps]);
23+
return getPreparedStorageNodesColumns({database, additionalNodesProps, groupId});
24+
}, [database, additionalNodesProps, groupId]);
2425

2526
const requiredColumns = React.useMemo(() => {
2627
if (visibleEntities === VISIBLE_ENTITIES.missing) {

src/containers/Storage/StorageNodes/columns/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ export interface GetStorageNodesColumnsParams {
1111
additionalNodesProps: AdditionalNodesProps | undefined;
1212
visibleEntities?: VisibleEntities;
1313
database?: string;
14+
groupId?: string;
1415
}

src/types/additionalProps.ts

-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ export type NodeAddress = Pick<TSystemStateInfo, 'Host' | 'Endpoints' | 'NodeId'
2828
export type GetNodeRefFunc = (node?: NodeAddress) => string | null;
2929

3030
export interface AdditionalNodesProps extends Record<string, unknown> {
31-
groupId?: string;
3231
getNodeRef?: GetNodeRefFunc;
3332
}

0 commit comments

Comments
 (0)