Skip to content

Commit

Permalink
Merge pull request #1413 from makeplane/stage-release
Browse files Browse the repository at this point in the history
promote: stage-release to master
  • Loading branch information
vamsi authored Jun 28, 2023
2 parents dbbce43 + 379d258 commit 6394f51
Show file tree
Hide file tree
Showing 202 changed files with 9,103 additions and 3,741 deletions.
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ NEXT_PUBLIC_TRACK_EVENTS=0
NEXT_PUBLIC_SLACK_CLIENT_ID=""

# Backend
# Debug value for api server use it as 0 for production use
DEBUG=0

# Error logs
SENTRY_DSN=""

# Database Settings
PGUSER="plane"
PGPASSWORD="plane"
PGHOST="plane-db"
PGDATABASE="plane"
DATABASE_URL=postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}/${PGDATABASE}

# Redis Settings
REDIS_HOST="plane-redis"
REDIS_PORT="6379"
REDIS_URL="redis://${REDIS_HOST}:6379/"

# Email Settings
EMAIL_HOST=""
Expand All @@ -35,6 +46,7 @@ EMAIL_HOST_PASSWORD=""
EMAIL_PORT=587
EMAIL_FROM="Team Plane <[email protected]>"
EMAIL_USE_TLS="1"
EMAIL_USE_SSL="0"

# AWS Settings
AWS_REGION=""
Expand Down Expand Up @@ -65,4 +77,6 @@ NGINX_PORT=80
DEFAULT_EMAIL="[email protected]"
DEFAULT_PASSWORD="password123"

# SignUps
ENABLE_SIGNUP="1"
# Auto generated and Required that will be generated from setup.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ yarn-error.log*

## Django ##
venv
.venv
*.pyc
staticfiles
mediafiles
Expand Down
862 changes: 661 additions & 201 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ Our [Code of Conduct](https://github.com/makeplane/plane/blob/master/CODE_OF_CON

## ⛓️ Security

If you believe you have found a security vulnerability in Plane, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@plane.so to disclose any security vulnerabilities.
If you believe you have found a security vulnerability in Plane, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email engineering@plane.so to disclose any security vulnerabilities.
4 changes: 2 additions & 2 deletions apiserver/plane/api/permissions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .workspace import WorkSpaceBasePermission, WorkSpaceAdminPermission
from .project import ProjectBasePermission, ProjectEntityPermission, ProjectMemberPermission
from .workspace import WorkSpaceBasePermission, WorkSpaceAdminPermission, WorkspaceEntityPermission
from .project import ProjectBasePermission, ProjectEntityPermission, ProjectMemberPermission, ProjectLitePermission
13 changes: 13 additions & 0 deletions apiserver/plane/api/permissions/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,16 @@ def has_permission(self, request, view):
role__in=[Admin, Member],
project_id=view.project_id,
).exists()


class ProjectLitePermission(BasePermission):

def has_permission(self, request, view):
if request.user.is_anonymous:
return False

return ProjectMember.objects.filter(
workspace__slug=view.workspace_slug,
member=request.user,
project_id=view.project_id,
).exists()
12 changes: 10 additions & 2 deletions apiserver/plane/api/permissions/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from plane.db.models import WorkspaceMember



# Permission Mappings
Owner = 20
Admin = 15
Expand Down Expand Up @@ -44,7 +43,6 @@ def has_permission(self, request, view):

class WorkSpaceAdminPermission(BasePermission):
def has_permission(self, request, view):

if request.user.is_anonymous:
return False

Expand All @@ -53,3 +51,13 @@ def has_permission(self, request, view):
workspace__slug=view.workspace_slug,
role__in=[Owner, Admin],
).exists()


class WorkspaceEntityPermission(BasePermission):
def has_permission(self, request, view):
if request.user.is_anonymous:
return False

