Closed ttizze closed 2 months ago
This update introduces a suite of enhancements to the application, focusing on user profile management, page editing capabilities, and database structure improvements. Key features include a new customizable Switch
component, improved page status management through additional properties, enhanced data retrieval functions, and user-friendly UI elements for managing page visibility. These changes collectively enhance user experience, accessibility, and content management functionalities.
File(s) | Change Summary |
---|---|
web/app/components/ui/switch.tsx |
Introduced Switch component as a wrapper for Radix UI, supporting customization and accessibility. |
web/app/routes/$userName+/functions/mutations.server.ts |
Added functions for toggling page status and archiving, utilizing Prisma for database interactions. |
web/app/routes/$userName+/functions/queries.server.ts |
Modified getSanitizedUserWithPages to include isOwnProfile for better page filtering and sanitization. |
web/app/routes/$userName+/index.tsx |
Enhanced user profile loader and action to handle ownership checks and page actions. |
web/app/routes/$userName+/page+/$slug+/edit/_edit.tsx |
Updated EditPage to manage publication status, including new form fields and UI elements. |
web/app/routes/$userName+/page+/$slug+/edit/components/EditFooter.tsx |
Introduced EditFooter to enhance UI at the bottom of the edit page. |
web/app/routes/$userName+/page+/$slug+/edit/components/EditHeader.tsx |
Improved EditHeader to reflect and control page publish state. |
web/app/routes/$userName+/page+/$slug+/edit/functions/mutations.server.ts |
Included isPublished parameter in createOrUpdatePage for managing publication state. |
web/app/routes/$userName+/page+/$slug+/edit/functions/queries.server.ts |
Expanded data retrieval to include new page status fields. |
web/app/routes/$userName+/page+/$slug+/index.tsx |
Renamed variable for clarity and improved access control logic for page translations. |
web/app/routes/$userName+/page+/$slug+/types.ts |
Added isPublished and isArchived properties to PageWithTranslations interface for better tracking. |
web/app/routes/$userName+/utils/stripHtmlTags.ts |
Introduced HTML sanitization utility to clean up page content. |
web/app/routes/resources+/footer.tsx |
Changed footer icon from Home to UserPen for better contextual representation. |
web/package.json |
Added @radix-ui/react-switch dependency for enhanced UI components. |
web/prisma/migrations/.../migration.sql |
Modified columns in pages table to track page visibility and archival status. |
web/prisma/schema.prisma |
Added isPublished and isArchived fields to the Page model for effective state management. |
sequenceDiagram
participant User
participant EditPage
participant Database
User->>EditPage: Request to edit page
EditPage->>Database: Fetch page data
Database-->>EditPage: Return page data
EditPage->>User: Render edit form
User->>EditPage: Submit changes (title, content, isPublished)
EditPage->>Database: Update page with new data
Database-->>EditPage: Confirm update
EditPage->>User: Display success message
🐰 In fields of green, we hop with glee,
New switches and pages, oh what a spree!
Publish or save, with ease now we play,
Enhancing our garden, come join the fray!
Each click, a joy, each toggle, a dance,
In this wondrous world, let's take a chance! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Switch
component for enhanced UI interactivity.Bug Fixes
Documentation
Chores
package.json
to include Radix UI's switch component.