Skip to content

Commit

Permalink
refactor: Update columnType check in FilterField component
Browse files Browse the repository at this point in the history
feat: Introduce special characters as separators in removeColumnTypePrefix function
  • Loading branch information
thiagodallacqua-hpe committed Oct 31, 2024
1 parent b7187bc commit 9529b4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const FilterField = ({
const users = Loadable.getOrElse([], useObservable(userStore.getUsers()));
const resourcePools = Loadable.getOrElse([], useObservable(clusterStore.resourcePools));
const currentColumn = useMemo(
() => columns.find((c) => c.column === field.columnName),
[columns, field.columnName],
() => columns.find((c) => c.type === field.type && c.column === field.columnName),
[columns, field.columnName, field.type],
);

const columnType = useMemo(() => {
Expand Down
3 changes: 2 additions & 1 deletion webui/react/src/utils/flatRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export const removeColumnTypePrefix = (columnName: V1ColumnType): string => {
return columnName.replace('COLUMN_TYPE_', '');
};

/// wanna know why this separator is used? see https://hpe-aiatscale.atlassian.net/browse/ET-785
/// we want to use special characters as "separators" to prevent user input to match with such when creating the arbitrary metadata
export const COLUMN_SEPARATOR = '␟';
export const METADATA_SEPARATOR = '\u241F' as const; // TODO: unify after merging PR 10052

export const formatColumnKey = (col: ProjectColumn, required = false): string => {
Expand Down

0 comments on commit 9529b4b

Please sign in to comment.