link listResearchers to ResearcherProfile
This commit is contained in:
@ -3,6 +3,7 @@ import { ref} from "vue";
|
||||
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
|
||||
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
|
||||
import {getFile, fetchAllResearches, addView} from "@/rest/ScientificPublications/ManageResearch.js";
|
||||
import {fetchResearch} from "@/rest/ScientificPublications/ResearcherProfile.js";
|
||||
const input = ref("")
|
||||
const isFilterOpened = ref(false);
|
||||
const isResearchOpened = ref(false);
|
||||
@ -37,9 +38,10 @@ const downloadBibTex = (research) => {
|
||||
getFile(research.bibTexLocation)
|
||||
}
|
||||
|
||||
const downloadArticle = (research) => {
|
||||
addView(research.pdfLocation)
|
||||
getFile(research.pdfLocation)
|
||||
async function downloadArticle (research){
|
||||
await addView(research.pdfLocation)
|
||||
await getFile(research.pdfLocation)
|
||||
articleToDisplay.value = await fetchResearch(articleToDisplay.value.id)
|
||||
}
|
||||
|
||||
function downloadCoAuthors(){
|
||||
@ -97,12 +99,12 @@ function lDistance(s,t){
|
||||
<button id="filterButton" @click="openFilter"> Filters </button>
|
||||
<button v-if="!isResearcher" id="unToggledResearchButton" @click="isResearcher = !isResearcher"> Toggle Researcher Search</button>
|
||||
<button v-if="isResearcher" id="toggledResearchButton" @click="isResearcher = !isResearcher"> UnToggle Researcher Search</button>
|
||||
|
||||
</div>
|
||||
<ul id="researchUL">
|
||||
<li id="researchLi" v-for="n in searchInList(researchList,input)">
|
||||
<div class="vl"> {{n.title}}</div>
|
||||
<div class="vl"> {{ n.researcher.user.firstName +" "+ n.researcher.user.lastName }}</div>
|
||||
<div class="vl"> <a :href="'#/researcher-profile?id=' + n.researcher.id"> {{ n.researcher.user.firstName +" "+ n.researcher.user.lastName }}</a>
|
||||
</div>
|
||||
<a @click="openResearch(n)"> MoreInfo </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
import { ref, reactive } from "vue";
|
||||
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
|
||||
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
|
||||
import {fetchResearcher, fetchResearches, fetchStats} from "@/rest/ScientificPublications/ResearcherProfile.js";
|
||||
import {fetchResearcher, fetchResearches, fetchStats, fetchResearch} from "@/rest/ScientificPublications/ResearcherProfile.js";
|
||||
import {getFile, addView} from "@/rest/ScientificPublications/ManageResearch.js";
|
||||
const input = ref("");
|
||||
const statsOf = ref("");
|
||||
@ -20,16 +20,18 @@ const articleToDisplay = ref(Object)
|
||||
const filters = ref([]);
|
||||
let chart;
|
||||
|
||||
const researchList = ref(await fetchResearches(1));
|
||||
//todo changer dynamiquement le 1 ici en fct de sur quel profil on est
|
||||
const researcher = ref(await fetchResearcher(1));
|
||||
const stats = ref(await fetchStats(1))
|
||||
const researcherId = window.location.href.split("=")[1]
|
||||
|
||||
const props = defineProps({
|
||||
researcherId: ref(), //int
|
||||
filters: ref([""]),
|
||||
filters: ref([]),
|
||||
});
|
||||
|
||||
|
||||
|
||||
const researchList = ref(await fetchResearches(researcherId));
|
||||
const researcher = ref(await fetchResearcher(researcherId));
|
||||
const stats = ref(await fetchStats(researcherId))
|
||||
|
||||
const openFilter = () => {
|
||||
isFilterOpened.value = true;
|
||||
};
|
||||
@ -52,9 +54,12 @@ const downloadBibTex = (research) => {
|
||||
getFile(research.bibTexLocation)
|
||||
}
|
||||
|
||||
const downloadArticle = (research) => {
|
||||
addView(research.pdfLocation)
|
||||
getFile(research.pdfLocation)
|
||||
async function downloadArticle (research) {
|
||||
await addView(research.pdfLocation)
|
||||
await getFile(research.pdfLocation)
|
||||
articleToDisplay.value = await fetchResearch(articleToDisplay.value.id)
|
||||
stats.value = await fetchStats(researcher.value.id)
|
||||
update()
|
||||
}
|
||||
|
||||
function downloadCoAuthors(){
|
||||
|
Reference in New Issue
Block a user