Added a demo mode to show or hide instance warnings that data is deleted

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-11-21 16:07:43 +01:00
parent 119cb5f71d
commit a53100ef6e
11 changed files with 21 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div id="mobilizon">
<NavBar />
<div class="container">
<div class="container" v-if="config && config.demoMode">
<b-message type="is-danger" :title="$t('Warning').toLocaleUpperCase()" closable aria-close-label="Close">
<p>{{ $t('This is a demonstration site to test the beta version of Mobilizon.') }}</p>
<p v-html="$t('<b>Please do not use it in any real way</b>: everything you create here (accounts, events, identities, etc.) will be automatically deleted every 48 hours.')" />
@@ -35,11 +35,14 @@ import { CURRENT_USER_CLIENT, UPDATE_CURRENT_USER_CLIENT } from '@/graphql/user'
import Footer from '@/components/Footer.vue';
import Logo from '@/components/Logo.vue';
import { initializeCurrentActor } from '@/utils/auth';
import { CONFIG } from '@/graphql/config';
import { IConfig } from '@/types/config.model';
@Component({
apollo: {
currentUser: {
query: CURRENT_USER_CLIENT,
},
config: CONFIG,
},
components: {
Logo,
@@ -48,6 +51,8 @@ import { initializeCurrentActor } from '@/utils/auth';
},
})
export default class App extends Vue {
config!: IConfig;
async created() {
if (await this.initializeCurrentUser()) {
await initializeCurrentActor(this.$apollo.provider.defaultClient);