Skip to content

Commit

Permalink
feat: setup maintenance bandeau
Browse files Browse the repository at this point in the history
  • Loading branch information
batleforc committed Jan 27, 2025
1 parent 0665122 commit c70d7cb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
18 changes: 18 additions & 0 deletions apps/front/src/component/helper/WarnBan.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script setup lang="ts">
defineProps({
className: {
type: String,
default: '',
},
text: {
type: String,
default: '',
},
});
</script>

<template>
<h1 class="font-bold p-4 text-white bg-red-600 text-center" :class="className">
🚧🚧 WARNING : {{ text }} 🚧🚧
</h1>
</template>
2 changes: 2 additions & 0 deletions apps/front/src/stores/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export interface PageState {
pageV2?: PageV2;
pagePath: string;
v2Switch: boolean;
maintenance: boolean;
}

export const usePageStore = defineStore('page', {
state: (): PageState => ({
pageLoading: false,
pagePath: '',
v2Switch: true,
maintenance: false,
}),
actions: {
fetchPage(path: string) {
Expand Down
4 changes: 4 additions & 0 deletions apps/front/src/views/BlogHomeView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup lang="ts">
import WarnBan from '../component/helper/WarnBan.vue';
import PageMetadata from '../component/Page/PageMetadata.vue';
import { useBlogStore } from '../stores/blog';
import { useDocStore } from '../stores/doc';
import { usePageStore } from '../stores/page';
const docStore = useDocStore();
const blogStore = useBlogStore();
const pageStore = usePageStore();
if (!docStore.inited && !docStore.docLoading) {
docStore.init();
Expand All @@ -19,6 +22,7 @@ if (!blogStore.inited && !blogStore.blogLoading) {

<template>
<div id="title">
<WarnBan v-if="pageStore.maintenance" text="Maintenance en cours" />
<div class="flex flex-row justify-center"
v-if="blogStore.inited && !blogStore.blogLoading && blogStore.getBlogContent !== undefined">
<ul class="flex flex-col w-full">
Expand Down
2 changes: 2 additions & 0 deletions apps/front/src/views/BlogView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { usePageStore } from '../stores/page';
import { computed, watch } from 'vue';
import PageRender from '../component/Page/PageRender.vue';
import PageV2Render from '../component/PageV2/PageV2Render.vue';
import WarnBan from '../component/helper/WarnBan.vue';
const route = useRoute();
const docStore = useDocStore();
Expand Down Expand Up @@ -42,6 +43,7 @@ watch(pathReactive, (newVal) => {
<template>
<div id="title" class="docContainer" v-if="docStore.inited && blogStore.inited">
<div class="docContent">
<WarnBan v-if="pageStore.maintenance" text="Maintenance en cours" />
<div class="docRealContent" v-if="pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/front/src/views/DocHomeView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import DocSidebar from '../component/Doc/DocSidebar.vue';
import Footer from '../component/helper/Footer.vue';
import WarnBan from '../component/helper/WarnBan.vue';
import PageRender from '../component/Page/PageRender.vue';
import PageV2Render from '../component/PageV2/PageV2Render.vue';
import { useDocStore } from '../stores/doc';
Expand All @@ -24,6 +25,7 @@ if (docStore.inited && docStore.docContent.has_index && pageStore.pageLoading ==
<div id="title" class="docContainer" v-if="docStore.inited">
<DocSidebar />
<div class="docContent">
<WarnBan v-if="pageStore.maintenance" text="Maintenance en cours" />
<div class="docRealContent" v-if="docStore.docContent.has_index && pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/front/src/views/DocView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { usePageStore } from '../stores/page';
import PageRender from '../component/Page/PageRender.vue';
import PageV2Render from '../component/PageV2/PageV2Render.vue';
import Footer from '../component/helper/Footer.vue';
import WarnBan from '../component/helper/WarnBan.vue';
const route = useRoute();
Expand Down Expand Up @@ -38,8 +39,7 @@ watch(pathReactive, (newVal) => {

<DocSidebar />
<div class="docContent">
<h1 class="font-bold p-4 text-white bg-red-600 text-center"> 🚧🚧 WARNING : The Doc page is under construction
🚧🚧</h1>
<WarnBan v-if="pageStore.maintenance" text="Maintenance en cours" />
<div class="docRealContent" v-if="pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
Expand Down

0 comments on commit c70d7cb

Please sign in to comment.