Skip to content

Commit 6acdcaf

Browse files
committed
feat: add boot and test lab cards
Closes #1616
1 parent 749d70c commit 6acdcaf

File tree

7 files changed

+54
-1
lines changed

7 files changed

+54
-1
lines changed

dashboard/src/locales/messages/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const messages = {
5353
'filter.architectureSubtitle': 'Please select one or more Architectures:',
5454
'filter.bootDuration': 'Boot duration',
5555
'filter.bootIssue': 'Boot issue',
56+
'filter.bootLab': 'Boot Lab',
5657
'filter.bootOrigin': 'Boot origin',
5758
'filter.bootPlatform': 'Boot Platforms',
5859
'filter.bootStatus': 'Boot Status',
@@ -93,6 +94,7 @@ export const messages = {
9394
'filter.tableFilter': 'Status filters:',
9495
'filter.testDuration': 'Test duration',
9596
'filter.testIssue': 'Test issue',
97+
'filter.testLab': 'Test Lab',
9698
'filter.testOrigin': 'Test origin',
9799
'filter.testPlatform': 'Test Platforms',
98100
'filter.testStatus': 'Test Status',

dashboard/src/pages/TreeDetails/Tabs/Boots/BootsTab.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ const BootsTab = ({
284284
data={summaryBootsData?.origins ?? {}}
285285
filterSection="bootOrigin"
286286
/>,
287+
<MemoizedFilterCard
288+
cardTitle="filter.labs"
289+
key="labs"
290+
diffFilter={diffFilter}
291+
data={summaryBootsData?.labs ?? {}}
292+
filterSection="bootLab"
293+
hideSingleValue={false}
294+
/>,
287295
],
288296
footerCards: [
289297
<MemoizedIssuesList

dashboard/src/pages/TreeDetails/Tabs/Tests/TestsTab.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ const TestsTab = ({
285285
data={summaryTestsData?.origins ?? {}}
286286
filterSection="testOrigin"
287287
/>,
288+
<MemoizedFilterCard
289+
cardTitle="filter.labs"
290+
key="labs"
291+
diffFilter={diffFilter}
292+
data={summaryTestsData?.labs ?? {}}
293+
filterSection="testLab"
294+
hideSingleValue={false}
295+
/>,
288296
],
289297
footerCards: [
290298
<MemoizedIssuesList

dashboard/src/pages/TreeDetails/TreeDetailsFilter.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ type PossibleTreeDetailsFilters = Pick<
3434
| 'bootOrigin'
3535
| 'testOrigin'
3636
| 'buildLab'
37+
| 'bootLab'
38+
| 'testLab'
3739
>;
3840

3941
interface ITreeDetailsFilter {
@@ -69,6 +71,8 @@ export const createFilter = (data: TreeDetailsSummary): TFilter => {
6971
filters.testOrigin = {};
7072

7173
filters.buildLab = {};
74+
filters.bootLab = {};
75+
filters.testLab = {};
7276

7377
// Filters affecting all tabs
7478
const allFilters = data.filters.all;
@@ -113,6 +117,9 @@ export const createFilter = (data: TreeDetailsSummary): TFilter => {
113117
for (const o of bootFilters.origins) {
114118
filters.bootOrigin[o] = false;
115119
}
120+
for (const l of bootFilters.labs) {
121+
filters.bootLab[l] = false;
122+
}
116123

117124
// Test tab filters
118125
const testFilters = data.filters.tests;
@@ -125,6 +132,9 @@ export const createFilter = (data: TreeDetailsSummary): TFilter => {
125132
for (const o of testFilters.origins) {
126133
filters.testOrigin[o] = false;
127134
}
135+
for (const l of testFilters.labs) {
136+
filters.testLab[l] = false;
137+
}
128138

129139
return filters;
130140
};
@@ -208,6 +218,18 @@ const sectionTrees: ISectionItem[] = [
208218
sectionKey: 'buildLab',
209219
isGlobal: false,
210220
},
221+
{
222+
title: 'filter.bootLab',
223+
subtitle: 'filter.labsSubtitle',
224+
sectionKey: 'bootLab',
225+
isGlobal: false,
226+
},
227+
{
228+
title: 'filter.testLab',
229+
subtitle: 'filter.labsSubtitle',
230+
sectionKey: 'testLab',
231+
isGlobal: false,
232+
},
211233
];
212234

213235
// TODO: some sections can be hidden if there is only 1 value for them (e.g., origins, labs)

dashboard/src/types/commonDetails.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type TestSummary = {
2121
environment_compatible?: PropertyStatusCounts;
2222
environment_misc?: PropertyStatusCounts;
2323
platforms?: PropertyStatusCounts;
24+
labs: Record<string, RequiredStatusCount>;
2425
};
2526

2627
type BuildSummary = {
@@ -51,11 +52,12 @@ export type LocalFilters = {
5152
issues: IssueFilterItem[];
5253
has_unknown_issue: boolean;
5354
origins: string[];
55+
labs: string[];
5456
};
5557

5658
export type DetailsFilters = {
5759
all: GlobalFilters;
58-
builds: LocalFilters & { labs: string[] };
60+
builds: LocalFilters;
5961
boots: LocalFilters;
6062
tests: LocalFilters;
6163
};

dashboard/src/types/general.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ export const zFilterObjectsKeys = z.enum([
164164
'bootOrigin',
165165
'testOrigin',
166166
'buildLab',
167+
'bootLab',
168+
'testLab',
167169
]);
168170

169171
export const zFilterNumberKeys = z.enum([
@@ -210,6 +212,8 @@ export const zDiffFilter = z
210212
bootOrigin: zFilterBoolValue,
211213
testOrigin: zFilterBoolValue,
212214
buildLab: zFilterBoolValue,
215+
bootLab: zFilterBoolValue,
216+
testLab: zFilterBoolValue,
213217
} satisfies Record<TFilterKeys, unknown>),
214218
z.record(z.never()),
215219
])
@@ -281,6 +285,8 @@ const requestFilters = {
281285
'boot.origin',
282286
'test.origin',
283287
'build.lab',
288+
'boot.lab',
289+
'test.lab',
284290
],
285291
issueListing: [
286292
'origin',
@@ -325,6 +331,8 @@ export const filterFieldMap = {
325331
'build.status': 'buildStatus',
326332
'build.origin': 'buildOrigin',
327333
'build.lab': 'buildLab',
334+
'boot.lab': 'bootLab',
335+
'test.lab': 'testLab',
328336
origin: 'origins',
329337
'issue.culprit': 'issueCulprits',
330338
'issue.categories': 'issueCategories',

dashboard/src/utils/search.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ const diffFilterMinifiedParams: Record<TFilterKeys, string> = {
194194
buildOrigin: 'buo',
195195
bootOrigin: 'boo',
196196
testOrigin: 'to',
197+
buildLab: 'bul',
198+
bootLab: 'bol',
199+
testLab: 'tl',
197200
} as const satisfies Record<TFilterKeys, string>;
198201

199202
type MinifiedParams = Record<

0 commit comments

Comments
 (0)