fix: eslint + prettier
This commit is contained in:
parent
e890a03a48
commit
864bbbb9fd
@ -106,7 +106,6 @@ const currentDescriptions = ref<SectionCell[]>([]);
|
|||||||
const editedDescriptions = ref<SectionCell[]>([]);
|
const editedDescriptions = ref<SectionCell[]>([]);
|
||||||
const isEditing = ref<boolean[]>([]);
|
const isEditing = ref<boolean[]>([]);
|
||||||
|
|
||||||
// Fonctions
|
|
||||||
const startEditing = (index: number) => {
|
const startEditing = (index: number) => {
|
||||||
isEditing.value[index] = true;
|
isEditing.value[index] = true;
|
||||||
};
|
};
|
||||||
@ -178,7 +177,6 @@ const handleFetchError = (error: unknown) => {
|
|||||||
isEditing.value = [false];
|
isEditing.value = [false];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const fetchData = async (
|
const fetchData = async (
|
||||||
projectId: number,
|
projectId: number,
|
||||||
title: 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."];
|
const section = leanCanvasData[title] || ["Aucune donnée disponible."];
|
||||||
|
|
||||||
// On crée des instances de SectionCell
|
|
||||||
const result = section.map(
|
const result = section.map(
|
||||||
(txt, index) =>
|
(txt, index) =>
|
||||||
new SectionCell({
|
new SectionCell({
|
||||||
@ -347,7 +343,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
.tooltip-explain {
|
.tooltip-explain {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 101%; /* au-dessus de la carte */
|
bottom: 101%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
|
@ -24,15 +24,15 @@
|
|||||||
v-if="entrepreneurEmails.length > 0"
|
v-if="entrepreneurEmails.length > 0"
|
||||||
class="contact-dropdown"
|
class="contact-dropdown"
|
||||||
:class="{ 'dropdown-visible': isDropdownOpen }"
|
: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>
|
{{ email }}
|
||||||
<button
|
</button>
|
||||||
v-for="(email, index) in entrepreneurEmails"
|
|
||||||
:key="index"
|
|
||||||
@click="contactSingle(email)"
|
|
||||||
>
|
|
||||||
{{ email }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -68,18 +68,18 @@ const fetchMockEntrepreneurs = () => {
|
|||||||
{
|
{
|
||||||
userName: "Doe",
|
userName: "Doe",
|
||||||
userSurname: "John",
|
userSurname: "John",
|
||||||
primaryMail: "john.doe@example.com"
|
primaryMail: "john.doe@example.com",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
userName: "Smith",
|
userName: "Smith",
|
||||||
userSurname: "Anna",
|
userSurname: "Anna",
|
||||||
primaryMail: "anna.smith@example.com"
|
primaryMail: "anna.smith@example.com",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
userName: "Mock",
|
userName: "Mock",
|
||||||
userSurname: "User",
|
userSurname: "User",
|
||||||
primaryMail: null
|
primaryMail: null,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
entrepreneurs.value = mockData.map((item) => new UserEntrepreneur(item));
|
entrepreneurs.value = mockData.map((item) => new UserEntrepreneur(item));
|
||||||
@ -97,26 +97,28 @@ const fetchEntrepreneurs = (projectId: number, useMock = false) => {
|
|||||||
getProjectEntrepreneurs(
|
getProjectEntrepreneurs(
|
||||||
projectId,
|
projectId,
|
||||||
(response) => {
|
(response) => {
|
||||||
const rawData = response.data;
|
const rawData = response.data as Partial<UserEntrepreneur>[];
|
||||||
entrepreneurs.value = rawData.map(
|
entrepreneurs.value = rawData.map(
|
||||||
(item: any) => new UserEntrepreneur(item)
|
(item) => new UserEntrepreneur(item)
|
||||||
);
|
);
|
||||||
entrepreneurEmails.value = entrepreneurs.value
|
entrepreneurEmails.value = entrepreneurs.value
|
||||||
.map((e) => e.primaryMail)
|
.map((e) => e.primaryMail)
|
||||||
.filter((mail): mail is string => !!mail); // filtrer undefined
|
.filter((mail): mail is string => !!mail);
|
||||||
},
|
},
|
||||||
(error) => {
|
(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 contactAll = () => {
|
||||||
const allEmails = entrepreneurEmails.value.join(", ");
|
const allEmails = entrepreneurEmails.value.join(", ");
|
||||||
navigator.clipboard.writeText(allEmails)
|
navigator.clipboard
|
||||||
|
.writeText(allEmails)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
alert("Tous les emails copiés dans le presse-papiers !");
|
alert("Tous les emails copiés dans le presse-papiers !");
|
||||||
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
||||||
@ -125,7 +127,8 @@ const contactAll = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const contactSingle = (email: string) => {
|
const contactSingle = (email: string) => {
|
||||||
navigator.clipboard.writeText(email)
|
navigator.clipboard
|
||||||
|
.writeText(email)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
alert(`Adresse copiée : ${email}`);
|
alert(`Adresse copiée : ${email}`);
|
||||||
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
||||||
@ -134,7 +137,11 @@ const contactSingle = (email: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
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;
|
isDropdownOpen.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -151,7 +158,6 @@ onBeforeUnmount(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@import "@/components/canvas/style-project.css";
|
@import "@/components/canvas/style-project.css";
|
||||||
|
|
||||||
|
@ -78,27 +78,6 @@ const items = ref([
|
|||||||
class: "Revenus",
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -111,10 +90,10 @@ onMounted(() => {
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: auto; /* autorise la hauteur à s'ajuster selon le contenu */
|
height: auto;
|
||||||
max-height: none; /* enlève la limite de hauteur */
|
max-height: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: visible; /* autorise le débordement visible */
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
@ -161,7 +140,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.canvas-item {
|
.canvas-item {
|
||||||
/*background-color: white;*/
|
|
||||||
border: 1px solid #dee2e6;
|
border: 1px solid #dee2e6;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<header>
|
<header>
|
||||||
<HeaderCanvas
|
<HeaderCanvas :project-id="1" :is-admin="isAdmin_" />
|
||||||
:project-id="1"
|
|
||||||
:is-admin="isAdmin_"
|
|
||||||
/>
|
|
||||||
</header>
|
</header>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -13,22 +10,22 @@
|
|||||||
Cliquez sur un champ du tableau pour afficher son contenu en détail
|
Cliquez sur un champ du tableau pour afficher son contenu en détail
|
||||||
ci-dessous.
|
ci-dessous.
|
||||||
</p>
|
</p>
|
||||||
<LeanCanvas
|
<LeanCanvas :project-id="1" :is-admin="isAdmin_" />
|
||||||
:project-id="1"
|
|
||||||
:is-admin="isAdmin_"
|
|
||||||
/>
|
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<p v-if="admin">
|
<p v-if="admin">
|
||||||
Responsable :
|
Responsable :
|
||||||
<strong>{{ admin.userName }} {{ admin.userSurname }}</strong><br />
|
<strong>{{ admin.userName }} {{ admin.userSurname }}</strong
|
||||||
|
><br />
|
||||||
Contact :
|
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>
|
<a :href="`tel:${admin.phoneNumber}`">{{
|
||||||
</p>
|
admin.phoneNumber
|
||||||
<p v-else>
|
}}</a>
|
||||||
Chargement des informations du responsable...
|
|
||||||
</p>
|
</p>
|
||||||
|
<p v-else>Chargement des informations du responsable...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -37,10 +34,10 @@
|
|||||||
import HeaderCanvas from "../components/canvas/HeaderCanvas.vue";
|
import HeaderCanvas from "../components/canvas/HeaderCanvas.vue";
|
||||||
import LeanCanvas from "../components/canvas/LeanCanvas.vue";
|
import LeanCanvas from "../components/canvas/LeanCanvas.vue";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { axiosInstance } from "@/services/api.ts";
|
|
||||||
import { isAdmin } from "@/services/tools.ts";
|
import { isAdmin } from "@/services/tools.ts";
|
||||||
import { getProjectAdmin } from "@/services/Apis/Shared.ts";
|
import { getProjectAdmin } from "@/services/Apis/Shared.ts";
|
||||||
import UserAdmin from "@/ApiClasses/UserAdmin.ts";
|
import UserAdmin from "@/ApiClasses/UserAdmin.ts";
|
||||||
|
import type { AxiosResponse, AxiosError } from "axios";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@ -54,7 +51,6 @@ const IS_MOCK_MODE = false;
|
|||||||
const isAdmin_ = isAdmin();
|
const isAdmin_ = isAdmin();
|
||||||
const admin = ref<UserAdmin | null>(null);
|
const admin = ref<UserAdmin | null>(null);
|
||||||
|
|
||||||
|
|
||||||
const mockAdminData = new UserAdmin({
|
const mockAdminData = new UserAdmin({
|
||||||
idUser: 1,
|
idUser: 1,
|
||||||
userSurname: "ALAMI",
|
userSurname: "ALAMI",
|
||||||
@ -64,19 +60,33 @@ const mockAdminData = new UserAdmin({
|
|||||||
phoneNumber: "0600000000",
|
phoneNumber: "0600000000",
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchAdminData = async (projectId: number, useMock = IS_MOCK_MODE) => {
|
const fetchAdminData = (projectId: number, useMock = IS_MOCK_MODE) => {
|
||||||
if (useMock) {
|
if (useMock) {
|
||||||
console.log("Utilisation des données mockées pour l'administrateur");
|
console.log("Utilisation des données mockées pour l'administrateur");
|
||||||
admin.value = mockAdminData;
|
admin.value = mockAdminData;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
getProjectAdmin(
|
||||||
const response = await axiosInstance.get(`/shared/projects/admin/${projectId}`);
|
projectId,
|
||||||
admin.value = new UserAdmin(response.data);
|
(response: AxiosResponse) => {
|
||||||
} catch (error) {
|
admin.value = new UserAdmin(response.data);
|
||||||
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(() => {
|
onMounted(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user