14 Commits

Author SHA1 Message Date
f99ed470f8 added comment 2024-04-09 17:58:02 +02:00
9a83d14aea added article Popup 2024-04-09 17:32:04 +02:00
0cbe0dd82b filter popup mock done 2024-04-09 00:57:06 +02:00
3167d1f2fc added the Filters button and popup 2024-04-08 22:56:44 +02:00
a94167c8a0 scrollable + better search 2024-04-08 11:02:59 +02:00
d31547c4cc added levenshtein distance to search input 2024-04-07 15:51:53 +02:00
ec2b975467 Merge pull request 'proposition of some fixes' (#1) from PGL/Clyde:tonitch/max/front/fix/vue into master
Reviewed-on: Maxime/Clyde#1
2024-04-07 14:59:12 +02:00
05359d64ac Merge remote-tracking branch 'origin/master' 2024-04-05 09:06:01 +02:00
9e0db361b8 Merge pull request 'Make app use full space' (#148) from tonitch/front/fullSpaceApp into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m26s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 2m5s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #148
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-24 22:32:46 +01:00
7a13d412f1 Full screen apps
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m48s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-23 23:56:24 +01:00
9de4b06e75 Login 'fixed'
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m53s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-23 13:57:46 +01:00
123fa97611 Merge branch 'wal/front/temp' into tonitch/front/fullSpaceApp 2024-03-22 20:15:45 +01:00
1fad792be7 Just to merge 2024-03-22 20:14:20 +01:00
acd1262955 Make app use full space
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m50s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-22 13:56:04 +01:00
5 changed files with 383 additions and 66 deletions

View File

@ -9,6 +9,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@canvasjs/vue-charts": "^1.0.4", "@canvasjs/vue-charts": "^1.0.4",
"@vueuse/core": "^10.9.0",
"vite-plugin-top-level-await": "^1.4.1", "vite-plugin-top-level-await": "^1.4.1",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue3-toastify": "^0.2.1" "vue3-toastify": "^0.2.1"
@ -768,6 +769,11 @@
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
}, },
"node_modules/@types/web-bluetooth": {
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
"integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow=="
},
"node_modules/@vitejs/plugin-vue": { "node_modules/@vitejs/plugin-vue": {
"version": "5.0.4", "version": "5.0.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.0.4.tgz", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.0.4.tgz",
@ -881,6 +887,89 @@
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz",
"integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==" "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw=="
}, },
"node_modules/@vueuse/core": {
"version": "10.9.0",
"resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.9.0.tgz",
"integrity": "sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==",
"dependencies": {
"@types/web-bluetooth": "^0.0.20",
"@vueuse/metadata": "10.9.0",
"@vueuse/shared": "10.9.0",
"vue-demi": ">=0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/core/node_modules/vue-demi": {
"version": "0.14.7",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
"integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/@vueuse/metadata": {
"version": "10.9.0",
"resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.9.0.tgz",
"integrity": "sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==",
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/shared": {
"version": "10.9.0",
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.9.0.tgz",
"integrity": "sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==",
"dependencies": {
"vue-demi": ">=0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/shared/node_modules/vue-demi": {
"version": "0.14.7",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
"integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/agent-base": { "node_modules/agent-base": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",

View File

@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"@canvasjs/vue-charts": "^1.0.4", "@canvasjs/vue-charts": "^1.0.4",
"@vueuse/core": "^10.9.0",
"vite-plugin-top-level-await": "^1.4.1", "vite-plugin-top-level-await": "^1.4.1",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue3-toastify": "^0.2.1" "vue3-toastify": "^0.2.1"

View File

@ -0,0 +1,76 @@
<!----------------------------------------------------
File: ArticleComponent.vue
Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess
Description: Pop Up summarizing an article
----------------------------------------------------->
<script setup>
import { defineProps, defineEmits, ref } from "vue";
import {onClickOutside} from '@vueuse/core'
let checked = ref([])
const props = defineProps({
isOpen: Boolean,
});
const example = ["Title","Author",["Co-author1", "co-Authors2"],
" Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas condimentum ex tempor leo pulvinar, vitae imperdiet leo pellentesque. Aenean aliquam, ante at tempus sagittis, lorem leo feugiat felis, eget vestibulum tortor est nec libero. Cras sit amet venenatis velit, at rhoncus est. Cras id sem placerat, cursus sem et, aliquam felis. Nullam mi nunc, laoreet eget rutrum ac, blandit nec lorem. Duis fermentum aliquet tortor ac tristique. Aenean ac sagittis nulla, at auctor dolor. Vivamus et neque sodales, vestibulum dolor et, posuere urna. Pellentesque ut elit metus. Cras velit lectus, luctus auctor interdum eu, aliquam nec est. Donec elementum nisl sit amet nibh aliquam ultricies. Nullam felis orci, suscipit eu tincidunt pretium, euismod vel sem. Duis eget vehicula neque, nec gravida leo. Cras pellentesque arcu quis justo lobortis, ut semper massa rhoncus. Quisque sagittis dignissim congue. Nullam tortor ligula, mattis vel cursus id, pretium non lacus.",
"language",
"access",
]
const emit = defineEmits(["modal-close"]);
const target = ref(null)
onClickOutside(target, ()=>emit('modal-close'))
</script>
<template>
<div v-if="isOpen" class="modal-mask">
<div class="modal-wrapper">
<div class="modal-container" ref="target">
<ul v-for="n in example"><li>{{n}}</li></ul>
<div id="downloads">
<button @click.stop="emit('modal-close')">Download BibTex</button>
<button @click.stop="emit('modal-close')">Download Article</button>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.modal-mask {
position: fixed;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-container {
width: 70%;
margin: 150px auto;
padding: 20px 30px;
background: rgba(157, 99, 205);
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
}
#downloads {
text-align: end;
}
#downloads button {
align-self: center;
margin-left: 2px;
font-size: large;
color: white;
background: rgba(191, 64, 191,0.5);
border:2px solid black;
border-radius: 5px;
}
</style>

View File

@ -0,0 +1,92 @@
<!----------------------------------------------------
File: ArticleComponent.vue
Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess
Description: Pop Up for selecting search Filters
----------------------------------------------------->
<script setup>
import { defineProps, defineEmits, ref } from "vue";
import {onClickOutside} from '@vueuse/core'
let checked = ref([])
const props = defineProps({
isOpen: Boolean,
});
const example = ["A","B", "Lorem Ipsum AAAAAAAAAAAAAAAAAAA",
"H",
"H",
"H",
"H",
"H",
]
const emit = defineEmits(["modal-close"]);
const target = ref(null)
onClickOutside(target, ()=>emit('modal-close'))
</script>
<template>
<div v-if="isOpen" class="modal-mask">
<div class="modal-wrapper">
<div class="modal-container" ref="target">
<div id="filterGrid">
<div> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
<div class="vl"> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
<div class="vl"> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
<div> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
<div class="vl"> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
<div class="vl"> example :<ul class="checkers"> <li v-for="n in example"> <input type="checkbox" :value=n v-model="checked"> {{n}} </li> </ul> </div>
</div>
<div id="submit">
<button @click.stop="emit('modal-close')">Submit</button>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.modal-mask {
position: fixed;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-container {
width: 70%;
margin: 150px auto;
padding: 20px 30px;
background: rgba(157, 99, 205);
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
}
#filterGrid {
display: grid;
grid-template-columns: auto auto auto;
column-gap: 5px;
grid-template-rows: auto auto;
}
#filterGrid ul {
list-style-type: none;
padding: 15px;
height: 100px;
overflow: scroll;
scrollbar-color: #8a2be2 rgb(255,255,255,0.04);
background-color: rgba(255, 255, 255, 0.09);
border-radius: 6px;
}
.vl {
border-left: 6px solid #8a2be2;
}
#submit {
text-align: end;
}
</style>

View File

@ -7,11 +7,50 @@
<script setup> <script setup>
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
import ArticleComponent from "@/Apps/ScientificPublications/ArticleComponent.vue";
const input = ref(""); const input = ref("");
const statsOf = ref(""); const statsOf = ref("");
const statsBy = ref(""); const statsBy = ref("");
const isFilterOpened = ref(false);
const isArticleOpened = ref(false);
let chart; let chart;
const openModal = () => {
isFilterOpened.value = true;
};
const closeModal = () => {
isFilterOpened.value = false;
};
const submitFilters = ()=>{
// call only with those filters the get
}
const openArticle = (article) => {
isArticleOpened.value = true;
}
const closeArticle = () => {
isArticleOpened.value =false;
}
const downloadBibTex = (article) => {
//todo
}
const downloadArticle = (article) => {
//todo
}
const articleList = [
["The Great Potato War Lorem Ipsum aeaDq Terelumni ","Author",["Co-author1", "co-Authors2"],
" Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas condimentum ex tempor leo pulvinar, vitae imperdiet leo pellentesque. Aenean aliquam, ante at tempus sagittis, lorem leo feugiat felis, eget vestibulum tortor est nec libero. Cras sit amet venenatis velit, at rhoncus est. Cras id sem placerat, cursus sem et, aliquam felis. Nullam mi nunc, laoreet eget rutrum ac, blandit nec lorem. Duis fermentum aliquet tortor ac tristique. Aenean ac sagittis nulla, at auctor dolor. Vivamus et neque sodales, vestibulum dolor et, posuere urna. Pellentesque ut elit metus. Cras velit lectus, luctus auctor interdum eu, aliquam nec est. Donec elementum nisl sit amet nibh aliquam ultricies. Nullam felis orci, suscipit eu tincidunt pretium, euismod vel sem. Duis eget vehicula neque, nec gravida leo. Cras pellentesque arcu quis justo lobortis, ut semper massa rhoncus. Quisque sagittis dignissim congue. Nullam tortor ligula, mattis vel cursus id, pretium non lacus.",
"language",
"access",
]
]
const jsonMockViewsByYears= [ const jsonMockViewsByYears= [
{label: "2004", y:4}, {label: "2004", y:4},
{label: "2005", y:99}, {label: "2005", y:99},
@ -20,24 +59,38 @@ const jsonMockViewsByYears= [
{label: "2011", y:1666}, {label: "2011", y:1666},
] ]
function inputKeyUp() { function searchInList(list, searchInput){
let filter, ul, li, a, txtValue; let retList= []
filter = input.value.toUpperCase(); if (searchInput === "")
if (document.getElementById("myUL") != null) { return [list[0].slice(0,2)]
ul = document.getElementById("myUL"); for (let i = 0; i < list.length; i++) {
li = ul.getElementsByTagName("li"); console.log(list[i])
if (lDistance(list[i][0], searchInput) < 10 || list[i][0].toUpperCase().indexOf(searchInput.toUpperCase()) > -1){
retList.push(list[i].slice(0,2))
}
console.log(list[i][0].toUpperCase().indexOf(searchInput.toUpperCase()))
}
return retList
}
// Loop through all list items, and hide those who don't match the search query function lDistance(s,t){
for (let i = 0; i < li.length; i++) { if (!s.length) return t.length;
a = li[i].getElementsByTagName("a")[0]; if (!t.length) return s.length;
txtValue = a.textContent || a.innerText; const arr = [];
if (txtValue.toUpperCase().indexOf(filter) > -1) { for (let i = 0; i <= t.length; i++) {
li[i].style.display = ""; arr[i] = [i];
} else { for (let j = 1; j <= s.length; j++) {
li[i].style.display = "none"; arr[i][j] =
} i === 0
? j
: Math.min(
arr[i - 1][j] + 1,
arr[i][j - 1] + 1,
arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)
);
} }
} }
return arr[t.length][s.length];
} }
const options = reactive({ const options = reactive({
@ -75,6 +128,9 @@ function update(){
<template> <template>
<div id="main"> <div id="main">
<FilterComponent :isOpen="isFilterOpened" @modal-close="closeModal" @submit="submitFilters">
</FilterComponent>
<ArticleComponent :isOpen="isArticleOpened" @modal-close="closeArticle"></ArticleComponent>
<div id="profilePicture"> <div id="profilePicture">
<img src="/Clyde.png" /> <img src="/Clyde.png" />
</div> </div>
@ -113,23 +169,15 @@ function update(){
</div> </div>
</div> </div>
<div id="articles"> <div id="articles">
<input <div id="search">
type="text" <input type="text" id="search-input" placeholder="search articles" v-model="input"/>
id="search-input" <button id="filterButton" @click="openModal"> Filters </button>
@keyup="inputKeyUp()" </div>
placeholder="search articles" <ul id="articlesUL">
v-model="input" <li id="articleLi" v-for="n in searchInList(articleList,input)">
/> <div class="vl"> {{n[0]}}</div>
<ul id="myUL"> <div class="vl"> {{n[1]}}</div>
<li><a href="#">Adele</a></li> <a @click="openArticle"> MoreInfo </a></li>
<li><a href="#">Agnes</a></li>
<li><a href="#">Billy</a></li>
<li><a href="#">Bob</a></li>
<li><a href="#">Calvin</a></li>
<li><a href="#">Christina</a></li>
<li><a href="#">Cindy</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -180,57 +228,68 @@ function update(){
color: white; color: white;
background-color: rgb(255, 255, 255, 0.1); background-color: rgb(255, 255, 255, 0.1);
font-size: large; font-size: large;
align-self: center;
text-align: center;
} }
#statsPie { #statsPie {
} }
#articles { #search{
background-color: orange; width: 100%;
height: 10%;
display: inline-flex;
} }
#search-input { #search-input {
width: 60%; margin-left: 25px;
width: 75%;
font-size: 16px; font-size: 16px;
padding: 12px 20px 12px 40px; padding: 12px 20px 12px 40px;
border: 1px solid #ddd; border: 1px solid #ddd;
margin-bottom: 12px; height: 20px;
align-self: center;
} }
#myUL { #filterButton {
align-self: center;
margin-left: 2px;
font-size: xx-large;
color: white;
background: rgba(191, 64, 191,0.5);
border:2px solid black;
}
#filterButton:hover{
background: rgba(191, 64, 191);
}
#articlesUL {
list-style-type: none; list-style-type: none;
padding: 0; color: white;
margin: 0;
}
#myUL li a {
border: 1px solid #ddd;
/* Add a border to all links */
margin-top: -1px;
/* Prevent double borders */
background-color: #f6f6f6;
/* Grey background color */
padding: 12px; padding: 12px;
/* Add some padding */ margin: 5px;
text-decoration: none; height: 400px;
/* Remove default text underline */ overflow: scroll;
font-size: 18px; }
/* Increase the font-size */ #articleLi{
color: black; display: grid;
/* Add a black text color */ grid-template-columns: auto auto auto;
display: block; border: 2px solid black;
/* Make it into a block element to fill the whole list */ color: white;
font-size: x-large;
text-align: center;
text-indent: 7px;
background-color: rgba(255, 255, 255, 0.09);
border-radius: 18px;
margin-bottom: 15px;
}
a{
color:#007aff;
text-decoration: underline;
cursor: pointer;
} }
#myUL li a:hover:not(.header) { .vl {
background-color: #eee; border-right: 2px solid black;
} }
#Chart{
width: "100%";
height: "100%";
}
</style> </style>