fix: eslint + prettier
Some checks failed
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 40s
CI / build (push) Failing after 12s
Format / formatting (pull_request) Successful in 6s

This commit is contained in:
2025-04-29 11:32:30 +02:00
parent e890a03a48
commit 864bbbb9fd
4 changed files with 65 additions and 75 deletions

View File

@@ -24,15 +24,15 @@
v-if="entrepreneurEmails.length > 0"
class="contact-dropdown"
:class="{ 'dropdown-visible': isDropdownOpen }"
>
<button @click="contactAll">Contacter tous</button>
<button
v-for="(email, index) in entrepreneurEmails"
:key="index"
@click="contactSingle(email)"
>
<button @click="contactAll">Contacter tous</button>
<button
v-for="(email, index) in entrepreneurEmails"
:key="index"
@click="contactSingle(email)"
>
{{ email }}
</button>
{{ email }}
</button>
</div>
</div>
</div>
@@ -68,18 +68,18 @@ const fetchMockEntrepreneurs = () => {
{
userName: "Doe",
userSurname: "John",
primaryMail: "john.doe@example.com"
primaryMail: "john.doe@example.com",
},
{
userName: "Smith",
userSurname: "Anna",
primaryMail: "anna.smith@example.com"
primaryMail: "anna.smith@example.com",
},
{
userName: "Mock",
userSurname: "User",
primaryMail: null
}
primaryMail: null,
},
];
entrepreneurs.value = mockData.map((item) => new UserEntrepreneur(item));
@@ -97,26 +97,28 @@ const fetchEntrepreneurs = (projectId: number, useMock = false) => {
getProjectEntrepreneurs(
projectId,
(response) => {
const rawData = response.data;
const rawData = response.data as Partial<UserEntrepreneur>[];
entrepreneurs.value = rawData.map(
(item: any) => new UserEntrepreneur(item)
(item) => new UserEntrepreneur(item)
);
entrepreneurEmails.value = entrepreneurs.value
.map((e) => e.primaryMail)
.filter((mail): mail is string => !!mail); // filtrer undefined
.filter((mail): mail is string => !!mail);
},
(error) => {
console.error("Erreur lors de la récupération des entrepreneurs :", error);
console.error(
"Erreur lors de la récupération des entrepreneurs :",
error
);
}
);
}
};
const contactAll = () => {
const allEmails = entrepreneurEmails.value.join(", ");
navigator.clipboard.writeText(allEmails)
navigator.clipboard
.writeText(allEmails)
.then(() => {
alert("Tous les emails copiés dans le presse-papiers !");
window.open("https://partage.bordeaux-inp.fr/", "_blank");
@@ -125,7 +127,8 @@ const contactAll = () => {
};
const contactSingle = (email: string) => {
navigator.clipboard.writeText(email)
navigator.clipboard
.writeText(email)
.then(() => {
alert(`Adresse copiée : ${email}`);
window.open("https://partage.bordeaux-inp.fr/", "_blank");
@@ -134,7 +137,11 @@ const contactSingle = (email: string) => {
};
const handleClickOutside = (event: MouseEvent) => {
if (isDropdownOpen.value && dropdownRef.value && !dropdownRef.value.contains(event.target as Node)) {
if (
isDropdownOpen.value &&
dropdownRef.value &&
!dropdownRef.value.contains(event.target as Node)
) {
isDropdownOpen.value = false;
}
};
@@ -151,7 +158,6 @@ onBeforeUnmount(() => {
});
</script>
<style scoped>
@import "@/components/canvas/style-project.css";