Skip to content

Commit 292097d

Browse files
committed
fix: use all PipelineRunTypes labels
1 parent d05d618 commit 292097d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/Filter/utils/pipelineruns-filter-utils.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export const createFilterObj = (
1212
}
1313

1414
const key = keyExtractor(item);
15+
const capitalized = key.charAt(0).toUpperCase() + key.slice(1);
16+
1517
if (validKeys.includes(key)) {
16-
if (acc[key] !== undefined) {
17-
acc[key] = acc[key] + 1;
18+
if (acc[capitalized] !== undefined) {
19+
acc[capitalized] = acc[capitalized] + 1;
1820
} else {
19-
acc[key] = 1;
21+
acc[capitalized] = 1;
2022
}
2123
}
2224

src/utils/pipelinerun-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ const QueryRun = curry(
6161
export const QueryPipelineRun = QueryRun(getPipelineRuns, PipelineRunModel);
6262
export const QueryTaskRun = QueryRun(getTaskRuns, TaskRunModel);
6363

64-
export const pipelineRunTypes = [PipelineRunType.BUILD as string, PipelineRunType.TEST as string];
64+
export const pipelineRunTypes = Object.values(PipelineRunType).map((type) => type as string);

0 commit comments

Comments
 (0)