Skip to content

Commit

Permalink
adding filter by analysis to Application inventory table
Browse files Browse the repository at this point in the history
  • Loading branch information
HadasahR committed Sep 18, 2024
1 parent f389539 commit a639050
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ import { useFetchTagsWithTagItems } from "@app/queries/tags";

// Relative components
import { AnalysisWizard } from "../analysis-wizard/analysis-wizard";
import { ApplicationAnalysisStatus } from "../components/application-analysis-status";
import {
ApplicationAnalysisStatus,
taskStateToAnalyze,
} from "../components/application-analysis-status";
import { ApplicationAssessmentStatus } from "../components/application-assessment-status";
import { ApplicationBusinessService } from "../components/application-business-service";
import { ApplicationDependenciesForm } from "@app/components/ApplicationDependenciesFormContainer/ApplicationDependenciesForm";
Expand Down Expand Up @@ -499,7 +502,24 @@ export const ApplicationsTable: React.FC = () => {
],
getItemValue: (item) => normalizeRisk(item.risk) ?? "",
},
{
categoryKey: "analysis",
title: t("terms.analysis"),
type: FilterType.multiselect,
placeholderText:
t("actions.filterBy", {
what: t("terms.analysis").toLowerCase(),
}) + "...",
selectOptions: Array.from(taskStateToAnalyze).map(
([taskState, displayStatus]) => ({
value: taskState,
label: t(`${displayStatus}`),
})
),
getItemValue: (item) => item?.tasks.currentAnalyzer?.state || "No Task",
},
],

initialItemsPerPage: 10,
hasActionsColumn: true,
isSelectionEnabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface ApplicationAnalysisStatusProps {
state: TaskState;
}

const taskStateToAnalyze: Map<TaskState, IconedStatusPreset> = new Map([
export const taskStateToAnalyze: Map<TaskState, IconedStatusPreset> = new Map([
["not supported", "Canceled"],
["Canceled", "Canceled"],
["Created", "Scheduled"],
Expand Down

0 comments on commit a639050

Please sign in to comment.