2021-02-08 11:08:35 +00:00
|
|
|
<template>
|
|
|
|
<transition name="menu-slide">
|
|
|
|
<div
|
|
|
|
v-if="show"
|
|
|
|
v-on-clickaway="() => $emit('close')"
|
2021-03-20 07:38:56 +00:00
|
|
|
class="dropdown-pane dropdowm--top"
|
2021-02-08 11:08:35 +00:00
|
|
|
>
|
2021-03-20 07:38:56 +00:00
|
|
|
<woot-dropdown-menu>
|
|
|
|
<woot-dropdown-item v-if="showChangeAccountOption">
|
2021-05-20 08:21:46 +00:00
|
|
|
<woot-button
|
|
|
|
variant="clear"
|
|
|
|
size="small"
|
|
|
|
class=" change-accounts--button"
|
2021-02-08 11:08:35 +00:00
|
|
|
@click="$emit('toggle-accounts')"
|
|
|
|
>
|
|
|
|
{{ $t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS') }}
|
2021-05-20 08:21:46 +00:00
|
|
|
</woot-button>
|
2021-03-20 07:38:56 +00:00
|
|
|
</woot-dropdown-item>
|
|
|
|
<woot-dropdown-item v-if="globalConfig.chatwootInboxToken">
|
2021-05-20 08:21:46 +00:00
|
|
|
<woot-button
|
|
|
|
variant="clear"
|
|
|
|
size="small"
|
|
|
|
class=" change-accounts--button"
|
2021-02-08 11:08:35 +00:00
|
|
|
@click="$emit('show-support-chat-window')"
|
|
|
|
>
|
|
|
|
Contact Support
|
2021-05-20 08:21:46 +00:00
|
|
|
</woot-button>
|
2021-03-20 07:38:56 +00:00
|
|
|
</woot-dropdown-item>
|
2021-08-10 04:23:40 +00:00
|
|
|
<woot-dropdown-item>
|
|
|
|
<woot-button
|
|
|
|
variant="clear"
|
|
|
|
size="small"
|
|
|
|
class=" change-accounts--button"
|
|
|
|
@click="$emit('key-shortcut-modal')"
|
|
|
|
>
|
|
|
|
{{ $t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS') }}
|
|
|
|
</woot-button>
|
|
|
|
</woot-dropdown-item>
|
2021-03-20 07:38:56 +00:00
|
|
|
<woot-dropdown-item>
|
2021-05-20 08:21:46 +00:00
|
|
|
<router-link
|
|
|
|
:to="`/app/accounts/${accountId}/profile/settings`"
|
|
|
|
class="button clear small change-accounts--button"
|
|
|
|
>
|
2021-02-08 11:08:35 +00:00
|
|
|
{{ $t('SIDEBAR_ITEMS.PROFILE_SETTINGS') }}
|
|
|
|
</router-link>
|
2021-03-20 07:38:56 +00:00
|
|
|
</woot-dropdown-item>
|
|
|
|
<woot-dropdown-item>
|
2021-05-20 08:21:46 +00:00
|
|
|
<woot-button
|
|
|
|
variant="clear"
|
|
|
|
size="small"
|
|
|
|
class=" change-accounts--button"
|
|
|
|
@click="logout"
|
|
|
|
>
|
2021-02-08 11:08:35 +00:00
|
|
|
{{ $t('SIDEBAR_ITEMS.LOGOUT') }}
|
2021-05-20 08:21:46 +00:00
|
|
|
</woot-button>
|
2021-03-20 07:38:56 +00:00
|
|
|
</woot-dropdown-item>
|
|
|
|
</woot-dropdown-menu>
|
2021-02-08 11:08:35 +00:00
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mixin as clickaway } from 'vue-clickaway';
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import Auth from '../../../api/auth';
|
2021-03-20 07:38:56 +00:00
|
|
|
import WootDropdownItem from 'shared/components/ui/dropdown/DropdownItem.vue';
|
|
|
|
import WootDropdownMenu from 'shared/components/ui/dropdown/DropdownMenu.vue';
|
2021-02-08 11:08:35 +00:00
|
|
|
|
|
|
|
export default {
|
2021-03-20 07:38:56 +00:00
|
|
|
components: {
|
|
|
|
WootDropdownMenu,
|
|
|
|
WootDropdownItem,
|
|
|
|
},
|
2021-02-08 11:08:35 +00:00
|
|
|
mixins: [clickaway],
|
|
|
|
props: {
|
|
|
|
show: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
currentUser: 'getCurrentUser',
|
|
|
|
globalConfig: 'globalConfig/get',
|
|
|
|
accountId: 'getCurrentAccountId',
|
|
|
|
}),
|
|
|
|
showChangeAccountOption() {
|
|
|
|
if (this.globalConfig.createNewAccountFromDashboard) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return this.currentUser.accounts.length > 1;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
logout() {
|
|
|
|
Auth.logout();
|
|
|
|
|
|
|
|
if (this.globalConfig.chatwootInboxToken) {
|
|
|
|
window.$chatwoot.reset();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2021-04-08 14:12:38 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.dropdown-pane {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
</style>
|