Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Talya notifications close all together bug #2118

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
"success": {
"saveWhat": "{{type}} {{what}} was successfully saved.",
"save": "{{type}} was successfully saved.",
"applicationDeleted": "{{appIDCount}} application(s) successfully deleted.",
"applicationDeleted": "{{appName}} application(s) successfully deleted.",
"assessmentAndReviewCopied": "Success! Assessment and review copied to selected applications",
"assessmentCopied": "Success! Assessment copied to selected applications",
"assessmentDiscarded": "Success! Assessment discarded for {{application}}.",
Expand Down
2 changes: 1 addition & 1 deletion client/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"toastr": {
"success": {
"added": "Éxito! {{what}} fue creado como un {{type}}.",
"applicationDeleted": "{{appIDCount}} aplicacione(s) descheda.",
"applicationDeleted": "{{appName}} aplicacione(s) descheda.",
"assessmentAndReviewCopied": "Éxito! Evaluación y revisión copiada a las aplicaciones seleccionadas",
"assessmentCopied": "Éxito! Evaluación copiada a las aplicaciones seleccionadas",
"assessmentDiscarded": "Éxito! Evaluación de {{application}} desechada.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ import {
import { useDeleteAssessmentMutation } from "@app/queries/assessments";
import { useDeleteReviewMutation } from "@app/queries/reviews";
import { useFetchTagsWithTagItems } from "@app/queries/tags";
import { TaskState } from "@app/api/models";

// 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 @@ -236,7 +240,7 @@ export const ApplicationsTable: React.FC = () => {
const onDeleteApplicationSuccess = (appIDCount: number) => {
pushNotification({
title: t("toastr.success.applicationDeleted", {
appIDCount: appIDCount,
appName: applicationsToDelete[0].name,
}),
variant: "success",
});
Expand Down Expand Up @@ -335,7 +339,7 @@ export const ApplicationsTable: React.FC = () => {
sort: "sessionStorage",
},
isLoading: isFetchingApplications,
sortableColumns: ["name", "businessService", "tags", "effort"],
sortableColumns: ["name", "businessService", "tags", "effort", "analysis"],
initialSort: { columnKey: "name", direction: "asc" },
initialColumns: {
name: { isIdentity: true },
Expand All @@ -345,6 +349,7 @@ export const ApplicationsTable: React.FC = () => {
businessService: app.businessService?.name || "",
tags: app.tags?.length || 0,
effort: app.effort || 0,
analysis: app.tasks.currentAnalyzer?.state || 0,
}),
filterCategories: [
{
Expand All @@ -367,7 +372,7 @@ export const ApplicationsTable: React.FC = () => {
title: t("terms.archetypes"),
type: FilterType.multiselect,
placeholderText:
t("actions.filterBy", {
t("action s.filterBy", {
what: t("terms.archetypes").toLowerCase(),
}) + "...",
selectOptions: referencedArchetypeRefs.map(({ name }) => ({
Expand Down Expand Up @@ -499,6 +504,44 @@ 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: Object.values(applications)
// .map(a => ({
// value: a?.tasks.currentAnalyzer?.state || "No Task",
// label: a?.tasks.currentAnalyzer?.state || "Not Started",
// }))
// .filter((v, i, a) => a.findIndex(v2 => v2.label === v.label) === i)
// .sort((a, b) => a.value.localeCompare(b.value)),
// getItemValue: (item) => item?.tasks.currentAnalyzer?.state || "No Task",
// }
{
categoryKey: "analysis",
title: t("terms.analysis"),
type: FilterType.multiselect,
placeholderText:
t("actions.filterBy", {
what: t("terms.analysis").toLowerCase(),
}) + "...",
selectOptions: Object.values(applications)
.map((a) => {
let value = a?.tasks.currentAnalyzer?.state || "No Task";
if (value === "No Task") {
value = "No task";
}
const label = taskStateToAnalyze.get(value as TaskState) || value;
return { value, label };
})
.filter((v, i, a) => a.findIndex((v2) => v2.label === v.label) === i)
.sort((a, b) => a.value.localeCompare(b.value)),
getItemValue: (item) => item?.tasks.currentAnalyzer?.state || "No Task",
},
],
initialItemsPerPage: 10,
hasActionsColumn: 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
Loading