-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-2937] feat: home recent activies list endpoint #6295
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2c4541f
Crud for wuick links
sangeethailango 274612c
Validate quick link existence
sangeethailango ecfbec8
Add custom method for destroy and retrieve
sangeethailango a6a0da0
Add List method
sangeethailango 749f1ee
Remove print statements
sangeethailango 0eee395
List all the workspace quick links
sangeethailango bf36eb0
feat: endpoint to get recently active items
sangeethailango ac20cc4
Merge branch 'preview' into feat-home-recents
sangeethailango 3c5c892
Resolve conflicts
sangeethailango 8a58ec6
Resolve conflicts
sangeethailango 40a18f7
Merge branch 'feat-home-recents' of github.com:makeplane/plane into f…
sangeethailango 6fbb36c
Add filter to only list required entities
sangeethailango 3f70338
Return required fields
sangeethailango bd2b140
Add filter
sangeethailango 80e21ea
Add filter
sangeethailango 53d521f
Merge branch 'feat-home-recents' of github.com:makeplane/plane into f…
sangeethailango c42d234
Merge branch 'feat-home-recents' of github.com:makeplane/plane into f…
sangeethailango 9ebd6f8
Merge branch 'feat-home-recents' of github.com:makeplane/plane into f…
sangeethailango File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Third party imports | ||
| from rest_framework import status | ||
| from rest_framework.response import Response | ||
|
|
||
| from plane.db.models import UserRecentVisit | ||
| from plane.app.serializers import WorkspaceRecentVisitSerializer | ||
|
|
||
| # Modules imports | ||
| from ..base import BaseViewSet | ||
| from plane.app.permissions import allow_permission, ROLE | ||
|
|
||
| class UserRecentVisitViewSet(BaseViewSet): | ||
| model = UserRecentVisit | ||
|
|
||
| def get_serializer_class(self): | ||
| return WorkspaceRecentVisitSerializer | ||
|
|
||
| @allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST], level="WORKSPACE") | ||
| def list(self, request, slug): | ||
| user_recent_visits = UserRecentVisit.objects.filter(workspace__slug=slug) | ||
sangeethailango marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| entity_name = request.query_params.get("entity_name") | ||
|
|
||
| if entity_name: | ||
| user_recent_visits = user_recent_visits.filter(entity_name=entity_name) | ||
|
|
||
| user_recent_visits = user_recent_visits.filter(entity_name__in=["issue","page","project"]) | ||
|
|
||
| serializer = WorkspaceRecentVisitSerializer(user_recent_visits[:20], many=True) | ||
| return Response(serializer.data, status=status.HTTP_200_OK) | ||
sangeethailango marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.