Skip to content

Commit

Permalink
fix: breadcrumbs error in edit views
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Feb 27, 2024
1 parent 2ece457 commit 221183d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
"infosFound": "info{s} found",
"remediationPlan": "Remediation plan",
"treatmentPlan": "Treatment plan",
"plan": "Plan",
"asPDF": "as PDF",
"asCSV": "as CSV",
"draft": "Draft",
Expand Down
1 change: 1 addition & 0 deletions frontend/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
"infosFound": "info{s} trouvée{s}",
"remediationPlan": "Plan de remédiation",
"treatmentPlan": "Plan de traitement",
"plan": "Plan",
"asPDF": "en PDF",
"asCSV": "en CSV",
"draft": "Brouillon",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@
crumbs = tokens.map((t) => {
tokenPath += '/' + t;
if (t === $breadcrumbObject.id) {
if ($breadcrumbObject.name) title = $breadcrumbObject.name;
else title = $breadcrumbObject.email;
if ($breadcrumbObject.name) t = $breadcrumbObject.name;
else t = $breadcrumbObject.email;
} else if (t === 'folders') {
t = 'domains';
}
t = t.replace(/-/g, ' ');
t = capitalizeSecondWord(t);
console.log(title)
return {
label: $page.data.label || title || t,
label: $page.data.label || t,
href: Object.keys(listViewFields).includes(tokens[0]) ? tokenPath : null
};
});
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lib/utils/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ export function localItems(languageTag: string): LocalItems {
lossOfAccountabilityText: m.lossOfAccountabilityText({ languageTag: languageTag }),
lossOfAccountabilityChoice1: m.lossOfAccountabilityChoice1({ languageTag: languageTag }),
lossOfAccountabilityChoice2: m.lossOfAccountabilityChoice2({ languageTag: languageTag }),
lossOfAccountabilityChoice3: m.lossOfAccountabilityChoice3({ languageTag: languageTag })
lossOfAccountabilityChoice3: m.lossOfAccountabilityChoice3({ languageTag: languageTag }),
composer: m.composer({ languageTag: languageTag }),
plan: m.plan({ languageTag: languageTag }),
};
return LOCAL_ITEMS;
}

0 comments on commit 221183d

Please sign in to comment.