Skip to content

Conversation

antony-lambdacurry
Copy link
Collaborator

No description provided.

Copy link

coderabbitai bot commented Mar 4, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

…5-migrate-core-page-builder-models-to-medusa-v2
Comment on lines 12 to 14
<Shell leftSidebar={<EditorSidebar />} rightSidebar={<PostSettingsSidebar />}>
{children}
</Shell>

Choose a reason for hiding this comment

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

Why do these need to be passed in here? Just include them in the Shell?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking it could be reused, but maybe I should just do as you suggested for now.

…5-migrate-core-page-builder-models-to-medusa-v2
- Posts Data Table
- Single Column Layout
- Header, ActionMenu, etc
…nents

- Remove CreatePostButton component and replace with simple Create button
- Add comprehensive PostsDataTable with filtering, sorting, and mock data
- Streamline content page layout and navigation
…n types

- Rename model exports to include 'Model' suffix for clarity (e.g., Post to PostModel).
- Introduce common types for post-related entities in a new common.ts file.
- Update references in the PageBuilderService and model files to use the new names.
- Introduce pageBuilderModuleEvents with a POST_CREATED event for better event handling.
- Ensure PageBuilderService is imported for module functionality.
- Change handle column to be nullable in the PostModel.
- Add migration to alter handle column type and drop not null constraint.
- Update snapshot to reflect changes in the database schema.
- Add types for post creation in mutations.ts.
- Create createPostWorkflow to handle post creation logic.
- Implement createPostStep for managing post creation and deletion.
- Export common types and mutations from index.ts for better modularity.
- Implement middlewares for creating and listing posts in the admin section.
- Define schemas for post creation and query validation using Zod.
- Create route handlers for GET and POST requests to manage posts.
- Remove obsolete admin pages route file.
- Introduce ExtendedMedusaSDK to encapsulate admin and store resources.
- Create AdminPageBuilderResource for managing admin post operations.
- Implement ExtendedAdmin and ExtendedStore classes to extend Medusa functionality.
- Define types for admin page builder operations in types.ts.
- Establish StorePageBuilderResource for future store-related functionalities.
- Create sdk.ts to initialize ExtendedMedusaSDK with backend URL configuration.
… in Header

- Update Header component to use Fragment for better key management in action mapping.
- Ensure consistent usage of React components for improved readability.
- Add useAdminCreatePost hook for creating posts with mutation handling.
- Introduce useAdminListPosts and useAdminFetchPost hooks for fetching posts and individual post details.
- Update ContentPage to utilize the new post creation hook and manage loading state.
- Refactor PostsDataTable to use the new admin hooks for data fetching and filtering.
- Enhance type definitions for better clarity and consistency across components.
- Add POST_UPDATED event to pageBuilderModuleEvents for handling post updates.
- Introduce UpdatePostStepInput and UpdatePostWorkflowInput types for post update operations.
- Create updatePostWorkflow to manage the update process and emit events.
- Implement updatePostStep for updating posts with rollback functionality.
- Introduce updatePostSchema for validating post updates.
- Create UpdatePostDTO type for structured update requests.
- Implement PUT route handler for updating posts using the new updatePostWorkflow.
- Enhance admin post middlewares to include update functionality.
- Introduce deletePostWorkflow and deletePostStep for handling post deletions.
- Add DELETE route handler for removing posts by ID.
- Implement validation schemas for post creation, update, and deletion.
- Refactor middlewares to include new admin post item routes.
- Update pageBuilderModuleEvents to include POST_DELETED event for better event handling.
- Introduce updatePost method for modifying existing posts.
- Implement deletePost method for removing posts by ID.
- Update type definitions to include AdminPageBuilderUpdatePostBody and AdminPageBuilderDeletePostResponse.
- Refactor types to enhance clarity and maintainability.
- Implement useAdminUpdatePost and useAdminDeletePost hooks for managing post updates and deletions.
- Update PostsDataTable to utilize the new delete functionality with toast notifications.
- Refactor usePostsDataTableColumns to support updated action handlers for editing, duplicating, and deleting posts.
- Remove obsolete use-posts-data-table-columns file for cleaner codebase.
- Add duplicatePostWorkflow to handle the duplication of posts.
- Create duplicatePostStep for generating a new post based on an existing one.
- Implement duplicatePostRelationsStep to manage the relations of the duplicated post.
- Ensure proper handling of sections, featured images, authors, and tags during duplication.
- Introduce DuplicatePostStepInput and DuplicatePostWorkflowInput types for handling post duplication.
- Implement AdminPageBuilderDuplicatePostResponse type for response structure.
- Add duplicatePost method in AdminPageBuilderResource to facilitate post duplication via API.
- Implement POST route handler in route.ts to facilitate post duplication.
- Utilize duplicatePostWorkflow to process duplication requests and return the duplicated post.
…able

- Implement useAdminDuplicatePost hook for duplicating posts.
- Update PostsDataTable to include duplication action with toast notifications.
- Refactor usePostsDataTableColumns to support duplicate action in column definitions.
…ataTable

- Add useQueryParams hook for managing query parameters in URL.
- Refactor PostsDataTable to utilize usePostTableQuery for handling pagination, filtering, and sorting.
- Simplify state management by integrating query parameters into the data table logic.
…nfiguration

- Create package.json for page-builder-types with dependencies and configuration.
- Add .gitignore to exclude node_modules.
- Define type declarations for posts, storefronts, and common types in TypeScript.
- Implement interfaces for paginated responses, post creation, updating, and deletion.
- Establish foundational types for post management in the page builder.
- Bump version to 0.0.6-beta.3 in package.json.
- Add AdminPageBuilderResource for managing posts in the admin interface.
- Introduce StorePageBuilderResource for storefront integration.
- Extend ExtendedAdminSDK and ExtendedStorefrontSDK to include page builder resources.
- Update dependencies to @medusajs/types and @medusajs/js-sdk version 2.6.1.
- Update post-related types and workflows to utilize new enum values for post statuses, types, and content modes.
- Refactor validations and routes to use updated type imports from @lambdacurry/medusa-page-builder-types.
- Remove deprecated common types and SDK files to streamline the codebase.
- Bump dependencies in package.json to version 2.6.1 for various Medusa packages.
- Introduce new enum-values module for better organization of post-related constants.
- Replace ExtendedMedusaSDK with MedusaPluginsSDK for improved integration.
- Update type imports to use @lambdacurry/medusa-page-builder-types across various hooks and components.
- Refactor PostsDataTable and related query hooks to streamline data handling and enhance type safety.
…age-builder-models-to-medusa-v2

feat(page-builder): add core models/links/services/module
…t-implementation

Post Management implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants