feat(frontend) : filter archived tasks and groups from kanban view
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,12 +78,12 @@
|
|||||||
<span class="text-sm font-semibold text-neutral-900">{{ task.title }}</span>
|
<span class="text-sm font-semibold text-neutral-900">{{ task.title }}</span>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<span
|
<span
|
||||||
v-for="type in task.types"
|
v-for="tag in task.tags"
|
||||||
:key="type.id"
|
:key="tag.id"
|
||||||
class="rounded-full px-2 py-0.5 text-xs font-semibold text-white"
|
class="rounded-full px-2 py-0.5 text-xs font-semibold text-white"
|
||||||
:style="{ backgroundColor: type.color }"
|
:style="{ backgroundColor: tag.color }"
|
||||||
>
|
>
|
||||||
{{ type.label }}
|
{{ tag.label }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="task.priority"
|
v-if="task.priority"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
:statuses="statuses"
|
:statuses="statuses"
|
||||||
:efforts="efforts"
|
:efforts="efforts"
|
||||||
:priorities="priorities"
|
:priorities="priorities"
|
||||||
:types="types"
|
:tags="tags"
|
||||||
:groups="groups"
|
:groups="groups"
|
||||||
:users="users"
|
:users="users"
|
||||||
@saved="onSaved"
|
@saved="onSaved"
|
||||||
@@ -138,7 +138,7 @@ import type { Task } from '~/services/dto/task'
|
|||||||
import type { TaskStatus } from '~/services/dto/task-status'
|
import type { TaskStatus } from '~/services/dto/task-status'
|
||||||
import type { TaskEffort } from '~/services/dto/task-effort'
|
import type { TaskEffort } from '~/services/dto/task-effort'
|
||||||
import type { TaskPriority } from '~/services/dto/task-priority'
|
import type { TaskPriority } from '~/services/dto/task-priority'
|
||||||
import type { TaskType } from '~/services/dto/task-type'
|
import type { TaskTag } from '~/services/dto/task-tag'
|
||||||
import type { TaskGroup } from '~/services/dto/task-group'
|
import type { TaskGroup } from '~/services/dto/task-group'
|
||||||
import type { UserData } from '~/services/dto/user-data'
|
import type { UserData } from '~/services/dto/user-data'
|
||||||
import { useProjectService } from '~/services/projects'
|
import { useProjectService } from '~/services/projects'
|
||||||
@@ -146,7 +146,7 @@ import { useTaskService } from '~/services/tasks'
|
|||||||
import { useTaskStatusService } from '~/services/task-statuses'
|
import { useTaskStatusService } from '~/services/task-statuses'
|
||||||
import { useTaskEffortService } from '~/services/task-efforts'
|
import { useTaskEffortService } from '~/services/task-efforts'
|
||||||
import { useTaskPriorityService } from '~/services/task-priorities'
|
import { useTaskPriorityService } from '~/services/task-priorities'
|
||||||
import { useTaskTypeService } from '~/services/task-types'
|
import { useTaskTagService } from '~/services/task-tags'
|
||||||
import { useTaskGroupService } from '~/services/task-groups'
|
import { useTaskGroupService } from '~/services/task-groups'
|
||||||
import { useUserService } from '~/services/users'
|
import { useUserService } from '~/services/users'
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ const taskService = useTaskService()
|
|||||||
const statusService = useTaskStatusService()
|
const statusService = useTaskStatusService()
|
||||||
const effortService = useTaskEffortService()
|
const effortService = useTaskEffortService()
|
||||||
const priorityService = useTaskPriorityService()
|
const priorityService = useTaskPriorityService()
|
||||||
const typeService = useTaskTypeService()
|
const tagService = useTaskTagService()
|
||||||
const groupService = useTaskGroupService()
|
const groupService = useTaskGroupService()
|
||||||
const userService = useUserService()
|
const userService = useUserService()
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ const tasks = ref<Task[]>([])
|
|||||||
const statuses = ref<TaskStatus[]>([])
|
const statuses = ref<TaskStatus[]>([])
|
||||||
const efforts = ref<TaskEffort[]>([])
|
const efforts = ref<TaskEffort[]>([])
|
||||||
const priorities = ref<TaskPriority[]>([])
|
const priorities = ref<TaskPriority[]>([])
|
||||||
const types = ref<TaskType[]>([])
|
const tags = ref<TaskTag[]>([])
|
||||||
const groups = ref<TaskGroup[]>([])
|
const groups = ref<TaskGroup[]>([])
|
||||||
const users = ref<UserData[]>([])
|
const users = ref<UserData[]>([])
|
||||||
const isLoading = ref(true)
|
const isLoading = ref(true)
|
||||||
@@ -181,12 +181,15 @@ const taskDrawerOpen = ref(false)
|
|||||||
const selectedTask = ref<Task | null>(null)
|
const selectedTask = ref<Task | null>(null)
|
||||||
|
|
||||||
const groupFilterOptions = computed(() =>
|
const groupFilterOptions = computed(() =>
|
||||||
groups.value.map(g => ({ label: g.title, value: g.id }))
|
groups.value.filter(g => !g.archived).map(g => ({ label: g.title, value: g.id }))
|
||||||
)
|
)
|
||||||
|
|
||||||
const filteredTasks = computed(() => {
|
const filteredTasks = computed(() => {
|
||||||
if (!selectedGroupId.value) return tasks.value
|
let result = tasks.value.filter(t => !t.archived)
|
||||||
return tasks.value.filter(t => t.group?.id === selectedGroupId.value)
|
if (selectedGroupId.value) {
|
||||||
|
result = result.filter(t => t.group?.id === selectedGroupId.value)
|
||||||
|
}
|
||||||
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
function tasksByStatus(statusId: number): Task[] {
|
function tasksByStatus(statusId: number): Task[] {
|
||||||
@@ -206,7 +209,7 @@ async function loadData() {
|
|||||||
statusService.getAll(),
|
statusService.getAll(),
|
||||||
effortService.getAll(),
|
effortService.getAll(),
|
||||||
priorityService.getAll(),
|
priorityService.getAll(),
|
||||||
typeService.getAll(),
|
tagService.getAll(),
|
||||||
groupService.getByProject(projectId.value),
|
groupService.getByProject(projectId.value),
|
||||||
userService.getAll(),
|
userService.getAll(),
|
||||||
])
|
])
|
||||||
@@ -215,7 +218,7 @@ async function loadData() {
|
|||||||
statuses.value = s
|
statuses.value = s
|
||||||
efforts.value = e
|
efforts.value = e
|
||||||
priorities.value = pr
|
priorities.value = pr
|
||||||
types.value = ty
|
tags.value = ty
|
||||||
groups.value = g
|
groups.value = g
|
||||||
users.value = u
|
users.value = u
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user