報告除外の admin view を追加する - #19
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
管理画面で「報告除外(exclusions)」を編集できる UI を追加し、既存の報告除外 API を運用できるようにする PR です。イベント編集画面(EventFormPage)から、クエストごとの報告一覧を開いて除外・理由を保存できます。
Changes:
- 管理画面にクエスト報告一覧+除外編集用の UI(QuestReportManager)を追加
- 公開データ(中間 JSON)を取得するための
fetchQuestReports()と関連型(Report/QuestData)を追加 - 管理画面の環境変数例に
VITE_DATA_URLを追加
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| admin/src/types/index.ts | 中間 JSON 用の Report / QuestData 型を追加 |
| admin/src/pages/EventFormPage.tsx | イベント編集画面の各クエストカードに報告管理 UI を埋め込み |
| admin/src/components/QuestReportManager.tsx | 報告一覧表示・除外トグル・理由入力・保存を行う新コンポーネントを追加 |
| admin/src/api/client.ts | 公開データ URL からクエスト JSON を取得する API 関数を追加 |
| admin/.env.example | VITE_DATA_URL のサンプルを追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+109
to
+112
| const res = await fetch(`${DATA_URL}/${eventId}/${questId}.json`); | ||
| if (res.status === 403 || res.status === 404) return null; | ||
| if (!res.ok) throw new Error(`Failed to fetch quest data: ${res.status}`); | ||
| return res.json() as Promise<QuestData>; |
Comment on lines
+126
to
+128
| )} | ||
|
|
||
| {loaded && !loading && reports.length > 0 && ( |
VITE_DATA_URL 未設定のまま実行すると "undefined/..." へ fetch して 原因が分かりづらくなるため、未設定時は明示的にエラーを投げる。 あわせて eventId/questId を URL パスに埋め込む前に encodeURIComponent する。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
orphan 除外(現在の報告一覧に存在しない既存除外)は「X件除外中」に 含まれるが画面で確認できず混乱を招くため、パネル内に件数と 「保存時に保持される」旨を明示する注記を追加する。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
報告除外の API 自体は存在していたが、設定するための admin view がなかったので追加する