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:
ALAMI Adnane 2025-04-29 11:32:30 +02:00
parent e890a03a48
commit 864bbbb9fd
4 changed files with 65 additions and 75 deletions

View File

@ -106,7 +106,6 @@ const currentDescriptions = ref<SectionCell[]>([]);
const editedDescriptions = ref<SectionCell[]>([]);
const isEditing = ref<boolean[]>([]);
// Fonctions
const startEditing = (index: number) => {
isEditing.value[index] = true;
};
@ -178,7 +177,6 @@ const handleFetchError = (error: unknown) => {
isEditing.value = [false];
};
const fetchData = async (
projectId: number,
title: number,
@ -287,10 +285,8 @@ const mockFetch = async (
],
};
// On extrait les descriptions pour la section demandée
const section = leanCanvasData[title] || ["Aucune donnée disponible."];
// On crée des instances de SectionCell
const result = section.map(
(txt, index) =>
new SectionCell({
@ -347,7 +343,7 @@ onMounted(() => {
.tooltip-explain {
position: absolute;
bottom: 101%; /* au-dessus de la carte */
bottom: 101%;
left: 50%;
transform: translateX(-50%);
background-color: #333;

View File

@ -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";

View File

@ -78,27 +78,6 @@ const items = ref([
class: "Revenus",
},
]);
/*
onMounted(() => {
const bootstrapCss = document.createElement("link");
bootstrapCss.rel = "stylesheet";
bootstrapCss.href =
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css";
bootstrapCss.integrity =
"sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+Fpc+NC";
bootstrapCss.crossOrigin = "anonymous";
document.head.appendChild(bootstrapCss);
const bootstrapJs = document.createElement("script");
bootstrapJs.src =
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js";
bootstrapJs.integrity =
"sha384-mQ93S0EhrF4Z1nM+fTflmYf0DyzsY5j7F5H3WlClDD6H3WUJh6kxBkF3GDW8n1j6";
bootstrapJs.crossOrigin = "anonymous";
document.body.appendChild(bootstrapJs);
});
*/
</script>
<style scoped>
@ -111,10 +90,10 @@ onMounted(() => {
gap: 12px;
padding: 30px;
position: relative;
height: auto; /* autorise la hauteur à s'ajuster selon le contenu */
max-height: none; /* enlève la limite de hauteur */
height: auto;
max-height: none;
box-sizing: border-box;
overflow: visible; /* autorise le débordement visible */
overflow: visible;
}
@media (max-width: 768px) {
@ -161,7 +140,6 @@ onMounted(() => {
}
.canvas-item {
/*background-color: white;*/
border: 1px solid #dee2e6;
border-radius: 0.5rem;
}

View File

@ -1,10 +1,7 @@
<template>
<div>
<header>
<HeaderCanvas
:project-id="1"
:is-admin="isAdmin_"
/>
<HeaderCanvas :project-id="1" :is-admin="isAdmin_" />
</header>
</div>
<div>
@ -13,22 +10,22 @@
Cliquez sur un champ du tableau pour afficher son contenu en détail
ci-dessous.
</p>
<LeanCanvas
:project-id="1"
:is-admin="isAdmin_"
/>
<LeanCanvas :project-id="1" :is-admin="isAdmin_" />
<div class="info-box">
<p v-if="admin">
Responsable :
<strong>{{ admin.userName }} {{ admin.userSurname }}</strong><br />
<strong>{{ admin.userName }} {{ admin.userSurname }}</strong
><br />
Contact :
<a :href="`mailto:${admin.primaryMail}`">{{ admin.primaryMail }}</a>
<a :href="`mailto:${admin.primaryMail}`">{{
admin.primaryMail
}}</a>
|
<a :href="`tel:${admin.phoneNumber}`">{{ admin.phoneNumber }}</a>
</p>
<p v-else>
Chargement des informations du responsable...
<a :href="`tel:${admin.phoneNumber}`">{{
admin.phoneNumber
}}</a>
</p>
<p v-else>Chargement des informations du responsable...</p>
</div>
</div>
</template>
@ -37,10 +34,10 @@
import HeaderCanvas from "../components/canvas/HeaderCanvas.vue";
import LeanCanvas from "../components/canvas/LeanCanvas.vue";
import { ref, onMounted } from "vue";
import { axiosInstance } from "@/services/api.ts";
import { isAdmin } from "@/services/tools.ts";
import { getProjectAdmin } from "@/services/Apis/Shared.ts";
import UserAdmin from "@/ApiClasses/UserAdmin.ts";
import type { AxiosResponse, AxiosError } from "axios";
/*
const props = defineProps<{
@ -54,7 +51,6 @@ const IS_MOCK_MODE = false;
const isAdmin_ = isAdmin();
const admin = ref<UserAdmin | null>(null);
const mockAdminData = new UserAdmin({
idUser: 1,
userSurname: "ALAMI",
@ -64,19 +60,33 @@ const mockAdminData = new UserAdmin({
phoneNumber: "0600000000",
});
const fetchAdminData = async (projectId: number, useMock = IS_MOCK_MODE) => {
const fetchAdminData = (projectId: number, useMock = IS_MOCK_MODE) => {
if (useMock) {
console.log("Utilisation des données mockées pour l'administrateur");
admin.value = mockAdminData;
return;
}
try {
const response = await axiosInstance.get(`/shared/projects/admin/${projectId}`);
getProjectAdmin(
projectId,
(response: AxiosResponse) => {
admin.value = new UserAdmin(response.data);
} catch (error) {
console.error("Erreur lors de la récupération des données de l'administrateur :", error);
},
(error: AxiosError) => {
console.error(
"Erreur lors de la récupération des données de l'administrateur :",
error
);
admin.value = {
idUser: 0,
userSurname: "Erreur",
userName: "Chargement",
primaryMail: "N/A",
secondaryMail: "N/A",
phoneNumber: "N/A",
};
}
);
};
onMounted(() => {