moved getFile() and no download when managing
This commit is contained in:
		
							
								
								
									
										30
									
								
								frontend/src/Apps/ScientificPublications/ListResearches.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								frontend/src/Apps/ScientificPublications/ListResearches.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					<script setup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
 | 
				
			||||||
 | 
					import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					<div id="main">
 | 
				
			||||||
 | 
					  <FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters()"></FilterComponent>
 | 
				
			||||||
 | 
					  <ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="false" @modal-close="closeResearch" @downloadPdf="downloadArticle(articleToDisplay)" @downloadBibTex="downloadBibTex(articleToDisplay)"></ArticleComponent>
 | 
				
			||||||
 | 
					  <div id="researches">
 | 
				
			||||||
 | 
					    <div id="search">
 | 
				
			||||||
 | 
					      <input type="text" id="search-input" placeholder="search for researches" v-model="input"/>
 | 
				
			||||||
 | 
					      <button id="filterButton" @click="openFilter">  Filters </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>
 | 
				
			||||||
 | 
					        <a @click="openResearch(n)"> MoreInfo  </a></li>
 | 
				
			||||||
 | 
					    </ul>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@ -67,7 +67,7 @@ async function deleteThisArticle(){
 | 
				
			|||||||
          <li>Views : {{article.views}}</li>
 | 
					          <li>Views : {{article.views}}</li>
 | 
				
			||||||
          <li>Access : {{article.access}}</li>
 | 
					          <li>Access : {{article.access}}</li>
 | 
				
			||||||
        </ul>
 | 
					        </ul>
 | 
				
			||||||
          <div id="downloads" v-if="article.pdfLocation !== null">
 | 
					          <div id="downloads" v-if="article.pdfLocation !== null && !manage">
 | 
				
			||||||
            <button @click.stop="emit('downloadBibTex')">Download BibTex</button>
 | 
					            <button @click.stop="emit('downloadBibTex')">Download BibTex</button>
 | 
				
			||||||
            <button @click.stop="emit('downloadPdf')">Download Research</button>
 | 
					            <button @click.stop="emit('downloadPdf')">Download Research</button>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -9,7 +9,8 @@
 | 
				
			|||||||
import { ref, reactive } from "vue";
 | 
					import { ref, reactive } from "vue";
 | 
				
			||||||
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
 | 
					import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
 | 
				
			||||||
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
 | 
					import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
 | 
				
			||||||
import {fetchResearcher, fetchResearches, fetchStats, addView, getFile} from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
					import {fetchResearcher, fetchResearches, fetchStats, addView} from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
				
			||||||
 | 
					import {getFile} from "@/rest/ScientificPublications/ManageResearch.js";
 | 
				
			||||||
const input = ref("");
 | 
					const input = ref("");
 | 
				
			||||||
const statsOf = ref("");
 | 
					const statsOf = ref("");
 | 
				
			||||||
const statsBy = ref("");
 | 
					const statsBy = ref("");
 | 
				
			||||||
 | 
				
			|||||||
@ -22,3 +22,12 @@ export async function uploadBibTex(file){
 | 
				
			|||||||
export async function postResearch(data){
 | 
					export async function postResearch(data){
 | 
				
			||||||
    return restPost("/research", data)
 | 
					    return restPost("/research", data)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export async function fetchResearches(){
 | 
				
			||||||
 | 
					    return restGet("/researches")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export async function getFile(url){
 | 
				
			||||||
 | 
					    const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
 | 
				
			||||||
 | 
					    await fetch(restURL + "/"+url, {method: "GET"})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -14,8 +14,3 @@ export async function fetchStats(id){
 | 
				
			|||||||
export async function addView(url){
 | 
					export async function addView(url){
 | 
				
			||||||
    return restPost("/addview/" +url)
 | 
					    return restPost("/addview/" +url)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
export async function getFile(url){
 | 
					 | 
				
			||||||
    const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
 | 
					 | 
				
			||||||
    await fetch(restURL + "/"+url, {method: "GET"})
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user