feat: cycles and modules archive. (#4005)
* fix: GET request changes * fix: filtering changes * feat: cycles and modules archive. * chore: disable fetching of cycle/ module details when clicked on the card in archives page. * chore: remove copy link button from archived modules/ cycles. * fix: archived cycle and module loading fliker issue. * chore: add validation to only archive completed cycles. * chore: add validation to only archive completed or cancelled module. * chore: archived issues/ cycles/ modules empty state update. --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
parent
4d1b5adfc4
commit
061be85a5d
72 changed files with 2429 additions and 682 deletions
|
|
@ -481,7 +481,7 @@ class CycleArchiveUnarchiveAPIEndpoint(BaseAPIView):
|
|||
.distinct()
|
||||
)
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
def get(self, request, slug, project_id):
|
||||
return self.paginate(
|
||||
request=request,
|
||||
queryset=(self.get_queryset()),
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ class ModuleArchiveUnarchiveAPIEndpoint(BaseAPIView):
|
|||
.order_by(self.kwargs.get("order_by", "-created_at"))
|
||||
)
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
def get(self, request, slug, project_id):
|
||||
return self.paginate(
|
||||
request=request,
|
||||
queryset=(self.get_queryset()),
|
||||
|
|
|
|||
|
|
@ -714,10 +714,8 @@ class CycleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
project_id=self.kwargs.get("project_id"),
|
||||
workspace__slug=self.kwargs.get("slug"),
|
||||
)
|
||||
return self.filter_queryset(
|
||||
super()
|
||||
.get_queryset()
|
||||
.filter(workspace__slug=self.kwargs.get("slug"))
|
||||
return (
|
||||
Cycle.objects.filter(workspace__slug=self.kwargs.get("slug"))
|
||||
.filter(project_id=self.kwargs.get("project_id"))
|
||||
.filter(archived_at__isnull=False)
|
||||
.filter(
|
||||
|
|
@ -831,7 +829,7 @@ class CycleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
.distinct()
|
||||
)
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
def get(self, request, slug, project_id):
|
||||
queryset = (
|
||||
self.get_queryset()
|
||||
.annotate(
|
||||
|
|
@ -869,6 +867,7 @@ class CycleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
"backlog_issues",
|
||||
"assignee_ids",
|
||||
"status",
|
||||
"archived_at",
|
||||
)
|
||||
).order_by("-is_favorite", "-created_at")
|
||||
return Response(queryset, status=status.HTTP_200_OK)
|
||||
|
|
|
|||
|
|
@ -498,10 +498,7 @@ class ModuleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
workspace__slug=self.kwargs.get("slug"),
|
||||
)
|
||||
return (
|
||||
super()
|
||||
.get_queryset()
|
||||
.filter(project_id=self.kwargs.get("project_id"))
|
||||
.filter(workspace__slug=self.kwargs.get("slug"))
|
||||
Module.objects.filter(workspace__slug=self.kwargs.get("slug"))
|
||||
.filter(archived_at__isnull=False)
|
||||
.annotate(is_favorite=Exists(favorite_subquery))
|
||||
.select_related("project")
|
||||
|
|
@ -594,7 +591,7 @@ class ModuleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
.order_by("-is_favorite", "-created_at")
|
||||
)
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
def get(self, request, slug, project_id):
|
||||
queryset = self.get_queryset()
|
||||
modules = queryset.values( # Required fields
|
||||
"id",
|
||||
|
|
@ -624,6 +621,7 @@ class ModuleArchiveUnarchiveEndpoint(BaseAPIView):
|
|||
"backlog_issues",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"archived_at"
|
||||
)
|
||||
return Response(modules, status=status.HTTP_200_OK)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue