Browse Source

fix conflicts

Olivier Massot 2 years ago
parent
commit
6c3be57b69

+ 1 - 1
components/Layout/Header/Notification.vue

@@ -225,7 +225,7 @@ const markNotificationAsRead = (notification: Notification) => {
     throw new Error('Current access id is null')
   }
   const notificationUsers = em.newInstance(NotificationUsers, {
-    access:`/api/accesses/${accessProfileStore.switchId ?? accessProfileStore.id}`,
+    access:`/api/accesses/${accessProfileStore.currentAccessId}`,
     notification:`/api/notifications/${notification.id}`,
     isRead: true
   })

+ 1 - 1
env/.env.docker

@@ -27,7 +27,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://local.sub.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://local.mercure.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.prod

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://###subDomain###.opentalent.fr
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test1

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test1.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test2

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test2.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test3

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test3.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test4

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test4.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 1 - 1
env/.env.test5

@@ -28,7 +28,7 @@ NUXT_PUBLIC_BASE_URL_TYPO3=https://test5.opentalent.fr/###subDomain###
 # Mercure push events
 NUXT_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
 NUXT_PUBLIC_BASE_URL_MERCURE=https://mercure.test.opentalent.fr/.well-known/mercure
-MERCURE_SUBSCRIBER_JWT_KEY=NQEupdREijrfYvCmF2mnvZQFL9zLKDH9RCYter6tUWzjemPqzicffhc2fSf0yEmM
+MERCURE_SUBSCRIBER_JWT_KEY=TXsLVKnU4Ew4oyH4qcQO81CuSOVTbj58W42fDTIzIZPwpPCaGu2EvIL3DbtDWtKHIGR6vvL98lnYlOADCB6buOvvfv30HL92OaBhB6jkyVnACipg7W4KQVRnQifiz3WymMnQYiprsBT9gyvRMTyhDHVDGaKrpgD1Y1j1pTR2JON9SSMHYTHsx6g7S7rKydgWEuNq4Jq2nldtYXXTYVRyZ2qKy5uGWfya2ahHsWGWTbz5UOkwN3b48fXpURSsMze4
 
 # Other links
 NUXT_SUPPORT_URL=https://support.opentalent.fr/

+ 3 - 3
lang/fr.json

@@ -581,7 +581,6 @@
   "ERROR": "Erreur",
   "select": "Sélectionner",
   "Internal Server Error": "Erreur de serveur interne",
-  "cmf_licence_breadcrumbs": "Licence CMF",
   "preferences": "Préférences",
   "online_registration": "Inscription en ligne",
   "online_registration_text_creation_card": "Ajouter une nouvelle inscription",
@@ -667,8 +666,9 @@
   "create_a_new_residence_area": "Créer une nouvelle zone de résidence",
   "residence_areas_breadcrumbs": "Zones de résidence",
   "super_admin_explanation_text": "Le compte super-admin possède tous les droits de gestion sur votre logiciel. On l’utilise entre autre pour la gestion de votre site internet, pour créer les comptes des membres de votre structure à la première connexion au logiciel, ou dans des situations de dépannage.",
-  "cycles_breadcrumbs": "Enseignements",
   "exit": "Quitter",
   "max_size_4_mb": "Taille maximum: 4 MO",
-  "file_too_large": "Le fichier est trop volumineux"
+  "file_too_large": "Le fichier est trop volumineux",
+  "cycles_breadcrumbs": "Enseignements",
+  "cmf_licence_structure_breadcrumbs": "Licence CMF - Structure"
 }

+ 4 - 1
package.json

@@ -1,7 +1,10 @@
 {
   "name": "app",
   "private": true,
-  "version": "2.3.0",
+  "version": "2.5.0",
+  "engines" : {
+    "node" : "18.10.0"
+  },
   "scripts": {
     "postinstall": "node ./env/setupEnv.mjs",
     "dev": "rm -rf /tmp/nitro && nuxt dev",

+ 10 - 0
pages/cmf_licence/organization.vue → pages/cmf_licence_structure.vue

@@ -93,6 +93,16 @@ const submit = async () => {
     // SSE will update its status to ready when it'll be.
     await em.fetch(File, receipt.fileId)
 
+    // In the case of a SSE dysfonctionnement, program a forced checkup of file status
+    for (let i = 0; i < 3; i++) {
+      setTimeout(async () => {
+        if (file.value && file.value.status === 'PENDING') {
+          console.warn("File's status has not been updated : force a status checkup")
+          await em.fetch(File, receipt.fileId, true)
+        }
+      }, i * 4000)
+    }
+
   } finally {
     submitting.value = false
   }

+ 1 - 1
plugins/sse.client.ts

@@ -29,7 +29,7 @@ export default defineNuxtPlugin(nuxtApp => {
 
     const sseSource = new SseSource(
         runtimeConfig.public.baseUrlMercure,
-        "access/" + accessProfile.id,
+        "access/" + accessProfile.currentAccessId,
         onOpen,
         onMessage,
         onClose,

+ 1 - 1
services/layout/menuBuilder/configurationMenuBuilder.ts

@@ -26,7 +26,7 @@ export default class ConfigurationMenuBuilder extends AbstractMenuBuilder {
     }
 
     if (this.ability.can('display', 'cmf_licence_page')) {
-      children.push(this.createItem('cmf_licence_generate', undefined, '/licence_cmf/organization', MENU_LINK_TYPE.V1))
+      children.push(this.createItem('cmf_licence_generate', undefined, '/cmf_licence_structure', MENU_LINK_TYPE.INTERNAL))
     }
 
     if (this.ability.can('display', 'parameters_page')) {

+ 7 - 6
stores/accessProfile.ts

@@ -11,6 +11,7 @@ import {computed, ref} from "@vue/reactivity";
 import type {Ref} from "@vue/reactivity";
 import RoleUtils from "~/services/rights/roleUtils";
 import * as _ from 'lodash-es'
+import {ComputedRef} from "vue";
 
 export const useAccessProfileStore = defineStore('accessProfile', () => {
 
@@ -49,19 +50,19 @@ export const useAccessProfileStore = defineStore('accessProfile', () => {
 
   // Getters
   /**
-   * Est-ce que l'utilisateur possède un compte administrateur
+   * Retourne l'id de la session en cours
    * @return {boolean}
    */
-  const isAdminAccount = computed((): boolean => {
-    return isAdminAccess.value ?? false
+  const currentAccessId = computed((): number => {
+    return (!switchId.value || isNaN(switchId.value)) ? id.value!! : switchId.value
   })
 
   /**
-   * Retourne l'id de la session en cours
+   * Est-ce que l'utilisateur possède un compte administrateur
    * @return {boolean}
    */
-  const currentAccessId = computed((): number => {
-    return (!switchId.value || isNaN(switchId.value)) ? (id.value ?? 0) : switchId.value
+  const isAdminAccount = computed((): boolean => {
+    return isAdminAccess.value ?? false
   })
 
   // Actions

+ 1 - 1
tests/units/services/layout/menuBuilder/configurationMenuBuilder.test.ts

@@ -63,7 +63,7 @@ describe('build', () => {
         ability.can = vi.fn((action: string, subject: string) => action === 'display' && subject === 'cmf_licence_page')
 
         expect(menuBuilder.build()).toEqual(
-            {label: 'cmf_licence_generate', icon: undefined, to: 'https://mydomain.com/#/licence_cmf/organization', type: MENU_LINK_TYPE.V1, active: false}
+            {label: 'cmf_licence_generate', icon: undefined, to: '/cmf_licence_structure', type: MENU_LINK_TYPE.INTERNAL, active: false}
         )
     })