diff --git a/apiserver/plane/api/serializers/__init__.py b/apiserver/plane/api/serializers/__init__.py index 9fe63d723..2b72c5ae1 100644 --- a/apiserver/plane/api/serializers/__init__.py +++ b/apiserver/plane/api/serializers/__init__.py @@ -23,7 +23,6 @@ from .project import ( ProjectLiteSerializer, ) from .state import StateSerializer, StateLiteSerializer -from .shortcut import ShortCutSerializer from .view import IssueViewSerializer, IssueViewFavoriteSerializer from .cycle import CycleSerializer, CycleIssueSerializer, CycleFavoriteSerializer from .asset import FileAssetSerializer diff --git a/apiserver/plane/api/serializers/shortcut.py b/apiserver/plane/api/serializers/shortcut.py deleted file mode 100644 index 18c2bd049..000000000 --- a/apiserver/plane/api/serializers/shortcut.py +++ /dev/null @@ -1,14 +0,0 @@ -# Module imports -from .base import BaseSerializer - -from plane.db.models import Shortcut - - -class ShortCutSerializer(BaseSerializer): - class Meta: - model = Shortcut - fields = "__all__" - read_only_fields = [ - "workspace", - "project", - ] diff --git a/apiserver/plane/api/urls.py b/apiserver/plane/api/urls.py index e207a29d6..936fd73ab 100644 --- a/apiserver/plane/api/urls.py +++ b/apiserver/plane/api/urls.py @@ -84,9 +84,6 @@ from plane.api.views import ( ProjectEstimatePointEndpoint, BulkEstimatePointEndpoint, ## End Estimates - # Shortcuts - ShortCutViewSet, - ## End Shortcuts # Views IssueViewViewSet, ViewIssuesEndpoint, @@ -539,30 +536,6 @@ urlpatterns = [ name="bulk-create-estimate-points", ), # End Estimates ## - # Shortcuts - path( - "workspaces//projects//shortcuts/", - ShortCutViewSet.as_view( - { - "get": "list", - "post": "create", - } - ), - name="project-shortcut", - ), - path( - "workspaces//projects//shortcuts//", - ShortCutViewSet.as_view( - { - "get": "retrieve", - "put": "update", - "patch": "partial_update", - "delete": "destroy", - } - ), - name="project-shortcut", - ), - ## End Shortcuts # Views path( "workspaces//projects//views/", diff --git a/apiserver/plane/api/views/__init__.py b/apiserver/plane/api/views/__init__.py index c525f25c8..f8d170532 100644 --- a/apiserver/plane/api/views/__init__.py +++ b/apiserver/plane/api/views/__init__.py @@ -43,7 +43,6 @@ from .workspace import ( WorkspaceThemeViewSet, ) from .state import StateViewSet -from .shortcut import ShortCutViewSet from .view import IssueViewViewSet, ViewIssuesEndpoint, IssueViewFavoriteViewSet from .cycle import ( CycleViewSet, diff --git a/apiserver/plane/api/views/shortcut.py b/apiserver/plane/api/views/shortcut.py deleted file mode 100644 index 49453fb14..000000000 --- a/apiserver/plane/api/views/shortcut.py +++ /dev/null @@ -1,29 +0,0 @@ -# Module imports -from . import BaseViewSet -from plane.api.serializers import ShortCutSerializer -from plane.api.permissions import ProjectEntityPermission -from plane.db.models import Shortcut - - -class ShortCutViewSet(BaseViewSet): - - serializer_class = ShortCutSerializer - model = Shortcut - permission_classes = [ - ProjectEntityPermission, - ] - - def perform_create(self, serializer): - serializer.save(project_id=self.kwargs.get("project_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(project__project_projectmember__member=self.request.user) - .select_related("project") - .select_related("workspace") - .distinct() - ) diff --git a/apiserver/plane/db/models/__init__.py b/apiserver/plane/db/models/__init__.py index 7f1d1c03f..96c649a83 100644 --- a/apiserver/plane/db/models/__init__.py +++ b/apiserver/plane/db/models/__init__.py @@ -43,8 +43,6 @@ from .state import State from .cycle import Cycle, CycleIssue, CycleFavorite -from .shortcut import Shortcut - from .view import IssueView, IssueViewFavorite from .module import Module, ModuleMember, ModuleIssue, ModuleLink, ModuleFavorite diff --git a/apiserver/plane/db/models/shortcut.py b/apiserver/plane/db/models/shortcut.py deleted file mode 100644 index bdc09c1f2..000000000 --- a/apiserver/plane/db/models/shortcut.py +++ /dev/null @@ -1,26 +0,0 @@ -# Django imports -from django.db import models - - -# Module imports -from . import ProjectBaseModel - - -class Shortcut(ProjectBaseModel): - TYPE_CHOICES = (("repo", "Repo"), ("direct", "Direct")) - name = models.CharField(max_length=255, verbose_name="Cycle Name") - description = models.TextField(verbose_name="Cycle Description", blank=True) - type = models.CharField( - max_length=255, verbose_name="Shortcut Type", choices=TYPE_CHOICES - ) - url = models.URLField(verbose_name="URL", blank=True, null=True) - - class Meta: - verbose_name = "Shortcut" - verbose_name_plural = "Shortcuts" - db_table = "shortcuts" - ordering = ("-created_at",) - - def __str__(self): - """Return name of the shortcut""" - return f"{self.name} <{self.project.name}>"