فهرست منبع

V8-5072_fixes_after_tests_1

Olivier Massot 2 سال پیش
والد
کامیت
878258faae

+ 3 - 0
components/Layout/AlertBar/RegistrationStatus.vue

@@ -32,6 +32,9 @@ const messagesByStatus = {
 }
 
 const message: ComputedRef<string> = computed(() => {
+  if (!registrationStatus.value) {
+    return ''
+  }
   const status = (registrationStatus.value as RegistrationStatus).status
   return status ? messagesByStatus[status] : ''
 })

+ 1 - 1
components/Layout/AlertBar/SwitchYear.vue

@@ -6,7 +6,7 @@ Barre d'alerte qui s'affiche lorsque l'utilisateur n'est pas sur l'année couran
 
 <template>
   <!-- TODO : fonctionnement à valider -->
-  <UiSystemBar v-if="show" class="theme-warning">
+  <UiSystemBar v-if="show" class="theme-warning flex-column">
     {{$t('not_current_year')}}
 
     <a @click="resetYear" class="text-decoration-none on-warning" style="cursor: pointer;">

+ 1 - 1
components/Layout/Header.vue

@@ -39,7 +39,7 @@ Contient entre autres le nom de l'organisation, l'accès à l'aide et aux préf
 
     <a
         :href="runtimeConfig.supportUrl"
-        class="text-body pa-3 ml-2 theme-secondary text-decoration-none"
+        class="text-body pa-3 ml-2 theme-secondary text-decoration-none h-100"
         target="_blank"
     >
       <span class="d-none d-sm-none d-md-flex">{{ $t('help_access') }}</span>

+ 8 - 3
components/Layout/MainMenu.vue

@@ -22,15 +22,16 @@ Prend en paramètre une liste de ItemMenu et les met en forme
       <!-- TODO: que se passe-t-il si le menu ne comprend qu'un seul MenuItem? -->
       <div v-for="(item, i) in items" :key="i">
 
-        <!-- Cas 1 : l'item n'a pas d'enfants, c'est un lien -->
+        <!-- Cas 1 : l'item n'a pas d'enfants, c'est un lien (ou le menu est en mode réduit) -->
         <v-list-item
-          v-if="!item.children"
+          v-if="!item.children || isRail"
           :title="$t(item.label)"
           :prepend-icon="item.icon.name"
           :href="!isInternalLink(item) ? item.to : undefined"
           :to="isInternalLink(item) ? item.to : undefined"
           exact
           height="48px"
+          class="menu-item"
         />
 
         <!-- Cas 2 : l'item a des enfants, c'est un groupe -->
@@ -44,7 +45,7 @@ Prend en paramètre une liste de ItemMenu et les met en forme
                 v-bind="props"
                 :prepend-icon="item.icon.name"
                 :title="$t(item.label)"
-                class="theme-secondary"
+                class="theme-secondary menu-item"
                 height="48px"
             />
           </template>
@@ -179,4 +180,8 @@ onUnmounted(() => {
     margin-right: 10px;
   }
 
+  :deep(.menu-item .fa) {
+    text-align: center;
+  }
+
 </style>

+ 4 - 2
components/Layout/SubHeader/DataTiming.vue

@@ -55,7 +55,9 @@ const historicalValue: Ref<Array<string>> = ref(historicalChoices.filter((item)
 const onUpdate = async (newValue: Array<string>) => {
   historicalValue.value = newValue
 
-  if (accessProfileStore.id === null) {
+  const accessId = accessProfileStore.switchId ?? accessProfileStore.id
+
+  if (accessId === null) {
     throw new Error('Invalid profile id')
   }
 
@@ -68,7 +70,7 @@ const onUpdate = async (newValue: Array<string>) => {
   setDirty(false)
   pageStore.loading = true
 
-  await em.patch(Access, accessProfileStore.id, {'historical': accessProfileStore.historical})
+  await em.patch(Access, accessId, {'historical': accessProfileStore.historical})
   if (process.server) {
       // Force profile refresh server side to avoid a bug where server and client stores diverge on profile refresh
       await em.refreshProfile()

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

@@ -34,7 +34,10 @@ const end = accessProfileStore.historical.dateEnd
 const datesRange: Ref<Array<Date> | null> = ref((start && end) ? [new Date(start), new Date(end)] : null)
 
 const updateDateTimeRange = async (dates: Array<Date>): Promise<any> => {
-  if (accessProfileStore.id === null) {
+
+  const accessId = accessProfileStore.switchId ?? accessProfileStore.id
+
+  if (accessId === null) {
     throw new Error('Invalid profile id')
   }
 
@@ -51,7 +54,7 @@ const updateDateTimeRange = async (dates: Array<Date>): Promise<any> => {
   setDirty(false)
   pageStore.loading = true
 
-  await em.patch(Access, accessProfileStore.id, {'historical': accessProfileStore.historical})
+  await em.patch(Access, accessId, {'historical': accessProfileStore.historical})
   if (process.server) {
       // Force profile refresh server side to avoid a bug where server and client stores diverge on profile refresh
       await em.refreshProfile()

+ 1 - 1
lang/fr.json

@@ -50,7 +50,7 @@
   "domain_name": "Nom de domaine",
   "dummy_domain_name": "ma-structure.fr",
   "associated_mail_address": "Adresse email associée",
-  "dummy_email_address": "contact[at]ma-structure.fr",
+  "dummy_email_address": "contact{'@'}ma-structure.fr",
   "GUARDIANS": "Tuteurs uniquement",
   "STUDENTS": "Élèves uniquement",
   "STUDENTS_AND_THEIR_GUARDIANS": "Élèves et leurs tuteurs",

+ 0 - 4
services/layout/menuBuilder/statsMenuBuilder.ts

@@ -27,10 +27,6 @@ export default class StatsMenuBuilder extends AbstractMenuBuilder {
       children.push(this.createItem('fede_stats', {name: 'fas fa-chart-bar'}, '/statistic/membersfedeonly', MENU_LINK_TYPE.V1))
     }
 
-    if (this.ability.can('display', 'structure_stats_page')) {
-      children.push(this.createItem('structure_stats', {name: 'fas fa-chart-bar'}, '/statistic/membersfedeassos', MENU_LINK_TYPE.V1))
-    }
-
     if (children.length > 1) {
       // Plusieurs éléments, on retourne un groupe
       return this.createGroup('stats', {name: 'fas fa-chart-bar'}, children)