parametersMenuBuilder.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
  2. import {MenuGroup, MenuItems} from "~/types/layout";
  3. import {MENU_LINK_TYPE} from "~/types/enum/layout";
  4. /**
  5. * Menu Paramètres
  6. */
  7. export default class ParametersMenuBuilder extends AbstractMenuBuilder {
  8. static readonly menuName = "Parameters"
  9. /**
  10. * Construit le menu Header Configuration, ou null si aucune page accessible
  11. */
  12. build(): MenuGroup | null {
  13. const children: MenuItems = []
  14. if (!this.ability.can('display', 'parameters_page')) {
  15. return null
  16. }
  17. children.push(this.createItem('general_parameters', {name: 'fas fa-gears'},`/parameters/general_parameters`))
  18. children.push(this.createItem('website', {name: 'fas fa-globe-americas'},`/parameters/website`))
  19. if (this.organizationProfile.isSchool) {
  20. children.push(this.createItem('teaching', {name: 'fas fa-school'}, `/parameters/teaching`))
  21. children.push(this.createItem('intranet_access', {name: 'fas fa-arrows-down-to-people'}, `/parameters/intranet`))
  22. children.push(this.createItem('educationNotations', {name: 'fas fa-graduation-cap'}, `/parameters/education_notation`))
  23. children.push(this.createItem('bulletin', {name: 'fas fa-file-lines'}, `/parameters/bulletin`))
  24. children.push(this.createItem('educationTimings', {name: 'fas fa-clock'}, `/parameters/education_timings`))
  25. children.push(this.createItem('attendances', {name: 'fas fa-user-times'}, `/parameters/attendances`))
  26. children.push(this.createItem('residenceAreas', {name: 'fas fa-location-dot'}, `/parameters/residence_areas`))
  27. }
  28. if (this.organizationProfile.hasModule('Sms')) {
  29. children.push(this.createItem('sms_option', {name: 'fas fa-mobile'}, `/parameters/sms`))
  30. }
  31. children.push(this.createItem('super_admin', {name: 'fas fa-user-gear'},`/parameters/super_admin`))
  32. // Voir nouveau découpage?
  33. // if (this.ability.can('display', 'parameters_page')) {
  34. // children.push(this.createItem('general_params', {name: 'fas fa-cogs'},`/parameters`, MENU_LINK_TYPE.V1))
  35. // }
  36. // if (this.ability.can('display', 'parameters_communication_page')) {
  37. // children.push(this.createItem('communication_params', {name: 'fas fa-comments'},`/parameters/communication`, MENU_LINK_TYPE.V1))
  38. // }
  39. // if (this.ability.can('display', 'parameters_student_page')) {
  40. // children.push(this.createItem('students_params', {name: 'fas fa-users'},`/parameters/student`, MENU_LINK_TYPE.V1))
  41. // }
  42. // if (this.ability.can('display', 'parameters_education_page')) {
  43. // children.push(this.createItem('education_params', {name: 'fas fa-graduation-cap'},`/parameters/education`, MENU_LINK_TYPE.V1))
  44. // }
  45. // if (this.ability.can('display', 'parameters_bills_page')) {
  46. // children.push(this.createItem('bills_params', {name: 'fas fa-euro-sign'},`/parameters/billing`, MENU_LINK_TYPE.V1))
  47. // }
  48. // if (this.ability.can('display', 'parameters_secure_page')) {
  49. // children.push(this.createItem('secure_params', {name: 'fas fa-lock'},`/parameters/secure`, MENU_LINK_TYPE.V1))
  50. // }
  51. if (children.length > 0) {
  52. return this.createGroup('parameters', undefined, children)
  53. }
  54. return null
  55. }
  56. }