+
+
{messages.caseTitleOrDescription}
+ }
+ type="search"
+ value={search}
+ onValueChange={setSearch}
+ maxLength={100}
+ />
+
+
+
+
{messages.status}
+
+
+ }>
+ {selectedStatuses === 'all' || selectedStatuses.size === 0
+ ? messages.selectStatus
+ : `${selectedStatuses.size} ${messages.selected}`}
+
+
+
+ {testRunCaseStatus.map((status) => (
+ }
+ className="flex items-center"
+ >
+ {testRunCaseStatusMessages[status.uid]}
+
+ ))}
+
+
+
+
+
+
{messages.tags}
+
+
+ }>
+ {selectedTags === 'all' || selectedTags.size === 0
+ ? messages.selectTags
+ : `${selectedTags.size} ${messages.selected}`}
+
+
+
+ {tags.map((tag) => (
+
+ {tag.name}
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
index 9bbeee9..f9626a9 100644
--- a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
+++ b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
@@ -35,6 +35,15 @@ export default function Page({ params }: { params: { projectId: string; runId: s
expectedResult: t('expected_result'),
detailsOfTheStep: t('details_of_the_step'),
close: t('close'),
+ filter: t('filter'),
+ clearAll: t('clear_all'),
+ apply: t('apply'),
+ selectStatus: t('select_status'),
+ pleaseSave: t('please_save'),
+ caseTitleOrDescription: t('case_title_or_description'),
+ selected: t('selected'),
+ tags: t('tags'),
+ selectTags: t('select_tags'),
};
const rst = useTranslations('RunStatus');
diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/runsControl.ts b/frontend/src/app/[locale]/projects/[projectId]/runs/runsControl.ts
index dd1c2ee..0a30414 100644
--- a/frontend/src/app/[locale]/projects/[projectId]/runs/runsControl.ts
+++ b/frontend/src/app/[locale]/projects/[projectId]/runs/runsControl.ts
@@ -315,8 +315,31 @@ async function updateRunCases(jwt: string, runId: number, testCases: CaseType[])
}
}
-async function fetchProjectCases(jwt: string, projectId: number, runId: number) {
- const url = `${apiServer}/cases/byproject?projectId=${projectId}&runId=${runId}`;
+async function fetchProjectCases(
+ jwt: string,
+ projectId: number,
+ runId: number,
+ search?: string,
+ status?: string[],
+ tag?: string[]
+) {
+ const queryParams = [`projectId=${projectId}&runId=${runId}`];
+
+ if (search) {
+ queryParams.push(`search=${search}`);
+ }
+
+ if (status && status.length > 0) {
+ queryParams.push(`status=${status.join(',')}`);
+ }
+
+ if (tag && tag.length > 0) {
+ queryParams.push(`tag=${tag.join(',')}`);
+ }
+
+ const query = `?${queryParams.join('&')}`;
+
+ const url = `${apiServer}/cases/byproject${query}`;
try {
const response = await fetch(url, {
diff --git a/frontend/types/run.ts b/frontend/types/run.ts
index c696fe3..2680c75 100644
--- a/frontend/types/run.ts
+++ b/frontend/types/run.ts
@@ -80,6 +80,15 @@ type RunMessages = {
expectedResult: string;
detailsOfTheStep: string;
close: string;
+ filter: string;
+ clearAll: string;
+ apply: string;
+ selectStatus: string;
+ pleaseSave: string;
+ caseTitleOrDescription: string;
+ selected: string;
+ tags: string;
+ selectTags: string;
};
export type { RunType, RunCaseType, RunStatusCountType, ProgressSeriesType, RunsMessages, RunMessages };