Skip to content

Commit a29154e

Browse files
authored
Merge pull request #97 from TaskFlow-CLAP/CLAP-270
CLAP-270 TaskCard의 라벨 컴포넌트 제작
2 parents aa1e0d6 + da8c38c commit a29154e

File tree

11 files changed

+40
-16
lines changed

11 files changed

+40
-16
lines changed

src/components/PieChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:options="options" />
66
<NoContent
77
v-else
8-
content="데이터가 없습니다" />
8+
content="집계된 데이터가 없습니다" />
99
</template>
1010

1111
<script setup lang="ts">

src/components/TaskCard.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
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+
v-if="data.labelInfo"
11+
:color="data.labelInfo.labelColor"
12+
:content="data.labelInfo.labelName" />
13+
<span class="text-black">{{ data.title }}</span>
14+
</div>
915
<CommonIcons
1016
v-if="draggable"
1117
:name="bentoIcon" />
@@ -34,6 +40,7 @@ import { computed } from 'vue'
3440
import type { TaskCardProps } from '@/types/manager'
3541
import CommonIcons from './common/CommonIcons.vue'
3642
import { statusAsColor } from '@/utils/statusAsColor'
43+
import TaskLabel from './common/TaskLabel.vue'
3744
3845
const { data } = defineProps<{ data: TaskCardProps; draggable?: boolean }>()
3946
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/statistics/StatisticsCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const fetchStatistics = async () => {
6363
}
6464
6565
const { data } = useQuery<StatisticsData[]>({
66-
queryKey: [statisticsType, periodType],
66+
queryKey: computed(() => [statisticsType, periodType]),
6767
queryFn: fetchStatistics
6868
})
6969

src/components/statistics/StatisticsCategoryCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const fetchMainStatistics = async () => {
5454
return response.data
5555
}
5656
const { data: mainData } = useQuery<StatisticsData[]>({
57-
queryKey: ['REQUEST_BY_CATEGORY', periodType],
57+
queryKey: computed(() => ['REQUEST_BY_CATEGORY', periodType]),
5858
queryFn: fetchMainStatistics
5959
})
6060
const mainLabels = computed(() => {
@@ -75,7 +75,7 @@ const fetchSubStatistics = async () => {
7575
return response.data
7676
}
7777
const { data: subData } = useQuery<StatisticsData[]>({
78-
queryKey: [mainCategory.value, periodType],
78+
queryKey: computed(() => [mainCategory.value, periodType]),
7979
queryFn: fetchSubStatistics,
8080
enabled: computed(() => mainCategory.value !== '')
8181
})

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
}

0 commit comments

Comments
 (0)