ARCHIVED: This plan was not delivered. Preserved for context.
Backoffice Merge Implementation Plan¶
Goals¶
Consolidate the System section into Backoffice, so the final backoffice sidebar contains these pages in order:
- Reporting (already exists)
- User Management (already exists)
- Documentation Editing (already exists — Texts section removed)
- UI Texts Editing (new — receives Texts section from Documentation Editing)
- Logs (new — from System, tab disabled for non-Superadmins)
Remove all UI exposition of the System section (header button, system-route sidebar, system navigation).
Current State¶
Backoffice nav (BACKOFFICE_NAV in navigation.ts)¶
| Key | Route | Path |
|---|---|---|
BACKOFFICE_REPORTING |
backoffice-reporting |
back-office/reporting |
BACKOFFICE_USER_MANAGEMENT |
backoffice-user-management |
back-office/user-management |
BACKOFFICE_DATA_MANAGEMENT |
backoffice-data-management |
back-office/data-management |
BACKOFFICE_DOCUMENTATION_EDITING |
backoffice-documentation-editing |
back-office/documentation-editing |
System nav (SYSTEM_NAV in navigation.ts)¶
| Key | Route | Path |
|---|---|---|
SYSTEM_USER_MANAGEMENT |
system-user-management |
system/user-management |
SYSTEM_MODULE_MANAGEMENT |
system-module-management |
system/module-management |
SYSTEM_LOGS |
system-logs |
system/logs |
System UI entry points (in Co2Header.vue)¶
- Button
user_management_system_button_label→ navigates tosystem-user-management(shown whenhasSystemAccess && !isInSystemRoute) - Button "Back to Calculator" (shown when
hasSystemAccess && isInSystemRoute) - Button for dev docs (shown when
hasSystemAccess && isInSystemRoute)
Changes Required¶
1. frontend/src/constant/navigation.ts¶
a) Add superAdminOnly field to NavItem interface
export interface NavItem {
routeName: string;
icon: string;
description?: string;
limitedAccess?: boolean;
superAdminOnly?: boolean; // tab visible but disabled unless user has superadmin role
}
b) Add two new entries and reorder BACKOFFICE_NAV
Final key order must match sidebar display order:
export const BACKOFFICE_NAV: Record<string, NavItem> = {
BACKOFFICE_REPORTING: { ... }, // unchanged
BACKOFFICE_USER_MANAGEMENT: { ... }, // unchanged
BACKOFFICE_DATA_MANAGEMENT: { ... }, // unchanged (stays between user mgmt and doc editing)
BACKOFFICE_DOCUMENTATION_EDITING: { ... }, // unchanged
BACKOFFICE_UI_TEXTS_EDITING: {
routeName: 'backoffice-ui-texts-editing',
description: 'backoffice-ui-texts-editing-description',
icon: 'o_translate',
},
BACKOFFICE_LOGS: {
routeName: 'backoffice-logs',
description: 'backoffice-logs-description',
icon: 'o_list_alt',
superAdminOnly: true,
},
};
Note:
SYSTEM_NAVcan remain in the file for now (system routes are kept as dead routes) but will no longer be referenced in the UI.
2. frontend/src/router/routes.ts¶
a) Add two new backoffice routes (after existing backoffice routes, before system routes):
{
path: 'back-office/ui-texts-editing',
name: BACKOFFICE_NAV.BACKOFFICE_UI_TEXTS_EDITING.routeName,
component: () => import('pages/back-office/UITextsEditingPage.vue'),
beforeEnter: requirePermission('backoffice.users', 'view'),
meta: {
requiresAuth: true,
note: 'Back Office - UI translation text management via GitHub',
breadcrumb: false,
isBackOffice: true,
},
},
{
path: 'back-office/logs',
name: BACKOFFICE_NAV.BACKOFFICE_LOGS.routeName,
component: () => import('pages/system/LogsPage.vue'),
beforeEnter: requirePermission('system.users', 'edit'),
meta: {
requiresAuth: true,
note: 'Back Office - Audit logs (superadmin only)',
breadcrumb: false,
isBackOffice: true,
},
},
Reuses
pages/system/LogsPage.vuedirectly — no need to copy.requirePermission('system.users', 'edit')acts as the hard route guard; the sidebar'ssuperAdminOnlyflag handles the visual disabled state.
3. frontend/src/components/layout/Co2Sidebar.vue¶
a) Add superadmin role check
Import ROLES from src/constant/roles and add a computed:
import { ROLES } from "src/constant/roles";
const hasSuperAdminRole = computed(() => {
return (
authStore.user?.roles_raw?.some((x) => x.role === ROLES.SuperAdmin) ?? false
);
});
b) Update isItemDisabled
function isItemDisabled(item: NavItem): boolean {
if (item.superAdminOnly === true && !hasSuperAdminRole.value) return true;
if (item.limitedAccess === true && !hasBackOfficeEditPermission.value)
return true;
return false;
}
4. frontend/src/components/layout/Co2Header.vue¶
Remove all system-section UI. Delete the following:
import { isBackOfficeRoute, isSystemRoute }→ change toimport { isBackOfficeRoute }(dropisSystemRoute)hasSystemAccesscomputed propertyisInSystemRoutecomputed property- The three
<q-btn>elements that referencehasSystemAccess: - Dev docs button (
v-if="hasSystemAccess && isInSystemRoute") - "System Management" nav button (
v-if="hasSystemAccess && !isInSystemRoute") - "Back to Calculator" button for system route (
v-if="hasSystemAccess && isInSystemRoute")
The existing backoffice buttons (hasBackOfficeAccess) are untouched.
5. frontend/src/pages/back-office/UITextsEditingPage.vue (new file)¶
Create this page by extracting the Texts section from DocumentationEditingPage.vue.
Content:
NavigationHeaderusingBACKOFFICE_NAV.BACKOFFICE_UI_TEXTS_EDITING- The
rowscomputed (all 18 GitHub links to i18n.tsfiles) - The translation table (
q-table) with existing columns - The i18n keys (
documentation_editing_translation_title,documentation_editing_translation_description_part_1, etc.) - Same styles (
.page,.table-spacing,.github-btn) copied from DocumentationEditingPage
6. frontend/src/pages/back-office/DocumentationEditingPage.vue¶
Remove the Texts section:
- Delete the entire
rowscomputed (lines 10–135) - Delete the
<h1>+ description block for translations (firsttext-h2section) - Delete the first
<q-table>block that uses:rows="rows" - Keep:
docRowscomputed, the Documentation<h1>section, and the second<q-table> - Update
NavigationHeader— it already usesBACKOFFICE_NAV.BACKOFFICE_DOCUMENTATION_EDITING, no change needed there
7. frontend/src/i18n/backoffice.ts¶
Add i18n entries for the two new nav items:
[BACKOFFICE_NAV.BACKOFFICE_UI_TEXTS_EDITING.routeName]: {
en: 'UI Texts Editing',
fr: 'Édition des textes UI',
},
[BACKOFFICE_NAV.BACKOFFICE_UI_TEXTS_EDITING.description]: {
en: 'Edit UI translation files for all modules.',
fr: 'Modifier les fichiers de traduction UI pour tous les modules.',
},
[BACKOFFICE_NAV.BACKOFFICE_LOGS.routeName]: {
en: 'Logs',
fr: 'Journaux',
},
[BACKOFFICE_NAV.BACKOFFICE_LOGS.description]: {
en: 'View system audit logs. Superadmin access only.',
fr: 'Consulter les journaux d\'audit. Accès superadmin uniquement.',
},
File Change Summary¶
| File | Change |
|---|---|
src/constant/navigation.ts |
Add superAdminOnly to NavItem; add BACKOFFICE_UI_TEXTS_EDITING and BACKOFFICE_LOGS to BACKOFFICE_NAV |
src/router/routes.ts |
Add backoffice-ui-texts-editing and backoffice-logs routes |
src/components/layout/Co2Sidebar.vue |
Add superadmin check; update isItemDisabled |
src/components/layout/Co2Header.vue |
Remove all system-section buttons and computeds |
src/pages/back-office/UITextsEditingPage.vue |
New file — extracted Texts section |
src/pages/back-office/DocumentationEditingPage.vue |
Remove Texts section (keep Documentation section only) |
src/i18n/backoffice.ts |
Add 4 new i18n keys for new nav items |