From b063426bc02e4eaa234d99f21847179a002418f0 Mon Sep 17 00:00:00 2001 From: Thiago Dallacqua Date: Mon, 21 Oct 2024 13:52:48 -0300 Subject: [PATCH] refactor: Remove unnecessary `toLowerCase` method from column type capture. --- webui/react/package-lock.json | 8 ++++---- webui/react/src/components/ColumnPickerMenu.tsx | 7 +++---- webui/react/src/pages/FlatRuns/FlatRuns.tsx | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/webui/react/package-lock.json b/webui/react/package-lock.json index 3766d9268e48..e9933e80a140 100644 --- a/webui/react/package-lock.json +++ b/webui/react/package-lock.json @@ -617,9 +617,9 @@ } }, "node_modules/@codemirror/commands": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.7.0.tgz", - "integrity": "sha512-+cduIZ2KbesDhbykV02K25A5xIVrquSPz4UxxYBemRlAT2aW8dhwUgLDwej7q/RJUHKk4nALYcR1puecDvbdqw==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.7.1.tgz", + "integrity": "sha512-llTrboQYw5H4THfhN4U3qCnSZ1SOJ60ohhz+SzU0ADGtwlc533DtklQP0vSFaQuCPDn3BPpOd1GbbnUtwNjsrw==", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.4.0", @@ -7793,7 +7793,7 @@ "node_modules/hew": { "name": "@hpe.com/hew", "version": "0.6.52", - "resolved": "git+ssh://git@github.com/determined-ai/hew.git#c54a14dabdfdccb23f405c9302b38a9c58b174ba", + "resolved": "git+ssh://git@github.com/determined-ai/hew.git#95a8cd475fa0a1446a4ec57a70dd220df0920b1e", "dependencies": { "@ant-design/icons": "^5.0.1", "@codemirror/lang-json": "^6.0.1", diff --git a/webui/react/src/components/ColumnPickerMenu.tsx b/webui/react/src/components/ColumnPickerMenu.tsx index 3fa9335b351e..f3bdccbfd398 100644 --- a/webui/react/src/components/ColumnPickerMenu.tsx +++ b/webui/react/src/components/ColumnPickerMenu.tsx @@ -97,7 +97,7 @@ const ColumnPickerTab: React.FC = ({ const allFilteredColumnsChecked = useMemo(() => { return filteredColumns.every((col) => { - const colType = col.type.replace('COLUMN_TYPE_', '').toLowerCase(); + const colType = col.type.replace('COLUMN_TYPE_', ''); if (col.column.includes('metadata')) return columnState.includes(col.column.concat(`_${colType}`)); @@ -108,7 +108,7 @@ const ColumnPickerTab: React.FC = ({ const handleShowHideAll = useCallback(() => { const filteredColumnMap: Record = filteredColumns.reduce((acc, col) => { - const colType = col.type.replace('COLUMN_TYPE_', '').toLowerCase(); + const colType = col.type.replace('COLUMN_TYPE_', ''); if (col.column.includes('metadata')) return { @@ -127,7 +127,7 @@ const ColumnPickerTab: React.FC = ({ ...new Set([ ...columnState, ...filteredColumns.map((col) => { - const colType = col.type.replace('COLUMN_TYPE_', '').toLowerCase(); + const colType = col.type.replace('COLUMN_TYPE_', ''); if (col.column.includes('metadata')) return col.column.concat(`_${colType}`); return col.column; @@ -179,7 +179,6 @@ const ColumnPickerTab: React.FC = ({ if (!checked) { onHeatmapSelectionRemove?.(targetCol); } - // TODO: work on a logic to map the metadata columns const newColumnSet = new Set(columnState); checked ? newColumnSet.add(targetCol) : newColumnSet.delete(targetCol); onVisibleColumnChange?.([...newColumnSet], pinnedCount); diff --git a/webui/react/src/pages/FlatRuns/FlatRuns.tsx b/webui/react/src/pages/FlatRuns/FlatRuns.tsx index f395c3e18c90..b14363ec67b6 100644 --- a/webui/react/src/pages/FlatRuns/FlatRuns.tsx +++ b/webui/react/src/pages/FlatRuns/FlatRuns.tsx @@ -321,7 +321,7 @@ const FlatRuns: React.FC = ({ projectId, workspaceId, searchId }) => { projectColumns, (columns) => { return columns.reduce((acc, col) => { - const colType = col.type.replace('COLUMN_TYPE_', '').toLowerCase(); + const colType = col.type.replace('COLUMN_TYPE_', ''); if (col.column.includes('metadata')) return { ...acc, [col.column.concat(`_${colType}`)]: col };