Ver código fonte

various fixes

Olivier Massot 2 anos atrás
pai
commit
f22c8c055d

+ 9 - 5
components/Layout/AlertBar/SuperAdmin.vue

@@ -6,7 +6,7 @@ Barre d'alerte qui s'affiche lorsque l'utilisateur est un super admin en mode sw
 
 <template>
   <!-- TODO : fonctionnement à valider -->
-  <UiSystemBar v-if="show" class="theme-danger" :href="url">
+  <UiSystemBar v-if="show" class="theme-danger" :on-click="onClick">
     <v-icon small>fas fa-exclamation-triangle</v-icon>
     <span>{{ $t('super_admin_switch_account') }} </span>
   </UiSystemBar>
@@ -16,10 +16,10 @@ Barre d'alerte qui s'affiche lorsque l'utilisateur est un super admin en mode sw
   import {useAccessProfileStore} from "~/stores/accessProfile";
   import UrlUtils from "~/services/utils/urlUtils";
   import type {ComputedRef} from "@vue/reactivity";
+  import {navigateTo} from "#app";
+  import {useAdminUrl} from "~/composables/utils/useAdminUrl";
 
-  const runtimeConfig = useRuntimeConfig()
-
-  const baseLegacyUrl: string = runtimeConfig.baseUrlAdminLegacy
+  const { makeAdminUrl } = useAdminUrl()
 
   const accessProfile = useAccessProfileStore()
 
@@ -32,10 +32,14 @@ Barre d'alerte qui s'affiche lorsque l'utilisateur est un super admin en mode sw
     const originalAccessId = accessProfile.originalAccess ? accessProfile.originalAccess.id : null
 
     if (show && orgId && originalAccessId) {
-      return UrlUtils.join(baseLegacyUrl, '#', 'switch_user', orgId, originalAccessId, 'exit')
+      return makeAdminUrl(UrlUtils.join('#', 'switch_user', orgId, originalAccessId, 'exit'))
     }
     return ''
   })
+
+  const onClick = () => {
+    navigateTo(url.value,{ external: true })
+  }
 </script>
 
 <style scoped lang="scss">

+ 0 - 3
components/Layout/SubHeader/ActivityYear.vue

