Skip to content

Announcement Setting Implementation - #20

Merged
OmarLawaty merged 6 commits into
devfrom
feat/settings/announcement
Aug 19, 2026
Merged

OmarLawaty merged 6 commits into
devfrom
feat/settings/announcement

Conversation

@OmarLawaty

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 announcement settings UI (preview + configuration modal) and wires it into the Settings page.
  • Introduces an announcement settings schema and updates backend types/constants to support the new setting and media folder.
  • Refactors the product media uploader into a reusable ReorderedMediaUpload component 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.intervalHours will hide a valid value of 0 (and the form allows 0 via min={0}). If 0 is 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.

Comment thread src/hooks/settings/useSetAppSettingsMutation.ts
Comment thread src/api/backend/types.ts
Comment thread src/components/settings/Announcement.tsx
@OmarLawaty
OmarLawaty merged commit 66d4f4b into dev Aug 19, 2026
2 checks passed
@OmarLawaty
OmarLawaty deleted the feat/settings/announcement branch August 19, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants