Skip to content

Commit

Permalink
fix(messagerie): correction pb composant ToolTip et autres (#521)
Browse files Browse the repository at this point in the history
- Correction prévisualisation (+icone enveloppe) : lié à suppression du
div dans le composant et probablement rebase de l'index.js côté shared
- Ajout affichage des cartes uniquement pour profil DREETS
- Ajout du tag de lecture uniquement pour le profil DREETS 
- Correction liste des déclarations au lieu de la liste des messages sur
l’organisme (effet de bord de la mise en composant de la liste)
  • Loading branch information
l-scherer authored Oct 1, 2024
2 parents c7ea9d0 + 87d16b0 commit 51a88c8
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
]"
/>
<CardsNumber
v-if="!props.organisme && props.display === displayType.Messagerie"
v-if="
!props.organisme &&
props.display === displayType.Messagerie &&
userStore.user.serviceCompetent === 'DEP'
"
:values="[
{
title: 'Messages non lus',
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-bo/src/pages/messagerie/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="fr-container">
<DemandesSejourListe :display="'Messagerie'" />
<DemandesSejourListe display="Messagerie" />
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<DemandesSejourListe
v-if="organismeName"
:organisme="organismeName"
display="Organisme"
></DemandesSejourListe>
</DsfrTabContent>
</DsfrTabs>
Expand Down
15 changes: 13 additions & 2 deletions packages/frontend-bo/src/pages/sejours/[declarationId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ definePageMeta({
roles: ["DemandeSejour_Lecture", "DemandeSejour_Ecriture"],
});
const usersStore = useUserStore();
const log = logger("pages/sejours");
const toaster = useToaster();
Expand All @@ -205,7 +207,7 @@ const selectTab = async (idx) => {
if (idx === 2 && !historique.value) {
execute();
}
if (idx === 3) {
if (idx === 3 && userStore.user.serviceCompetent === "DEP") {
await demandeStore.readMessages(route.params.declarationId);
demandeStore.fetchMessages(route.params.declarationId);
}
Expand Down Expand Up @@ -249,10 +251,19 @@ const isOrganismeNonAgree = computed(() => {
});
onMounted(async () => {
if (!usersStore.user.serviceCompetent) {
await usersStore.refreshProfile();
}
try {
await demandeStore.setCurrentDemande(route.params.declarationId);
demandeStore.fetchMessages(route.params.declarationId);
if (parseInt(route.query.defaultTabIndex) === 3)
if (!usersStore.user.serviceCompetent) {
await usersStore.refreshProfile();
}
if (
parseInt(route.query.defaultTabIndex) === 3 &&
userStore.user.serviceCompetent === "DEP"
)
await demandeStore.readMessages(route.params.declarationId);
} catch (e) {

Check warning on line 268 in packages/frontend-bo/src/pages/sejours/[declarationId].vue

View workflow job for this annotation

GitHub Actions / lint-format-test

'e' is defined but never used
navigateTo("/sejours");
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-bo/src/pages/sejours/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="fr-container">
<DemandesSejourListe :display="'Organisme'" />
<DemandesSejourListe display="Organisme" />
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<DemandeSejourListe :display="'Organisme'" />
<DemandeSejourListe display="Organisme" />
</template>
2 changes: 1 addition & 1 deletion packages/frontend-usagers/src/pages/messagerie/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="fr-container">
<DemandeSejourListe :display="'Messagerie'" />
<DemandeSejourListe display="Messagerie" />
</div>
</template>

Expand Down
4 changes: 0 additions & 4 deletions packages/shared/src/components/messages/MessageEtat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ const props = defineProps({
type: String,
validator: (value) => Object.values(messageEtat.etat).includes(value),
},
message: {
required: true,
type: String,
},
});
import messageEtat from "@vao/shared/src/utils/messageUtils";
Expand Down
8 changes: 5 additions & 3 deletions packages/shared/src/components/messages/MessageHover.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<DsfrTooltip on-hover :content="content">
<div class="fr-icon-mail-line"></div>
</DsfrTooltip>
<div>
<DsfrTooltip on-hover :content="content">
<div class="fr-icon-mail-line"></div>
</DsfrTooltip>
</div>
</template>

<script setup>
Expand Down
12 changes: 11 additions & 1 deletion packages/shared/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ import hebergement from "./hebergement";
import regex from "./hebergement";
import eigUtils from "./hebergement";
import messageUtils from "./messageUtils";
import MessageHover from "../components/messages/MessageHover.vue";
import MessageEtat from "../components/messages/MessageEtat.vue";

export { createLogger, hebergement, regex, eigUtils, messageUtils };
export {
createLogger,
hebergement,
regex,
eigUtils,
messageUtils,
MessageHover,
MessageEtat,
};

0 comments on commit 51a88c8

Please sign in to comment.