-
Notifications
You must be signed in to change notification settings - Fork 0
管理者が手動でアンケートを流す機能の実装 #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
管理者が手動でアンケートを流す機能の実装 #345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a manual survey distribution feature for administrators to send survey prompts to users. The feature allows admins to configure and send Google Forms survey URLs to users via real-time modal prompts.
- Adds database schema for survey events with URL and activation status tracking
- Implements admin interface for survey URL configuration and distribution control
- Creates user-side modal system with session-based display restrictions
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| view-user/src/types/graphql.ts | Generated GraphQL types for events table and survey subscription |
| view-user/src/state/survey.ts | Recoil atom for tracking survey display state in user sessions |
| view-user/src/gql/events.gql | GraphQL subscription for real-time survey event updates |
| view-user/src/components/common/SurveyPromptModal/ | New modal component for displaying survey prompts to users |
| view-user/src/components/Layout/Layout.tsx | Integration of survey subscription and modal display logic |
| view-admin/src/type/graphql.ts | Generated GraphQL types for admin-side survey mutations |
| view-admin/src/pages/index.tsx | Admin interface for survey URL input and distribution controls |
| view-admin/src/gql/events.gql | GraphQL query and mutation for survey management |
| api/migrations/default/1720521696814_auto/up.sql | Database migration creating events table with survey fields |
| api/metadata/databases/default/tables/ | Hasura metadata configuration for events table GraphQL API |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
view-user/src/components/common/SurveyPromptModal/SurveyPromptModal.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 66a2a7a.
|
大体copilotのは対応したはず |
YosukeIida
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This reverts commit 7a66d94.
| const Layout = (props: LayoutProps) => { | ||
| const router = useRouter(); | ||
| const t = props.language === "ja" ? ja : en; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Delete ··
|
|
||
| const [mainColor, setMainColor] = useState(COLOR_PRESETS.DEFAULT_MAIN_COLOR); | ||
| const [subColor, setSubColor] = useState(COLOR_PRESETS.DEFAULT_SUB_COLOR); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Delete ··
対応Issue
概要
管理者(
view-admin)が任意のタイミングで「アンケート配信」を押すと、ユーザー(view-user)側にモーダルでGoogle Formsへの協力を促す機能を実装しました。ユーザー画面の番号サブスクとは分離した"軽量サブスク"で実現し、localStorageを使わずにセッション中1回だけ表示に抑制する仕様になっています。実装詳細
DB/Hasura
eventsテーブルにsurvey_urlとis_survey_activeの2列を追加(migration済み)public_events.yamlを追加してGraphQL APIを有効化view-admin
CreateEventSurvey) でアンケート状態を更新view-user
SubscribeLatestEventSurvey) でリアルタイム更新hasShownSurveyState) でセッション中の表示制御SurveyPromptModalの作成主要ファイル
api/metadata/databases/default/tables/public_events.yaml(新規)view-admin/src/gql/events.gql(新規)view-user/src/gql/events.gql(新規)view-user/src/state/survey.ts(新規)view-user/src/components/common/SurveyPromptModal/(新規)view-admin/src/pages/index.tsx(修正)view-user/src/components/Layout/Layout.tsx(修正)画面スクリーンショット等
管理者画面にアンケートURL入力欄と「配信する」「配信を停止する」ボタンを追加。ユーザー画面では配信時にモーダルが表示され、「回答する」でGoogle Formsが新しいタブで開き、「閉じる」または背景クリックでモーダルが閉じます。
テスト項目
備考