Skip to content

Commit 3a9b7a7

Browse files
Added index component
1 parent 983f849 commit 3a9b7a7

9 files changed

Lines changed: 379 additions & 31 deletions

File tree

others/vuejs-frontend/src/App.vue

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
<template>
2-
<metainfo></metainfo>
3-
<div v-if="isStyleLoaded" id="app" class="app">
4-
<CustomHeader/>
5-
<main>
6-
<nav class="navigation-drawer" v-show="isDrawerOpen" :style="{background: `linear-gradient(${themeValues.primaryColor} 65%, ${themeValues.secondaryColor})`}">
7-
<MenuSearchBar v-model="searchQuery" class="search-bar" />
8-
<TreeViewNode v-for="(motherCategory, index) in filteredTree" :key="index" :node="motherCategory" :depth="0" :searchQuery="searchQuery"/>
9-
</nav>
10-
<div class="page-content">
11-
<router-view v-if="!isFetching" class="page-content__router-view" :key="$route.fullPath"/>
12-
<Spinner v-else/>
13-
</div>
14-
</main>
15-
<LightBox/>
2+
<div class="root-container">
3+
<metainfo></metainfo>
4+
<div v-if="isStyleLoaded" id="app" class="app">
5+
<CustomHeader/>
6+
<main>
7+
<nav class="navigation-drawer" v-show="isDrawerOpen" :style="{background: `linear-gradient(${themeValues.primaryColor} 65%, ${themeValues.secondaryColor})`}">
8+
<MenuSearchBar v-model="searchQuery" class="search-bar" />
9+
<TreeViewNode v-for="(motherCategory, index) in filteredTree" :key="index" :node="motherCategory" :depth="0" :searchQuery="searchQuery"/>
10+
</nav>
11+
<div class="page-content">
12+
<router-view v-if="!isFetching" class="page-content__router-view" :key="$route.fullPath"/>
13+
<Spinner v-else/>
14+
<TableOfContents class="page-content_toc" v-if="!isFetching"/>
15+
<Spinner v-else/>
16+
</div>
17+
</main>
18+
<LightBox/>
19+
</div>
20+
<Spinner v-else/>
1621
</div>
17-
<Spinner v-else/>
1822
</template>
1923

