Skip to content

Commit

Permalink
commiting without unrelated changes
Browse files Browse the repository at this point in the history
Signed-off-by: TalyaNaima <[email protected]>
  • Loading branch information
TalyaNaima authored and TalyaNaima committed Oct 13, 2024
1 parent a771b1d commit 7a473d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 52 deletions.
1 change: 1 addition & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@
"saveWhat": "{{type}} {{what}} was successfully saved.",
"save": "{{type}} was successfully saved.",
"applicationDeleted": "{{appName}} application(s) successfully deleted.",
"applicationsDeleted": "{{appIDcount}} 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
3 changes: 2 additions & 1 deletion client/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@
"toastr": {
"success": {
"added": "Éxito! {{what}} fue creado como un {{type}}.",
"applicationDeleted": "{{appName}} aplicacione(s) descheda.",
"applicationDeleted": "{{appName}} aplicacione descheda.",
"applicationsDeleted": "{{appIDcount}} 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,14 +85,10 @@ 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,
taskStateToAnalyze,
} from "../components/application-analysis-status";
import { ApplicationAnalysisStatus } 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 @@ -238,12 +234,20 @@ export const ApplicationsTable: React.FC = () => {
} = useDecoratedApplications(baseApplications, tasks);

const onDeleteApplicationSuccess = (appIDCount: number) => {
pushNotification({
title: t("toastr.success.applicationDeleted", {
appName: applicationsToDelete[0].name,
}),
variant: "success",
});
if (applicationsToDelete.length == 1)
pushNotification({
title: t("toastr.success.applicationDeleted", {
appName: applicationsToDelete[0].name,
}),
variant: "success",
});
else
pushNotification({
title: t("toastr.success.applicationsDeleted", {
appIdCount: appIDCount,
}),
variant: "success",
});
clearActiveItem();
setApplicationsToDelete([]);
};
Expand Down Expand Up @@ -339,7 +343,7 @@ export const ApplicationsTable: React.FC = () => {
sort: "sessionStorage",
},
isLoading: isFetchingApplications,
sortableColumns: ["name", "businessService", "tags", "effort", "analysis"],
sortableColumns: ["name", "businessService", "tags", "effort"],
initialSort: { columnKey: "name", direction: "asc" },
initialColumns: {
name: { isIdentity: true },
Expand Down Expand Up @@ -372,7 +376,7 @@ export const ApplicationsTable: React.FC = () => {
title: t("terms.archetypes"),
type: FilterType.multiselect,
placeholderText:
t("action s.filterBy", {
t("action.filterBy", {
what: t("terms.archetypes").toLowerCase(),
}) + "...",
selectOptions: referencedArchetypeRefs.map(({ name }) => ({
Expand Down Expand Up @@ -504,44 +508,6 @@ 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

0 comments on commit 7a473d6

Please sign in to comment.