Southclaws / storyden

With a fresh new take on traditional bulletin board forum software, Storyden is a modern, secure and extensible platform for building communities.
https://www.storyden.org/
Mozilla Public License 2.0
93 stars 11 forks source link

add tags to nodes and pages #259

Closed Southclaws closed 3 weeks ago

vercel[bot] commented 4 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **storyden** | ⬜️ Ignored ([Inspect](https://vercel.com/southclaws-projects/storyden/GjhQAq9EKDWzTrsVU5bctzdGqufu)) | [Visit Preview](https://storyden-git-rework-tags-southclaws-projects.vercel.app) | | Oct 25, 2024 5:43pm | | **storyden-homepage** | ⬜️ Ignored ([Inspect](https://vercel.com/southclaws-projects/storyden-homepage/B5jH8PWEhf6Y6YJC469yNcGLvC5R)) | [Visit Preview](https://storyden-homepage-git-rework-tags-southclaws-projects.vercel.app) | | Oct 25, 2024 5:43pm |
coderabbitai[bot] commented 4 weeks ago

[!CAUTION]

Review failed

The pull request is closed.

📝 Walkthrough
📝 Walkthrough ## Walkthrough The changes in this pull request encompass a significant overhaul of the tag management system across various components of the application. Key modifications include the introduction of new types and methods for handling tags, updates to existing structures to incorporate tags, and the removal of outdated tag-related functionalities. Notably, the `tag_ref` package has been introduced, which provides a structured approach to managing tags. Additionally, several interfaces and methods have been updated to reflect these changes, ensuring a consistent and improved tagging mechanism throughout the application. ## Changes | File Path | Change Summary | |------------------------------------------------------|----------------------------------------------------------------------------------------------------| | app/resources/collection/dto.go | Modified import statements for `post` and `profile` packages. | | app/resources/library/mapping.go | Added import for `tag_ref`, modified `NodeFromModel` to handle tags. | | app/resources/library/node.go | Added `Tags` field of type `tag_ref.Tags` to `Node` struct. | | app/resources/library/node_querier/node_querier.go | Updated `Get` method to include `WithTags()` in query builder. | | app/resources/library/node_writer/node_writer.go | Introduced `WithTagsAdd` and `WithTagsRemove` methods for tag management. | | app/resources/post/thread/db.go | Removed `tags` parameter from `Create` method, simplifying its logic. | | app/resources/post/thread/repo.go | Updated `Create` method signature, added `WithTagsAdd` and `WithTagsRemove`, removed `WithTags`. | | app/resources/post/thread/thread.go | Changed `Tags` field type from `[]string` to `tag_ref.Tags`. | | app/resources/profile/profile.go | Updated `Interests` field type from `[]*tag.Tag` to `[]*tag_ref.Tag`. | | app/resources/resources.go | Updated imports and function calls in `Build` function for tag handling. | | app/resources/seed/post.go | Modified `threads` function to pass `nil` for `Tags` during thread creation. | | app/resources/tag/db.go | Deleted file, removing tag database management functionality. | | app/resources/tag/dto.go | Deleted file, removing `Tag` struct definition. | | app/resources/tag/repo.go | Deleted file, removing `Repository` interface for tag management. | | app/resources/tag/tag.go | Introduced new `Tag` struct and `Map` function for tag handling. | | app/resources/tag/tag_querier/querier.go | Added `Querier` struct with methods for querying tags from the database. | | app/resources/tag/tag_ref/ref.go | Introduced `tag_ref` package with types and functions for tag management. | | app/resources/tag/tag_writer/writer.go | Added `Writer` struct for managing tag operations in the database. | | app/services/event/event_management/event.go | Modified `Create` and `Update` methods for enhanced event handling. | | app/services/library/node_mutate/node.go | Added support for tags in `Partial` struct and `Create`/`Update` methods. | | app/services/thread/create.go | Updated `Create` method to handle tags through `partial` object. | | app/services/thread/service.go | Updated `Service` interface and `Partial` struct for tag handling. | | app/services/thread/update.go | Enhanced `Update` method to manage tags associated with threads. | | app/transports/http/bindings/nodes.go | Updated `NodeCreate` and `NodeUpdate` methods to include `Tags` field in request bodies. | | app/transports/http/bindings/threads.go | Updated `ThreadCreate` and `ThreadUpdate` methods for tag handling. | | app/transports/http/bindings/utils.go | Added functions for serializing and deserializing tags. | | tests/library/node_tags/node_tags_test.go | Introduced unit tests for node tagging functionality. | | tests/thread/thread_tags/thread_tags_test.go | Introduced unit tests for thread tagging functionality. | | web/src/api/openapi-schema/index.ts | Added export for `tagNameList`. | | web/src/api/openapi-schema/nodeCommonProps.ts | Added `tags` property to `NodeCommonProps` interface. | | web/src/api/openapi-schema/nodeInitialProps.ts | Added optional `tags` property to `NodeInitialProps` interface. | | web/src/api/openapi-schema/nodeMutableProps.ts | Added optional `tags` property to `NodeMutableProps` interface. | | web/src/api/openapi-schema/tag.ts | Changed `colour` property in `Tag` interface from optional to required. | | web/src/api/openapi-schema/tagNameList.ts | Introduced new `tagNameList.ts` file with `TagNameList` type. | | web/src/api/openapi-schema/threadInitialProps.ts | Updated `tags` property type in `ThreadInitialProps` interface. | | web/src/api/openapi-schema/threadMutableProps.ts | Updated `tags` property type in `ThreadMutableProps` interface. | | web/src/api/openapi-schema/threadReferenceProps.ts | Changed `tags` property type in `ThreadReferenceProps` interface. | ## Poem > In the garden of code, where tags now bloom, > A rabbit hops lightly, dispelling all gloom. > With `tag_ref` in hand, we dance and we play, > Enhancing our threads in a bright, joyful way. > So gather 'round, friends, let’s celebrate this feat, > For tags make our stories and nodes oh-so-sweet! 🐇✨

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?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , 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 resolve` resolve all the CodeRabbit review comments. - `@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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.