Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-1184] feat: issue bulk operations #4530

Merged
merged 47 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
60216e7
chore: bulk operations
NarayanBavisetti May 6, 2024
60c262a
chore: archive bulk issues
NarayanBavisetti May 6, 2024
b5deb90
chore: bulk ops keys changed
NarayanBavisetti May 6, 2024
5c328ff
dev: bulk ops init
aaryan610 May 7, 2024
51c0794
chore: bulk delete and archive confirmation modals
aaryan610 May 7, 2024
fe923cf
fix: merge conflicts resolved from preview
aaryan610 May 9, 2024
7e2a5dd
style: list layout spacing
aaryan610 May 9, 2024
53b9f60
fix: merge conflicts resolved from preview
aaryan610 May 17, 2024
836e186
chore: create hoc for multi-select groups
aaryan610 May 21, 2024
077b8cc
chore: update multiple select components
aaryan610 May 21, 2024
aaa81fb
fix: merge conflicts resolved from preview
aaryan610 May 21, 2024
0f13f76
chore: archive, target and start date error messsage
NarayanBavisetti May 21, 2024
6bea619
chore: edge case handling
NarayanBavisetti May 21, 2024
1200090
chore: bulk ops in spreadsheet layout
aaryan610 May 22, 2024
a76e020
chore: update UI
aaryan610 May 22, 2024
9c1e32a
fix: merge conflicts resolved from preview
aaryan610 May 22, 2024
e157240
chore: scroll element into view
aaryan610 May 22, 2024
ac6e22b
fix: shift + arrow navigation
aaryan610 May 22, 2024
6626c32
chore: implement bulk ops in the gantt layout
aaryan610 May 22, 2024
cbe348b
fix: ui bugs
aaryan610 May 23, 2024
bb0afc0
chore: move selection logic to store
aaryan610 May 23, 2024
02b23c8
fix: group selection
aaryan610 May 23, 2024
e6a2e10
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
aaryan610 May 23, 2024
aa9df2d
refactor: multiple select store
aaryan610 May 23, 2024
8c6fef8
style: dropdowns UI
aaryan610 May 23, 2024
221f9da
fix: bulk assignee and label update mutation
aaryan610 May 23, 2024
7b0062b
chore: removed migrations
NarayanBavisetti May 23, 2024
71b7618
Merge branch 'feat/bulk-operations' of github.com:makeplane/plane int…
NarayanBavisetti May 23, 2024
dffd879
refactor: entities grouping logic
aaryan610 May 24, 2024
9c4c43c
Merge branch 'feat/bulk-operations' of https://github.com/makeplane/p…
aaryan610 May 24, 2024
f1e8b17
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
aaryan610 May 24, 2024
cd038c5
fix performance issue is selection of bulk ops
rahulramesha May 24, 2024
07e4828
fix: shift keyboard navigation
aaryan610 May 24, 2024
bbc3574
Merge pull request #4578 from makeplane/bulk-ops-performance-fixes
aaryan610 May 24, 2024
9a1860f
fix: group click action
aaryan610 May 24, 2024
33190a0
chore: start and target date validation
NarayanBavisetti May 26, 2024
a31ed8d
fix: merge conflicts resolved from preview
aaryan610 May 26, 2024
dca3e3e
Merge branch 'feat/bulk-operations' of https://github.com/makeplane/p…
aaryan610 May 26, 2024
c7dc5e5
chore: remove optimistic updates, check archivability in frontend
aaryan610 May 27, 2024
96c5e2b
chore: code optimisation
NarayanBavisetti May 27, 2024
f41917b
Merge branch 'feat/bulk-operations' of github.com:makeplane/plane int…
NarayanBavisetti May 27, 2024
ab7fc8c
chore: add store comments
aaryan610 May 27, 2024
315a3a1
Merge branch 'feat/bulk-operations' of https://github.com/makeplane/p…
aaryan610 May 27, 2024
67982e4
fix: merge conflicts resolved from preview
aaryan610 May 28, 2024
98fcd84
refactor: component fragmentation
aaryan610 May 28, 2024
d85c09e
Merge branch 'develop' of https://github.com/makeplane/plane into fea…
aaryan610 May 28, 2024
05cf502
style: issue active state
aaryan610 May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions admin/components/admin-sidebar/help-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { observer } from "mobx-react-lite";
import Link from "next/link";
import { ExternalLink, FileText, HelpCircle, MoveLeft } from "lucide-react";
import { Transition } from "@headlessui/react";
// ui
import { DiscordIcon, GithubIcon, Tooltip } from "@plane/ui";
// helpers
import { cn, WEB_BASE_URL } from "@/helpers/common.helper";
// hooks
import { WEB_BASE_URL } from "@/helpers/common.helper";
import { useTheme } from "@/hooks/store";
// assets
import packageJson from "package.json";
Expand Down Expand Up @@ -42,9 +44,12 @@ export const HelpSection: FC = observer(() => {

return (
<div
className={`flex w-full items-center justify-between gap-1 self-baseline border-t border-custom-sidebar-border-200 bg-custom-sidebar-background-100 px-4 py-2 ${
isSidebarCollapsed ? "flex-col" : ""
}`}
className={cn(
"flex w-full items-center justify-between gap-1 self-baseline border-t border-custom-border-200 bg-custom-sidebar-background-100 px-4 h-28",
{
"flex-col h-auto py-1.5": isSidebarCollapsed,
}
)}
>
<div className={`flex items-center gap-1 ${isSidebarCollapsed ? "flex-col justify-center" : "w-full"}`}>
<Tooltip tooltipContent="Redirect to plane" position="right" className="ml-4" disabled={!isSidebarCollapsed}>
Expand Down
12 changes: 12 additions & 0 deletions apiserver/plane/app/urls/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
IssueUserDisplayPropertyEndpoint,
IssueViewSet,
LabelViewSet,
BulkIssueOperationsEndpoint,
BulkArchiveIssuesEndpoint,
)

urlpatterns = [
Expand Down Expand Up @@ -81,6 +83,11 @@
BulkDeleteIssuesEndpoint.as_view(),
name="project-issues-bulk",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/bulk-archive-issues/",
BulkArchiveIssuesEndpoint.as_view(),
name="bulk-archive-issues",
),
##
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/issues/<uuid:issue_id>/sub-issues/",
Expand Down Expand Up @@ -298,4 +305,9 @@
),
name="project-issue-draft",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/bulk-operation-issues/",
BulkIssueOperationsEndpoint.as_view(),
name="bulk-operations-issues",
),
]
6 changes: 3 additions & 3 deletions apiserver/plane/app/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@
IssueActivityEndpoint,
)

