Skip to content

Commit ff72ba7

Browse files
committed
fix(AuditGenerationPage): modify page title (bis)
- Add "Page " to tab name to avoid misleading page title. For example: "Page Accueil - Audit de Ma procédure - Ara" instead of "Accueil - Audit de Ma procédure - Ara" - Add 3 comments to describe the 3 page title parts (apart from "Ara", the website name)
1 parent 7363b94 commit ff72ba7

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

confiture-web-app/src/pages/audit/AuditGenerationPage.vue

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ const pageTitle = computed(() => {
159159
// X résultats pour « [search] » - [tabName] - Audit de [procedureName]
160160
const titleParts = [];
161161
const curAudit = auditStore.currentAudit;
162+
163+
// No audit in store? (Should never happen?)
162164
if (!curAudit) {
163165
return "";
164166
}
167+
168+
// 1. Search results
165169
if (filterStore.search) {
166170
const results = `${filterResultsCount.value} ${pluralize(
167171
"résultat",
@@ -171,14 +175,19 @@ const pageTitle = computed(() => {
171175
172176
titleParts.push(results);
173177
}
174-
if (curAudit) {
175-
const tabName =
176-
curAudit.pages.find((p) => p.id === auditStore.currentPageId)?.name ??
177-
StaticTabLabel.AUDIT_COMMON_ELEMENTS_TAB_LABEL;
178-
const procedureName = auditStore.currentAudit.procedureName;
179178
180-
titleParts.push(tabName, "Audit de " + procedureName);
181-
}
179+
// 2. Tab name
180+
const pageName = curAudit.pages.find(
181+
(p) => p.id === auditStore.currentPageId
182+
)?.name;
183+
const tabName = pageName
184+
? "Page " + pageName
185+
: StaticTabLabel.AUDIT_COMMON_ELEMENTS_TAB_LABEL;
186+
187+
// 3. Procedure name
188+
const procedureName = auditStore.currentAudit.procedureName;
189+
190+
titleParts.push(tabName, "Audit de " + procedureName);
182191
183192
return titleParts.join(" - ");
184193
});

0 commit comments

Comments
 (0)