Skip to content

Commit dfba314

Browse files
committed
✨ [feat] : TaskLabel 컴포넌트 구현 및 PENDING_COMPLETED -> IN_REVIEWING으로 ENUM 수정
1 parent e5c72c7 commit dfba314

File tree

8 files changed

+35
-12
lines changed

8 files changed

+35
-12
lines changed

src/components/TaskCard.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
@click="onTaskClick">
66
<div class="flex flex-col gap-1">
77
<div class="flex justify-between items-center gap-4">
8-
<span class="text-black">{{ data.title }}</span>
8+
<div class="flex items-center gap-2">
9+
<TaskLabel
10+
:color="data.labelInfo.labelColor"
11+
:content="data.labelInfo.labelName" />
12+
<span class="text-black">{{ data.title }}</span>
13+
</div>
914
<CommonIcons
1015
v-if="draggable"
1116
:name="bentoIcon" />
@@ -34,6 +39,7 @@ import { computed } from 'vue'
3439
import type { TaskCardProps } from '@/types/manager'
3540
import CommonIcons from './common/CommonIcons.vue'
3641
import { statusAsColor } from '@/utils/statusAsColor'
42+
import TaskLabel from './common/TaskLabel.vue'
3743
3844
const { data } = defineProps<{ data: TaskCardProps; draggable?: boolean }>()
3945
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<span
3+
class="px-2 py-0.5 text-[10px] font-bold border-2 rounded-full whitespace-nowrap"
4+
:style="{ borderColor, backgroundColor }">
5+
{{ content }}
6+
</span>
7+
</template>
8+
9+
<script setup lang="ts">
10+
import { COLOR_LIST } from '@/constants/common'
11+
12+
const { color, content } = defineProps<{ color: string; content: string }>()
13+
const [borderColor, backgroundColor] = [
14+
COLOR_LIST.find(el => el.colorEnum === color)?.borderColor,
15+
COLOR_LIST.find(el => el.colorEnum === color)?.fillColor
16+
]
17+
</script>

src/components/task-board/TaskBoard.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
<div class="flex flex-1 bg-primary2 rounded-t-lg">
1010
<span class="text-xs font-bold text-body p-4">
11-
검토 중 {{ data?.tasksPendingComplete.length }}
11+
검토 중 {{ data?.tasksInProgress.length }}
1212
</span>
1313
</div>
1414
<div class="flex flex-1 bg-primary2 rounded-t-lg">
@@ -47,7 +47,7 @@
4747
<div class="flex-1 px-4 pb-4 bg-primary2 rounded-b-lg relative">
4848
<div class="absolute top-0 left-0 px-4 w-full">
4949
<div
50-
v-if="data?.tasksPendingComplete.length === 0"
50+
v-if="data?.tasksInProgress.length === 0"
5151
class="w-full max-w-80 h-[130px] bg-white border border-dashed border-border-1 rounded-lg flex justify-center items-center">
5252
<span class="whitespace-pre-wrap text-center text-sm font-bold text-disabled">
5353
{{ '상태를 변경할 작업을\n끌어 놓으세요' }}
@@ -59,7 +59,7 @@
5959
group="taskList"
6060
item-key="task"
6161
class="flex flex-col gap-4 h-full"
62-
@change="event => onListChange(event, 'PENDING_COMPLETED')">
62+
@change="event => onListChange(event, 'IN_REVIEWING')">
6363
<template #item="{ element }">
6464
<TaskCard
6565
:key="element.taskId"
@@ -113,8 +113,8 @@ const queryClient = useQueryClient()
113113
const statusToKey = (status: Status): keyof TaskCardList | undefined => {
114114
if (status === 'IN_PROGRESS') {
115115
return 'tasksInProgress'
116-
} else if (status === 'PENDING_COMPLETED') {
117-
return 'tasksPendingComplete'
116+
} else if (status === 'IN_REVIEWING') {
117+
return 'tasksInReviewing'
118118
} else if (status === 'COMPLETED') {
119119
return 'tasksCompleted'
120120
}
@@ -172,6 +172,6 @@ const { data } = useQuery<TaskCardList>({
172172
})
173173
174174
const tasksInProgress = computed(() => [...(data.value?.tasksInProgress || [])])
175-
const tasksPendingComplete = computed(() => [...(data.value?.tasksPendingComplete || [])])
175+
const tasksPendingComplete = computed(() => [...(data.value?.tasksInReviewing || [])])
176176
const tasksCompleted = computed(() => [...(data.value?.tasksCompleted || [])])
177177
</script>

src/constants/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const TERM_LIST = [
1010
]
1111
export const TASK_STATUS_LIST: TaskStatusListTypes[] = [
1212
{ value: 'IN_PROGRESS', content: '진행 중' },
13-
{ value: 'PENDING_COMPLETED', content: '검토 중' },
13+
{ value: 'IN_REVIEWING', content: '검토 중' },
1414
{ value: 'COMPLETED', content: '완료' },
1515
{ value: 'TERMINATED', content: '종료' }
1616
]

src/types/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface ListBarTabProps {
5050
justifyCenter?: boolean
5151
}
5252

53-
export type Status = 'REQUESTED' | 'IN_PROGRESS' | 'PENDING_COMPLETED' | 'COMPLETED' | 'TERMINATED'
53+
export type Status = 'REQUESTED' | 'IN_PROGRESS' | 'IN_REVIEWING' | 'COMPLETED' | 'TERMINATED'
5454

5555
export type SortDirection = 'DESC' | 'ASC'
5656

src/types/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface TaskCardProps {
4646

4747
export interface TaskCardList {
4848
tasksInProgress: TaskCardProps[]
49-
tasksPendingComplete: TaskCardProps[]
49+
tasksInReviewing: TaskCardProps[]
5050
tasksCompleted: TaskCardProps[]
5151
}
5252

src/utils/statusAsColor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Status } from '@/types/common'
33
const defaultColor = {
44
REQUESTED: 'gray',
55
IN_PROGRESS: 'blue',
6-
PENDING_COMPLETED: 'orange',
6+
IN_REVIEWING: 'orange',
77
COMPLETED: 'green',
88
TERMINATED: 'red'
99
}

src/utils/statusAsText.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Status } from '@/types/common'
33
const text = {
44
REQUESTED: '요청',
55
IN_PROGRESS: '진행 중',
6-
PENDING_COMPLETED: '검토 중',
6+
IN_REVIEWING: '검토 중',
77
COMPLETED: '완료',
88
TERMINATED: '종료'
99
}

0 commit comments

Comments
 (0)