-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: quick links CRUD #6286
base: preview
Are you sure you want to change the base?
feat: quick links CRUD #6286
Conversation
sangeetha seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
WalkthroughThis pull request introduces a new feature for managing quick links within workspaces. The implementation spans multiple files, adding a new serializer for Changes
Sequence DiagramsequenceDiagram
participant Client
participant QuickLinkViewSet
participant WorkspaceUserLinkSerializer
participant Database
Client->>QuickLinkViewSet: POST /workspaces/{slug}/quick-link/
QuickLinkViewSet->>WorkspaceUserLinkSerializer: Validate data
WorkspaceUserLinkSerializer-->>QuickLinkViewSet: Validation result
QuickLinkViewSet->>Database: Save new quick link
Database-->>QuickLinkViewSet: Saved link
QuickLinkViewSet-->>Client: 201 Created
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
apiserver/plane/app/views/workspace/quick_link.py (1)
29-29
: Shorten line length.A static analysis tool indicates line length exceeds 88 characters. Consider breaking it into multiple lines or using local variables to make it more readable and comply with style guides.
- serializer = WorkspaceUserLinkSerializer(quick_link, data=request.data, partial=True) + serializer = WorkspaceUserLinkSerializer( + quick_link, data=request.data, partial=True + )🧰 Tools
🪛 Ruff (0.8.2)
29-29: Line too long (93 > 88)
(E501)
apiserver/plane/app/urls/workspace.py (2)
217-218
: Use a more descriptive comment.While "quick link" is clear, it can be more descriptive for future maintainers, e.g., "# Endpoints for managing quick links within a workspace".
219-223
: Remove trailing space fromname="workspace-quick-links "
string.There is a trailing space in the
name
argument's string literal, which can accidentally cause inconsistencies when referencing this path name in other parts of the code.- name="workspace-quick-links " + name="workspace-quick-links"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apiserver/plane/app/serializers/__init__.py
(1 hunks)apiserver/plane/app/serializers/workspace.py
(2 hunks)apiserver/plane/app/urls/workspace.py
(2 hunks)apiserver/plane/app/views/__init__.py
(1 hunks)apiserver/plane/app/views/workspace/quick_link.py
(1 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
apiserver/plane/app/views/workspace/quick_link.py
29-29: Line too long (93 > 88)
(E501)
🔇 Additional comments (4)
apiserver/plane/app/serializers/workspace.py (1)
110-114
: Serializer fields look consistent.
The WorkspaceUserLinkSerializer
includes fields = "__all__"
, but marks workspace
and owner
as read-only. This is consistent with many usage patterns to avoid accidental overrides. No issues found here.
apiserver/plane/app/serializers/__init__.py (1)
22-22
: LGTM.
Importing WorkspaceUserLinkSerializer
here neatly centralizes your exports. No changes needed.
apiserver/plane/app/views/__init__.py (1)
75-75
: Approved import addition.
Adding QuickLinkViewSet
is consistent with the new feature. This arrangement keeps workspace-related views logically grouped.
apiserver/plane/app/urls/workspace.py (1)
224-228
: Verify whether a GET endpoint is needed to retrieve a single quick link.
Currently, only patch
and delete
are exposed for single quick links. If retrieving an individual quick link by ID is desired, consider adding a retrieve
action. Otherwise, confirm that you do not need to retrieve a single quick link in your use case.
✅ Verification successful
Let me gather more information about the quick link functionality to better understand the use case.
Let me try a different approach to understand the quick link functionality better.
A GET endpoint for single quick link retrieval is not necessary
Based on the codebase analysis:
- The workspace quick links are simple entities with basic fields (title, url, metadata)
- All quick links for a workspace can be retrieved using the list endpoint (
GET /workspaces/<slug>/quick-links/
) - The current CRUD operations (list all, create, update, delete) are sufficient for the use case
- There's no evidence of a need for individual quick link retrieval in the frontend code
Since quick links are lightweight resources and can be efficiently retrieved through the list endpoint, adding a separate retrieve endpoint would be unnecessary complexity.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify usage of QuickLinkViewSet across the codebase to confirm if GET retrieval by pk is needed.
rg -A 5 --heading $'QuickLinkViewSet'
Length of output: 853
Script:
#!/bin/bash
# Check the model and serializer implementation
ast-grep --pattern 'class WorkspaceUserLink'
# Check frontend API calls
rg -g '*.{ts,tsx}' 'quick-link.*pk'
Length of output: 84
Script:
#!/bin/bash
# Check the model definition
rg -A 10 "class WorkspaceUserLink"
# Check frontend API calls related to quick links
rg -g '*.{ts,tsx}' -A 5 "quick-link"
# Check serializer implementation
rg -A 10 "class WorkspaceUserLinkSerializer"
Length of output: 1718
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
New Features
Bug Fixes
Documentation