Tidying in TenantDropdown.vue
This commit is contained in:
@@ -14,8 +14,12 @@ const tenantInitials = computed(() => {
|
|||||||
.join('') || 'M'
|
.join('') || 'M'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const activeTenants = computed(() =>
|
||||||
|
auth.tenants.filter((tenant) => tenant.hasActiveLicense)
|
||||||
|
)
|
||||||
|
|
||||||
const tenantItems = computed(() => [
|
const tenantItems = computed(() => [
|
||||||
auth.tenants.map((tenant) => ({
|
activeTenants.value.map((tenant) => ({
|
||||||
label: tenant.name,
|
label: tenant.name,
|
||||||
icon: tenant.id === auth.activeTenant ? 'i-heroicons-check' : undefined,
|
icon: tenant.id === auth.activeTenant ? 'i-heroicons-check' : undefined,
|
||||||
disabled: Boolean(tenant.locked),
|
disabled: Boolean(tenant.locked),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const useAuthStore = defineStore("auth", {
|
|||||||
is_admin?: boolean;
|
is_admin?: boolean;
|
||||||
},
|
},
|
||||||
profile: null as null | any,
|
profile: null as null | any,
|
||||||
tenants: [] as { tenant_id: string; role: string; tenants: { id: string; name: string } }[],
|
tenants: [] as { tenant_id: string; role: string; tenants: { id: string; name: string }; id?: string; name?: string; hasActiveLicense?: boolean; locked?: string | null }[],
|
||||||
permissions: [] as string[],
|
permissions: [] as string[],
|
||||||
activeTenant: null as any,
|
activeTenant: null as any,
|
||||||
activeTenantData: null as any,
|
activeTenantData: null as any,
|
||||||
|
|||||||
Reference in New Issue
Block a user