Pārlūkot izejas kodu

Merge branch 'release/2.4.1' into develop

Olivier Massot 1 gadu atpakaļ
vecāks
revīzija
89aa9e31cf

+ 11 - 0
middleware/routing.global.ts

@@ -15,6 +15,17 @@ export default defineNuxtRouteMiddleware((to, _) => {
   candidates.forEach((routeName) => {
     const name: string = routeName?.toString() ?? ''
 
+    // <<- TODO: remove after 2.5 release
+    const runtimeConfig = useRuntimeConfig()
+    if (
+      runtimeConfig.public.env === 'production' &&
+      (name === 'cmf_licence_page' || name === 'parameters_page')
+    ) {
+      const { redirectToHome } = useRedirect()
+      redirectToHome()
+    }
+    // ->>
+
     if (
       name &&
       restrictedPages.includes(name) &&

+ 26 - 4
services/layout/menuBuilder/configurationMenuBuilder.ts

@@ -30,24 +30,46 @@ export default class ConfigurationMenuBuilder extends AbstractMenuBuilder {
       )
     }
 
+    // if (this.ability.can('display', 'cmf_licence_page')) {
+    //   children.push(
+    //     this.createItem(
+    //       'cmf_licence_generate',
+    //       undefined,
+    //       '/cmf_licence_structure',
+    //       MENU_LINK_TYPE.INTERNAL,
+    //     ),
+    //   )
+    // }
+
     if (this.ability.can('display', 'cmf_licence_page')) {
       children.push(
         this.createItem(
           'cmf_licence_generate',
           undefined,
-          '/cmf_licence_structure',
-          MENU_LINK_TYPE.INTERNAL,
+          '/licence_cmf/organization',
+          MENU_LINK_TYPE.V1,
         ),
       )
     }
 
+    // if (this.ability.can('display', 'parameters_page')) {
+    //   children.push(
+    //     this.createItem(
+    //       'parameters',
+    //       undefined,
+    //       `/parameters`,
+    //       MENU_LINK_TYPE.INTERNAL,
+    //     ),
+    //   )
+    // }
+
     if (this.ability.can('display', 'parameters_page')) {
       children.push(
         this.createItem(
           'parameters',
           undefined,
-          `/parameters`,
-          MENU_LINK_TYPE.INTERNAL,
+          `/main/edit/parameters/${this.organizationProfile.id}`,
+          MENU_LINK_TYPE.V1,
         ),
       )
     }