Announcement Setting Implementation - #20
Merged
Merged
Conversation
…and update imports
…for interval input
There was a problem hiding this comment.
Pull request overview
Implements a new Announcement app setting in the admin Settings page, including backend schema/type wiring and reusable media upload/reordering support (reused by Product forms).
Changes:
- Adds an
announcementsettings UI (preview + configuration modal) and wires it into the Settings page. - Introduces an
announcementsettings schema and updates backend types/constants to support the new setting and media folder. - Refactors the product media uploader into a reusable
ReorderedMediaUploadcomponent and migrates product pages to it.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/hooks/settings/useSetAppSettingsMutation.ts | Adds mediaIds mapping for settings mutations. |
| src/components/settings/index.ts | Re-exports the new Announcement settings component. |
| src/components/settings/Announcement.tsx | New Announcement settings card + modal (rich text, schedule, interval, media upload). |
| src/components/ReorderedMediaUpload.tsx | Refactors product-only media upload/reorder into a reusable component supporting folders. |
| src/components/products/index.ts | Removes the old ProductUploadMedia export. |
| src/components/index.ts | Exports ReorderedMediaUpload from the root components barrel. |
| src/app/(hydration)/(base)/settings/page.tsx | Renders the new Announcement section on the Settings page. |
| src/app/(hydration)/(base)/(store)/products/add/page.tsx | Switches product add page to ReorderedMediaUpload. |
| src/app/(hydration)/(base)/(store)/products/[id]/page.tsx | Switches product edit page to ReorderedMediaUpload. |
| src/api/backend/types.ts | Adds announcement to AppSettings response typings. |
| src/api/backend/schemas/settings/maintenanceModeSchema.ts | Minor formatting-only change. |
| src/api/backend/schemas/settings/index.ts | Registers the new announcementSchema in appSettingsSchemas. |
| src/api/backend/schemas/settings/announcementSchema.ts | New Zod schema for announcement settings payload validation. |
| src/api/backend/const.ts | Adds announcement to mediaFolders and mediaFoldersTypeMap. |
Suppressed comments (1)
src/components/settings/Announcement.tsx:76
!!data.intervalHourswill hide a valid value of0(and the form allows0viamin={0}). If0is a meaningful value (or just the default), this block won’t render even though the setting is set.
{!!data.intervalHours && (
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
No description provided.