mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
Fetch user mailboxes using IMAP
This commit is contained in:
@@ -98,8 +98,17 @@
|
||||
/>
|
||||
<div class="mx-2 d-flex flex-column flex-grow-1">
|
||||
<template v-for="arg in getActionArguments(action.name)">
|
||||
<v-select
|
||||
v-if="arg.type === 'list'"
|
||||
v-model="action.args[arg.name]"
|
||||
:items="arg.choices"
|
||||
item-title="label"
|
||||
density="compact"
|
||||
variant="outlined"
|
||||
:rules="[rules.required]"
|
||||
/>
|
||||
<v-text-field
|
||||
v-if="arg.type === 'string' || arg.type === 'list'"
|
||||
v-if="arg.type === 'string'"
|
||||
v-model="action.args[arg.name]"
|
||||
density="compact"
|
||||
variant="outlined"
|
||||
|
||||
@@ -155,7 +155,7 @@ const displayName = computed(() => {
|
||||
|
||||
const menuItems = computed(() => {
|
||||
if (route.meta.layout === 'account') {
|
||||
return userSettingsMenuItems
|
||||
return getUserSettingsMenuItems()
|
||||
}
|
||||
return mainMenuItems
|
||||
})
|
||||
@@ -256,19 +256,6 @@ const mainMenuItems = [
|
||||
}
|
||||
]
|
||||
|
||||
const userSettingsMenuItems = [
|
||||
{
|
||||
text: $gettext('Filters'),
|
||||
to: { name: 'AccountFilters' },
|
||||
icon: 'mdi-filter'
|
||||
},
|
||||
{
|
||||
text: $gettext('Settings'),
|
||||
to: { name: 'AccountSettings' },
|
||||
icon: 'mdi-cog'
|
||||
}
|
||||
]
|
||||
|
||||
const userMenuItems = [
|
||||
{
|
||||
text: $gettext('Account'),
|
||||
@@ -291,6 +278,24 @@ if (authUser.value.role !== 'SimpleUsers') {
|
||||
})
|
||||
}
|
||||
|
||||
function getUserSettingsMenuItems() {
|
||||
const result = []
|
||||
|
||||
if (authUser.value.mailbox) {
|
||||
result.push({
|
||||
text: $gettext('Filters'),
|
||||
to: { name: 'AccountFilters' },
|
||||
icon: 'mdi-filter'
|
||||
})
|
||||
}
|
||||
result.push({
|
||||
text: $gettext('Settings'),
|
||||
to: { name: 'AccountSettings' },
|
||||
icon: 'mdi-cog'
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
function displayMenuItem(item) {
|
||||
if (isAuthenticated.value) {
|
||||
const condition =
|
||||
|
||||
@@ -263,6 +263,7 @@ const routes = [
|
||||
meta: {
|
||||
layout: 'account',
|
||||
requiresAuth: true,
|
||||
requiresMailbox: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -293,14 +294,18 @@ router.beforeEach((to, from, next) => {
|
||||
const authStore = useAuthStore()
|
||||
authStore.initialize().then(() => {
|
||||
authStore.validateAccess()
|
||||
/*
|
||||
if (to.meta.requiresMailbox && !authStore.authUser.mailbox) {
|
||||
next(false)
|
||||
} else {
|
||||
/*
|
||||
if (to.meta.allowedRoles !== undefined) {
|
||||
if (to.meta.allowedRoles.indexOf(authStore.authUser.role) === -1) {
|
||||
next({ name: 'Dashboard' })
|
||||
return
|
||||
}
|
||||
}*/
|
||||
next()
|
||||
next()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
|
||||
Reference in New Issue
Block a user