Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change default tables columns, reorder columns #1694

Merged
merged 2 commits into from
Nov 26, 2024
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
8 changes: 4 additions & 4 deletions src/containers/Nodes/columns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export function getNodesColumns(params: GetNodesColumnsParams): Column<NodesPrep
getNodeNameColumn<NodesPreparedEntity>(),
getDataCenterColumn<NodesPreparedEntity>(),
getRackColumn<NodesPreparedEntity>(),
getVersionColumn<NodesPreparedEntity>(),
getUptimeColumn<NodesPreparedEntity>(),
getMemoryColumn<NodesPreparedEntity>(),
getRAMColumn<NodesPreparedEntity>(),
getPoolsColumn<NodesPreparedEntity>(),
getCpuColumn<NodesPreparedEntity>(),
getPoolsColumn<NodesPreparedEntity>(),
getRAMColumn<NodesPreparedEntity>(),
getMemoryColumn<NodesPreparedEntity>(),
getLoadAverageColumn<NodesPreparedEntity>(),
getVersionColumn<NodesPreparedEntity>(),
getTabletsColumn<NodesPreparedEntity>(params),
];

Expand Down
9 changes: 3 additions & 6 deletions src/containers/Nodes/columns/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ export const NODES_TABLE_SELECTED_COLUMNS_LS_KEY = 'nodesTableSelectedColumns';
export const DEFAULT_NODES_COLUMNS: NodesColumnId[] = [
'NodeId',
'Host',
'DC',
'Rack',
'Version',
'Uptime',
'Memory',
'Pools',
'LoadAverage',
'CPU',
'RAM',
'Version',
'Tablets',
];

Expand Down
5 changes: 0 additions & 5 deletions src/containers/Storage/StorageGroups/columns/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ export type StorageGroupsColumnId = ValueOf<typeof STORAGE_GROUPS_COLUMNS_IDS>;
export const DEFAULT_STORAGE_GROUPS_COLUMNS: StorageGroupsColumnId[] = [
'GroupId',
'PoolName',
'MediaType',
'Erasure',
'Used',
'Limit',
'Usage',
'Read',
'Write',
'VDisks',
];

Expand Down
12 changes: 6 additions & 6 deletions src/containers/Storage/StorageNodes/columns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ export const getStorageNodesColumns = ({

const columns = [
getNodeIdColumn<PreparedStorageNode>(),
getNodeNameColumn<PreparedStorageNode>(),
getHostColumn<PreparedStorageNode>({getNodeRef, database}),
getNodeNameColumn<PreparedStorageNode>(),
getDataCenterColumn<PreparedStorageNode>(),
getRackColumn<PreparedStorageNode>(),
getVersionColumn<PreparedStorageNode>(),
getMemoryColumn<PreparedStorageNode>(),
getRAMColumn<PreparedStorageNode>(),
getPoolsColumn<PreparedStorageNode>(),
getUptimeColumn<PreparedStorageNode>(),
getCpuColumn<PreparedStorageNode>(),
getPoolsColumn<PreparedStorageNode>(),
getRAMColumn<PreparedStorageNode>(),
getMemoryColumn<PreparedStorageNode>(),
getDiskSpaceUsageColumn<PreparedStorageNode>(),
getUptimeColumn<PreparedStorageNode>(),
getVersionColumn<PreparedStorageNode>(),
getMissingDisksColumn<PreparedStorageNode>(),
getPDisksColumn({viewContext}),
];
Expand Down
5 changes: 2 additions & 3 deletions src/containers/Storage/StorageNodes/columns/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ export const STORAGE_NODES_SELECTED_COLUMNS_LS_KEY = 'storageNodesSelectedColumn
export const DEFAULT_STORAGE_NODES_COLUMNS: NodesColumnId[] = [
'NodeId',
'Host',
'DC',
'Rack',
'Pools',
'Uptime',
'CPU',
'RAM',
'PDisks',
];
export const REQUIRED_STORAGE_NODES_COLUMNS: NodesColumnId[] = ['NodeId'];
Expand Down
6 changes: 4 additions & 2 deletions tests/suites/nodes/nodes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ test.describe('Test Nodes Paginated Table', async () => {

expect(rowData).toHaveProperty('Host');
expect(rowData).toHaveProperty('Uptime');
expect(rowData).toHaveProperty('Detailed Memory');
expect(rowData).toHaveProperty('Pools');
expect(rowData).toHaveProperty('CPU');
expect(rowData).toHaveProperty('RAM');
expect(rowData).toHaveProperty('Version');
expect(rowData).toHaveProperty('Tablets');
});

test('Column values can be retrieved correctly', async ({page}) => {
Expand Down
11 changes: 6 additions & 5 deletions tests/suites/storage/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ test.describe('Test Storage Paginated Table', async () => {

const rowData = await storageTable.getRowData(0);

expect(rowData).toHaveProperty('Group ID');
expect(rowData).toHaveProperty('Pool Name');
expect(rowData).toHaveProperty('Type');
expect(rowData).toHaveProperty('Erasure');
expect(rowData).toHaveProperty('Usage');
expect(rowData).toHaveProperty('Used');
expect(rowData).toHaveProperty('VDisks');
});

test('Column values can be retrieved correctly', async ({page}) => {
Expand All @@ -117,12 +118,12 @@ test.describe('Test Storage Paginated Table', async () => {
await paginatedTable.waitForTableToLoad();
await paginatedTable.waitForTableData();

const typeValues = await paginatedTable.getColumnValues('Type');
const poolValues = await paginatedTable.getColumnValues('Pool Name');
const erasureValues = await paginatedTable.getColumnValues('Erasure');

expect(typeValues.length).toBeGreaterThan(0);
expect(poolValues.length).toBeGreaterThan(0);
expect(erasureValues.length).toBeGreaterThan(0);
expect(typeValues.length).toBe(erasureValues.length);
expect(poolValues.length).toBe(erasureValues.length);
});

test('Clicking on Group ID header sorts the table', async ({page}) => {
Expand Down
Loading