Conversation
|
Preview (prod) → https://214-prod.rucq-ui-preview.trapti.tech/ |
📝 WalkthroughWalkthrough複数ファイルのローカルAPIスキーマ型エイリアスを削除し、新規の Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR consolidates response type aliases from the API schema into a centralized typeAliases.ts file, eliminating repetitive boilerplate code across components. Previously, each component imported components from @/api/schema and defined local type aliases. Now, commonly used response types are exported from typeAliases.ts and imported where needed.
Changes:
- Created
src/typeAliases.tswith centralized response type aliases (User, Camp, CampEvent, QuestionGroup, Question, Dashboard, Payment, RoomGroup, Room, RollCall, RollCallReaction, and event-related types) - Updated 20+ files to import types from
typeAliases.tsinstead of defining them locally - Fixed
QuestionGrouptype usage inUserInfoView.vueto correctly specifyQuestionGroup[]for the query type
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/typeAliases.ts | New file with centralized response type aliases from API schema |
| src/views/UserInfoView.vue | Replaced local type definitions with imports from typeAliases; fixed QuestionGroup array type |
| src/views/ScheduleView.vue | Replaced local CampEvent type with import from typeAliases |
| src/views/RoomInfoView.vue | Replaced local Room and RoomGroup types with imports from typeAliases |
| src/views/RollCallView.vue | Replaced local RollCall type with import from typeAliases |
| src/views/RegistrationView.vue | Replaced local Camp type with import from typeAliases |
| src/store.ts | Replaced local User and Camp types with imports from typeAliases |
| src/components/rollcall/rollCallStream.ts | Replaced local RollCall and RollCallReaction types with imports from typeAliases |
| src/components/information/*.vue | Replaced local type definitions with imports from typeAliases across multiple components |
| src/components/event/utils/*.ts | Replaced local event-related type definitions with imports from typeAliases |
| src/components/event/*.vue | Replaced local event-related type definitions with imports from typeAliases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <script setup lang="ts"> | ||
| import type { components } from '@/api/schema' | ||
| import { nextTick, ref, watch, onMounted } from 'vue' | ||
| import type { VTextField } from 'vuetify/components' | ||
|
|
||
| type DurationEvent = components['schemas']['DurationEventResponse'] | ||
| type EventColor = DurationEvent['displayColor'] | ||
|
|
||
| const textFieldRef = ref<VTextField>() | ||
| import type { DurationEvent } from '@/typeAliases' |
There was a problem hiding this comment.
The removal of the VTextField import and textFieldRef variable declaration may cause issues. The template at line 58 still references ref="textFieldRef", which suggests these declarations may have been unintentionally removed during the type alias consolidation. Consider restoring import type { VTextField } from 'vuetify/components' and const textFieldRef = ref<VTextField>(), or remove the unused ref attribute from the template if it's no longer needed.
42919bb to
1844832
Compare
| type RollCallReactionEvent = components['schemas']['RollCallReactionEvent'] | ||
| type RollCall = components['schemas']['RollCallResponse'] | ||
| type RollCallReaction = components['schemas']['RollCallReactionResponse'] | ||
|
|
| type DurationEventRequestBody = components['schemas']['DurationEventRequest'] | ||
|
|
| const isRegistered = computed(() => campStore.hasRegisteredLatest) | ||
|
|
||
| // 質問グループ一覧 | ||
| const { data: questionGroups } = useQuery<QuestionGroup, Error>({ |
closes #172
これまでのコードでは各コンポーネントで
のようなボイラープレートによって型を使用していましたが、これを typeAliases.ts に集約します
Summary by CodeRabbit