Fix unwanted footer content in management mode

This commit is contained in:
Bubka 2023-11-10 16:49:39 +01:00
parent 2ad5105378
commit 53e3698076
2 changed files with 17 additions and 13 deletions

View File

@ -1,24 +1,19 @@
<script setup>
import { useAppSettingsStore } from '@/stores/appSettings'
import { useUserStore } from '@/stores/user'
import { useBusStore } from '@/stores/bus'
const appSettings = useAppSettingsStore()
const user = useUserStore()
const bus = useBusStore()
const $2fauth = inject('2fauth')
const props = defineProps({
showButtons: true
showButtons: true,
internalFooterType: {
type: String,
default: 'navLinks'
}
})
const emit = defineEmits(['management-mode-exited'])
function exitManagementMode() {
bus.inManagementMode = false
emit('management-mode-exited')
}
function logout() {
if(confirm(trans('auth.confirm.logout'))) {
user.logout()
@ -35,8 +30,8 @@
</div>
</div>
</div>
<div v-if="bus.inManagementMode" class="content has-text-centered">
<button id="lnkExitEdit" class="button is-ghost is-like-text" @click="exitManagementMode">{{ $t('commons.done') }}</button>
<div v-if="internalFooterType == 'doneButton'" class="content has-text-centered">
<button id="lnkExitEdit" class="button is-ghost is-like-text" @click.stop="$emit('doneButtonClicked', true)">{{ $t('commons.done') }}</button>
</div>
<div v-else class="content has-text-centered">
<div v-if="$route.meta.showAbout === true" class="is-size-6">

View File

@ -217,6 +217,15 @@
}
}
/**
* Exits from the Management mode
*/
function exitManagementMode()
{
bus.inManagementMode = false
twofaccounts.selectNone()
}
</script>
<template>
@ -344,7 +353,7 @@
</div>
</span>
</div>
<VueFooter :showButtons="true" v-on:management-mode-exited="twofaccounts.selectNone()">
<VueFooter :showButtons="true" :internalFooterType="bus.inManagementMode && !showDestinationGroupSelector ? 'doneButton' : 'navLinks'" @done-button-clicked="exitManagementMode">
<ActionButtons
v-model:inManagementMode="bus.inManagementMode"
:areDisabled="twofaccounts.hasNoneSelected"