فهرست منبع

rebase development

Vincent GUFFON 3 سال پیش
والد
کامیت
032e6a6e8f

+ 1 - 1
composables/layout/Menus/baseMenu.ts

@@ -28,7 +28,7 @@ class BaseMenu {
    * @param {Array<ItemMenu>} actions Tableau d'ItemMenu représentant les actions devant apparaitre en bas du menu
    * @return {ItemMenu}
    */
-  constructMenu (title: string, icon: IconItem, link?: string, isOldLink?: boolean, children?: Array<ItemMenu>, isExternalLink?: boolean): ItemMenu {
+  constructMenu (title: string, icon?: IconItem, link?: string, isOldLink?: boolean, children?: Array<ItemMenu>, isExternalLink?: boolean): ItemMenu {
     return children ? {
       title,
       icon,

+ 6 - 6
composables/layout/Menus/parametersMenu.ts

@@ -30,22 +30,22 @@ class ParametersMenu extends BaseMenu implements Menu {
     const children: ItemsMenu = []
 
     if (this.$ability.can('display', 'parameters_page')) {
-      children.push(this.constructMenu('general_params', 'fa-cogs',`/parameters`, false))
+      children.push(this.constructMenu('general_params', {name: 'fa-cogs'},`/parameters`, false))
     }
     if (this.$ability.can('display', 'parameters_communication_page')) {
-      children.push(this.constructMenu('communication_params', 'fa-comments',`/parameters/communication`, false))
+      children.push(this.constructMenu('communication_params', {name: 'fa-comments'},`/parameters/communication`, false))
     }
     if (this.$ability.can('display', 'parameters_student_page')) {
-      children.push(this.constructMenu('students_params', 'fa-users',`/parameters/student`, false))
+      children.push(this.constructMenu('students_params', {name: 'fa-users'},`/parameters/student`, false))
     }
     if (this.$ability.can('display', 'parameters_education_page')) {
-      children.push(this.constructMenu('education_params', 'fa-graduation-cap',`/parameters/education`, false))
+      children.push(this.constructMenu('education_params', {name: 'fa-graduation-cap'},`/parameters/education`, false))
     }
     if (this.$ability.can('display', 'parameters_bills_page')) {
-      children.push(this.constructMenu('bills_params', 'fa-euro-sign',`/parameters/billing`, false))
+      children.push(this.constructMenu('bills_params', {name: 'fa-euro-sign'},`/parameters/billing`, false))
     }
     if (this.$ability.can('display', 'parameters_secure_page')) {
-      children.push(this.constructMenu('secure_params', 'fa-lock',`/parameters/secure`, false))
+      children.push(this.constructMenu('secure_params', {name: 'fa-lock'},`/parameters/secure`, false))
     }
 
     if (children.length > 0) {

+ 3 - 3
tests/unit/composables/layout/menu.spec.ts

@@ -2,7 +2,7 @@ import BaseMenu from '~/composables/layout/Menus/baseMenu'
 
 describe('constructMenu()', () => {
   it('should construct a menu without children', () => {
-    const menuWithoutChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('children', 'icon', '/url', false)
+    const menuWithoutChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('children', {name:'icon'}, '/url', false)
     expect(menuWithoutChildren).toStrictEqual({
       title: 'children',
       icon: 'icon',
@@ -12,8 +12,8 @@ describe('constructMenu()', () => {
   })
 
   it('should construct a menu with children', () => {
-    const menuWithoutChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('children', 'icon', '/url', false)
-    const menuWithChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('parent', 'icon', undefined, undefined, [menuWithoutChildren])
+    const menuWithoutChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('children', {name:'icon'}, '/url', false)
+    const menuWithChildren = new BaseMenu({ baseURL_adminLegacy: 'base_url' }).constructMenu('parent', {name:'icon'}, undefined, undefined, [menuWithoutChildren])
     expect(menuWithChildren).toStrictEqual({
       children: [
         {