From f797bb20f993e5115ebfc105650895e1c8e87fd2 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 20 Jun 2023 10:26:31 +0530 Subject: [PATCH] remove: time line issues (#1316) --- apiserver/plane/api/serializers/__init__.py | 1 - apiserver/plane/api/serializers/issue.py | 16 ---------- apiserver/plane/api/urls.py | 25 --------------- apiserver/plane/api/views/__init__.py | 1 - apiserver/plane/api/views/issue.py | 35 --------------------- apiserver/plane/db/models/__init__.py | 1 - apiserver/plane/db/models/issue.py | 18 ----------- 7 files changed, 97 deletions(-) diff --git a/apiserver/plane/api/serializers/__init__.py b/apiserver/plane/api/serializers/__init__.py index cb94f8068..9fe63d723 100644 --- a/apiserver/plane/api/serializers/__init__.py +++ b/apiserver/plane/api/serializers/__init__.py @@ -31,7 +31,6 @@ from .issue import ( IssueCreateSerializer, IssueActivitySerializer, IssueCommentSerializer, - TimeLineIssueSerializer, IssuePropertySerializer, BlockerIssueSerializer, BlockedIssueSerializer, diff --git a/apiserver/plane/api/serializers/issue.py b/apiserver/plane/api/serializers/issue.py index 01c2c977d..14782dbe5 100644 --- a/apiserver/plane/api/serializers/issue.py +++ b/apiserver/plane/api/serializers/issue.py @@ -16,7 +16,6 @@ from plane.db.models import ( Issue, IssueActivity, IssueComment, - TimelineIssue, IssueProperty, IssueBlocker, IssueAssignee, @@ -288,21 +287,6 @@ class IssueCommentSerializer(BaseSerializer): ] -class TimeLineIssueSerializer(BaseSerializer): - class Meta: - model = TimelineIssue - fields = "__all__" - read_only_fields = [ - "workspace", - "project", - "issue", - "created_by", - "updated_by", - "created_at", - "updated_at", - ] - - class IssuePropertySerializer(BaseSerializer): class Meta: model = IssueProperty diff --git a/apiserver/plane/api/urls.py b/apiserver/plane/api/urls.py index 7b2c6f76e..e207a29d6 100644 --- a/apiserver/plane/api/urls.py +++ b/apiserver/plane/api/urls.py @@ -70,7 +70,6 @@ from plane.api.views import ( BulkDeleteIssuesEndpoint, BulkImportIssuesEndpoint, ProjectUserViewsEndpoint, - TimeLineIssueViewSet, IssuePropertyViewSet, LabelViewSet, SubIssuesEndpoint, @@ -826,30 +825,6 @@ urlpatterns = [ name="project-issue-comment", ), ## End IssueComments - ## Roadmap - path( - "workspaces//projects//issues//roadmaps/", - TimeLineIssueViewSet.as_view( - { - "get": "list", - "post": "create", - } - ), - name="project-issue-roadmap", - ), - path( - "workspaces//projects//issues//roadmaps//", - TimeLineIssueViewSet.as_view( - { - "get": "retrieve", - "put": "update", - "patch": "partial_update", - "delete": "destroy", - } - ), - name="project-issue-roadmap", - ), - ## End Roadmap ## IssueProperty path( "workspaces//projects//issue-properties/", diff --git a/apiserver/plane/api/views/__init__.py b/apiserver/plane/api/views/__init__.py index 12299f79b..c525f25c8 100644 --- a/apiserver/plane/api/views/__init__.py +++ b/apiserver/plane/api/views/__init__.py @@ -58,7 +58,6 @@ from .issue import ( WorkSpaceIssuesEndpoint, IssueActivityEndpoint, IssueCommentViewSet, - TimeLineIssueViewSet, IssuePropertyViewSet, LabelViewSet, BulkDeleteIssuesEndpoint, diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index 794fecf5c..f5471dc6c 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -34,7 +34,6 @@ from plane.api.serializers import ( IssueCreateSerializer, IssueActivitySerializer, IssueCommentSerializer, - TimeLineIssueSerializer, IssuePropertySerializer, LabelSerializer, IssueSerializer, @@ -54,7 +53,6 @@ from plane.db.models import ( Issue, IssueActivity, IssueComment, - TimelineIssue, IssueProperty, Label, IssueLink, @@ -443,39 +441,6 @@ class IssueCommentViewSet(BaseViewSet): ) -class TimeLineIssueViewSet(BaseViewSet): - serializer_class = TimeLineIssueSerializer - model = TimelineIssue - permission_classes = [ - ProjectEntityPermission, - ] - - filterset_fields = [ - "issue__id", - "workspace__id", - ] - - def perform_create(self, serializer): - serializer.save( - project_id=self.kwargs.get("project_id"), - issue_id=self.kwargs.get("issue_id"), - ) - - 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")) - .filter(issue_id=self.kwargs.get("issue_id")) - .filter(project__project_projectmember__member=self.request.user) - .select_related("project") - .select_related("workspace") - .select_related("issue") - .distinct() - ) - - class IssuePropertyViewSet(BaseViewSet): serializer_class = IssuePropertySerializer model = IssueProperty diff --git a/apiserver/plane/db/models/__init__.py b/apiserver/plane/db/models/__init__.py index 0d236fe21..7f1d1c03f 100644 --- a/apiserver/plane/db/models/__init__.py +++ b/apiserver/plane/db/models/__init__.py @@ -23,7 +23,6 @@ from .project import ( from .issue import ( Issue, IssueActivity, - TimelineIssue, IssueProperty, IssueComment, IssueBlocker, diff --git a/apiserver/plane/db/models/issue.py b/apiserver/plane/db/models/issue.py index dcb7d20c4..7efe86d46 100644 --- a/apiserver/plane/db/models/issue.py +++ b/apiserver/plane/db/models/issue.py @@ -293,24 +293,6 @@ class IssueActivity(ProjectBaseModel): return str(self.issue) -class TimelineIssue(ProjectBaseModel): - issue = models.ForeignKey( - Issue, on_delete=models.CASCADE, related_name="issue_timeline" - ) - sequence_id = models.FloatField(default=1.0) - links = models.JSONField(default=dict, blank=True) - - class Meta: - verbose_name = "Timeline Issue" - verbose_name_plural = "Timeline Issues" - db_table = "issue_timelines" - ordering = ("-created_at",) - - def __str__(self): - """Return project of the project member""" - return str(self.issue) - - class IssueComment(ProjectBaseModel): comment_stripped = models.TextField(verbose_name="Comment", blank=True) comment_json = models.JSONField(blank=True, default=dict)