parametersMenuBuilder.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
  2. import type { MenuGroup, MenuItems } from '~/types/layout'
  3. /**
  4. * Menu Paramètres
  5. */
  6. export default class ParametersMenuBuilder extends AbstractMenuBuilder {
  7. static readonly menuName = 'Parameters'
  8. /**
  9. * Construit le menu Header Configuration, ou null si aucune page accessible
  10. */
  11. build(): MenuGroup | null {
  12. const children: MenuItems = []
  13. if (!this.ability.can('display', 'parameters_page')) {
  14. return null
  15. }
  16. children.push(
  17. this.createItem(
  18. 'general_parameters',
  19. { name: 'fas fa-gears' },
  20. `/parameters/general_parameters`,
  21. ),
  22. )
  23. children.push(
  24. this.createItem(
  25. 'website',
  26. { name: 'fas fa-globe-americas' },
  27. `/parameters/website`,
  28. ),
  29. )
  30. if (this.organizationProfile.isSchool) {
  31. children.push(
  32. this.createItem(
  33. 'teaching',
  34. { name: 'fas fa-school' },
  35. `/parameters/teaching`,
  36. ),
  37. )
  38. children.push(
  39. this.createItem(
  40. 'intranet_breadcrumbs',
  41. { name: 'fas fa-arrows-down-to-people' },
  42. `/parameters/intranet`,
  43. ),
  44. )
  45. children.push(
  46. this.createItem(
  47. 'educationNotations',
  48. { name: 'fas fa-graduation-cap' },
  49. `/parameters/education_notation`,
  50. ),
  51. )
  52. children.push(
  53. this.createItem(
  54. 'bulletin',
  55. { name: 'fas fa-file-lines' },
  56. `/parameters/bulletin`,
  57. ),
  58. )
  59. children.push(
  60. this.createItem(
  61. 'education_timings_breadcrumbs',
  62. { name: 'fas fa-clock' },
  63. `/parameters/education_timings`,
  64. ),
  65. )
  66. children.push(
  67. this.createItem(
  68. 'residenceAreas',
  69. { name: 'fas fa-location-dot' },
  70. `/parameters/residence_areas`,
  71. ),
  72. )
  73. }
  74. children.push(
  75. this.createItem(
  76. 'attendance',
  77. { name: 'fas fa-user-times' },
  78. `/parameters/attendances`,
  79. ),
  80. )
  81. if (this.organizationProfile.hasModule('Sms')) {
  82. children.push(
  83. this.createItem(
  84. 'sms_option',
  85. { name: 'fas fa-mobile' },
  86. `/parameters/sms`,
  87. ),
  88. )
  89. }
  90. children.push(
  91. this.createItem(
  92. 'super_admin',
  93. { name: 'fas fa-user-gear' },
  94. `/parameters/super_admin`,
  95. ),
  96. )
  97. // Voir nouveau découpage?
  98. // if (this.ability.can('display', 'parameters_page')) {
  99. // children.push(this.createItem('general_params', {name: 'fas fa-cogs'},`/parameters`, MENU_LINK_TYPE.V1))
  100. // }
  101. // if (this.ability.can('display', 'parameters_communication_page')) {
  102. // children.push(this.createItem('communication_params', {name: 'fas fa-comments'},`/parameters/communication`, MENU_LINK_TYPE.V1))
  103. // }
  104. // if (this.ability.can('display', 'parameters_student_page')) {
  105. // children.push(this.createItem('students_params', {name: 'fas fa-users'},`/parameters/student`, MENU_LINK_TYPE.V1))
  106. // }
  107. // if (this.ability.can('display', 'parameters_education_page')) {
  108. // children.push(this.createItem('education_params', {name: 'fas fa-graduation-cap'},`/parameters/education`, MENU_LINK_TYPE.V1))
  109. // }
  110. // if (this.ability.can('display', 'parameters_bills_page')) {
  111. // children.push(this.createItem('bills_params', {name: 'fas fa-euro-sign'},`/parameters/billing`, MENU_LINK_TYPE.V1))
  112. // }
  113. // if (this.ability.can('display', 'parameters_secure_page')) {
  114. // children.push(this.createItem('secure_params', {name: 'fas fa-lock'},`/parameters/secure`, MENU_LINK_TYPE.V1))
  115. // }
  116. if (children.length > 0) {
  117. return this.createGroup('parameters', undefined, children)
  118. }
  119. return null
  120. }
  121. }