2022-11-29 21:17:42 +00:00
|
|
|
# Python imports
|
|
|
|
import jwt
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
# Django imports
|
|
|
|
from django.core.exceptions import ValidationError
|
|
|
|
from django.db import IntegrityError
|
2023-05-15 14:07:17 +00:00
|
|
|
from django.db.models import Q, Exists, OuterRef, Func, F
|
2022-11-29 21:17:42 +00:00
|
|
|
from django.core.validators import validate_email
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
# Third Party imports
|
|
|
|
from rest_framework.response import Response
|
|
|
|
from rest_framework import status
|
|
|
|
from rest_framework import serializers
|
|
|
|
from sentry_sdk import capture_exception
|
|
|
|
|
|
|
|
# Module imports
|
|
|
|
from .base import BaseViewSet, BaseAPIView
|
|
|
|
from plane.api.serializers import (
|
|
|
|
ProjectSerializer,
|
|
|
|
ProjectMemberSerializer,
|
|
|
|
ProjectDetailSerializer,
|
|
|
|
ProjectMemberInviteSerializer,
|
2023-03-06 13:27:07 +00:00
|
|
|
ProjectFavoriteSerializer,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
from plane.api.permissions import ProjectBasePermission
|
|
|
|
|
|
|
|
from plane.db.models import (
|
|
|
|
Project,
|
|
|
|
ProjectMember,
|
|
|
|
Workspace,
|
|
|
|
ProjectMemberInvite,
|
|
|
|
User,
|
|
|
|
WorkspaceMember,
|
|
|
|
State,
|
|
|
|
TeamMember,
|
2023-03-06 13:27:07 +00:00
|
|
|
ProjectFavorite,
|
2022-11-29 21:17:42 +00:00
|
|
|
ProjectIdentifier,
|
2023-05-15 14:07:17 +00:00
|
|
|
Module,
|
2023-05-25 06:55:15 +00:00
|
|
|
Cycle,
|
|
|
|
CycleFavorite,
|
|
|
|
ModuleFavorite,
|
|
|
|
PageFavorite,
|
|
|
|
IssueViewFavorite,
|
|
|
|
Page,
|
|
|
|
IssueAssignee,
|
|
|
|
ModuleMember
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
2023-05-25 06:55:15 +00:00
|
|
|
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
from plane.bgtasks.project_invitation_task import project_invitation
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectViewSet(BaseViewSet):
|
|
|
|
serializer_class = ProjectSerializer
|
|
|
|
model = Project
|
|
|
|
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
def get_serializer_class(self, *args, **kwargs):
|
|
|
|
if self.action == "update" or self.action == "partial_update":
|
|
|
|
return ProjectSerializer
|
|
|
|
return ProjectDetailSerializer
|
|
|
|
|
|
|
|
def get_queryset(self):
|
2023-03-15 17:51:23 +00:00
|
|
|
subquery = ProjectFavorite.objects.filter(
|
|
|
|
user=self.request.user,
|
|
|
|
project_id=OuterRef("pk"),
|
|
|
|
workspace__slug=self.kwargs.get("slug"),
|
|
|
|
)
|
2022-11-29 21:17:42 +00:00
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.filter(workspace__slug=self.kwargs.get("slug"))
|
|
|
|
.filter(Q(project_projectmember__member=self.request.user) | Q(network=2))
|
2023-01-16 20:20:27 +00:00
|
|
|
.select_related(
|
|
|
|
"workspace", "workspace__owner", "default_assignee", "project_lead"
|
|
|
|
)
|
2023-03-15 17:51:23 +00:00
|
|
|
.annotate(is_favorite=Exists(subquery))
|
2022-11-29 21:17:42 +00:00
|
|
|
.distinct()
|
|
|
|
)
|
|
|
|
|
2023-03-15 17:54:26 +00:00
|
|
|
def list(self, request, slug):
|
|
|
|
try:
|
|
|
|
subquery = ProjectFavorite.objects.filter(
|
|
|
|
user=self.request.user,
|
|
|
|
project_id=OuterRef("pk"),
|
|
|
|
workspace__slug=self.kwargs.get("slug"),
|
|
|
|
)
|
|
|
|
projects = (
|
|
|
|
self.get_queryset()
|
|
|
|
.annotate(is_favorite=Exists(subquery))
|
2023-03-30 11:03:16 +00:00
|
|
|
.order_by("-is_favorite", "name")
|
2023-05-15 14:07:17 +00:00
|
|
|
.annotate(
|
|
|
|
total_members=ProjectMember.objects.filter(
|
|
|
|
project_id=OuterRef("id")
|
|
|
|
)
|
|
|
|
.order_by()
|
|
|
|
.annotate(count=Func(F("id"), function="Count"))
|
|
|
|
.values("count")
|
|
|
|
)
|
|
|
|
.annotate(
|
2023-05-25 06:57:04 +00:00
|
|
|
total_cycles=Cycle.objects.filter(
|
|
|
|
project_id=OuterRef("id"))
|
2023-05-15 14:07:17 +00:00
|
|
|
.order_by()
|
|
|
|
.annotate(count=Func(F("id"), function="Count"))
|
|
|
|
.values("count")
|
|
|
|
)
|
|
|
|
.annotate(
|
2023-05-25 06:57:04 +00:00
|
|
|
total_modules=Module.objects.filter(
|
|
|
|
project_id=OuterRef("id"))
|
2023-05-15 14:07:17 +00:00
|
|
|
.order_by()
|
|
|
|
.annotate(count=Func(F("id"), function="Count"))
|
|
|
|
.values("count")
|
|
|
|
)
|
2023-03-15 17:54:26 +00:00
|
|
|
)
|
|
|
|
return Response(ProjectDetailSerializer(projects, many=True).data)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
def create(self, request, slug):
|
|
|
|
try:
|
|
|
|
workspace = Workspace.objects.get(slug=slug)
|
|
|
|
|
|
|
|
serializer = ProjectSerializer(
|
|
|
|
data={**request.data}, context={"workspace_id": workspace.id}
|
|
|
|
)
|
|
|
|
if serializer.is_valid():
|
|
|
|
serializer.save()
|
|
|
|
|
2023-05-25 06:57:04 +00:00
|
|
|
# Add the user as Administrator to the project
|
2022-11-29 21:17:42 +00:00
|
|
|
ProjectMember.objects.create(
|
|
|
|
project_id=serializer.data["id"], member=request.user, role=20
|
|
|
|
)
|
|
|
|
|
2023-05-25 06:57:04 +00:00
|
|
|
# Default states
|
2022-11-29 21:17:42 +00:00
|
|
|
states = [
|
2022-12-13 17:52:34 +00:00
|
|
|
{
|
|
|
|
"name": "Backlog",
|
|
|
|
"color": "#5e6ad2",
|
|
|
|
"sequence": 15000,
|
|
|
|
"group": "backlog",
|
2023-02-13 19:42:32 +00:00
|
|
|
"default": True,
|
2022-12-13 17:52:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Todo",
|
|
|
|
"color": "#eb5757",
|
|
|
|
"sequence": 25000,
|
|
|
|
"group": "unstarted",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "In Progress",
|
|
|
|
"color": "#26b5ce",
|
|
|
|
"sequence": 35000,
|
|
|
|
"group": "started",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Done",
|
|
|
|
"color": "#f2c94c",
|
|
|
|
"sequence": 45000,
|
|
|
|
"group": "completed",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Cancelled",
|
|
|
|
"color": "#4cb782",
|
|
|
|
"sequence": 55000,
|
|
|
|
"group": "cancelled",
|
|
|
|
},
|
2022-11-29 21:17:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
State.objects.bulk_create(
|
|
|
|
[
|
|
|
|
State(
|
|
|
|
name=state["name"],
|
|
|
|
color=state["color"],
|
|
|
|
project=serializer.instance,
|
|
|
|
sequence=state["sequence"],
|
|
|
|
workspace=serializer.instance.workspace,
|
2022-12-13 18:02:49 +00:00
|
|
|
group=state["group"],
|
2023-02-13 19:42:32 +00:00
|
|
|
default=state.get("default", False),
|
2023-05-11 11:28:35 +00:00
|
|
|
created_by=request.user,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
for state in states
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
|
|
|
return Response(
|
|
|
|
[serializer.errors[error][0] for error in serializer.errors],
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
except IntegrityError as e:
|
|
|
|
if "already exists" in str(e):
|
|
|
|
return Response(
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
{"name": "The project name is already taken"},
|
2022-11-29 21:17:42 +00:00
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
2023-03-21 20:05:53 +00:00
|
|
|
else:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
2022-12-13 18:12:41 +00:00
|
|
|
except Workspace.DoesNotExist as e:
|
|
|
|
return Response(
|
|
|
|
{"error": "Workspace does not exist"}, status=status.HTTP_404_NOT_FOUND
|
|
|
|
)
|
2022-12-13 17:55:46 +00:00
|
|
|
except serializers.ValidationError as e:
|
|
|
|
return Response(
|
|
|
|
{"identifier": "The project identifier is already taken"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-12-13 17:55:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def partial_update(self, request, slug, pk=None):
|
|
|
|
try:
|
|
|
|
workspace = Workspace.objects.get(slug=slug)
|
|
|
|
|
|
|
|
project = Project.objects.get(pk=pk)
|
|
|
|
|
|
|
|
serializer = ProjectSerializer(
|
|
|
|
project,
|
|
|
|
data={**request.data},
|
|
|
|
context={"workspace_id": workspace.id},
|
|
|
|
partial=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
if serializer.is_valid():
|
|
|
|
serializer.save()
|
|
|
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
|
|
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
|
|
|
|
|
|
except IntegrityError as e:
|
|
|
|
if "already exists" in str(e):
|
|
|
|
return Response(
|
|
|
|
{"name": "The project name is already taken"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
2023-02-13 19:42:32 +00:00
|
|
|
except Project.DoesNotExist or Workspace.DoesNotExist as e:
|
2022-12-13 18:12:41 +00:00
|
|
|
return Response(
|
|
|
|
{"error": "Project does not exist"}, status=status.HTTP_404_NOT_FOUND
|
|
|
|
)
|
2022-11-29 21:17:42 +00:00
|
|
|
except serializers.ValidationError as e:
|
|
|
|
return Response(
|
|
|
|
{"identifier": "The project identifier is already taken"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class InviteProjectEndpoint(BaseAPIView):
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
def post(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
email = request.data.get("email", False)
|
|
|
|
role = request.data.get("role", False)
|
|
|
|
|
|
|
|
# Check if email is provided
|
|
|
|
if not email:
|
|
|
|
return Response(
|
|
|
|
{"error": "Email is required"}, status=status.HTTP_400_BAD_REQUEST
|
|
|
|
)
|
|
|
|
|
|
|
|
validate_email(email)
|
|
|
|
# Check if user is already a member of workspace
|
|
|
|
if ProjectMember.objects.filter(
|
|
|
|
project_id=project_id, member__email=email
|
|
|
|
).exists():
|
|
|
|
return Response(
|
|
|
|
{"error": "User is already member of workspace"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
user = User.objects.filter(email=email).first()
|
|
|
|
|
|
|
|
if user is None:
|
|
|
|
token = jwt.encode(
|
|
|
|
{"email": email, "timestamp": datetime.now().timestamp()},
|
|
|
|
settings.SECRET_KEY,
|
|
|
|
algorithm="HS256",
|
|
|
|
)
|
|
|
|
project_invitation_obj = ProjectMemberInvite.objects.create(
|
|
|
|
email=email.strip().lower(),
|
|
|
|
project_id=project_id,
|
|
|
|
token=token,
|
|
|
|
role=role,
|
|
|
|
)
|
|
|
|
domain = settings.WEB_URL
|
|
|
|
project_invitation.delay(email, project_id, token, domain)
|
|
|
|
|
|
|
|
return Response(
|
|
|
|
{
|
|
|
|
"message": "Email sent successfully",
|
|
|
|
"id": project_invitation_obj.id,
|
|
|
|
},
|
|
|
|
status=status.HTTP_200_OK,
|
|
|
|
)
|
|
|
|
|
|
|
|
project_member = ProjectMember.objects.create(
|
|
|
|
member=user, project_id=project_id, role=role
|
|
|
|
)
|
|
|
|
|
|
|
|
return Response(
|
2023-05-25 06:57:04 +00:00
|
|
|
ProjectMemberSerializer(
|
|
|
|
project_member).data, status=status.HTTP_200_OK
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
except ValidationError:
|
|
|
|
return Response(
|
|
|
|
{
|
|
|
|
"error": "Invalid email address provided a valid email address is required to send the invite"
|
|
|
|
},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
except (Workspace.DoesNotExist, Project.DoesNotExist) as e:
|
|
|
|
return Response(
|
|
|
|
{"error": "Workspace or Project does not exists"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class UserProjectInvitationsViewset(BaseViewSet):
|
|
|
|
serializer_class = ProjectMemberInviteSerializer
|
|
|
|
model = ProjectMemberInvite
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.filter(email=self.request.user.email)
|
2023-01-16 20:20:27 +00:00
|
|
|
.select_related("workspace", "workspace__owner", "project")
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def create(self, request):
|
|
|
|
try:
|
|
|
|
invitations = request.data.get("invitations")
|
|
|
|
project_invitations = ProjectMemberInvite.objects.filter(
|
|
|
|
pk__in=invitations, accepted=True
|
|
|
|
)
|
|
|
|
ProjectMember.objects.bulk_create(
|
|
|
|
[
|
|
|
|
ProjectMember(
|
|
|
|
project=invitation.project,
|
|
|
|
workspace=invitation.project.workspace,
|
|
|
|
member=request.user,
|
|
|
|
role=invitation.role,
|
2023-05-11 11:28:35 +00:00
|
|
|
created_by=request.user,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
for invitation in project_invitations
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2023-05-25 06:57:04 +00:00
|
|
|
# Delete joined project invites
|
2022-11-29 21:17:42 +00:00
|
|
|
project_invitations.delete()
|
|
|
|
|
|
|
|
return Response(status=status.HTTP_200_OK)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectMemberViewSet(BaseViewSet):
|
|
|
|
serializer_class = ProjectMemberSerializer
|
|
|
|
model = ProjectMember
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
search_fields = [
|
|
|
|
"member__email",
|
|
|
|
"member__first_name",
|
|
|
|
]
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.filter(workspace__slug=self.kwargs.get("slug"))
|
|
|
|
.filter(project_id=self.kwargs.get("project_id"))
|
2023-03-07 19:29:48 +00:00
|
|
|
.filter(member__is_bot=False)
|
2022-11-29 21:17:42 +00:00
|
|
|
.select_related("project")
|
|
|
|
.select_related("member")
|
2023-01-16 20:20:27 +00:00
|
|
|
.select_related("workspace", "workspace__owner")
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
2023-05-15 14:08:37 +00:00
|
|
|
def partial_update(self, request, slug, project_id, pk):
|
|
|
|
try:
|
2023-05-25 06:57:04 +00:00
|
|
|
project_member = ProjectMember.objects.get(
|
|
|
|
pk=pk, workspace__slug=slug, project_id=project_id)
|
2023-05-15 14:08:37 +00:00
|
|
|
if request.user.id == project_member.member_id:
|
|
|
|
return Response(
|
|
|
|
{"error": "You cannot update your own role"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
2023-05-25 06:57:04 +00:00
|
|
|
# Check while updating user roles
|
|
|
|
requested_project_member = ProjectMember.objects.get(project_id=project_id, workspace__slug=slug, member=request.user)
|
|
|
|
if "role" in request.data and request.data.get("role", project_member.role) > requested_project_member.role:
|
2023-05-15 14:08:37 +00:00
|
|
|
return Response(
|
|
|
|
{
|
|
|
|
"error": "You cannot update a role that is higher than your own role"
|
|
|
|
},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
serializer = ProjectMemberSerializer(
|
|
|
|
project_member, data=request.data, partial=True
|
|
|
|
)
|
|
|
|
|
|
|
|
if serializer.is_valid():
|
|
|
|
serializer.save()
|
|
|
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
|
|
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
|
|
except ProjectMember.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "Project Member does not exist"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response({"error": "Something went wrong please try again later"}, status=status.HTTP_400_BAD_REQUEST)
|
|
|
|
|
2023-05-25 06:55:15 +00:00
|
|
|
def destroy(self, request, slug, project_id, pk):
|
|
|
|
try:
|
|
|
|
project_member = ProjectMember.objects.get(
|
|
|
|
workspace__slug=slug, project_id=project_id, pk=pk
|
|
|
|
)
|
|
|
|
# Remove all favorites
|
|
|
|
ProjectFavorite.objects.filter(workspace__slug=slug, project_id=project_id, user=project_member.member).delete()
|
|
|
|
CycleFavorite.objects.filter(workspace__slug=slug, project_id=project_id, user=project_member.member).delete()
|
|
|
|
ModuleFavorite.objects.filter(workspace__slug=slug, project_id=project_id, user=project_member.member).delete()
|
|
|
|
PageFavorite.objects.filter(workspace__slug=slug, project_id=project_id, user=project_member.member).delete()
|
|
|
|
IssueViewFavorite.objects.filter(workspace__slug=slug, project_id=project_id, user=project_member.member).delete()
|
|
|
|
# Also remove issue from issue assigned
|
|
|
|
IssueAssignee.objects.filter(
|
|
|
|
workspace__slug=slug, project_id=project_id, assignee=project_member.member
|
|
|
|
).delete()
|
|
|
|
|
|
|
|
# Remove if module member
|
|
|
|
ModuleMember.objects.filter(workspace__slug=slug, project_id=project_id, member=project_member.member).delete()
|
|
|
|
# Delete owned Pages
|
|
|
|
Page.objects.filter(workspace__slug=slug, project_id=project_id, owned_by=project_member.member).delete()
|
|
|
|
project_member.delete()
|
|
|
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
|
|
|
except ProjectMember.DoesNotExist:
|
|
|
|
return Response({"error": "Project Member does not exist"}, status=status.HTTP_400)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response({"error": "Something went wrong please try again later"})
|
2023-05-15 14:08:37 +00:00
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
class AddMemberToProjectEndpoint(BaseAPIView):
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
def post(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
member_id = request.data.get("member_id", False)
|
|
|
|
role = request.data.get("role", False)
|
|
|
|
|
|
|
|
if not member_id or not role:
|
|
|
|
return Response(
|
|
|
|
{"error": "Member ID and role is required"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check if the user is a member in the workspace
|
|
|
|
if not WorkspaceMember.objects.filter(
|
|
|
|
workspace__slug=slug, member_id=member_id
|
|
|
|
).exists():
|
|
|
|
# TODO: Update this error message - nk
|
|
|
|
return Response(
|
|
|
|
{
|
|
|
|
"error": "User is not a member of the workspace. Invite the user to the workspace to add him to project"
|
|
|
|
},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check if the user is already member of project
|
|
|
|
if ProjectMember.objects.filter(
|
|
|
|
project=project_id, member_id=member_id
|
|
|
|
).exists():
|
|
|
|
return Response(
|
|
|
|
{"error": "User is already a member of the project"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
# Add the user to project
|
|
|
|
project_member = ProjectMember.objects.create(
|
|
|
|
project_id=project_id, member_id=member_id, role=role
|
|
|
|
)
|
|
|
|
|
|
|
|
serializer = ProjectMemberSerializer(project_member)
|
|
|
|
|
|
|
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AddTeamToProjectEndpoint(BaseAPIView):
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
def post(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
team_members = TeamMember.objects.filter(
|
|
|
|
workspace__slug=slug, team__in=request.data.get("teams", [])
|
|
|
|
).values_list("member", flat=True)
|
|
|
|
|
|
|
|
if len(team_members) == 0:
|
|
|
|
return Response(
|
|
|
|
{"error": "No such team exists"}, status=status.HTTP_400_BAD_REQUEST
|
|
|
|
)
|
|
|
|
|
|
|
|
workspace = Workspace.objects.get(slug=slug)
|
|
|
|
|
|
|
|
project_members = []
|
|
|
|
for member in team_members:
|
|
|
|
project_members.append(
|
|
|
|
ProjectMember(
|
|
|
|
project_id=project_id,
|
|
|
|
member_id=member,
|
|
|
|
workspace=workspace,
|
2023-05-11 11:28:35 +00:00
|
|
|
created_by=request.user,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
ProjectMember.objects.bulk_create(
|
|
|
|
project_members, batch_size=10, ignore_conflicts=True
|
|
|
|
)
|
|
|
|
|
|
|
|
serializer = ProjectMemberSerializer(project_members, many=True)
|
|
|
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
|
|
|
except IntegrityError as e:
|
|
|
|
if "already exists" in str(e):
|
|
|
|
return Response(
|
|
|
|
{"error": "The team with the name already exists"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
|
|
|
except Workspace.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "The requested workspace could not be found"},
|
|
|
|
status=status.HTTP_404_NOT_FOUND,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectMemberInvitationsViewset(BaseViewSet):
|
|
|
|
serializer_class = ProjectMemberInviteSerializer
|
|
|
|
model = ProjectMemberInvite
|
|
|
|
|
|
|
|
search_fields = []
|
|
|
|
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.filter(workspace__slug=self.kwargs.get("slug"))
|
|
|
|
.filter(project_id=self.kwargs.get("project_id"))
|
|
|
|
.select_related("project")
|
2023-01-16 20:20:27 +00:00
|
|
|
.select_related("workspace", "workspace__owner")
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectMemberInviteDetailViewSet(BaseViewSet):
|
|
|
|
serializer_class = ProjectMemberInviteSerializer
|
|
|
|
model = ProjectMemberInvite
|
|
|
|
|
|
|
|
search_fields = []
|
|
|
|
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
def get_queryset(self):
|
2023-01-16 20:20:27 +00:00
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.select_related("project")
|
|
|
|
.select_related("workspace", "workspace__owner")
|
|
|
|
)
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectIdentifierEndpoint(BaseAPIView):
|
|
|
|
permission_classes = [
|
|
|
|
ProjectBasePermission,
|
|
|
|
]
|
|
|
|
|
|
|
|
def get(self, request, slug):
|
|
|
|
try:
|
|
|
|
name = request.GET.get("name", "").strip().upper()
|
|
|
|
|
|
|
|
if name == "":
|
|
|
|
return Response(
|
|
|
|
{"error": "Name is required"}, status=status.HTTP_400_BAD_REQUEST
|
|
|
|
)
|
|
|
|
|
2022-12-13 18:12:41 +00:00
|
|
|
exists = ProjectIdentifier.objects.filter(
|
|
|
|
name=name, workspace__slug=slug
|
|
|
|
).values("id", "name", "project")
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
return Response(
|
|
|
|
{"exists": len(exists), "identifiers": exists},
|
|
|
|
status=status.HTTP_200_OK,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def delete(self, request, slug):
|
|
|
|
try:
|
|
|
|
name = request.data.get("name", "").strip().upper()
|
|
|
|
|
|
|
|
if name == "":
|
|
|
|
return Response(
|
|
|
|
{"error": "Name is required"}, status=status.HTTP_400_BAD_REQUEST
|
|
|
|
)
|
|
|
|
|
2022-12-13 18:12:41 +00:00
|
|
|
if Project.objects.filter(identifier=name, workspace__slug=slug).exists():
|
2022-11-29 21:17:42 +00:00
|
|
|
return Response(
|
|
|
|
{"error": "Cannot delete an identifier of an existing project"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
2023-05-25 06:57:04 +00:00
|
|
|
ProjectIdentifier.objects.filter(
|
|
|
|
name=name, workspace__slug=slug).delete()
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
return Response(
|
|
|
|
status=status.HTTP_204_NO_CONTENT,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectJoinEndpoint(BaseAPIView):
|
|
|
|
def post(self, request, slug):
|
|
|
|
try:
|
|
|
|
project_ids = request.data.get("project_ids", [])
|
|
|
|
|
|
|
|
# Get the workspace user role
|
|
|
|
workspace_member = WorkspaceMember.objects.get(
|
|
|
|
member=request.user, workspace__slug=slug
|
|
|
|
)
|
|
|
|
|
|
|
|
workspace_role = workspace_member.role
|
|
|
|
workspace = workspace_member.workspace
|
|
|
|
|
|
|
|
ProjectMember.objects.bulk_create(
|
|
|
|
[
|
|
|
|
ProjectMember(
|
|
|
|
project_id=project_id,
|
|
|
|
member=request.user,
|
|
|
|
role=20
|
|
|
|
if workspace_role >= 15
|
|
|
|
else (15 if workspace_role == 10 else workspace_role),
|
|
|
|
workspace=workspace,
|
2023-05-11 11:28:35 +00:00
|
|
|
created_by=request.user,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
|
|
|
for project_id in project_ids
|
|
|
|
],
|
|
|
|
ignore_conflicts=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
return Response(
|
|
|
|
{"message": "Projects joined successfully"},
|
|
|
|
status=status.HTTP_201_CREATED,
|
|
|
|
)
|
|
|
|
except WorkspaceMember.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "User is not a member of workspace"},
|
|
|
|
status=status.HTTP_403_FORBIDDEN,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-11-29 21:17:42 +00:00
|
|
|
)
|
2022-12-13 17:57:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectUserViewsEndpoint(BaseAPIView):
|
|
|
|
def post(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
project = Project.objects.get(pk=project_id, workspace__slug=slug)
|
|
|
|
|
|
|
|
project_member = ProjectMember.objects.filter(
|
|
|
|
member=request.user, project=project
|
|
|
|
).first()
|
|
|
|
|
|
|
|
if project_member is None:
|
|
|
|
return Response(
|
|
|
|
{"error": "Forbidden"}, status=status.HTTP_403_FORBIDDEN
|
|
|
|
)
|
|
|
|
|
2022-12-20 11:29:24 +00:00
|
|
|
view_props = project_member.view_props
|
|
|
|
default_props = project_member.default_props
|
|
|
|
|
2023-05-25 06:57:04 +00:00
|
|
|
project_member.view_props = request.data.get(
|
|
|
|
"view_props", view_props)
|
2022-12-20 11:29:24 +00:00
|
|
|
project_member.default_props = request.data.get(
|
|
|
|
"default_props", default_props
|
|
|
|
)
|
2022-12-13 17:57:59 +00:00
|
|
|
|
|
|
|
project_member.save()
|
|
|
|
|
|
|
|
return Response(status=status.HTTP_200_OK)
|
|
|
|
|
|
|
|
except Project.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "The requested resource does not exists"},
|
|
|
|
status=status.HTTP_404_NOT_FOUND,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-12-13 17:57:59 +00:00
|
|
|
)
|
2022-12-16 16:00:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectMemberUserEndpoint(BaseAPIView):
|
|
|
|
def get(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
project_member = ProjectMember.objects.get(
|
2022-12-20 10:01:39 +00:00
|
|
|
project_id=project_id, workspace__slug=slug, member=request.user
|
2022-12-16 16:00:04 +00:00
|
|
|
)
|
|
|
|
serializer = ProjectMemberSerializer(project_member)
|
|
|
|
|
|
|
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
|
|
|
|
|
|
|
except ProjectMember.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "User not a member of the project"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_403_FORBIDDEN,
|
2022-12-16 16:00:04 +00:00
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
2022-12-16 16:00:04 +00:00
|
|
|
)
|
2023-03-06 13:27:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectFavoritesViewSet(BaseViewSet):
|
|
|
|
serializer_class = ProjectFavoriteSerializer
|
|
|
|
model = ProjectFavorite
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
return self.filter_queryset(
|
|
|
|
super()
|
|
|
|
.get_queryset()
|
|
|
|
.filter(workspace__slug=self.kwargs.get("slug"))
|
|
|
|
.filter(user=self.request.user)
|
|
|
|
.select_related(
|
|
|
|
"project", "project__project_lead", "project__default_assignee"
|
|
|
|
)
|
|
|
|
.select_related("workspace", "workspace__owner")
|
|
|
|
)
|
|
|
|
|
|
|
|
def perform_create(self, serializer):
|
|
|
|
serializer.save(user=self.request.user)
|
|
|
|
|
|
|
|
def create(self, request, slug):
|
|
|
|
try:
|
|
|
|
serializer = ProjectFavoriteSerializer(data=request.data)
|
|
|
|
if serializer.is_valid():
|
|
|
|
serializer.save(user=request.user)
|
|
|
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
|
|
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
|
|
except IntegrityError as e:
|
|
|
|
print(str(e))
|
|
|
|
if "already exists" in str(e):
|
|
|
|
return Response(
|
|
|
|
{"error": "The project is already added to favorites"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
|
|
|
status=status.HTTP_410_GONE,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
|
|
|
|
def destroy(self, request, slug, project_id):
|
|
|
|
try:
|
|
|
|
project_favorite = ProjectFavorite.objects.get(
|
|
|
|
project=project_id, user=request.user, workspace__slug=slug
|
|
|
|
)
|
|
|
|
project_favorite.delete()
|
|
|
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
|
|
|
except ProjectFavorite.DoesNotExist:
|
|
|
|
return Response(
|
|
|
|
{"error": "Project is not in favorites"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|
|
|
|
except Exception as e:
|
|
|
|
capture_exception(e)
|
|
|
|
return Response(
|
|
|
|
{"error": "Something went wrong please try again later"},
|
|
|
|
status=status.HTTP_400_BAD_REQUEST,
|
|
|
|
)
|