Skip to content

Commit

Permalink
๐Ÿค– chore: ใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆ (#360)
Browse files Browse the repository at this point in the history
* ๐Ÿค– chore: format

* ๐Ÿ› fix: type error

* ๐Ÿ› fix: format

* ๐ŸŽธ feat: fetchRequest ใง offset limit ใ‚’ๅŠ ใˆใฆ้€ใ‚‹
  • Loading branch information
anko9801 authored Dec 29, 2024
1 parent 8102e92 commit 2498e8f
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/components/groupDetail/GroupName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useGroupDetailStore } from '/@/stores/groupDetail'
import { useUserStore } from '/@/stores/user'
import type { EditMode } from '/@/components/groupDetail/composables/useGroupInformation'
import InputText from '/@/components/shared/InputText.vue'
import EditButton from '/@/components/shared/EditButton.vue'
import InputText from '/@/components/shared/InputText.vue'
import SimpleButton from '/@/components/shared/SimpleButton.vue'
interface Props {
Expand Down
4 changes: 1 addition & 3 deletions src/components/modal/ModalWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script setup lang="ts">
const emit = defineEmits<{
(e: 'closeModal'): void
}>()
const emit = defineEmits<(e: 'closeModal') => void>()
</script>

<template>
Expand Down
6 changes: 2 additions & 4 deletions src/components/modal/StatusChangeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import { useToast } from 'vue-toastification'
import MarkdownTextarea from '/@/components/shared/MarkdownTextarea.vue'
import SimpleButton from '/@/components/shared/SimpleButton.vue'
import StatusChip from '/@/components/shared/StatusChip.vue'
import type { RequestDetail } from '/@/features/request/model'
import { changeStatusUsecase } from '/@/features/request/usecase'
import type { RequestStatus } from '/@/features/requestStatus/model'
import type { RequestDetail } from '/@/features/request/model'
const props = defineProps<{
request: RequestDetail
nextStatus: RequestStatus
}>()
const emit = defineEmits<{
(e: 'closeModal'): void
}>()
const emit = defineEmits<(e: 'closeModal') => void>()
const toast = useToast()
Expand Down
6 changes: 3 additions & 3 deletions src/components/newRequest/NewRequestFileForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ interface Props {
}
const props = defineProps<Props>()
const emit = defineEmits<{ (e: 'input', value: FileSeed[]): void }>()
const emit = defineEmits<(e: 'input', value: FileSeed[]) => void>()
const inputRef = ref()
function handleFileChange(e: Event) {
if (!(e.target instanceof HTMLInputElement) || !e.target.files) {
return
}
Array.from(e.target.files).forEach(file => {
for (const file of Array.from(e.target.files)) {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
Expand All @@ -29,7 +29,7 @@ function handleFileChange(e: Event) {
{ name: file.name, src: reader.result as string, type: file.type }
])
}
})
}
if (inputRef.value) {
inputRef.value.value = null
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/newRequest/NewRequestTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
tags: Tag[]
}
const props = defineProps<Props>()
const emit = defineEmits<{ (e: 'input', value: Tag[]): void }>()
const emit = defineEmits<(e: 'input', value: Tag[]) => void>()
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/newRequest/NewRequestTargets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {
}
const props = defineProps<Props>()
const emit = defineEmits<{ (e: 'input', value: RequestTarget[]): void }>()
const emit = defineEmits<(e: 'input', value: RequestTarget[]) => void>()
const userStore = useUserStore()
const { userOptions } = storeToRefs(userStore)
Expand Down
6 changes: 3 additions & 3 deletions src/components/newTransaction/NewTransactionTarget.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts" setup>
import SimpleButton from '/@/components/shared/SimpleButton.vue'
import InputText from '/@/components/shared/InputText.vue'
import { PlusIcon, TrashIcon } from '@heroicons/vue/24/outline'
import InputText from '/@/components/shared/InputText.vue'
import SimpleButton from '/@/components/shared/SimpleButton.vue'
interface Props {
targets: string[]
}
const props = defineProps<Props>()
const emit = defineEmits<{ (e: 'input', value: string[]): void }>()
const emit = defineEmits<(e: 'input', value: string[]) => void>()
function handleEditTarget(index: number, value: string) {
emit(
Expand Down
10 changes: 5 additions & 5 deletions src/components/requestDetail/RequestTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { ref } from 'vue'
import { useUserStore } from '/@/stores/user'
import { useToast } from 'vue-toastification'
import EditButton from '/@/components/shared/EditButton.vue'
import TagsGroup from '/@/components/shared/TagsGroup.vue'
import InputSelectTagWithCreation from '/@/components/shared/InputSelectTagWithCreation.vue'
import type { Tag } from '/@/features/tag/model'
import { editRequestUsecase } from '/@/features/request/usecase'
import type { RequestDetail } from '/@/features/request/model'
import TagsGroup from '/@/components/shared/TagsGroup.vue'
import { useRequest } from '/@/features/request/composables'
import { useToast } from 'vue-toastification'
import type { RequestDetail } from '/@/features/request/model'
import { editRequestUsecase } from '/@/features/request/usecase'
import type { Tag } from '/@/features/tag/model'
const props = defineProps<{
request: RequestDetail
Expand Down
10 changes: 5 additions & 5 deletions src/components/requestDetail/RequestTargets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { storeToRefs } from 'pinia'
import { useUserStore } from '/@/stores/user'
import EditButton from '/@/components/shared/EditButton.vue'
import { ref } from 'vue'
import { useToast } from 'vue-toastification'
import RequestTarget from '/@/components/requestDetail/RequestTarget.vue'
import type { RequestTargetDetail } from '/@/features/requestTarget/model'
import EditButton from '/@/components/shared/EditButton.vue'
import SimpleButton from '/@/components/shared/SimpleButton.vue'
import { editRequestUsecase } from '/@/features/request/usecase'
import type { RequestDetail } from '/@/features/request/model'
import { useRequest } from '/@/features/request/composables'
import { useToast } from 'vue-toastification'
import type { RequestDetail } from '/@/features/request/model'
import { editRequestUsecase } from '/@/features/request/usecase'
import type { RequestTargetDetail } from '/@/features/requestTarget/model'
const props = defineProps<{
request: RequestDetail
Expand Down
5 changes: 2 additions & 3 deletions src/components/shared/InputSelectMultiple.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import { ChevronDownIcon } from '@heroicons/vue/24/solid';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { ChevronDownIcon } from '@heroicons/vue/24/solid'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ValueValue = Record<string, any> | string | null
Expand Down
7 changes: 3 additions & 4 deletions src/components/shared/InputSelectSingle.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts" setup>
import { ChevronDownIcon } from '@heroicons/vue/24/solid';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { ChevronDownIcon } from '@heroicons/vue/24/solid'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ValueValue = Record<string, any> | string | null
type ValueValue = Record<string, unknown> | string | null
interface Value {
key: string
Expand Down
6 changes: 4 additions & 2 deletions src/features/request/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { DateTime } from 'luxon'
import type { Group } from '/@/features/group/model'
import type { RequestComment } from '/@/features/requestComment/model'
import type {
RequestStatusDetail,
RequestStatus
RequestStatus,
RequestStatusDetail
} from '/@/features/requestStatus/model'
import type {
RequestTarget,
Expand All @@ -30,6 +30,8 @@ export interface RequestQuerySeed {
target: string
since: string
until: string
limit: number
offset: number
tags: string[]
group: string
}
Expand Down
6 changes: 4 additions & 2 deletions src/features/request/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { convertRequestCommentFromData } from '/@/features/requestComment/conver
import type { RequestComment } from '/@/features/requestComment/model'
import { convertRequestStatusFromData } from '/@/features/requestStatus/converter'
import type {
RequestStatusDetail,
RequestStatus
RequestStatus,
RequestStatusDetail
} from '/@/features/requestStatus/model'

import type {
Expand All @@ -31,6 +31,8 @@ const createRequestRepository = () => ({
querySeed.target,
querySeed.since,
querySeed.until,
querySeed.limit,
querySeed.offset,
querySeed.tags.join(','),
querySeed.group
)
Expand Down
9 changes: 3 additions & 6 deletions src/pages/AdminPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
import { storeToRefs } from 'pinia'
import { ref } from 'vue'
import { useToast } from 'vue-toastification'
import { useAdminStore } from '/@/stores/admin'
import { useTagStore } from '/@/stores/tag'
import { useUserStore } from '/@/stores/user'
import InputSelectMultiple from '/@/components/shared/InputSelectMultiple.vue'
import SimpleButton from '/@/components/shared/SimpleButton.vue'
import { useFetchAdminsUsecase } from '/@/features/admin/usecase'
import { deleteTagsUsecase, useFetchTagsUsecase } from '/@/features/tag/usecase'
import { useFetchUsersUsecase } from '/@/features/user/usecase'
import { useAdminStore } from '/@/stores/admin'
import { useTagStore } from '/@/stores/tag'
import { useUserStore } from '/@/stores/user'
import { useAdmin } from './composables/useAdmin'
const adminStore = useAdminStore()
Expand Down
106 changes: 51 additions & 55 deletions src/pages/NewGroupPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,61 +38,57 @@ if (!isUserFetched.value) {
</script>

<template>
<div class="mb-6">
<h1 class="text-2xl">ใ‚ฐใƒซใƒผใƒ—ใฎๆ–ฐ่ฆไฝœๆˆ</h1>
<div class="mb-6">
<h1 class="text-2xl">ใ‚ฐใƒซใƒผใƒ—ใฎๆ–ฐ่ฆไฝœๆˆ</h1>
</div>
<form class="flex flex-col gap-6">
<div class="flex flex-col gap-3">
<label class="font-medium">ใ‚ฐใƒซใƒผใƒ—ๅ</label>
<InputText
v-model="group.name"
auto-focus
placeholder="ใ‚ฐใƒซใƒผใƒ—ๅใ‚’ๅ…ฅๅŠ›"
required />
</div>
<form class="flex flex-col gap-6">
<div class="flex flex-col gap-3">
<label class="font-medium">ใ‚ฐใƒซใƒผใƒ—ๅ</label>
<InputText
v-model="group.name"
auto-focus
placeholder="ใ‚ฐใƒซใƒผใƒ—ๅใ‚’ๅ…ฅๅŠ›"
required />
</div>
<div class="flex flex-col gap-3">
<label class="font-medium" for="details">่ชฌๆ˜Ž</label>
<MarkdownTextarea
id="details"
v-model="group.description"
placeholder=""
required />
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ไบˆ็ฎ—</label>
<div class="flex w-1/2">
<InputNumber
v-model="group.budget"
class="mr-2"
:min="1"
required />ๅ††
</div>
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ใ‚ชใƒผใƒŠใƒผ</label>
<InputSelectMultiple
v-model="group.owners"
class="w-full"
:options="userOptions"
placeholder="ใ‚ชใƒผใƒŠใƒผใ‚’้ธๆŠž" />
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ใƒกใƒณใƒใƒผ</label>
<InputSelectMultiple
v-model="group.members"
class="w-full"
:options="userOptions"
placeholder="ใƒกใƒณใƒใƒผใ‚’้ธๆŠž" />
</div>
<div>
<SimpleButton
class="ml-auto mt-8 block"
:disabled="isSending"
font-size="xl"
padding="md"
@click="handleCreateGroup">
ใ‚ฐใƒซใƒผใƒ—ใ‚’ไฝœๆˆ
</SimpleButton>
<div class="flex flex-col gap-3">
<label class="font-medium" for="details">่ชฌๆ˜Ž</label>
<MarkdownTextarea
id="details"
v-model="group.description"
placeholder=""
required />
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ไบˆ็ฎ—</label>
<div class="flex w-1/2">
<InputNumber v-model="group.budget" class="mr-2" :min="1" required />ๅ††
</div>
</form>
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ใ‚ชใƒผใƒŠใƒผ</label>
<InputSelectMultiple
v-model="group.owners"
class="w-full"
:options="userOptions"
placeholder="ใ‚ชใƒผใƒŠใƒผใ‚’้ธๆŠž" />
</div>
<div class="flex flex-col gap-3">
<label class="font-medium">ใƒกใƒณใƒใƒผ</label>
<InputSelectMultiple
v-model="group.members"
class="w-full"
:options="userOptions"
placeholder="ใƒกใƒณใƒใƒผใ‚’้ธๆŠž" />
</div>
<div>
<SimpleButton
class="ml-auto mt-8 block"
:disabled="isSending"
font-size="xl"
padding="md"
@click="handleCreateGroup">
ใ‚ฐใƒซใƒผใƒ—ใ‚’ไฝœๆˆ
</SimpleButton>
</div>
</form>
</template>
2 changes: 2 additions & 0 deletions src/stores/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const defaultParams: RequestQuerySeed = {
target: '',
since: '',
until: '',
limit: 10,
offset: 0,
tags: [],
group: ''
}
Expand Down

0 comments on commit 2498e8f

Please sign in to comment.