fix: archive issue bugs (#2712)

* fix: blur on side/modal peek view

* fix: delete archive not working on list layout with group by is none

* fix: show empty group has no effect

* fix: filter/display options same as production

* fix: disabling full-screen peek-overview for archive issues

* fix: truncate in calendar view
This commit is contained in:
Dakshesh Jain 2023-11-20 12:48:30 +05:30 committed by GitHub
parent 9db6312081
commit 8839e42dc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 46 deletions

View File

@ -30,12 +30,14 @@ export const ArchivedIssueListLayout: FC = observer(() => {
const issues = archivedIssueStore.getIssues; const issues = archivedIssueStore.getIssues;
const displayProperties = archivedIssueFiltersStore?.userDisplayProperties || null; const displayProperties = archivedIssueFiltersStore?.userDisplayProperties || null;
const group_by: string | null = archivedIssueFiltersStore?.userDisplayFilters?.group_by || null; const group_by: string | null = archivedIssueFiltersStore?.userDisplayFilters?.group_by || null;
const showEmptyGroup = archivedIssueFiltersStore?.userDisplayFilters?.show_empty_groups || false;
const handleIssues = (group_by: string | null, issue: IIssue, action: "delete" | "update") => { const handleIssues = (group_by: string | null, issue: IIssue, action: "delete" | "update") => {
if (!workspaceSlug || !projectId) return; if (!workspaceSlug || !projectId) return;
if (action === "delete") { if (action === "delete") {
archivedIssueStore.deleteArchivedIssue(group_by, null, issue); archivedIssueStore.deleteArchivedIssue(group_by === "null" ? null : group_by, null, issue);
archivedIssueStore.fetchIssues(workspaceSlug.toString(), projectId.toString());
} }
}; };
@ -68,6 +70,7 @@ export const ArchivedIssueListLayout: FC = observer(() => {
members={projectMembers?.map((m) => m.member) ?? null} members={projectMembers?.map((m) => m.member) ?? null}
projects={projects} projects={projects}
estimates={estimates?.points ? orderArrayBy(estimates.points, "key") : null} estimates={estimates?.points ? orderArrayBy(estimates.points, "key") : null}
showEmptyGroup={showEmptyGroup}
/> />
</div> </div>
); );

View File

@ -247,9 +247,6 @@ export const IssueView: FC<IIssueView> = observer((props) => {
{/* content */} {/* content */}
<div className="relative w-full h-full overflow-hidden overflow-y-auto"> <div className="relative w-full h-full overflow-hidden overflow-y-auto">
{isArchived && (
<div className="absolute top-0 left-0 h-full w-full z-[999] flex items-center justify-center bg-custom-background-100 opacity-60" />
)}
{isLoading && !issue ? ( {isLoading && !issue ? (
<div className="h-full w-full flex items-center justify-center"> <div className="h-full w-full flex items-center justify-center">
<Spinner /> <Spinner />
@ -258,7 +255,10 @@ export const IssueView: FC<IIssueView> = observer((props) => {
issue && ( issue && (
<> <>
{["side-peek", "modal"].includes(peekMode) ? ( {["side-peek", "modal"].includes(peekMode) ? (
<div className="flex flex-col gap-3 py-5 px-8"> <div className="relative flex flex-col gap-3 py-5 px-8">
{isArchived && (
<div className="absolute top-0 left-0 h-full min-h-full w-full z-[9] flex items-center justify-center bg-custom-background-100 opacity-60" />
)}
<PeekOverviewIssueDetails <PeekOverviewIssueDetails
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
issue={issue} issue={issue}
@ -290,33 +290,39 @@ export const IssueView: FC<IIssueView> = observer((props) => {
/> />
</div> </div>
) : ( ) : (
<div className="w-full h-full flex"> <div className={`overflow-auto w-full h-full flex ${isArchived ? "opacity-60" : ""}`}>
<div className="w-full h-full space-y-6 p-4 py-5"> <div className="relative w-full h-full space-y-6 p-4 py-5 overflow-auto">
<PeekOverviewIssueDetails <div className={isArchived ? "pointer-events-none" : ""}>
workspaceSlug={workspaceSlug} <PeekOverviewIssueDetails
issue={issue} workspaceSlug={workspaceSlug}
issueReactions={issueReactions} issue={issue}
issueUpdate={issueUpdate} issueReactions={issueReactions}
user={user} issueUpdate={issueUpdate}
issueReactionCreate={issueReactionCreate} user={user}
issueReactionRemove={issueReactionRemove} issueReactionCreate={issueReactionCreate}
/> issueReactionRemove={issueReactionRemove}
/>
<IssueComment <IssueComment
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
projectId={projectId} projectId={projectId}
issueId={issueId} issueId={issueId}
user={user} user={user}
issueComments={issueComments} issueComments={issueComments}
issueCommentCreate={issueCommentCreate} issueCommentCreate={issueCommentCreate}
issueCommentUpdate={issueCommentUpdate} issueCommentUpdate={issueCommentUpdate}
issueCommentRemove={issueCommentRemove} issueCommentRemove={issueCommentRemove}
issueCommentReactionCreate={issueCommentReactionCreate} issueCommentReactionCreate={issueCommentReactionCreate}
issueCommentReactionRemove={issueCommentReactionRemove} issueCommentReactionRemove={issueCommentReactionRemove}
showCommentAccessSpecifier={showCommentAccessSpecifier} showCommentAccessSpecifier={showCommentAccessSpecifier}
/> />
</div>
</div> </div>
<div className="flex-shrink-0 !w-[400px] h-full border-l border-custom-border-200 p-4 py-5"> <div
className={`flex-shrink-0 !w-[400px] h-full border-l border-custom-border-200 p-4 py-5 ${
isArchived ? "pointer-events-none" : ""
}`}
>
<PeekOverviewProperties <PeekOverviewProperties
issue={issue} issue={issue}
issueUpdate={issueUpdate} issueUpdate={issueUpdate}

View File

@ -251,23 +251,10 @@ export const ISSUE_DISPLAY_FILTERS_BY_LAYOUT: {
}, },
archived_issues: { archived_issues: {
list: { list: {
filters: ["priority", "state_group", "labels", "start_date", "target_date"], filters: ["priority", "state", "assignees", "created_by", "labels", "start_date", "target_date"],
display_properties: true, display_properties: true,
display_filters: { display_filters: {
group_by: ["state_detail.group", "priority", "project", "labels", null], group_by: ["state", "state_detail.group", "priority", "labels", "assignees", "created_by", null],
order_by: ["sort_order", "-created_at", "-updated_at", "start_date", "priority"],
type: [null, "active", "backlog"],
},
extra_options: {
access: true,
values: ["show_empty_groups"],
},
},
kanban: {
filters: ["priority", "state_group", "labels", "start_date", "target_date"],
display_properties: true,
display_filters: {
group_by: ["state_detail.group", "priority", "project", "labels", null],
order_by: ["sort_order", "-created_at", "-updated_at", "start_date", "priority"], order_by: ["sort_order", "-created_at", "-updated_at", "start_date", "priority"],
type: [null, "active", "backlog"], type: [null, "active", "backlog"],
}, },

View File

@ -138,7 +138,7 @@ export class ArchivedIssueStore implements IArchivedIssueStore {
}; };
} }
const orderBy = this.rootStore?.issueFilter?.userDisplayFilters?.order_by || ""; const orderBy = this.rootStore?.archivedIssueFilters?.userDisplayFilters?.order_by || "";
if (orderBy === "-created_at") { if (orderBy === "-created_at") {
issues = sortArrayByDate(issues as any, "created_at"); issues = sortArrayByDate(issues as any, "created_at");
} }