from .issue.archive import (
IssueArchiveViewSet,
)
from .issue.archive import IssueArchiveViewSet, BulkArchiveIssuesEndpoint

from .issue.attachment import (
IssueAttachmentEndpoint,
Expand Down Expand Up @@ -154,6 +152,8 @@
)


from .issue.bulk_operations import BulkIssueOperationsEndpoint

Check notice on line 155 in apiserver/plane/app/views/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apiserver/plane/app/views/__init__.py#L155

'.issue.bulk_operations.BulkIssueOperationsEndpoint' imported but unused (F401)

from .module.base import (
ModuleViewSet,
ModuleLinkViewSet,
Expand Down
58 changes: 57 additions & 1 deletion apiserver/plane/app/views/issue/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from rest_framework import status

# Module imports
from .. import BaseViewSet
from .. import BaseViewSet, BaseAPIView
from plane.app.serializers import (
IssueSerializer,
IssueFlatSerializer,
Expand All @@ -49,6 +49,7 @@
from plane.utils.issue_filters import issue_filters
from plane.utils.user_timezone_converter import user_timezone_converter


class IssueArchiveViewSet(BaseViewSet):
permission_classes = [
ProjectEntityPermission,
Expand Down Expand Up @@ -351,3 +352,58 @@ def unarchive(self, request, slug, project_id, pk=None):
issue.save()

return Response(status=status.HTTP_204_NO_CONTENT)


class BulkArchiveIssuesEndpoint(BaseAPIView):
permission_classes = [
ProjectEntityPermission,
]

def post(self, request, slug, project_id):
issue_ids = request.data.get("issue_ids", [])

if not len(issue_ids):
return Response(
{"error": "Issue IDs are required"},
status=status.HTTP_400_BAD_REQUEST,
)

issues = Issue.objects.filter(
workspace__slug=slug, project_id=project_id, pk__in=issue_ids
)
bulk_archive_issues = []
for issue in issues:
if issue.state.group not in ["completed", "cancelled"]:
return Response(
{
"error_code": "4091",
"error_message": "INVALID_ARCHIVE_STATE_GROUP"
},
status=status.HTTP_400_BAD_REQUEST,
)
issue_activity.delay(
type="issue.activity.updated",
requested_data=json.dumps(
{
"archived_at": str(timezone.now().date()),
"automation": False,
}
),
actor_id=str(request.user.id),
issue_id=str(issue.id),
project_id=str(project_id),
current_instance=json.dumps(
IssueSerializer(issue).data, cls=DjangoJSONEncoder
),
epoch=int(timezone.now().timestamp()),
notification=True,
origin=request.META.get("HTTP_ORIGIN"),
)
issue.archived_at = timezone.now().date()
bulk_archive_issues.append(issue)
Issue.objects.bulk_update(bulk_archive_issues, ["archived_at"])

return Response(
{"archived_at": str(timezone.now().date())},
status=status.HTTP_200_OK,
)
Loading
Loading