Parcourir la source

Refactoring Use Menu

Vincent GUFFON il y a 5 ans
Parent
commit
cff7d3d3e3

+ 1 - 1
components/Layout/MenuComponent.vue

@@ -77,7 +77,7 @@
       }
     },
     setup() {
-      const menu: AnyJson = $useMenu.setUpContext().useMenuConstruct()
+      const menu: AnyJson = $useMenu.setUpContext().useLateralMenuConstruct()
 
       return {
         menu

+ 3 - 3
test/use/template/menu.spec.js

@@ -1,7 +1,7 @@
-import {$useMenu} from "~/use/template/menu";
+import BaseMenu from "~/use/template/Menus/baseMenu";
 
 test('test constructMenu', () => {
-  const menuWithoutChildren = $useMenu.constructMenu('icon', 'children', '/url', false)
+  const menuWithoutChildren = new BaseMenu({'baseURL_adminLegacy': 'base_url'}).constructMenu('icon', 'children', '/url', false)
   expect(menuWithoutChildren).toStrictEqual({
     "icon": "icon",
     "title": "children",
@@ -9,7 +9,7 @@ test('test constructMenu', () => {
     "old": false
   });
 
-  const menuWithChildren = $useMenu.constructMenu('icon', 'parent', undefined, undefined, [menuWithoutChildren])
+  const menuWithChildren = new BaseMenu({'baseURL_adminLegacy': 'base_url'}).constructMenu('icon', 'parent', undefined, undefined, [menuWithoutChildren])
   expect(menuWithChildren).toStrictEqual({
     "children": [
       {

+ 52 - 0
use/template/Menus/accessMenu.ts

@@ -0,0 +1,52 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import {$organizationProfile} from "~/services/profile/organizationProfile";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class AccessMenu extends BaseMenu{
+  private $ability:any;
+  private $store:any;
+
+  constructor($config:any, $ability:any, $store:any) {
+    super($config)
+    this.$ability = $ability
+    this.$store = $store
+  }
+
+  /**
+   * Construit le menu Répertoire ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'accesses_page')) {
+      const organization = $organizationProfile(this.$store)
+      let to = organization.isSchool() ? `/students/list/` : `/adherent/list/`
+      children.push(this.constructMenu('fa-user', 'person', to, true))
+    }
+
+    if (this.$ability().can('display', 'student_registration_page')) {
+      children.push(this.constructMenu('fa-users', 'family_view', '/student_registration/new', true))
+    }
+
+    if (this.$ability().can('display', 'education_student_next_year_page')) {
+      children.push(this.constructMenu('fa-list-alt', 'education_student_next_year', '/education_student_next_year/list/', true))
+    }
+    if (this.$ability().can('display', 'commissions_page')) {
+      children.push(this.constructMenu('fa-street-view', 'commissions', '/commissions/list/', true))
+    }
+    if (this.$ability().can('display', 'network_children_page')) {
+      children.push(this.constructMenu('fa-sitemap', 'network', 'networks/list/', true))
+    }
+    if (this.$ability().can('display', 'network_parents_page')) {
+      children.push(this.constructMenu('fa-sitemap', 'my_network', '/network_artist_schools/list/', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-address-book', 'address_book', undefined, undefined, children) : null;
+  }
+}
+
+export const getAccessMenu = ($config:any, $ability:any, $store:any) => new AccessMenu($config, $ability, $store).getMenu()

+ 34 - 0
use/template/Menus/agendaMenu.ts

@@ -0,0 +1,34 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class AgendaMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Agenda ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'agenda_page')) {
+      children.push(this.constructMenu('fa-calendar-alt', 'schedule', '/calendar', true))
+    }
+
+    if (this.$ability().can('display', 'attendance_page')) {
+      children.push(this.constructMenu('fa-calendar-check', 'attendances', '/attendances/list/', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-calendar-alt', 'schedule', undefined, undefined, children) : null;
+  }
+}
+
+export const getAgendaMenu = ($config:any, $ability:any) => new AgendaMenu($config, $ability).getMenu()

+ 32 - 0
use/template/Menus/baseMenu.ts

@@ -0,0 +1,32 @@
+import {ItemMenu} from "~/types/types";
+
+class BaseMenu{
+  private $config:any;
+
+  constructor($config:any) {
+    this.$config = $config;
+  }
+
+  /**
+   * Construit un ItemMenu
+   * @param {string} icon
+   * @param {string} title titre qui sera traduit
+   * @param {string} link lien
+   * @param {boolean} isOldLink est-ce un lien renvoyant vers l'ancien admin ?
+   * @param {Array<ItemMenu>} children Tableau d'ItemMenu représentant les sous menu du menu principal
+   * @return {ItemMenu}
+   */
+  constructMenu(icon: string, title: string, link?: string, isOldLink?: boolean, children?: Array<ItemMenu>): ItemMenu{
+    return children ? {
+      icon: icon,
+      title: title,
+      children: children,
+    } : {
+      icon: icon,
+      title: title,
+      to: `${isOldLink ? this.$config.baseURL_adminLegacy : ''}${link}`,
+      old: isOldLink,
+    }
+  }
+}
+export default BaseMenu;

+ 58 - 0
use/template/Menus/billingMenu.ts

@@ -0,0 +1,58 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class BillingMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Facturation ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'billing_product_page')) {
+      children.push(this.constructMenu('fa-cube', 'billing_product', '/intangibles/list/', true))
+    }
+
+    if (this.$ability().can('display', 'billing_products_by_student_page')) {
+      children.push(this.constructMenu('fa-cubes', 'billing_products_by_student', '/access_intangibles/list/', true))
+    }
+
+    if (this.$ability().can('display', 'billing_edition_page')) {
+      children.push(this.constructMenu('fa-copy', 'billing_edition', '/billing_edition', true))
+    }
+
+    if (this.$ability().can('display', 'billing_accounting_page')) {
+      children.push(this.constructMenu('fa-file-alt', 'billing_accounting', '/bill_accountings/list/', true))
+    }
+
+    if (this.$ability().can('display', 'billing_payment_list_page')) {
+      children.push(this.constructMenu('fa-credit-card', 'billing_payment_list', '/bill_payments_list/list/', true))
+    }
+
+    if (this.$ability().can('display', 'pes_page')) {
+      children.push(this.constructMenu('fa-align-justify', 'pes_export', '/pes/list/', true))
+    }
+
+    if (this.$ability().can('display', 'berger_levrault_page')) {
+      children.push(this.constructMenu('fa-align-justify', 'berger_levrault_export', '/berger_levraults/list/', true))
+    }
+
+    if (this.$ability().can('display', 'jvs_page')) {
+      children.push(this.constructMenu('fa-align-justify', 'jvs_export', '/jvs/list/', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-euro-sign', 'billing', undefined, undefined, children) : null;
+  }
+}
+
+export const getBillingMenu = ($config:any, $ability:any) => new BillingMenu($config, $ability).getMenu()

+ 38 - 0
use/template/Menus/communicationMenu.ts

@@ -0,0 +1,38 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class CommunicationMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Communication ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'inbox_page')) {
+      children.push(this.constructMenu('fa-inbox', 'inbox', '/messages/list/', true))
+    }
+
+    if (this.$ability().can('display', 'message_send_page')) {
+      children.push(this.constructMenu('fa-paper-plane', 'message_send', '/messagessends/list/', true))
+    }
+
+    if (this.$ability().can('display', 'message_templates_page')) {
+      children.push(this.constructMenu('fa-edit', 'message_templates', '/templates/list/', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-comments', 'communication', undefined, undefined, children) : null;
+  }
+}
+
+export const getCommunicationMenu= ($config:any, $ability:any) => new CommunicationMenu($config, $ability).getMenu()

+ 24 - 0
use/template/Menus/donorsMenu.ts

@@ -0,0 +1,24 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class DonorsMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Partenariat et Dons ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    if (this.$ability().can('display', 'donors_page')) {
+      return this.constructMenu('far fa-handshake', 'donors', '/donors/list/', true)
+    }
+    return null;
+  }
+}
+
+export const getDonorsMenu = ($config:any, $ability:any) => new DonorsMenu($config, $ability).getMenu()

+ 50 - 0
use/template/Menus/educationalMenu.ts

@@ -0,0 +1,50 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class EducationalMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Suivi pédagogique ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'criteria_notations_page')) {
+      children.push(this.constructMenu('fa-bars', 'criteria_notations', '/criteria_notations/list/', true))
+    }
+
+    if (this.$ability().can('display', 'seizure_period_page')) {
+      children.push(this.constructMenu('fa-calendar-alt', 'seizure_period', '/education_teachers/list/', true))
+    }
+
+    if (this.$ability().can('display', 'test_seizure_page')) {
+      children.push(this.constructMenu('fa-pencil-alt', 'test_seizure', '/education_input/list/', true))
+    }
+
+    if (this.$ability().can('display', 'test_validation_page')) {
+      children.push(this.constructMenu('fa-check', 'test_validation', '/education_notations/list/', true))
+    }
+
+    if (this.$ability().can('display', 'examen_results_page')) {
+      children.push(this.constructMenu('fa-graduation-cap', 'examen_results', '/examen_convocations/list/', true))
+    }
+
+    if (this.$ability().can('display', 'education_by_student_validation_page')) {
+      children.push(this.constructMenu('fa-check-square', 'education_by_student_validation', '/education_by_student/list/', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-graduation-cap', 'education_state', undefined, undefined, children) : null;
+  }
+}
+
+export const getEducationalMenu = ($config:any, $ability:any) => new EducationalMenu($config, $ability).getMenu()

+ 24 - 0
use/template/Menus/equipmentMenu.ts

@@ -0,0 +1,24 @@
+import {ItemMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class EquipmentMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Equipement ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    if (this.$ability().can('display', 'equipment_page')) {
+      return this.constructMenu('fa-cube', 'equipment', '/equipment/list', true)
+    }
+    return null;
+  }
+}
+
+export const getEquipmentMenu = ($config:any, $ability:any) => new EquipmentMenu($config, $ability).getMenu()

+ 24 - 0
use/template/Menus/medalsMenu.ts

@@ -0,0 +1,24 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class MedalsMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Médails et Dons ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    if (this.$ability().can('display', 'medals_page')) {
+      return this.constructMenu('fa-trophy', 'medals', '/medals/list/', true)
+    }
+    return null;
+  }
+}
+
+export const getMedalsMenu = ($config:any, $ability:any) => new MedalsMenu($config, $ability).getMenu()

+ 38 - 0
use/template/Menus/statsMenu.ts

@@ -0,0 +1,38 @@
+import {ItemMenu, ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+
+class StatsMenu extends BaseMenu{
+  private $ability:any;
+
+  constructor($config:any, $ability:any) {
+    super($config)
+    this.$ability = $ability
+  }
+
+  /**
+   * Construit le menu Statistique et Dons ou null si aucune page accessible
+   * @return {ItemMenu | null}
+   */
+  getMenu():ItemMenu | null {
+    const children:ItemsMenu = [];
+
+    if (this.$ability().can('display', 'report_activity_page')) {
+      children.push(this.constructMenu('fa-chart-bar', 'report_activity', '/report_activity', true))
+    }
+
+    if (this.$ability().can('display', 'fede_stats_page')) {
+      children.push(this.constructMenu('fa-chart-bar', 'fede_stats', '/statistic/membersfedeonly', true))
+    }
+
+    if (this.$ability().can('display', 'structure_stats_page')) {
+      children.push(this.constructMenu('fa-chart-bar', 'structure_stats', '/statistic/membersfedeassos', true))
+    }
+
+    if(children.length === 1){
+      return children[0];
+    }
+    return children.length > 0 ? this.constructMenu('fa-chart-bar', 'stats', undefined, undefined, children) : null;
+  }
+}
+
+export const getStatsMenu = ($config:any, $ability:any) => new StatsMenu($config, $ability).getMenu()

+ 26 - 258
use/template/menu.ts

@@ -1,6 +1,16 @@
 import {ref, useContext} from "@nuxtjs/composition-api";
-import {ItemMenu, ItemsMenu} from "~/types/types";
-import {$organizationProfile} from "~/services/profile/organizationProfile";
+import {ItemsMenu} from "~/types/types";
+import BaseMenu from "~/use/template/Menus/baseMenu";
+import {getAccessMenu} from "~/use/template/Menus/accessMenu";
+import {getAgendaMenu} from "~/use/template/Menus/agendaMenu";
+import {getEquipmentMenu} from "~/use/template/Menus/equipmentMenu";
+import {getEducationalMenu} from "~/use/template/Menus/educationalMenu";
+import {getBillingMenu} from "~/use/template/Menus/billingMenu";
+import {getCommunicationMenu} from "~/use/template/Menus/communicationMenu";
+import {getDonorsMenu} from "~/use/template/Menus/donorsMenu";
+import {getMedalsMenu} from "~/use/template/Menus/medalsMenu";
+import {getStatsMenu} from "~/use/template/Menus/statsMenu";
+import {getCotisationsMenu} from "~/use/template/Menus/cotisationsMenu";
 
 /**
  * @category Use/template
@@ -30,283 +40,41 @@ class Menu{
   /**
    * Construit le menu
    */
-  useMenuConstruct(){
-    let menu:ItemsMenu = [ this.constructMenu('fa-home', 'welcome', '/dashboard', true) ]
+  useLateralMenuConstruct(){
+    let menu:ItemsMenu = []
 
-    const accessMenu = this.accessMenu()
+    const accessMenu = getAccessMenu(this.$config,this.$ability,this.$store)
     if(accessMenu) menu.push(accessMenu)
 
-    const agendaMenu = this.agendaMenu()
+    const agendaMenu = getAgendaMenu(this.$config,this.$ability)
     if(agendaMenu) menu.push(agendaMenu)
 
-    const equipmentMenu = this.equipmentMenu()
+    const equipmentMenu = getEquipmentMenu(this.$config,this.$ability)
     if(equipmentMenu) menu.push(equipmentMenu)
 
-    const educationalMenu = this.educationalMenu()
+    const educationalMenu = getEducationalMenu(this.$config,this.$ability)
     if(educationalMenu) menu.push(educationalMenu)
 
-    const billingMenu = this.billingMenu()
+    const billingMenu = getBillingMenu(this.$config,this.$ability)
     if(billingMenu) menu.push(billingMenu)
 
-    const communicationMenu = this.communicationMenu()
+    const communicationMenu = getCommunicationMenu(this.$config,this.$ability)
     if(communicationMenu) menu.push(communicationMenu)
 
-    const donorsMenu = this.donorsMenu()
+    const donorsMenu = getDonorsMenu(this.$config,this.$ability)
     if(donorsMenu) menu.push(donorsMenu)
 
-    const medalsMenu = this.medalsMenu()
+    const medalsMenu = getMedalsMenu(this.$config,this.$ability)
     if(medalsMenu) menu.push(medalsMenu)
 
-    const statsMenu = this.statsMenu()
+    const cotisationsMenu = getCotisationsMenu(this.$config,this.$ability)
+    if(cotisationsMenu) menu.push(cotisationsMenu)
+
+    const statsMenu = getStatsMenu(this.$config,this.$ability)
     if(statsMenu) menu.push(statsMenu)
 
     return ref(menu)
   }
-
-  /**
-   * Construit le menu Répertoire ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  accessMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'accesses_page')) {
-      const organization = $organizationProfile(this.$store)
-      let to = organization.isSchool() ? `/students/list/` : `/adherent/list/`
-      children.push(this.constructMenu('fa-user', 'person', to, true))
-    }
-
-    if (this.$ability().can('display', 'student_registration_page')) {
-      children.push(this.constructMenu('fa-users', 'family_view', '/student_registration/new', true))
-    }
-
-    if (this.$ability().can('display', 'education_student_next_year_page')) {
-      children.push(this.constructMenu('fa-list-alt', 'education_student_next_year', '/education_student_next_year/list/', true))
-    }
-    if (this.$ability().can('display', 'commissions_page')) {
-      children.push(this.constructMenu('fa-street-view', 'commissions', '/commissions/list/', true))
-    }
-    if (this.$ability().can('display', 'network_children_page')) {
-      children.push(this.constructMenu('fa-sitemap', 'network', 'networks/list/', true))
-    }
-    if (this.$ability().can('display', 'network_parents_page')) {
-      children.push(this.constructMenu('fa-sitemap', 'my_network', '/network_artist_schools/list/', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-address-book', 'address_book', undefined, undefined, children) : null;
-  }
-
-  /**
-   * Construit le menu Agenda ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  agendaMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'agenda_page')) {
-      children.push(this.constructMenu('fa-calendar-alt', 'schedule', '/calendar', true))
-    }
-
-    if (this.$ability().can('display', 'attendance_page')) {
-      children.push(this.constructMenu('fa-calendar-check', 'attendances', '/attendances/list/', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-calendar-alt', 'schedule', undefined, undefined, children) : null;
-  }
-
-  /**
-   * Construit le menu Equipement ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  equipmentMenu():ItemMenu | null {
-    if (this.$ability().can('display', 'equipment_page')) {
-      return this.constructMenu('fa-cube', 'equipment', '/equipment/list', true)
-    }
-    return null;
-  }
-
-  /**
-   * Construit le menu Suivi pédagogique ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  educationalMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'criteria_notations_page')) {
-      children.push(this.constructMenu('fa-bars', 'criteria_notations', '/criteria_notations/list/', true))
-    }
-
-    if (this.$ability().can('display', 'seizure_period_page')) {
-      children.push(this.constructMenu('fa-calendar-alt', 'seizure_period', '/education_teachers/list/', true))
-    }
-
-    if (this.$ability().can('display', 'test_seizure_page')) {
-      children.push(this.constructMenu('fa-pencil-alt', 'test_seizure', '/education_input/list/', true))
-    }
-
-    if (this.$ability().can('display', 'test_validation_page')) {
-      children.push(this.constructMenu('fa-check', 'test_validation', '/education_notations/list/', true))
-    }
-
-    if (this.$ability().can('display', 'examen_results_page')) {
-      children.push(this.constructMenu('fa-graduation-cap', 'examen_results', '/examen_convocations/list/', true))
-    }
-
-    if (this.$ability().can('display', 'education_by_student_validation_page')) {
-      children.push(this.constructMenu('fa-check-square', 'education_by_student_validation', '/education_by_student/list/', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-graduation-cap', 'education_state', undefined, undefined, children) : null;
-  }
-
-  /**
-   * Construit le menu Facturation ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  billingMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'billing_product_page')) {
-      children.push(this.constructMenu('fa-cube', 'billing_product', '/intangibles/list/', true))
-    }
-
-    if (this.$ability().can('display', 'billing_products_by_student_page')) {
-      children.push(this.constructMenu('fa-cubes', 'billing_products_by_student', '/access_intangibles/list/', true))
-    }
-
-    if (this.$ability().can('display', 'billing_edition_page')) {
-      children.push(this.constructMenu('fa-copy', 'billing_edition', '/billing_edition', true))
-    }
-
-    if (this.$ability().can('display', 'billing_accounting_page')) {
-      children.push(this.constructMenu('fa-file-alt', 'billing_accounting', '/bill_accountings/list/', true))
-    }
-
-    if (this.$ability().can('display', 'billing_payment_list_page')) {
-      children.push(this.constructMenu('fa-credit-card', 'billing_payment_list', '/bill_payments_list/list/', true))
-    }
-
-    if (this.$ability().can('display', 'pes_page')) {
-      children.push(this.constructMenu('fa-align-justify', 'pes_export', '/pes/list/', true))
-    }
-
-    if (this.$ability().can('display', 'berger_levrault_page')) {
-      children.push(this.constructMenu('fa-align-justify', 'berger_levrault_export', '/berger_levraults/list/', true))
-    }
-
-    if (this.$ability().can('display', 'jvs_page')) {
-      children.push(this.constructMenu('fa-align-justify', 'jvs_export', '/jvs/list/', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-euro-sign', 'billing', undefined, undefined, children) : null;
-  }
-
-  /**
-   * Construit le menu Communication ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  communicationMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'inbox_page')) {
-      children.push(this.constructMenu('fa-inbox', 'inbox', '/messages/list/', true))
-    }
-
-    if (this.$ability().can('display', 'message_send_page')) {
-      children.push(this.constructMenu('fa-paper-plane', 'message_send', '/messagessends/list/', true))
-    }
-
-    if (this.$ability().can('display', 'message_templates_page')) {
-      children.push(this.constructMenu('fa-edit', 'message_templates', '/templates/list/', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-comments', 'communication', undefined, undefined, children) : null;
-  }
-
-  /**
-   * Construit le menu Partenariat et Dons ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  donorsMenu():ItemMenu | null {
-    if (this.$ability().can('display', 'donors_page')) {
-      return this.constructMenu('far fa-handshake', 'donors', '/donors/list/', true)
-    }
-    return null;
-  }
-
-  /**
-   * Construit le menu Médails et Dons ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  medalsMenu():ItemMenu | null {
-    if (this.$ability().can('display', 'medals_page')) {
-      return this.constructMenu('fa-trophy', 'medals', '/medals/list/', true)
-    }
-    return null;
-  }
-
-  /**
-   * Construit le menu Statistique et Dons ou null si aucune page accessible
-   * @return {ItemMenu | null}
-   */
-  statsMenu():ItemMenu | null {
-    const children:ItemsMenu = [];
-
-    if (this.$ability().can('display', 'report_activity_page')) {
-      children.push(this.constructMenu('fa-chart-bar', 'report_activity', '/report_activity', true))
-    }
-
-    if (this.$ability().can('display', 'fede_stats_page')) {
-      children.push(this.constructMenu('fa-chart-bar', 'fede_stats', '/statistic/membersfedeonly', true))
-    }
-
-    if (this.$ability().can('display', 'structure_stats_page')) {
-      children.push(this.constructMenu('fa-chart-bar', 'structure_stats', '/statistic/membersfedeassos', true))
-    }
-
-    if(children.length === 1){
-      return children[0];
-    }
-    return children.length > 0 ? this.constructMenu('fa-chart-bar', 'stats', undefined, undefined, children) : null;
-  }
-
-
-  /**
-   * Construit un ItemMenu
-   * @param {string} icon
-   * @param {string} title titre qui sera traduit
-   * @param {string} link lien
-   * @param {boolean} isOldLink est-ce un lien renvoyant vers l'ancien admin ?
-   * @param {Array<ItemMenu>} children Tableau d'ItemMenu représentant les sous menu du menu principal
-   * @return {ItemMenu}
-   */
-  constructMenu(icon: string, title: string, link?: string, isOldLink?: boolean, children?: Array<ItemMenu>): ItemMenu{
-    return children ? {
-      icon: icon,
-      title: title,
-      children: children,
-    } : {
-      icon: icon,
-      title: title,
-      to: `${isOldLink ? this.$config.baseURL_adminLegacy : ''}${link}`,
-      old: isOldLink,
-    }
-  }
 }
 
 export const $useMenu = new Menu()