Skip to content

Commit

Permalink
chore: issue widgets added to issue peek overview (#5069)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Jul 8, 2024
1 parent 4e815c0 commit 0e4ce2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 115 deletions.
85 changes: 2 additions & 83 deletions web/core/components/issues/peek-overview/properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,10 @@

import { FC } from "react";
import { observer } from "mobx-react";
import {
Signal,
Tag,
Triangle,
LayoutPanelTop,
CircleDot,
CopyPlus,
XCircle,
CalendarClock,
CalendarCheck2,
Users,
UserCircle2,
} from "lucide-react";
import { Signal, Tag, Triangle, LayoutPanelTop, CalendarClock, CalendarCheck2, Users, UserCircle2 } from "lucide-react";
// hooks
// ui icons
import { DiceIcon, DoubleCircleIcon, ContrastIcon, RelatedIcon, Tooltip } from "@plane/ui";
import { DiceIcon, DoubleCircleIcon, ContrastIcon, Tooltip } from "@plane/ui";
// components
import {
DateDropdown,
Expand All @@ -28,13 +16,11 @@ import {
} from "@/components/dropdowns";
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
import {
IssueLinkRoot,
IssueCycleSelect,
IssueModuleSelect,
IssueParentSelect,
IssueLabel,
TIssueOperations,
IssueRelationSelect,
} from "@/components/issues";
// helpers
import { cn } from "@/helpers/common.helper";
Expand Down Expand Up @@ -287,70 +273,6 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = observer((pro
/>
</div>

{/* relates to */}
<div className="flex gap-3 min-h-8">
<div className="flex pt-2 gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
<RelatedIcon className="h-4 w-4 flex-shrink-0" />
<span>Relates to</span>
</div>
<IssueRelationSelect
className="w-3/4 flex-grow min-h-8 h-full"
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
relationKey="relates_to"
disabled={disabled}
/>
</div>

{/* blocking */}
<div className="flex gap-3 min-h-8">
<div className="flex pt-2 gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
<XCircle className="h-4 w-4 flex-shrink-0" />
<span>Blocking</span>
</div>
<IssueRelationSelect
className="w-3/4 flex-grow min-h-8 h-full"
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
relationKey="blocking"
disabled={disabled}
/>
</div>

{/* blocked by */}
<div className="flex gap-3 min-h-8">
<div className="flex pt-2 gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
<CircleDot className="h-4 w-4 flex-shrink-0" />
<span>Blocked by</span>
</div>
<IssueRelationSelect
className="w-3/4 flex-grow min-h-8 h-full"
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
relationKey="blocked_by"
disabled={disabled}
/>
</div>

{/* duplicate of */}
<div className="flex gap-3 min-h-8">
<div className="flex pt-2 gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
<CopyPlus className="h-4 w-4 flex-shrink-0" />
<span>Duplicate of</span>
</div>
<IssueRelationSelect
className="w-3/4 flex-grow min-h-8 h-full"
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
relationKey="duplicate"
disabled={disabled}
/>
</div>

{/* label */}
<div className="flex w-full items-center gap-3 min-h-8">
<div className="flex items-center gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
Expand All @@ -362,9 +284,6 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = observer((pro
</div>
</div>
</div>
<div className="w-full pt-3">
<IssueLinkRoot workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} disabled={disabled} />
</div>
</div>
);
});
42 changes: 10 additions & 32 deletions web/core/components/issues/peek-overview/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ import {
PeekOverviewProperties,
TIssueOperations,
ArchiveIssueModal,
PeekOverviewIssueAttachments,
IssuePeekOverviewLoader,
IssuePeekOverviewError,
IssueDetailWidgets,
} from "@/components/issues";
// helpers
import { cn } from "@/helpers/common.helper";
// hooks
import { useIssueDetail, useUser } from "@/hooks/store";
import { useIssueDetail } from "@/hooks/store";
import useKeypress from "@/hooks/use-keypress";
import usePeekOverviewOutsideClickDetector from "@/hooks/use-peek-overview-outside-click";
// store hooks
import { IssueActivity } from "../issue-detail/issue-activity";
import { SubIssuesRoot } from "../sub-issues";

interface IIssueView {
workspaceSlug: string;
Expand Down Expand Up @@ -52,7 +51,6 @@ export const IssueView: FC<IIssueView> = observer((props) => {
// ref
const issuePeekOverviewRef = useRef<HTMLDivElement>(null);
// store hooks
const { data: currentUser } = useUser();
const {
setPeekIssue,
isAnyModalOpen,
Expand Down Expand Up @@ -181,21 +179,11 @@ export const IssueView: FC<IIssueView> = observer((props) => {
setIsSubmitting={(value) => setIsSubmitting(value)}
/>

{currentUser && (
<SubIssuesRoot
workspaceSlug={workspaceSlug}
projectId={projectId}
parentIssueId={issueId}
currentUser={currentUser}
disabled={disabled || is_archived}
/>
)}

<PeekOverviewIssueAttachments
disabled={disabled || is_archived}
issueId={issueId}
projectId={projectId}
<IssueDetailWidgets
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
disabled={disabled}
/>

<PeekOverviewProperties
Expand Down Expand Up @@ -228,21 +216,11 @@ export const IssueView: FC<IIssueView> = observer((props) => {
setIsSubmitting={(value) => setIsSubmitting(value)}
/>

{currentUser && (
<SubIssuesRoot
workspaceSlug={workspaceSlug}
projectId={projectId}
parentIssueId={issueId}
currentUser={currentUser}
disabled={disabled || is_archived}
/>
)}

<PeekOverviewIssueAttachments
disabled={disabled || is_archived}
issueId={issueId}
projectId={projectId}
<IssueDetailWidgets
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
disabled={disabled}
/>

<IssueActivity
Expand Down

0 comments on commit 0e4ce2b

Please sign in to comment.