Feature/ Add "series" to link related articles
✨ Codu Pull Request 💻
Fixes #(issue) Fixes #1081
Pull Request details
- Added an extra input field in the more options section (While creating a new post) under the Canonical Url and Draft link
- Added a new table in the database called "series"
- Added a new field in the post table called seriesId referencing the id of the series table.
Cases considered
-
CREATE When the user creates a new record will be created in the series table
-
EDIT
- If the user adds a series name to a post which didn't have a series then a new record will be created
- If the user changes the series name to a new series name (which is not present in the db), then a new record will be created in the series table. (The previous series will be removed from the series table, if no other post has that series name to maintain consistency).
- If the user removes the series name then the seriesId in the post table will be set to null. (The previous series will be removed from the series table, if no other post has that series name to maintain consistency)
- DELETE If the user deletes the post which had a series name then the series will be removed from the series table, if no other post has that series.
Any Breaking changes
None
Associated Screenshots
WORKING GIF:
@RangerCreaky is attempting to deploy a commit to the Codú Team on Vercel.
A member of the Team first needs to authorize it.
[!IMPORTANT]
Review skipped
Review was skipped due to path filters
:no_entry: Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonCodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including
**/dist/**will override the default block on thedistdirectory, by removing the pattern from both the lists.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
Walkthrough
The changes in this pull request implement a new feature that allows users to link articles into a series. This includes adding a seriesName input field to the article creation form, updating the database schema to accommodate a new series table, and modifying the post management logic to handle the association between posts and series. The updates also ensure that the necessary validations are in place for the seriesName field and that existing functionalities remain intact.
Changes
| File Path | Change Summary |
|---|---|
| app/(editor)/create/[[...paramsArr]]/_client.tsx | Added a new input field for seriesName in the article creation form and updated getFormData and savePost functions to handle this new field. |
| schema/post.ts | Introduced a new optional field seriesName to SavePostSchema with validation rules. |
| server/api/router/post.ts | Enhanced postRouter to accept seriesName in the update mutation, modified delete mutation to handle series logic, and updated editDraft query to include series relationship. |
| server/db/schema.ts | Added a new series table with relevant fields and established a relationship with the post table through a new seriesId field. |
| drizzle/0000_initial_schema.sql | Updated SQL migration script to create the new Series table and add seriesId to the Post table with appropriate foreign key constraints. |
| drizzle/0011_add_series.sql | Introduced a new SQL script to create the Series table and modify the Post table, adding a foreign key constraint for seriesId. |
| server/api/router/index.ts | Minor modification in appRouter configuration related to tagRouter. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Allow users to group related articles into a series (#[1081]) | ✅ | |
| Add a series field to the article creation form and database (#[1081]) | ✅ | |
| Automatic Navigation for articles in a series (#[1081]) | ❌ | Navigation links are not implemented in this PR. |
| Indication of the article’s place within the series (#[1081]) | ❌ | No indication of article placement is included. |
Possibly related PRs
-
#1109: This PR updates the
Settingscomponent and includes enhancements to the email verification process, which may relate to user input handling and form management, similar to the changes made in the main PR regarding theCreatecomponent's form enhancements. -
#1153: This PR focuses on rendering articles accurately, which involves managing content and user input, paralleling the main PR's updates to the
Createcomponent that includes a new input field forseriesName. -
#1163: This PR introduces a new navigation system for the editor, which may interact with the
Createcomponent's functionality, especially in terms of user experience and form submission processes.
Suggested labels
hacktoberfest-accepted, hacktoberfest
Suggested reviewers
- NiallJoeMaher
Poem
In a garden of stories, we weave and we share,
A series of tales, with love and with care.
Each post a new chapter, linked hand in hand,
Together they flourish, a beautiful band.
So hop on this journey, let the stories flow,
With series to guide us, together we grow! 🐇✨
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?
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. (Beta) -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
@NiallJoeMaher can you please review, I have worked on the changes you mentioned previously.
@NiallJoeMaher Can you please check the reply and Please let me know if this approach works, or if there’s another way you'd like it handled!
@NiallJoeMaher Any update on this?
@NiallJoeMaher I have made the mentioned changes
@NiallJoeMaher any update on this?
@NiallJoeMaher any update on this?
hey @RangerCreaky sorry we've been busy, I'm taking a look at this
Hey @CarolinaCobo no problem.
@NiallJoeMaher, I will work on these changes Let me know if there are any more changes needed to be done
@NiallJoeMaher I have made the changes, please review
@NiallJoeMaher any update on this?
@RangerCreaky Hi Ranger Niall is actually on holidays at the moment.
@John-Paul-Larkin Oh okay,