Compare commits
No commits in common. "36db3c2968856c416f29b0ecd3558b54fb72ce59" and "6d875d9df19d40833ac8861e857f1c008dcd6d0e" have entirely different histories.
36db3c2968
...
6d875d9df1
@ -2,22 +2,9 @@
|
|||||||
<div class="project" @click="goToLink" >
|
<div class="project" @click="goToLink" >
|
||||||
<div class="project-header">
|
<div class="project-header">
|
||||||
<h2 >{{ projectName }}</h2>
|
<h2 >{{ projectName }}</h2>
|
||||||
<div class="header-actions">
|
<div class="project-buttons">
|
||||||
<div class="dropdown-wrapper">
|
<button class="contact-btn">Contact</button>
|
||||||
<button class="contact-button" @click="toggleDropdown">Contact</button>
|
</div>
|
||||||
<div 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)"
|
|
||||||
>
|
|
||||||
{{ email }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="project-body">
|
<div class="project-body">
|
||||||
<ul>
|
<ul>
|
||||||
@ -32,15 +19,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps } from "vue";
|
import { defineProps } from "vue";
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ref, onMounted } from "vue";
|
|
||||||
import axios from "axios";
|
|
||||||
const IS_MOCK_MODE = true;
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
projectName: string;
|
projectName: string;
|
||||||
listName: string[];
|
listName: string[];
|
||||||
projectLink: string;
|
projectLink: string;
|
||||||
projectId: number;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -51,101 +35,6 @@ const goToLink = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type Entrepreneur = {
|
|
||||||
idUser: number;
|
|
||||||
userSurname: string;
|
|
||||||
userName: string;
|
|
||||||
primaryMail: string;
|
|
||||||
secondaryMail: string;
|
|
||||||
phoneNumber: string;
|
|
||||||
school: string;
|
|
||||||
course: string;
|
|
||||||
sneeStatus: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
const isDropdownOpen = ref(false);
|
|
||||||
const entrepreneurEmails = ref<string[]>([]);
|
|
||||||
|
|
||||||
const toggleDropdown = () => {
|
|
||||||
isDropdownOpen.value = !isDropdownOpen.value;
|
|
||||||
console.log("Dropdown toggled:", isDropdownOpen.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchEntrepreneurs = async (projectId: number, useMock = IS_MOCK_MODE) => {
|
|
||||||
try {
|
|
||||||
const responseData: Entrepreneur[] = useMock
|
|
||||||
? await mockFetchEntrepreneurs(projectId)
|
|
||||||
: (await axios.get(`http://localhost:5000/shared/projects/entrepreneurs/${projectId}`)).data;
|
|
||||||
|
|
||||||
if (responseData.length > 0) {
|
|
||||||
entrepreneurEmails.value = responseData.map((item: Entrepreneur) => item.primaryMail);
|
|
||||||
} else {
|
|
||||||
console.warn("Aucun entrepreneur trouvé.");
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Erreur lors de la récupération des entrepreneurs :", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fonction de simulation de l'API
|
|
||||||
const mockFetchEntrepreneurs = async (projectId :number) => {
|
|
||||||
console.log(`Mock fetch pour projectId: ${projectId}`);
|
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
resolve([
|
|
||||||
{
|
|
||||||
idUser: 1,
|
|
||||||
userSurname: "Doe",
|
|
||||||
userName: "John",
|
|
||||||
primaryMail: "john.doe@example.com",
|
|
||||||
secondaryMail: "johndoe@backup.com",
|
|
||||||
phoneNumber: "612345678",
|
|
||||||
school: "ENSEIRB",
|
|
||||||
course: "Info",
|
|
||||||
sneeStatus: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
idUser: 2,
|
|
||||||
userSurname: "Smith",
|
|
||||||
userName: "Jane",
|
|
||||||
primaryMail: "jane.smith@example.com",
|
|
||||||
secondaryMail: "janesmith@backup.com",
|
|
||||||
phoneNumber: "698765432",
|
|
||||||
school: "ENSEIRB",
|
|
||||||
course: "Info",
|
|
||||||
sneeStatus: true
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const contactAll = () => {
|
|
||||||
const allEmails = entrepreneurEmails.value.join(", ");
|
|
||||||
navigator.clipboard.writeText(allEmails)
|
|
||||||
.then(() => {
|
|
||||||
alert("Tous les emails copiés dans le presse-papiers !");
|
|
||||||
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error("Erreur lors de la copie :", err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const contactSingle = (email: string) => {
|
|
||||||
navigator.clipboard.writeText(email)
|
|
||||||
.then(() => {
|
|
||||||
alert(`Adresse copiée : ${email}`);
|
|
||||||
window.open("https://partage.bordeaux-inp.fr/", "_blank");
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error("Erreur lors de la copie :", err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => fetchEntrepreneurs(props.projectId, IS_MOCK_MODE));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -217,17 +106,4 @@ onMounted(() => fetchEntrepreneurs(props.projectId, IS_MOCK_MODE));
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button {
|
|
||||||
padding: 10px 15px;
|
|
||||||
background-color: #007bff;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background-color: #0056b3;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -56,10 +56,10 @@ const props = defineProps<{
|
|||||||
title: number;
|
title: number;
|
||||||
titleText: string;
|
titleText: string;
|
||||||
description: string;
|
description: string;
|
||||||
isAdmin: number;
|
is_admin: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const IS_ADMIN = props.isAdmin;
|
const IS_ADMIN = props.is_admin;
|
||||||
|
|
||||||
const expanded = ref(false);
|
const expanded = ref(false);
|
||||||
const currentDescriptions = ref<string[]>([]);
|
const currentDescriptions = ref<string[]>([]);
|
||||||
|
@ -125,7 +125,7 @@ const contactSingle = (email: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
const copyToClipboard = (email: string) => {
|
const copyToClipboard = (email: string) => {
|
||||||
navigator.clipboard.writeText(email).then(() => {
|
navigator.clipboard.writeText(email).then(() => {
|
||||||
alert(`Adresse copiée : ${email}`);
|
alert(`Adresse copiée : ${email}`);
|
||||||
@ -133,7 +133,6 @@ const copyToClipboard = (email: string) => {
|
|||||||
console.error("Erreur lors de la copie :", err);
|
console.error("Erreur lors de la copie :", err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
onMounted(() => fetchEntrepreneurs(props.projectId, IS_MOCK_MODE));
|
onMounted(() => fetchEntrepreneurs(props.projectId, IS_MOCK_MODE));
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
v-for="(item, index) in items"
|
v-for="(item, index) in items"
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="item.title"
|
:title="item.title"
|
||||||
:title-text="item.title_text"
|
:titleText="item.title_text"
|
||||||
:description="item.description"
|
:description="item.description"
|
||||||
:project-id="item.projectId"
|
:project-id="item.projectId"
|
||||||
:class="['canvas-item', item.class, 'card', 'shadow', 'p-3']"
|
:class="['canvas-item', item.class, 'card', 'shadow', 'p-3']"
|
||||||
:is-admin= props.isAdmin
|
:is_admin=is_admin
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -18,7 +18,7 @@ import { ref, onMounted } from "vue";
|
|||||||
import CanvasItem from "@/components/canvas/CanvasItem.vue";
|
import CanvasItem from "@/components/canvas/CanvasItem.vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
isAdmin: number;
|
is_admin: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const items = ref([
|
const items = ref([
|
||||||
|
@ -34,12 +34,6 @@ const router = createRouter({
|
|||||||
name: 'signup',
|
name: 'signup',
|
||||||
component: () => import('../views/EntrepSignUp.vue'),
|
component: () => import('../views/EntrepSignUp.vue'),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
path: '/JorCproject',
|
|
||||||
name: 'JorCproject',
|
|
||||||
component: () => import('../views/JoinOrCreatProjectForEntrep.vue'),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
:project-name="project.name"
|
:project-name="project.name"
|
||||||
:list-name="project.members"
|
:list-name="project.members"
|
||||||
:project-link="project.link"
|
:project-link="project.link"
|
||||||
:project-id="0"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div id ="main">
|
<div id ="main">
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<p class="canvas-help-text">
|
<p class="canvas-help-text">
|
||||||
Cliquez sur un champ du tableau pour afficher son contenu en détail ci-dessous.
|
Cliquez sur un champ du tableau pour afficher son contenu en détail ci-dessous.
|
||||||
</p>
|
</p>
|
||||||
<LeanCanvas :is-admin=isAdmin />
|
<LeanCanvas :is_admin=is_admin />
|
||||||
|
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<p>
|
<p>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
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 /*, defineProps*/} from "vue";
|
import { ref, onMounted, defineProps} from "vue";
|
||||||
import { axiosInstance } from "@/services/api.ts";
|
import { axiosInstance } from "@/services/api.ts";
|
||||||
|
|
||||||
const IS_MOCK_MODE = true;
|
const IS_MOCK_MODE = true;
|
||||||
@ -41,7 +41,7 @@ const props = defineProps<{
|
|||||||
is_admin = token.includes("MyINPulse-admin")
|
is_admin = token.includes("MyINPulse-admin")
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const isAdmin = 0
|
const is_admin = 0
|
||||||
|
|
||||||
// Variables pour les informations de l'administrateur
|
// Variables pour les informations de l'administrateur
|
||||||
const admin = ref({
|
const admin = ref({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user