@@ -58,9 +58,6 @@ const setActivityYear = async (event: string) => {
   if (!(1900 < activityYear) || !(activityYear <= 2100)) {
     throw new Error("Error: 'year' shall be a valid year")
   }
-  if (accessProfileStore.id === null) {
-    throw new Error("Error: invalid access id")
-  }
   formStore.setDirty(false)
 
   pageStore.loading = true

+ 1 - 5
components/Layout/SubHeader/DataTiming.vue

@@ -57,11 +57,7 @@ const historicalValue: Ref<Array<string>> = ref(historicalChoices.filter((item)
 const onUpdate = async (newValue: Array<string>) => {
   historicalValue.value = newValue
 
-  const accessId = accessProfileStore.switchId ?? accessProfileStore.id
-
-  if (accessId === null) {
-    throw new Error('Invalid profile id')
-  }
+  const accessId = accessProfileStore.currentAccessId
 
   accessProfileStore.setHistorical(
       historicalValue.value.includes('past'),

+ 1 - 5
components/Layout/SubHeader/DataTimingRange.vue

@@ -37,11 +37,7 @@ const datesRange: Ref<Array<Date> | null> = ref((start && end) ? [new Date(start
 
 const updateDateTimeRange = async (dates: Array<Date>): Promise<any> => {
 
-  const accessId = accessProfileStore.switchId ?? accessProfileStore.id
-
-  if (accessId === null) {
-    throw new Error('Invalid profile id')
-  }
+  const accessId = accessProfileStore.currentAccessId
 
   datesRange.value = dates
 

+ 1 - 1
components/Ui/DateRangePicker.vue

@@ -108,7 +108,7 @@ const dateRangePickerAltPosition = (el: HTMLElement) => {
   }
 
   .date-range-picker {
-    div[role="textbox"] {
+    div {
       height: 100% !important;
       max-height: 100% !important;
     }

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "private": true,
   "version": "2.5.0",
   "engines" : {
-    "node" : "18.10.0"
+    "node" : "18.19.0"
   },
   "scripts": {
     "postinstall": "node ./env/setupEnv.mjs",

+ 45 - 43
pages/parameters/website.vue

@@ -79,49 +79,51 @@
             </div>
           </div>
 
-          <v-divider class="my-10"/>
-
-          <div class="my-8 d-flex flex-row justify-center w-100" v-if="!organizationProfile.isCmf">
-            <v-btn
-              v-if="!parameters.desactivateOpentalentSiteWeb"
-              color="error"
-              @click="showWebsiteDeactivationDialog=true"
-            >
-              {{ $t('deactivateOpentalentSiteWeb') }}
-            </v-btn>
-            <v-btn
-              v-else
-              color="primary"
-              @click="reactivateWebsite"
-            >
-              {{ $t('reactivateOpentalentSiteWeb') }}
-            </v-btn>
-
-            <LazyLayoutDialog :show="showWebsiteDeactivationDialog">
-              <template #dialogTitle>
-                {{ $t('please_confirm')}}
-              </template>
-              <template #dialogText>
-                <v-col>
-                  <div>{{ $t('yourOpentalentWebsiteWillBeDeactivatedOnceYouLlHaveSaved')}}.</div>
-                  <span>{{ $t('doYouWantToContinue')}} ?</span>
-                </v-col>
-              </template>
-              <template #dialogBtn>
-                <v-btn
-                    class="theme-neutral-soft mr-4"
-                    @click="showWebsiteDeactivationDialog=false"
-                >
-                  {{ $t('cancel') }}
-                </v-btn>
-                <v-btn
-                    class="theme-primary"
-                    @click="showWebsiteDeactivationDialog=false; deactivateWebsite()"
-                >
-                  {{ $t('yes') }}
-                </v-btn>
-              </template>
-            </LazyLayoutDialog>
+          <div v-if="!organizationProfile.isCmf">
+            <v-divider class="my-10"/>
+
+            <div class="my-8 d-flex flex-row justify-center w-100" v-if="!organizationProfile.isCmf">
+              <v-btn
+                v-if="!parameters.desactivateOpentalentSiteWeb"
+                color="error"
+                @click="showWebsiteDeactivationDialog=true"
+              >
+                {{ $t('deactivateOpentalentSiteWeb') }}
+              </v-btn>
+              <v-btn
+                v-else
+                color="primary"
+                @click="reactivateWebsite"
+              >
+                {{ $t('reactivateOpentalentSiteWeb') }}
+              </v-btn>
+
+              <LazyLayoutDialog :show="showWebsiteDeactivationDialog">
+                <template #dialogTitle>
+                  {{ $t('please_confirm')}}
+                </template>
+                <template #dialogText>
+                  <v-col>
+                    <div>{{ $t('yourOpentalentWebsiteWillBeDeactivatedOnceYouLlHaveSaved')}}.</div>
+                    <span>{{ $t('doYouWantToContinue')}} ?</span>
+                  </v-col>
+                </template>
+                <template #dialogBtn>
+                  <v-btn
+                      class="theme-neutral-soft mr-4"
+                      @click="showWebsiteDeactivationDialog=false"
+                  >
+                    {{ $t('cancel') }}
+                  </v-btn>
+                  <v-btn
+                      class="theme-primary"
+                      @click="showWebsiteDeactivationDialog=false; deactivateWebsite()"
+                  >
+                    {{ $t('yes') }}
+                  </v-btn>
+                </template>
+              </LazyLayoutDialog>
+            </div>
           </div>
         </v-col>
       </v-row>

+ 1 - 2
pages/subscription.vue

@@ -192,7 +192,7 @@ Page 'Mon abonnement'
                   {{ $t('sms') }}
                 </v-row>
                 <v-row class="align-end">
-                  <nuxt-img src="/images/sms.png" :height="140" :width="100"/>
+                  <nuxt-img src="/images/sms.png" :height="140" :width="175"/>
                 </v-row>
                 <v-row>
                   <p><b>{{ $t('send_sms') }} {{ $t('to_your_members_from_app') }}</b></p>
@@ -283,7 +283,6 @@ Page 'Mon abonnement'
   import MobytUserStatus from "~/models/Organization/MobytUserStatus";
   import type {Ref} from "@vue/reactivity";
   import {useDisplay} from "vuetify";
-  import {useRedirect} from "~/composables/utils/useRedirect";
 
   const ability = useAbility()
 

+ 3 - 0
plugins/init.server.ts

@@ -16,6 +16,9 @@ export default defineNuxtPlugin(async () => {
     }
 
     const accessId: number = parseInt(accessCookieId.value)
+    if (isNaN(accessId)) {
+        throw new Error('Invalid access id')
+    }
 
     const { initiateProfile } = useRefreshProfile()
 

+ 0 - 2
stores/accessProfile.ts

@@ -11,7 +11,6 @@ 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', () => {
 
@@ -102,7 +101,6 @@ export const useAccessProfileStore = defineStore('accessProfile', () => {
    * /!\ Server-side only
    *
    * @param profile
-   * @param abilitiesValue
    */
   const initiateProfile = (profile: any): void => {
 

+ 32 - 8
yarn.lock

@@ -3031,6 +3031,11 @@ citty@^0.1.4, citty@^0.1.5:
   dependencies:
     consola "^3.2.3"
 
+classnames@^2.2.6:
+  version "2.3.2"
+  resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924"
+  integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==
+
 clean-regexp@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7"
@@ -3431,6 +3436,11 @@ deasync@^0.1.15:
     bindings "^1.5.0"
     node-addon-api "^1.7.1"
 
+debounce@^1.2.0:
+  version "1.2.1"
+  resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5"
+  integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==
+
 debug@2.6.9, debug@^2.6.8:
   version "2.6.9"
   resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@@ -3670,10 +3680,15 @@ eastasianwidth@^0.2.0:
   resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
   integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
 
-editorconfig@^0.15.3:
-  version "0.15.3"
-  resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5"
-  integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==
+easy-bem@^1.0.2:
+  version "1.1.1"
+  resolved "https://registry.yarnpkg.com/easy-bem/-/easy-bem-1.1.1.tgz#1bfcc10425498090bcfddc0f9c000aba91399e03"
+  integrity sha512-GJRqdiy2h+EXy6a8E6R+ubmqUM08BK0FWNq41k24fup6045biQ8NXxoXimiwegMQvFFV3t1emADdGNL1TlS61A==
+
+editorconfig@^1.0.3:
+  version "1.0.4"
+  resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-1.0.4.tgz#040c9a8e9a6c5288388b87c2db07028aa89f53a3"
+  integrity sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==
   dependencies:
     "@one-ini/wasm" "0.1.1"
     commander "^10.0.0"
@@ -9007,10 +9022,19 @@ vscode-uri@^3.0.2:
   resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f"
   integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==
 
-vue-bundle-renderer@^1.0.3:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/vue-bundle-renderer/-/vue-bundle-renderer-1.0.3.tgz#422438aa4a024e2833e87a5a2d0b97c6c12fb2d8"
-  integrity sha512-EfjX+5TTUl70bki9hPuVp+54JiZOvFIfoWBcfXsSwLzKEiDYyHNi5iX8srnqLIv3YRnvxgbntdcG1WPq0MvffQ==
+vue-advanced-cropper@^2.8.8:
+  version "2.8.8"
+  resolved "https://registry.yarnpkg.com/vue-advanced-cropper/-/vue-advanced-cropper-2.8.8.tgz#af0e8324312be5a1a92ce9fd3aff8264d28a5b33"
+  integrity sha512-yDM7Jb/gnxcs//JdbOogBUoHr1bhCQSto7/ohgETKAe4wvRpmqIkKSppMm1huVQr+GP1YoVlX/fkjKxvYzwwDQ==
+  dependencies:
+    classnames "^2.2.6"
+    debounce "^1.2.0"
+    easy-bem "^1.0.2"
+
+vue-bundle-renderer@^2.0.0:
+  version "2.0.0"
+  resolved "https://registry.yarnpkg.com/vue-bundle-renderer/-/vue-bundle-renderer-2.0.0.tgz#ecab5c9b2803ab2454ba212afef502e684ddbb8e"
+  integrity sha512-oYATTQyh8XVkUWe2kaKxhxKVuuzK2Qcehe+yr3bGiaQAhK3ry2kYE4FWOfL+KO3hVFwCdLmzDQTzYhTi9C+R2A==
   dependencies:
     ufo "^1.2.0"