feat: add Admin layout
This commit is contained in:
@@ -92,13 +92,31 @@ const savingError = ref('')
|
||||
const statusOptions = ref<{ label: string; value: TaskStatus }[]>([])
|
||||
const priorityOptions = ref<{ label: string; value: TaskPriority }[]>([])
|
||||
|
||||
const FALLBACK_STATUS: { label: string; value: TaskStatus }[] = [
|
||||
{ label: 'To Do', value: 'Todo' },
|
||||
{ label: 'In Progress', value: 'InProgress' },
|
||||
{ label: 'Done', value: 'Done' },
|
||||
{ label: 'Cancelled', value: 'Cancelled' },
|
||||
]
|
||||
|
||||
const FALLBACK_PRIORITY: { label: string; value: TaskPriority }[] = [
|
||||
{ label: 'Low', value: 'Low' },
|
||||
{ label: 'Medium', value: 'Medium' },
|
||||
{ label: 'High', value: 'High' },
|
||||
]
|
||||
|
||||
onMounted(async () => {
|
||||
const [status, priority] = await Promise.all([
|
||||
getMasterDataOptions('task_status'),
|
||||
getMasterDataOptions('task_priority'),
|
||||
])
|
||||
statusOptions.value = status as { label: string; value: TaskStatus }[]
|
||||
priorityOptions.value = priority as { label: string; value: TaskPriority }[]
|
||||
try {
|
||||
const [status, priority] = await Promise.all([
|
||||
getMasterDataOptions('task_status'),
|
||||
getMasterDataOptions('task_priority'),
|
||||
])
|
||||
statusOptions.value = (status.length ? status : FALLBACK_STATUS) as { label: string; value: TaskStatus }[]
|
||||
priorityOptions.value = (priority.length ? priority : FALLBACK_PRIORITY) as { label: string; value: TaskPriority }[]
|
||||
} catch {
|
||||
statusOptions.value = FALLBACK_STATUS
|
||||
priorityOptions.value = FALLBACK_PRIORITY
|
||||
}
|
||||
})
|
||||
|
||||
const assigneeOptions = computed(() => props.members.map((m) => ({ label: m.displayName, value: m.userId })))
|
||||
|
||||
Reference in New Issue
Block a user