Show legal links from api if configured
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-07-18 21:39:30 +02:00
parent 8ab9824f96
commit 0be280aae3
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
9 changed files with 56 additions and 0 deletions

View File

@ -60,6 +60,8 @@
<router-link :to="{name: 'user.settings'}" class="dropdown-item"> <router-link :to="{name: 'user.settings'}" class="dropdown-item">
Settings Settings
</router-link> </router-link>
<a :href="imprintUrl" v-if="imprintUrl" class="dropdown-item" target="_blank">Imprint</a>
<a :href="privacyPolicyUrl" v-if="privacyPolicyUrl" class="dropdown-item" target="_blank">Privacy policy</a>
<a @click="logout()" class="dropdown-item"> <a @click="logout()" class="dropdown-item">
Logout Logout
</a> </a>
@ -404,6 +406,8 @@
}, },
currentList: CURRENT_LIST, currentList: CURRENT_LIST,
background: 'background', background: 'background',
imprintUrl: state => state.config.legal.imprintUrl,
privacyPolicyUrl: state => state.config.legal.privacyPolicyUrl,
}), }),
methods: { methods: {
logout() { logout() {

View File

@ -0,0 +1,19 @@
<template>
<div class="legal-links">
<a :href="imprintUrl" v-if="imprintUrl" target="_blank">Imprint</a>
<span v-if="imprintUrl && privacyPolicyUrl"> | </span>
<a :href="privacyPolicyUrl" v-if="privacyPolicyUrl" target="_blank">Privacy policy</a>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'legal',
computed: mapState({
imprintUrl: state => state.config.legal.imprintUrl,
privacyPolicyUrl: state => state.config.legal.privacyPolicyUrl,
})
}
</script>

View File

@ -15,6 +15,10 @@ export default {
taskAttachmentsEnabled: true, taskAttachmentsEnabled: true,
totpEnabled: true, totpEnabled: true,
enabledBackgroundProviders: [], enabledBackgroundProviders: [],
legal: {
imprintUrl: '',
privacyPolicyUrl: '',
}
}), }),
mutations: { mutations: {
[CONFIG](state, config) { [CONFIG](state, config) {
@ -28,6 +32,8 @@ export default {
state.taskAttachmentsEnabled = config.task_attachments_enabled state.taskAttachmentsEnabled = config.task_attachments_enabled
state.totpEnabled = config.totp_enabled state.totpEnabled = config.totp_enabled
state.enabledBackgroundProviders = config.enabled_background_providers state.enabledBackgroundProviders = config.enabled_background_providers
state.legal.imprintUrl = config.legal.imprint_url
state.legal.privacyPolicyUrl = config.legal.privacy_policy_url
}, },
}, },
actions: { actions: {

View File

@ -19,3 +19,4 @@
@import 'list-backgrounds'; @import 'list-backgrounds';
@import 'color-picker'; @import 'color-picker';
@import 'namespaces'; @import 'namespaces';
@import 'legal';

View File

@ -0,0 +1,6 @@
.legal-links {
margin-top: 1rem;
text-align: right;
color: $grey-light;
font-size: 1rem;
}

View File

@ -66,6 +66,7 @@
{{ errorMessage }} {{ errorMessage }}
</div> </div>
</form> </form>
<legal/>
</div> </div>
</div> </div>
</template> </template>
@ -77,8 +78,12 @@
import {HTTP} from '../../http-common' import {HTTP} from '../../http-common'
import message from '../../message' import message from '../../message'
import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types' import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types'
import legal from '../../components/misc/legal'
export default { export default {
components: {
legal,
},
data() { data() {
return { return {
confirmedEmailSuccess: false, confirmedEmailSuccess: false,

View File

@ -34,6 +34,7 @@
</div> </div>
<router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link> <router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link>
</div> </div>
<legal/>
</div> </div>
</div> </div>
</template> </template>
@ -41,8 +42,12 @@
<script> <script>
import PasswordResetModel from '../../models/passwordReset' import PasswordResetModel from '../../models/passwordReset'
import PasswordResetService from '../../services/passwordReset' import PasswordResetService from '../../services/passwordReset'
import Legal from '../../components/misc/legal'
export default { export default {
components: {
Legal,
},
data() { data() {
return { return {
passwordResetService: PasswordResetService, passwordResetService: PasswordResetService,

View File

@ -41,6 +41,7 @@
{{ errorMessage }} {{ errorMessage }}
</div> </div>
</form> </form>
<legal/>
</div> </div>
</div> </div>
</template> </template>
@ -49,8 +50,12 @@
import router from '../../router' import router from '../../router'
import {mapState} from 'vuex' import {mapState} from 'vuex'
import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types' import {ERROR_MESSAGE, LOADING} from '../../store/mutation-types'
import Legal from '../../components/misc/legal'
export default { export default {
components: {
Legal,
},
data() { data() {
return { return {
credentials: { credentials: {

View File

@ -26,6 +26,7 @@
</div> </div>
<router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link> <router-link :to="{ name: 'user.login' }" class="button is-primary">Login</router-link>
</div> </div>
<legal/>
</div> </div>
</div> </div>
</template> </template>
@ -33,8 +34,12 @@
<script> <script>
import PasswordResetModel from '../../models/passwordReset' import PasswordResetModel from '../../models/passwordReset'
import PasswordResetService from '../../services/passwordReset' import PasswordResetService from '../../services/passwordReset'
import Legal from '../../components/misc/legal'
export default { export default {
components: {
Legal,
},
data() { data() {
return { return {
passwordResetService: PasswordResetService, passwordResetService: PasswordResetService,