Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/containers/PDiskPage/PDiskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function PDiskPage() {
const handleAfterAction = () => {
if (pDiskParamsDefined) {
dispatch(
api.util.invalidateTags([{type: 'PDiskData', id: getPDiskId(nodeId, pDiskId)}]),
api.util.invalidateTags([{type: 'PDiskData', id: getPDiskId({nodeId, pDiskId})}]),
'StorageData',
);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ export function PDiskPage() {
<EntityPageTitle
entityName={pDiskPageKeyset('pdisk')}
status={getSeverityColor(Severity)}
id={getPDiskId(nodeId, pDiskId)}
id={getPDiskId({nodeId, pDiskId})}
/>
<DecommissionLabel decommission={DecommitStatus} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/store/reducers/pdisk/pdisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const pDiskApi = api.injectEndpoints({
'All',
{
type: 'PDiskData',
id: getPDiskId(arg.nodeId, arg.pDiskId),
id: getPDiskId({nodeId: arg.nodeId, pDiskId: arg.pDiskId}),
},
],
}),
Expand Down
3 changes: 2 additions & 1 deletion src/store/reducers/storage/prepareGroupsDisks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export function prepareGroupsPDisk(data: TStoragePDisk & {NodeId?: number} = {})
};

const StringifiedId =
bscPDisk.PDiskId || getPDiskId(mergedPDiskData.NodeId, mergedPDiskData.PDiskId);
bscPDisk.PDiskId ||
getPDiskId({nodeId: mergedPDiskData.NodeId, pDiskId: mergedPDiskData.PDiskId});

const {AllocatedPercent, AllocatedSize, AvailableSize, TotalSize} = preparePDiskSizeFields({
AvailableSize: mergedPDiskData.AvailableSize,
Expand Down
8 changes: 7 additions & 1 deletion src/utils/disks/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ export function getColorSeverity(color?: EFlag) {
return color ? DISK_COLOR_STATE_TO_NUMERIC_SEVERITY[color] : 0;
}

export function getPDiskId(nodeId?: string | number | null, pDiskId?: string | number | null) {
export function getPDiskId({
nodeId,
pDiskId,
}: {
nodeId?: string | number | null;
pDiskId?: string | number | null;
}) {
if (valueIsDefined(nodeId) && valueIsDefined(pDiskId)) {
return `${nodeId}-${pDiskId}`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/disks/prepareDisks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function prepareWhiteboardPDiskData(pdiskState: TPDiskStateInfo = {}): Pr
...restPDiskFields
} = pdiskState;

const StringifiedId = getPDiskId(PDiskId, NodeId);
const StringifiedId = getPDiskId({nodeId: NodeId, pDiskId: PDiskId});

const Type = getPDiskType(Category);

Expand Down
Loading