Skip to content

Commit 9405612

Browse files
authored
Merge pull request #164 from TaskFlow-CLAP/CLAP-377
Clap-377 수정 요구 Moya
2 parents 1ba65bf + 0cd7e13 commit 9405612

30 files changed

Lines changed: 205 additions & 99 deletions

.github/workflows/CD.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: CD for front using github actions
33

44
on:
55
release:
6-
types: [created, edited, published, released, prereleased]
7-
6+
types: [created]
87

98
permissions:
109
contents: read
@@ -48,7 +47,7 @@ jobs:
4847
- name: Docker build & push
4948
run: |
5049
docker login clap.kr-central-2.kcr.dev -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
51-
docker build -t ${{ secrets.DOCKER_REPO }}:${{ steps.version.outputs.VERSION }} .
50+
docker build -t ${{ secrets.DOCKER_REPO }}${{ steps.version.outputs.VERSION }} .
5251
docker push ${{ secrets.DOCKER_REPO }}:${{ steps.version.outputs.VERSION }}
5352
## deploy
5453
- name: Deploy

src/components/common/TaskCard.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,37 @@
4242

4343
<script setup lang="ts">
4444
import { bentoIcon } from '@/constants/iconPath'
45+
import { useTeamBoardParamsStore } from '@/stores/params'
4546
import type { Status } from '@/types/common'
4647
import type { TaskCardProps } from '@/types/manager'
4748
import { statusAsColor } from '@/utils/statusAsColor'
49+
import { useQueryClient } from '@tanstack/vue-query'
4850
import { computed, ref } from 'vue'
51+
import TaskDetail from '../task-detail/TaskDetail.vue'
4952
import CommonIcons from './CommonIcons.vue'
50-
import TaskLabel from './TaskLabel.vue'
5153
import ImageContainer from './ImageContainer.vue'
52-
import TaskDetail from '../task-detail/TaskDetail.vue'
54+
import TaskLabel from './TaskLabel.vue'
5355
5456
const { data } = defineProps<{ data: TaskCardProps; draggable?: boolean }>()
5557
const emit = defineEmits(['toggleModal'])
5658
const selectedID = ref<number | null>(null)
59+
const queryClient = useQueryClient()
60+
const { params } = useTeamBoardParamsStore()
5761
5862
const borderLeft = computed(() => {
5963
return `border-${statusAsColor(data.taskStatus as Status)}-1`
6064
})
6165
6266
const handleModal = (id: number | null) => {
67+
if (!id) {
68+
queryClient.invalidateQueries({
69+
queryKey: ['taskBoard']
70+
})
71+
queryClient.invalidateQueries({
72+
queryKey: ['teamStatus', params]
73+
})
74+
document.body.style.overflow = ''
75+
}
6376
emit('toggleModal')
6477
selectedID.value = id
6578
}

src/components/my-request/MyRequestList.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<template #listCards>
88
<MyRequestListCard
99
v-for="info in data?.content"
10-
:key="info.taskId"
10+
:key="info.taskStatus + info.processorName + info.taskId"
1111
:info="info" />
1212
<NoContent v-if="data?.content.length === 0" />
1313
</template>
@@ -22,19 +22,19 @@
2222
</template>
2323