2024
<script>
@@ -27,6 +31,7 @@
2731
import {useLessonStore} from '@/stores/lesson';
2832
import {useUiStore} from '@/stores/ui';
2933
import {useTreeStore} from '@/stores/tree';
34+
import TableOfContents from "./components/UI/TableOfContents.vue";
3035
3136
export default {
3237
name: 'App',
@@ -37,7 +42,7 @@
3742
treeStore: useTreeStore()
3843
}
3944
},
40-
components: {LightBox, CustomHeader, TreeViewNode, Spinner, MenuSearchBar},
45+
components: {LightBox, CustomHeader, TreeViewNode, Spinner, MenuSearchBar, TableOfContents},
4146
data: () => ({
4247
isFetching: true,
4348
isStyleLoaded: false,
@@ -175,12 +180,13 @@ button
175180
padding: 8px
176181
177182
.page-content
183+
display: flex
178184
width: 100%
179185
180186
&__router-view
181-
width: 100%
187+
width: 80%
182188
height: 100%
183-
189+
184190
.drawer-enter-active
185191
animation: drawerIn $duration-drawer-collapse
186192
@@ -198,5 +204,7 @@ button
198204
width: $drawer-width
199205
to
200206
width: 0
201-
207+
208+
.root-container
209+
height: 100%
202210
</style>

others/vuejs-frontend/src/components/Pages/AdvancedSearch.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export default {
9292
result.searchTerm = this.query;
9393
return result;
9494
});
95-
console.log(res.results);
9695
this.searchInfo = new ResultInfo(res.search_info);
9796
this.page += this.searchInfo?.pageIncrement;
9897
}catch(err){
@@ -157,7 +156,6 @@ export default {
157156
158157
class ResultInfo {
159158
constructor(info) {
160-
console.log(info);
161159
this.totalHits = info.total_hits;
162160
this.searchDuration = info.search_duration;
163161
this.searchType = info.search_type;

others/vuejs-frontend/src/components/Pages/Lesson.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,10 @@ export default {
343343
}
344344
},
345345
async created() {
346-
console.log("created");
347346
const searchQuery = this.$route.query.search; // Accéder au paramètre de requête
348347
if(searchQuery){
349348
this.search = this.escapeHtml(searchQuery);
350349
}
351-
console.log(this.search);
352350
hljs.configure({
353351
cssSelector: "code"
354352
});
@@ -615,7 +613,7 @@ export default {
615613
.linear
616614
.lesson-wrapper
617615
//@include fillParent()
618-
padding-right: 20%
616+
padding-right: 25px
619617
padding-left: 25px
620618
.lesson-block
621619
grid-column: 1/3

others/vuejs-frontend/src/components/Pages/SandBox/Demand.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
}),
7878
methods: {
7979
sendDemand: function () {
80-
console.log("COUNTER ===" + this.clickCounter);
8180
if (this.clickCounter === 0) {
8281
let email = document.getElementById("email");
8382
if (email.value !== "" && email.value !== undefined && email.value !== null) {
@@ -113,10 +112,8 @@
113112
let req = new XMLHttpRequest();
114113
req.open("POST", "https://portalpr.dev.simplicite.io/ext/PorIsdService", true);
115114
req.setRequestHeader("Content-type", "application/json");
116-
req.addEventListener("load", (result) => {
117-
console.log(result)
115+
req.addEventListener("load", () => {
118116
if (req.status >= 200 && req.status < 400) {
119-
console.log(req)
120117
this.showSpinner = false;
121118
btn.classList.add("server-ok");
122119
btn.innerText = "Un email vous a été envoyé !"

others/vuejs-frontend/src/components/Pages/SandBox/Deployment.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
let req = new XMLHttpRequest();
4444
req.open("GET", baseURL + demandId, true);
4545
req.send(null);
46-
console.log(req.responseText);
4746
}
4847
}
4948

others/vuejs-frontend/src/components/UI/MenuSearchBar.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
</span>
77
</div>
88
<input v-model="search" type="text" class="searchbar"/>
9+
<button v-if="search" @click="clearSearch" class="clear-button">
10+
<span class="material-icons">close</span>
11+
</button>
912
</div>
1013
</template>
1114

@@ -21,6 +24,11 @@ export default {
2124
this.$emit('update:modelValue', value); // Emits the updated value
2225
}
2326
}
27+
},
28+
methods: {
29+
clearSearch() {
30+
this.search = '';
31+
}
2432
}
2533
}
2634
</script>
@@ -63,4 +71,21 @@ export default {
6371
.searchbar:focus
6472
outline: none
6573
transition: border-color 0.3s ease
74+
75+
.clear-button
76+
position: absolute
77+
right: 10px
78+
background: none
79+
border: none
80+
cursor: pointer
81+
display: flex
82+
align-items: center
83+
justify-content: center
84+
height: 100%
85+
.material-icons
86+
font-size: 1.2rem
87+
color: #888
88+
89+
&:hover .material-icons
90+
color: #555
6691
</style>

others/vuejs-frontend/src/components/UI/SearchBar.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ export default {
113113
114114
watch(() => uiStore.contentLoaded, function(newValue) {
115115
if (newValue) {
116-
console.log("new load");
117116
this.setFocus();
118117
uiStore.resetContentLoaded();
119118
}

others/vuejs-frontend/src/components/UI/SuggestionItem/AdvancedSuggestionItem.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default {
2929
methods: {
3030
onClick(event) {
3131
if(event.type === "click") {
32-
console.log(this.suggestion.searchTerm);
3332
if (this.suggestion.type === "lesson") {
3433
event.preventDefault();
3534
this.$router.push('/lesson' + this.suggestion.path +"?search="+this.suggestion.searchTerm).catch(err => console.error(err));

0 commit comments

Comments
 (0)