|
|
@@ -0,0 +1,94 @@
|
|
|
+import {ItemMenu, ItemsMenu} from "~/types/types";
|
|
|
+import BaseMenu from "~/use/template/Menus/baseMenu";
|
|
|
+
|
|
|
+class CotisationsMenu 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', 'rate_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'rate_cotisation', '/cotisation/rate', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'parameters_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'parameters_cotisation', '/cotisation/parameter', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'send_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'send_cotisation', '/cotisation/send', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'state_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'state_cotisation', '/cotisation/state', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'pay_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'pay_cotisation', '/cotisation/pay', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'check_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'check_cotisation', '/cotisation/check', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'ledger_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'ledger_cotisation', '/cotisation/ledger', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'magazine_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'magazine_cotisation', '/cotisation/magazine', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'ventilated_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'ventilated_cotisation', '/cotisation/ventilated', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'pay_erase_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'pay_erase_cotisation', '/cotisation/payerase', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'resume_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'resume_cotisation', '/cotisation/resume', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'history_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'history_cotisation', '/cotisation/history', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'call_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'call_cotisation', '/cotisation/call', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'history_struture_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'history_struture_cotisation', '/cotisation/historystructure', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'insurance_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'insurance_cotisation', '/cotisation/insurance', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'resume_all_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'resume_all_cotisation', '/cotisation/resumeall', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$ability().can('display', 'resume_pay_cotisation_page')) {
|
|
|
+ children.push(this.constructMenu('fa-euro-sign', 'resume_pay_cotisation', '/cotisation/resumepay', true))
|
|
|
+ }
|
|
|
+
|
|
|
+ if(children.length === 1){
|
|
|
+ return children[0];
|
|
|
+ }
|
|
|
+ return children.length > 0 ? this.constructMenu('fa-money-bill', 'cotisations', undefined, undefined, children) : null;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export const getCotisationsMenu = ($config:any, $ability:any) => new CotisationsMenu($config, $ability).getMenu()
|