2424
<script setup lang="ts">
25+
import { useParseParams } from '@/hooks/useParseParams'
26+
import { useMemberStore } from '@/stores/member'
2527
import { useRequestParamsStore } from '@/stores/params'
2628
import type { MyRequestResponse } from '@/types/user'
2729
import { axiosInstance } from '@/utils/axios'
2830
import { useQuery } from '@tanstack/vue-query'
31+
import { storeToRefs } from 'pinia'
2932
import { computed } from 'vue'
3033
import ListContainer from '../lists/ListContainer.vue'
3134
import ListPagination from '../lists/ListPagination.vue'
3235
import NoContent from '../lists/NoContent.vue'
3336
import MyRequestListBar from './MyRequestListBar.vue'
3437
import MyRequestListCard from './MyRequestListCard.vue'
35-
import { useMemberStore } from '@/stores/member'
36-
import { storeToRefs } from 'pinia'
37-
import { useParseParams } from '@/hooks/useParseParams'
3838
3939
const { params } = useRequestParamsStore()
4040
const onPageChange = (value: number) => {

src/components/my-request/MyRequestListCard.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@
1919
</template>
2020

2121
<script setup lang="ts">
22+
import { useRequestParamsStore } from '@/stores/params'
2223
import type { ListCardProps } from '@/types/common'
2324
import type { MyRequestListData } from '@/types/user'
2425
import { formatDate } from '@/utils/date'
26+
import { useQueryClient } from '@tanstack/vue-query'
2527
import { ref } from 'vue'
2628
import ListCardTab from '../lists/ListCardTab.vue'
2729
import TaskDetail from '../task-detail/TaskDetail.vue'
2830
2931
const { info } = defineProps<{ info: MyRequestListData }>()
3032
const selectedID = ref<number | null>(null)
33+
const { params } = useRequestParamsStore()
34+
const queryClient = useQueryClient()
3135
3236
const handleModal = (id: number | null) => {
37+
if (!id) {
38+
queryClient.invalidateQueries({
39+
queryKey: ['myRequest', params]
40+
})
41+
}
3342
selectedID.value = id
3443
}
3544

src/components/my-task/MyTaskList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<template #listCards>
88
<MyTaskListCard
99
v-for="info in data?.content"
10-
:key="info.taskId"
10+
:key="info.taskStatus + info.taskId"
1111
:info="info" />
1212
<NoContent v-if="data?.content.length === 0" />
1313
</template>

src/components/my-task/MyTaskListCard.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@
1919
</template>
2020

2121
<script setup lang="ts">
22+
import { useRequestParamsStore } from '@/stores/params'
2223
import type { ListCardProps } from '@/types/common'
2324
import type { MyTaskListData } from '@/types/manager'
2425
import { formatDate } from '@/utils/date'
26+
import { useQueryClient } from '@tanstack/vue-query'
2527
import { ref } from 'vue'
2628
import ListCardTab from '../lists/ListCardTab.vue'
2729
import TaskDetail from '../task-detail/TaskDetail.vue'
2830
2931
const { info } = defineProps<{ info: MyTaskListData }>()
3032
const selectedID = ref<number | null>(null)
33+
const queryClient = useQueryClient()
34+
const { params } = useRequestParamsStore()
3135
3236
const handleModal = (id: number | null) => {
37+
if (!id) {
38+
queryClient.invalidateQueries({
39+
queryKey: ['myTask', params]
40+
})
41+
}
3342
selectedID.value = id
3443
}
3544
const myRequestTabList: ListCardProps[] = [

src/components/request-history/RequestHistoryList.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<template #listCards>
88
<RequestHistoryListCard
99
v-for="info in data?.content"
10-
:key="info.taskId"
10+
:key="info.taskStatus + info.processorName + info.taskId"
1111
:info="info" />
1212
<NoContent v-if="data?.content.length === 0" />
1313
</template>
@@ -22,19 +22,19 @@
2222
</template>
2323

2424
<script setup lang="ts">
25-
import ListPagination from '../lists/ListPagination.vue'
26-
import ListContainer from '../lists/ListContainer.vue'
25+
import { useParseParams } from '@/hooks/useParseParams'
26+
import { useMemberStore } from '@/stores/member'
2727
import { useRequestParamsStore } from '@/stores/params'
28-
import RequestHistoryListBar from './RequestHistoryListBar.vue'
29-
import RequestHistoryListCard from './RequestHistoryListCard.vue'
28+
import type { RequestHistoryResponse } from '@/types/manager'
3029
import { axiosInstance } from '@/utils/axios'
3130
import { useQuery } from '@tanstack/vue-query'
31+
import { storeToRefs } from 'pinia'
3232
import { computed } from 'vue'
33-
import type { RequestHistoryResponse } from '@/types/manager'
33+
import ListContainer from '../lists/ListContainer.vue'
34+
import ListPagination from '../lists/ListPagination.vue'
3435
import NoContent from '../lists/NoContent.vue'
35-
import { useMemberStore } from '@/stores/member'
36-
import { storeToRefs } from 'pinia'
37-
import { useParseParams } from '@/hooks/useParseParams'
36+
import RequestHistoryListBar from './RequestHistoryListBar.vue'
37+
import RequestHistoryListCard from './RequestHistoryListCard.vue'
3838
3939
const { params } = useRequestParamsStore()
4040
const onPageChange = (value: number) => {

src/components/request-history/RequestHistoryListCard.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@
1919
</template>
2020

2121
<script setup lang="ts">
22+
import { useRequestParamsStore } from '@/stores/params'
2223
import type { ListCardProps } from '@/types/common'
2324
import type { RequestHistoryListData } from '@/types/manager'
2425
import { formatDate } from '@/utils/date'
26+
import { useQueryClient } from '@tanstack/vue-query'
2527
import { ref } from 'vue'
2628
import ListCardTab from '../lists/ListCardTab.vue'
2729
import TaskDetail from '../task-detail/TaskDetail.vue'
2830
2931
const { info } = defineProps<{ info: RequestHistoryListData }>()
3032
const selectedID = ref<number | null>(null)
33+
const { params } = useRequestParamsStore()
34+
const queryClient = useQueryClient()
3135
3236
const handleModal = (id: number | null) => {
37+
if (!id) {
38+
queryClient.invalidateQueries({
39+
queryKey: ['requestHistory', params]
40+
})
41+
}
3342
selectedID.value = id
3443
}
3544
const myRequestTabList: ListCardProps[] = [

src/components/request-task/ReRequestTask.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@
3030
cancelText="취소"
3131
submitText="수정" />
3232
<ModalView
33-
:isOpen="isModalVisible"
33+
:isOpen="isModalVisible === 'success'"
3434
:type="'successType'"
3535
@close="handleCancel">
3636
<template #header>작업이 수정되었습니다</template>
3737
</ModalView>
38+
<ModalView
39+
:isOpen="isModalVisible === 'fail'"
40+
:type="'failType'"
41+
@close="handleCancel">
42+
<template #header>작업요청을 실패했습니다</template>
43+
<template #body>잠시후 시도해주세요</template>
44+
</ModalView>
3845
</div>
3946
</template>
4047

@@ -59,7 +66,8 @@ const title = ref('')
5966
const description = ref('')
6067
const file = ref(null as File[] | null)
6168
const isInvalidate = ref('')
62-
const isModalVisible = ref(false)
69+
const isModalVisible = ref('')
70+
const isSubmitting = ref(false)
6371
6472
const mainCategoryArr = ref<Category[]>([])
6573
const subCategoryArr = ref<SubCategory[]>([])
@@ -105,6 +113,7 @@ watch(category1, async newValue => {
105113
})
106114
107115
const handleSubmit = async () => {
116+
if (isSubmitting.value || isModalVisible.value) return
108117
if (!category2.value) {
109118
isInvalidate.value = 'category'
110119
return
@@ -158,9 +167,12 @@ const handleSubmit = async () => {
158167
} else {
159168
await patchTaskRequest(id, formData)
160169
}
161-
isModalVisible.value = true
162-
} catch (error) {
163-
console.error('요청 실패:', error)
170+
isModalVisible.value = 'success'
171+
} catch (e) {
172+
isModalVisible.value = 'fail'
173+
console.error('요청 실패:', e)
174+
} finally {
175+
isSubmitting.value = false
164176
}
165177
}
166178
</script>

src/components/request-task/RequestTask.vue

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@
3030
cancelText="취소"
3131
submitText="요청" />
3232
<ModalView
33-
:isOpen="isModalVisible"
33+
:isOpen="isModalVisible === 'success'"
3434
:type="'successType'"
3535
@close="handleCancel">
3636
<template #header>작업이 요청되었습니다</template>
3737
</ModalView>
38+
<ModalView
39+
:isOpen="isModalVisible === 'fail'"
40+
:type="'failType'"
41+
@close="handleCancel">
42+
<template #header>작업요청을 실패했습니다</template>
43+
<template #body>잠시후 시도해주세요</template>
44+
</ModalView>
3845
</div>
3946
</template>
4047

@@ -58,7 +65,8 @@ const title = ref('')
5865
const description = ref('')
5966
const file = ref(null as File[] | null)
6067
const isInvalidate = ref('')
61-
const isModalVisible = ref(false)
68+
const isModalVisible = ref('')
69+
const isSubmitting = ref(false)
6270
6371
const mainCategoryArr = ref<Category[]>([])
6472
const subCategoryArr = ref<SubCategory[]>([])
@@ -92,10 +100,13 @@ const handleCancel = () => {
92100
title.value = ''
93101
description.value = ''
94102
file.value = []
103+
isModalVisible.value = ''
95104
router.back()
96105
}
97106
98107
const handleSubmit = async () => {
108+
if (isSubmitting.value || isModalVisible.value) return
109+
99110
if (!category1.value || !category2.value) {
100111
isInvalidate.value = 'category'
101112
return
@@ -109,26 +120,30 @@ const handleSubmit = async () => {
109120
isInvalidate.value = 'description'
110121
return
111122
}
123+
124+
isSubmitting.value = true
125+
112126
const formData = new FormData()
113127
const taskInfo = {
114128
categoryId: category2.value.subCategoryId,
115129
title: title.value,
116130
description: description.value
117131
}
118-
119132
const jsonTaskInfo = JSON.stringify(taskInfo)
120133
const newBlob = new Blob([jsonTaskInfo], { type: 'application/json' })
121-
122134
formData.append('taskInfo', newBlob)
123135
124136
if (file.value && file.value.length > 0) {
125137
file.value.forEach(f => formData.append('attachment', f))
126138
}
127139
try {
128140
await postTaskRequest(formData)
129-
isModalVisible.value = true
130-
} catch (error) {
131-
console.error('요청 실패:', error)
141+
isModalVisible.value = 'success'
142+
} catch (e) {
143+
console.error(e)
144+
isModalVisible.value = 'fail'
145+
} finally {
146+
isSubmitting.value = false
132147
}
133148
}
134149
</script>

0 commit comments

Comments
 (0)