feat: implementation du role Gestionnaire RH et refonte de la gestion des offres

This commit is contained in:
jeremy bayse
2026-05-09 11:21:40 +02:00
parent 97a8b9443d
commit 9edf79e8ba
23 changed files with 1223 additions and 232 deletions

View File

@@ -10,7 +10,7 @@
* - Items nav : rounded-xl, active bg-highlight text-highlight-dark
* - Footer sidebar : avatar + nom + version + logout
*/
import { ref } from 'vue';
import { ref, computed } from 'vue';
import { Link, usePage } from '@inertiajs/vue3';
import Dropdown from '@/Components/Dropdown.vue';
import DropdownLink from '@/Components/DropdownLink.vue';
@@ -42,7 +42,7 @@ const navItems = [
{
route: 'admin.job-positions.index',
match: 'admin.job-positions.*',
label: 'Fiches de Poste',
label: 'Offres d\'emploi',
icon: 'M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z',
},
{
@@ -62,6 +62,15 @@ const navItems = [
},
];
const filteredNavItems = computed(() => {
const role = page.props.auth.user.role;
if (role === 'gestionnaire_rh') {
// HR Managers cannot see evaluation/selection related tabs
return navItems.filter(item => !['admin.quizzes.index', 'admin.comparative', 'admin.candidates.selected'].includes(item.route));
}
return navItems;
});
const superAdminItems = [
{
route: 'admin.tenants.index',
@@ -119,7 +128,7 @@ const isActive = (item) => {
<!-- Nav principale -->
<nav class="flex-1 px-2.5 py-4 space-y-0.5 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent">
<!-- Items principaux -->
<template v-for="item in navItems" :key="item.route">
<template v-for="item in filteredNavItems" :key="item.route">
<Link
:href="route(item.route)"
:title="!isSidebarOpen ? item.label : undefined"
@@ -138,17 +147,18 @@ const isActive = (item) => {
</Link>
</template>
<!-- Section super admin -->
<template v-if="$page.props.auth.user.role === 'super_admin'">
<!-- Section Administration (Structures) pour Super Admin et RH -->
<template v-if="['super_admin', 'gestionnaire_rh'].includes($page.props.auth.user.role)">
<div class="pt-4 pb-2">
<div
v-if="isSidebarOpen"
class="px-3 text-[9px] font-black uppercase tracking-[0.18em] text-white/25"
>Configuration</div>
>Administration</div>
<div v-else class="h-px w-8 mx-auto bg-white/10" />
</div>
<template v-for="item in superAdminItems" :key="item.route">
<!-- Structures Link (Visible for Super Admin and HR) -->
<template v-for="item in superAdminItems.filter(i => i.route === 'admin.tenants.index' || $page.props.auth.user.role === 'super_admin')" :key="item.route">
<Link
:href="route(item.route)"
:title="!isSidebarOpen ? item.label : undefined"