return WorkspaceMember.objects.filter(
member=request.user, workspace__slug=view.workspace_slug
).exists()
9 changes: 6 additions & 3 deletions apiserver/plane/api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
ProjectLiteSerializer,
)
from .state import StateSerializer, StateLiteSerializer
from .shortcut import ShortCutSerializer
from .view import IssueViewSerializer, IssueViewFavoriteSerializer
from .cycle import CycleSerializer, CycleIssueSerializer, CycleFavoriteSerializer
from .asset import FileAssetSerializer
from .issue import (
IssueCreateSerializer,
IssueActivitySerializer,
IssueCommentSerializer,
TimeLineIssueSerializer,
IssuePropertySerializer,
BlockerIssueSerializer,
BlockedIssueSerializer,
Expand Down Expand Up @@ -69,6 +67,11 @@

from .page import PageSerializer, PageBlockSerializer, PageFavoriteSerializer

from .estimate import EstimateSerializer, EstimatePointSerializer, EstimateReadSerializer
from .estimate import (
EstimateSerializer,
EstimatePointSerializer,
EstimateReadSerializer,
)

from .inbox import InboxSerializer, InboxIssueSerializer, IssueStateInboxSerializer
from .analytic import AnalyticViewSerializer
25 changes: 23 additions & 2 deletions apiserver/plane/api/serializers/cycle.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Django imports
from django.db.models.functions import TruncDate

# Third party imports
from rest_framework import serializers

Expand All @@ -20,13 +23,13 @@ class CycleSerializer(BaseSerializer):
unstarted_issues = serializers.IntegerField(read_only=True)
backlog_issues = serializers.IntegerField(read_only=True)
assignees = serializers.SerializerMethodField(read_only=True)
labels = serializers.SerializerMethodField(read_only=True)
total_estimates = serializers.IntegerField(read_only=True)
completed_estimates = serializers.IntegerField(read_only=True)
started_estimates = serializers.IntegerField(read_only=True)

workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace")
project_detail = ProjectLiteSerializer(read_only=True, source="project")

def get_assignees(self, obj):
members = [
{
Expand All @@ -44,6 +47,24 @@ def get_assignees(self, obj):
unique_list = [dict(item) for item in unique_objects]

return unique_list

def get_labels(self, obj):
labels = [
{
"name": label.name,
"color": label.color,
"id": label.id,
}
for issue_cycle in obj.issue_cycle.all()
for label in issue_cycle.issue.labels.all()
]
# Use a set comprehension to return only the unique objects
unique_objects = {frozenset(item.items()) for item in labels}

# Convert the set back to a list of dictionaries
unique_list = [dict(item) for item in unique_objects]

return unique_list

class Meta:
model = Cycle
Expand Down
58 changes: 58 additions & 0 deletions apiserver/plane/api/serializers/inbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Third party frameworks
from rest_framework import serializers

# Module imports
from .base import BaseSerializer
from .issue import IssueFlatSerializer, LabelLiteSerializer
from .project import ProjectLiteSerializer
from .state import StateLiteSerializer
from .project import ProjectLiteSerializer
from .user import UserLiteSerializer
from plane.db.models import Inbox, InboxIssue, Issue


class InboxSerializer(BaseSerializer):
project_detail = ProjectLiteSerializer(source="project", read_only=True)
pending_issue_count = serializers.IntegerField(read_only=True)

class Meta:
model = Inbox
fields = "__all__"
read_only_fields = [
"project",
"workspace",
]


class InboxIssueSerializer(BaseSerializer):
issue_detail = IssueFlatSerializer(source="issue", read_only=True)
project_detail = ProjectLiteSerializer(source="project", read_only=True)

class Meta:
model = InboxIssue
fields = "__all__"
read_only_fields = [
"project",
"workspace",
]


class InboxIssueLiteSerializer(BaseSerializer):
class Meta:
model = InboxIssue
fields = ["id", "status", "duplicate_to", "snoozed_till", "source"]
read_only_fields = fields


class IssueStateInboxSerializer(BaseSerializer):
state_detail = StateLiteSerializer(read_only=True, source="state")
project_detail = ProjectLiteSerializer(read_only=True, source="project")
label_details = LabelLiteSerializer(read_only=True, source="labels", many=True)
assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True)
sub_issues_count = serializers.IntegerField(read_only=True)
bridge_id = serializers.UUIDField(read_only=True)
issue_inbox = InboxIssueLiteSerializer(read_only=True, many=True)

class Meta:
model = Issue
fields = "__all__"
19 changes: 3 additions & 16 deletions apiserver/plane/api/serializers/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Issue,
IssueActivity,
IssueComment,
TimelineIssue,
IssueProperty,
IssueBlocker,
IssueAssignee,
Expand All @@ -41,6 +40,7 @@ class Meta:
"id",
"name",
"description",
"description_html",
"priority",
"start_date",
"target_date",
Expand Down Expand Up @@ -287,21 +287,6 @@ class Meta:
]


class TimeLineIssueSerializer(BaseSerializer):
class Meta:
model = TimelineIssue
fields = "__all__"
read_only_fields = [
"workspace",
"project",
"issue",
"created_by",
"updated_by",
"created_at",
"updated_at",
]


class IssuePropertySerializer(BaseSerializer):
class Meta:
model = IssueProperty
Expand Down Expand Up @@ -482,6 +467,8 @@ class IssueStateSerializer(BaseSerializer):
assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True)
sub_issues_count = serializers.IntegerField(read_only=True)
bridge_id = serializers.UUIDField(read_only=True)
attachment_count = serializers.IntegerField(read_only=True)
link_count = serializers.IntegerField(read_only=True)

class Meta:
model = Issue
Expand Down
1 change: 1 addition & 0 deletions apiserver/plane/api/serializers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ProjectDetailSerializer(BaseSerializer):
total_members = serializers.IntegerField(read_only=True)
total_cycles = serializers.IntegerField(read_only=True)
total_modules = serializers.IntegerField(read_only=True)
is_member = serializers.BooleanField(read_only=True)

class Meta:
model = Project
Expand Down
14 changes: 0 additions & 14 deletions apiserver/plane/api/serializers/shortcut.py

This file was deleted.

1 change: 1 addition & 0 deletions apiserver/plane/api/serializers/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class WorkSpaceSerializer(BaseSerializer):
owner = UserLiteSerializer(read_only=True)
total_members = serializers.IntegerField(read_only=True)
total_issues = serializers.IntegerField(read_only=True)

class Meta:
model = Workspace
Expand Down
Loading

1 comment on commit 6394f51

@vercel
Copy link

@vercel vercel bot commented on 6394f51 Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane – ./apps/app

plane-theta.vercel.app
plane-plane.vercel.app
app.plane.so
plane-git-master-plane.vercel.app

Please sign in to comment.