Skip to content
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

style: plane deploy #2039

Merged
merged 34 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8581226
chore: improve access field for comments for public boards (#1956)
pablohashescobar Aug 29, 2023
3a41ec7
chore: update user activity endpoint to return only workspace activit…
pablohashescobar Aug 29, 2023
abcdebe
fix: n+1 in issue history and issue automation tasks (#1994)
pablohashescobar Aug 29, 2023
e1ad385
fix: issue exports in self hosted instances (#1996)
pablohashescobar Aug 29, 2023
5ad5da4
dev: remove gunicorn config (#1999)
pablohashescobar Aug 29, 2023
91c1093
feat: mark all read notifications (#1963)
NarayanBavisetti Aug 29, 2023
1d30a9a
chore: project public board issue retrieve (#2003)
pablohashescobar Aug 29, 2023
1cf5e8d
fix: only external comments will show in deploy boards (#2010)
NarayanBavisetti Aug 29, 2023
b2a41d3
fix: issue votes (#2006)
NarayanBavisetti Aug 29, 2023
90cf39c
fix: access creation in comments (#2013)
pablohashescobar Aug 29, 2023
38a5623
dev: user timezone select option (#2002)
aaryan610 Aug 29, 2023
fd0efb0
fix: start date filter not working on the platform (#2007)
aaryan610 Aug 29, 2023
d8bbdc1
feat: access selector for comment (#2012)
aaryan610 Aug 29, 2023
168e79d
style: revamp of the issue details sidebar (#2014)
aaryan610 Aug 29, 2023
2e5ade0
chore: update module status icons and colors (#2011)
aaryan610 Aug 30, 2023
23f5d5d
chore: track public board comments and reaction users for public depl…
pablohashescobar Aug 30, 2023
426f658
feat: user timezones (#2009)
pablohashescobar Aug 30, 2023
761a1eb
fix: user created by stats (#2016)
pablohashescobar Aug 30, 2023
17aff1f
fix: asset key validation (#1938)
NarayanBavisetti Aug 30, 2023
f5a076e
dev: revamp peek overview (#2021)
aaryan610 Aug 30, 2023
6c6b81b
chore: tracking the history of issue reactions and votes. (#2020)
NarayanBavisetti Aug 30, 2023
54527cc
dev: revamp publish project modal (#2022)
aaryan610 Aug 30, 2023
5e00ffe
fix: bugs on the user profile page (#2018)
aaryan610 Aug 30, 2023
320608e
chore: return issue votes in public issue list endpoint (#2026)
pablohashescobar Aug 31, 2023
271cf12
style: list view
aaryan610 Aug 31, 2023
38b7f43
[feat]: Tiptap table integration (#2008)
Palanikannan1437 Aug 31, 2023
ea766b1
style: kanban view
aaryan610 Aug 31, 2023
af929ab
style: tiptap table (#2033)
aaryan610 Aug 31, 2023
51a6acd
fix: merge conflicts
aaryan610 Aug 31, 2023
9a4f17a
fix: merge conflicts
aaryan610 Aug 31, 2023
5bdadb1
fix: peek overview
aaryan610 Aug 31, 2023
6961df6
Merge branch 'feat/deploy-pages' of https://github.com/makeplane/plan…
aaryan610 Aug 31, 2023
298a6eb
style: theming added
aaryan610 Aug 31, 2023
323be47
chore: issue reactions and votes
aaryan610 Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apiserver/Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: gunicorn -w 4 -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:$PORT --config gunicorn.config.py --max-requests 10000 --max-requests-jitter 1000 --access-logfile -
web: gunicorn -w 4 -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:$PORT --max-requests 10000 --max-requests-jitter 1000 --access-logfile -
worker: celery -A plane worker -l info
beat: celery -A plane beat -l INFO
2 changes: 2 additions & 0 deletions apiserver/plane/api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ProjectMemberLiteSerializer,
ProjectDeployBoardSerializer,
ProjectMemberAdminSerializer,
ProjectPublicMemberSerializer
)
from .state import StateSerializer, StateLiteSerializer
from .view import IssueViewSerializer, IssueViewFavoriteSerializer
Expand All @@ -44,6 +45,7 @@
IssueReactionSerializer,
CommentReactionSerializer,
IssueVoteSerializer,
IssuePublicSerializer,
)

from .module import (
Expand Down
37 changes: 32 additions & 5 deletions apiserver/plane/api/serializers/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ class Meta:
]

def validate(self, data):
if data.get("start_date", None) is not None and data.get("target_date", None) is not None and data.get("start_date", None) > data.get("target_date", None):
if (
data.get("start_date", None) is not None
and data.get("target_date", None) is not None
and data.get("start_date", None) > data.get("target_date", None)
):
raise serializers.ValidationError("Start date cannot exceed target date")
return data

Expand Down Expand Up @@ -554,9 +558,7 @@ class Meta:
read_only_fields = ["workspace", "project", "comment", "actor"]



class IssueVoteSerializer(BaseSerializer):

class Meta:
model = IssueVote
fields = ["issue", "vote", "workspace_id", "project_id", "actor"]
Expand All @@ -569,7 +571,7 @@ class IssueCommentSerializer(BaseSerializer):
project_detail = ProjectLiteSerializer(read_only=True, source="project")
workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace")
comment_reactions = CommentReactionLiteSerializer(read_only=True, many=True)

is_member = serializers.BooleanField(read_only=True)

class Meta:
model = IssueComment
Expand All @@ -582,7 +584,6 @@ class Meta:
"updated_by",
"created_at",
"updated_at",
"access",
]


Expand Down Expand Up @@ -676,6 +677,32 @@ class Meta:
]


class IssuePublicSerializer(BaseSerializer):
project_detail = ProjectLiteSerializer(read_only=True, source="project")
state_detail = StateLiteSerializer(read_only=True, source="state")
issue_reactions = IssueReactionLiteSerializer(read_only=True, many=True)
votes = IssueVoteSerializer(read_only=True, many=True)

class Meta:
model = Issue
fields = [
"id",
"name",
"description_html",
"sequence_id",
"state",
"state_detail",
"project",
"project_detail",
"workspace",
"priority",
"target_date",
"issue_reactions",
"votes",
]
read_only_fields = fields


class IssueSubscriberSerializer(BaseSerializer):
class Meta:
model = IssueSubscriber
Expand Down
15 changes: 14 additions & 1 deletion apiserver/plane/api/serializers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ProjectIdentifier,
ProjectFavorite,
ProjectDeployBoard,
ProjectPublicMember,
)


Expand Down Expand Up @@ -177,5 +178,17 @@ class Meta:
fields = "__all__"
read_only_fields = [
"workspace",
"project" "anchor",
"project", "anchor",
]


class ProjectPublicMemberSerializer(BaseSerializer):

class Meta:
model = ProjectPublicMember
fields = "__all__"
read_only_fields = [
"workspace",
"project",
"member",
]
22 changes: 19 additions & 3 deletions apiserver/plane/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,18 @@
# Notification
NotificationViewSet,
UnreadNotificationEndpoint,
MarkAllReadNotificationViewSet,
## End Notification
# Public Boards
ProjectDeployBoardViewSet,
ProjectDeployBoardIssuesPublicEndpoint,
ProjectIssuesPublicEndpoint,
ProjectDeployBoardPublicSettingsEndpoint,
IssueReactionPublicViewSet,
CommentReactionPublicViewSet,
InboxIssuePublicViewSet,
IssueVotePublicViewSet,
WorkspaceProjectDeployBoardEndpoint,
IssueRetrievePublicEndpoint,
## End Public Boards
## Exporter
ExportIssuesEndpoint,
Expand Down Expand Up @@ -235,7 +237,7 @@
UpdateUserTourCompletedEndpoint.as_view(),
name="user-tour",
),
path("users/activities/", UserActivityEndpoint.as_view(), name="user-activities"),
path("users/workspaces/<str:slug>/activities/", UserActivityEndpoint.as_view(), name="user-activities"),
# user workspaces
path(
"users/me/workspaces/",
Expand Down Expand Up @@ -1494,6 +1496,15 @@
UnreadNotificationEndpoint.as_view(),
name="unread-notifications",
),
path(
"workspaces/<str:slug>/users/notifications/mark-all-read/",
MarkAllReadNotificationViewSet.as_view(
{
"post": "create",
}
),
name="mark-all-read-notifications",
),
## End Notification
# Public Boards
path(
Expand Down Expand Up @@ -1524,9 +1535,14 @@
),
path(
"public/workspaces/<str:slug>/project-boards/<uuid:project_id>/issues/",
ProjectDeployBoardIssuesPublicEndpoint.as_view(),
ProjectIssuesPublicEndpoint.as_view(),
name="project-deploy-board",
),
path(
"public/workspaces/<str:slug>/project-boards/<uuid:project_id>/issues/<uuid:issue_id>/",
IssueRetrievePublicEndpoint.as_view(),
name="workspace-project-boards",
),
path(
"public/workspaces/<str:slug>/project-boards/<uuid:project_id>/issues/<uuid:issue_id>/comments/",
IssueCommentPublicViewSet.as_view(
Expand Down
5 changes: 3 additions & 2 deletions apiserver/plane/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
ProjectUserViewsEndpoint,
ProjectMemberUserEndpoint,
ProjectFavoritesViewSet,
ProjectDeployBoardIssuesPublicEndpoint,
ProjectDeployBoardViewSet,
ProjectDeployBoardPublicSettingsEndpoint,
ProjectMemberEndpoint,
Expand Down Expand Up @@ -85,6 +84,8 @@
IssueReactionPublicViewSet,
CommentReactionPublicViewSet,
IssueVotePublicViewSet,
IssueRetrievePublicEndpoint,
ProjectIssuesPublicEndpoint,
)

from .auth_extended import (
Expand Down Expand Up @@ -162,7 +163,7 @@
DefaultAnalyticsEndpoint,
)

from .notification import NotificationViewSet, UnreadNotificationEndpoint
from .notification import NotificationViewSet, UnreadNotificationEndpoint, MarkAllReadNotificationViewSet

from .exporter import (
ExportIssuesEndpoint,
Expand Down
32 changes: 24 additions & 8 deletions apiserver/plane/api/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ class FileAssetEndpoint(BaseAPIView):
"""

def get(self, request, workspace_id, asset_key):
asset_key = str(workspace_id) + "/" + asset_key
files = FileAsset.objects.filter(asset=asset_key)
serializer = FileAssetSerializer(files, context={"request": request}, many=True)
return Response(serializer.data)
try:
asset_key = str(workspace_id) + "/" + asset_key
files = FileAsset.objects.filter(asset=asset_key)
if files.exists():
serializer = FileAssetSerializer(files, context={"request": request}, many=True)
return Response({"data": serializer.data, "status": True}, status=status.HTTP_200_OK)
else:
return Response({"error": "Asset key does not exist", "status": False}, status=status.HTTP_200_OK)
except Exception as e:
capture_exception(e)
return Response(
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)


def post(self, request, slug):
try:
Expand Down Expand Up @@ -68,11 +79,16 @@ class UserAssetsEndpoint(BaseAPIView):
def get(self, request, asset_key):
try:
files = FileAsset.objects.filter(asset=asset_key, created_by=request.user)
serializer = FileAssetSerializer(files, context={"request": request})
return Response(serializer.data)
except FileAsset.DoesNotExist:
if files.exists():
serializer = FileAssetSerializer(files, context={"request": request})
return Response({"data": serializer.data, "status": True}, status=status.HTTP_200_OK)
else:
return Response({"error": "Asset key does not exist", "status": False}, status=status.HTTP_200_OK)
except Exception as e:
capture_exception(e)
return Response(
{"error": "File Asset does not exist"}, status=status.HTTP_404_NOT_FOUND
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)

def post(self, request):
Expand Down
27 changes: 22 additions & 5 deletions apiserver/plane/api/views/base.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
# Python imports
import zoneinfo

# Django imports
from django.urls import resolve
from django.conf import settings

from django.utils import timezone
# Third part imports

from rest_framework import status
from rest_framework.viewsets import ModelViewSet
from rest_framework.exceptions import APIException
from rest_framework.views import APIView
from rest_framework.filters import SearchFilter
from rest_framework.permissions import IsAuthenticated
from rest_framework.exceptions import NotFound
from sentry_sdk import capture_exception
from django_filters.rest_framework import DjangoFilterBackend

# Module imports
from plane.db.models import Workspace, Project
from plane.utils.paginator import BasePaginator


class BaseViewSet(ModelViewSet, BasePaginator):
class TimezoneMixin:
"""
This enables timezone conversion according
to the user set timezone
"""
def initial(self, request, *args, **kwargs):
super().initial(request, *args, **kwargs)
if request.user.is_authenticated:
timezone.activate(zoneinfo.ZoneInfo(request.user.user_timezone))
else:
timezone.deactivate()




class BaseViewSet(TimezoneMixin, ModelViewSet, BasePaginator):

model = None

Expand Down Expand Up @@ -67,7 +84,7 @@ def project_id(self):
return self.kwargs.get("pk", None)


class BaseAPIView(APIView, BasePaginator):
class BaseAPIView(TimezoneMixin, APIView, BasePaginator):

permission_classes = [
IsAuthenticated,
Expand Down
Loading
Loading