fix: global views bugs (#2563)

This commit is contained in:
Aaryan Khandelwal 2023-10-31 12:06:11 +05:30 committed by GitHub
parent 52474715de
commit 8b7b5c54b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 106 additions and 63 deletions

View File

@ -134,6 +134,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
handleFiltersUpdate={handleFiltersUpdate} handleFiltersUpdate={handleFiltersUpdate}
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet} layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
labels={workspaceStore.workspaceLabels ?? undefined} labels={workspaceStore.workspaceLabels ?? undefined}
members={workspaceStore.workspaceMembers?.map((m) => m.member) ?? undefined}
projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined} projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined}
/> />
</FiltersDropdown> </FiltersDropdown>

View File

@ -2,7 +2,7 @@ import { Draggable } from "@hello-pangea/dnd";
// components // components
import { KanBanProperties } from "./properties"; import { KanBanProperties } from "./properties";
// types // types
import { IEstimatePoint, IIssue, IIssueLabels, IState, IUserLite } from "types"; import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IState, IUserLite } from "types";
interface IssueBlockProps { interface IssueBlockProps {
sub_group_id: string; sub_group_id: string;
@ -17,7 +17,7 @@ interface IssueBlockProps {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
displayProperties: any; displayProperties: IIssueDisplayProperties;
states: IState[] | null; states: IState[] | null;
labels: IIssueLabels[] | null; labels: IIssueLabels[] | null;
members: IUserLite[] | null; members: IUserLite[] | null;
@ -81,7 +81,7 @@ export const KanbanIssueBlock: React.FC<IssueBlockProps> = (props) => {
columnId={columnId} columnId={columnId}
issue={issue} issue={issue}
handleIssues={updateIssue} handleIssues={updateIssue}
display_properties={displayProperties} displayProperties={displayProperties}
states={states} states={states}
labels={labels} labels={labels}
members={members} members={members}

View File

@ -1,6 +1,6 @@
// components // components
import { KanbanIssueBlock } from "components/issues"; import { KanbanIssueBlock } from "components/issues";
import { IEstimatePoint, IIssue, IIssueLabels, IState, IUserLite } from "types"; import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IState, IUserLite } from "types";
interface IssueBlocksListProps { interface IssueBlocksListProps {
sub_group_id: string; sub_group_id: string;
@ -14,7 +14,7 @@ interface IssueBlocksListProps {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
display_properties: any; displayProperties: IIssueDisplayProperties;
states: IState[] | null; states: IState[] | null;
labels: IIssueLabels[] | null; labels: IIssueLabels[] | null;
members: IUserLite[] | null; members: IUserLite[] | null;
@ -29,7 +29,7 @@ export const KanbanIssueBlocksList: React.FC<IssueBlocksListProps> = (props) =>
isDragDisabled, isDragDisabled,
handleIssues, handleIssues,
quickActions, quickActions,
display_properties, displayProperties,
states, states,
labels, labels,
members, members,
@ -47,7 +47,7 @@ export const KanbanIssueBlocksList: React.FC<IssueBlocksListProps> = (props) =>
issue={issue} issue={issue}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
displayProperties={display_properties} displayProperties={displayProperties}
columnId={columnId} columnId={columnId}
sub_group_id={sub_group_id} sub_group_id={sub_group_id}
isDragDisabled={isDragDisabled} isDragDisabled={isDragDisabled}

View File

@ -7,7 +7,7 @@ import { useMobxStore } from "lib/mobx/store-provider";
import { KanBanGroupByHeaderRoot } from "./headers/group-by-root"; import { KanBanGroupByHeaderRoot } from "./headers/group-by-root";
import { KanbanIssueBlocksList, BoardInlineCreateIssueForm } from "components/issues"; import { KanbanIssueBlocksList, BoardInlineCreateIssueForm } from "components/issues";
// types // types
import { IEstimatePoint, IIssue, IIssueLabels, IProject, IState, IUserLite } from "types"; import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types";
// constants // constants
import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue"; import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue";
@ -26,7 +26,7 @@ export interface IGroupByKanBan {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
display_properties: any; displayProperties: IIssueDisplayProperties;
kanBanToggle: any; kanBanToggle: any;
handleKanBanToggle: any; handleKanBanToggle: any;
enableQuickIssueCreate?: boolean; enableQuickIssueCreate?: boolean;
@ -48,7 +48,7 @@ const GroupByKanBan: React.FC<IGroupByKanBan> = observer((props) => {
isDragDisabled, isDragDisabled,
handleIssues, handleIssues,
quickActions, quickActions,
display_properties, displayProperties,
kanBanToggle, kanBanToggle,
handleKanBanToggle, handleKanBanToggle,
states, states,
@ -104,7 +104,7 @@ const GroupByKanBan: React.FC<IGroupByKanBan> = observer((props) => {
isDragDisabled={isDragDisabled} isDragDisabled={isDragDisabled}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
states={states} states={states}
labels={labels} labels={labels}
members={members} members={members}
@ -151,7 +151,7 @@ export interface IKanBan {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
display_properties: any; displayProperties: IIssueDisplayProperties;
kanBanToggle: any; kanBanToggle: any;
handleKanBanToggle: any; handleKanBanToggle: any;
states: IState[] | null; states: IState[] | null;
@ -172,7 +172,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
sub_group_id = "null", sub_group_id = "null",
handleIssues, handleIssues,
quickActions, quickActions,
display_properties, displayProperties,
kanBanToggle, kanBanToggle,
handleKanBanToggle, handleKanBanToggle,
states, states,
@ -200,7 +200,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}
@ -223,7 +223,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}
@ -246,7 +246,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}
@ -269,7 +269,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}
@ -292,7 +292,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}
@ -315,7 +315,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop} isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate={enableQuickIssueCreate} enableQuickIssueCreate={enableQuickIssueCreate}

View File

@ -10,14 +10,22 @@ import { IssuePropertyAssignee } from "../properties/assignee";
import { IssuePropertyEstimates } from "../properties/estimates"; import { IssuePropertyEstimates } from "../properties/estimates";
import { IssuePropertyDate } from "../properties/date"; import { IssuePropertyDate } from "../properties/date";
import { Tooltip } from "@plane/ui"; import { Tooltip } from "@plane/ui";
import { IEstimatePoint, IIssue, IIssueLabels, IState, IUserLite, TIssuePriorities } from "types"; import {
IEstimatePoint,
IIssue,
IIssueDisplayProperties,
IIssueLabels,
IState,
IUserLite,
TIssuePriorities,
} from "types";
export interface IKanBanProperties { export interface IKanBanProperties {
sub_group_id: string; sub_group_id: string;
columnId: string; columnId: string;
issue: IIssue; issue: IIssue;
handleIssues: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => void; handleIssues: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => void;
display_properties: any; displayProperties: IIssueDisplayProperties;
states: IState[] | null; states: IState[] | null;
labels: IIssueLabels[] | null; labels: IIssueLabels[] | null;
members: IUserLite[] | null; members: IUserLite[] | null;
@ -30,7 +38,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
columnId: group_id, columnId: group_id,
issue, issue,
handleIssues, handleIssues,
display_properties, displayProperties,
states, states,
labels, labels,
members, members,
@ -97,7 +105,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
<div className="flex items-center gap-2 flex-wrap whitespace-nowrap"> <div className="flex items-center gap-2 flex-wrap whitespace-nowrap">
{/* basic properties */} {/* basic properties */}
{/* state */} {/* state */}
{display_properties && display_properties?.state && ( {displayProperties && displayProperties?.state && (
<IssuePropertyState <IssuePropertyState
value={issue?.state_detail || null} value={issue?.state_detail || null}
onChange={handleState} onChange={handleState}
@ -108,7 +116,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* priority */} {/* priority */}
{display_properties && display_properties?.priority && ( {displayProperties && displayProperties?.priority && (
<IssuePropertyPriority <IssuePropertyPriority
value={issue?.priority || null} value={issue?.priority || null}
onChange={handlePriority} onChange={handlePriority}
@ -118,7 +126,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* label */} {/* label */}
{display_properties && display_properties?.labels && ( {displayProperties && displayProperties?.labels && (
<IssuePropertyLabels <IssuePropertyLabels
value={issue?.labels || null} value={issue?.labels || null}
onChange={handleLabel} onChange={handleLabel}
@ -129,7 +137,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* assignee */} {/* assignee */}
{display_properties && display_properties?.assignee && ( {displayProperties && displayProperties?.assignee && (
<IssuePropertyAssignee <IssuePropertyAssignee
value={issue?.assignees || null} value={issue?.assignees || null}
hideDropdownArrow={true} hideDropdownArrow={true}
@ -140,7 +148,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* start date */} {/* start date */}
{display_properties && display_properties?.start_date && ( {displayProperties && displayProperties?.start_date && (
<IssuePropertyDate <IssuePropertyDate
value={issue?.start_date || null} value={issue?.start_date || null}
onChange={(date: string) => handleStartDate(date)} onChange={(date: string) => handleStartDate(date)}
@ -150,7 +158,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* target/due date */} {/* target/due date */}
{display_properties && display_properties?.due_date && ( {displayProperties && displayProperties?.due_date && (
<IssuePropertyDate <IssuePropertyDate
value={issue?.target_date || null} value={issue?.target_date || null}
onChange={(date: string) => handleTargetDate(date)} onChange={(date: string) => handleTargetDate(date)}
@ -160,7 +168,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* estimates */} {/* estimates */}
{display_properties && display_properties?.estimate && ( {displayProperties && displayProperties?.estimate && (
<IssuePropertyEstimates <IssuePropertyEstimates
value={issue?.estimate_point || null} value={issue?.estimate_point || null}
onChange={handleEstimate} onChange={handleEstimate}
@ -172,7 +180,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
{/* extra render properties */} {/* extra render properties */}
{/* sub-issues */} {/* sub-issues */}
{display_properties && display_properties?.sub_issue_count && ( {displayProperties && displayProperties?.sub_issue_count && (
<Tooltip tooltipHeading="Sub-issues" tooltipContent={`${issue.sub_issues_count}`}> <Tooltip tooltipHeading="Sub-issues" tooltipContent={`${issue.sub_issues_count}`}>
<div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5"> <div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5">
<Layers className="h-3 w-3 flex-shrink-0" strokeWidth={2} /> <Layers className="h-3 w-3 flex-shrink-0" strokeWidth={2} />
@ -182,7 +190,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* attachments */} {/* attachments */}
{display_properties && display_properties?.attachment_count && ( {displayProperties && displayProperties?.attachment_count && (
<Tooltip tooltipHeading="Attachments" tooltipContent={`${issue.attachment_count}`}> <Tooltip tooltipHeading="Attachments" tooltipContent={`${issue.attachment_count}`}>
<div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5"> <div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5">
<Paperclip className="h-3 w-3 flex-shrink-0" strokeWidth={2} /> <Paperclip className="h-3 w-3 flex-shrink-0" strokeWidth={2} />
@ -192,7 +200,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
)} )}
{/* link */} {/* link */}
{display_properties && display_properties?.link && ( {displayProperties && displayProperties?.link && (
<Tooltip tooltipHeading="Links" tooltipContent={`${issue.link_count}`}> <Tooltip tooltipHeading="Links" tooltipContent={`${issue.link_count}`}>
<div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5"> <div className="flex-shrink-0 border-[0.5px] border-custom-border-300 overflow-hidden rounded flex justify-center items-center gap-2 px-2.5 py-1 h-5">
<Link className="h-3 w-3 flex-shrink-0" strokeWidth={2} /> <Link className="h-3 w-3 flex-shrink-0" strokeWidth={2} />

View File

@ -35,7 +35,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null; const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null;
const display_properties = issueFilterStore?.userDisplayProperties || null; const displayProperties = issueFilterStore?.userDisplayProperties || null;
const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by
? "swimlanes" ? "swimlanes"
@ -113,7 +113,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")} handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle} kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -138,7 +138,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")} handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle} kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}

View File

@ -35,7 +35,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null; const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null;
const display_properties = issueFilterStore?.userDisplayProperties || null; const displayProperties = issueFilterStore?.userDisplayProperties || null;
const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by
? "swimlanes" ? "swimlanes"
@ -113,7 +113,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")} handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle} kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -138,7 +138,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")} handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle} kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}

View File

@ -34,7 +34,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
const group_by: string | null = profileIssueFiltersStore?.userDisplayFilters?.group_by || null; const group_by: string | null = profileIssueFiltersStore?.userDisplayFilters?.group_by || null;
const display_properties = profileIssueFiltersStore?.userDisplayProperties || null; const displayProperties = profileIssueFiltersStore?.userDisplayProperties || null;
const currentKanBanView: "swimlanes" | "default" = profileIssueFiltersStore?.userDisplayFilters?.sub_group_by const currentKanBanView: "swimlanes" | "default" = profileIssueFiltersStore?.userDisplayFilters?.sub_group_by
? "swimlanes" ? "swimlanes"
@ -96,7 +96,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")} handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={issueKanBanViewStore?.kanBanToggle} kanBanToggle={issueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -120,7 +120,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")} handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={issueKanBanViewStore?.kanBanToggle} kanBanToggle={issueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}

View File

@ -35,7 +35,7 @@ export const KanBanLayout: React.FC = observer(() => {
const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null; const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null;
const display_properties = issueFilterStore?.userDisplayProperties || null; const displayProperties = issueFilterStore?.userDisplayProperties || null;
const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by const currentKanBanView: "swimlanes" | "default" = issueFilterStore?.userDisplayFilters?.sub_group_by
? "swimlanes" ? "swimlanes"
@ -103,7 +103,7 @@ export const KanBanLayout: React.FC = observer(() => {
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")} handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={issueKanBanViewStore?.kanBanToggle} kanBanToggle={issueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -128,7 +128,7 @@ export const KanBanLayout: React.FC = observer(() => {
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")} handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
/> />
)} )}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={issueKanBanViewStore?.kanBanToggle} kanBanToggle={issueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}

View File

@ -7,7 +7,7 @@ import { KanBanGroupByHeaderRoot } from "./headers/group-by-root";
import { KanBanSubGroupByHeaderRoot } from "./headers/sub-group-by-root"; import { KanBanSubGroupByHeaderRoot } from "./headers/sub-group-by-root";
import { KanBan } from "./default"; import { KanBan } from "./default";
// types // types
import { IEstimatePoint, IIssue, IIssueLabels, IProject, IState, IUserLite } from "types"; import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types";
// constants // constants
import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue"; import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue";
@ -73,7 +73,7 @@ interface ISubGroupSwimlane extends ISubGroupSwimlaneHeader {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
display_properties: any; displayProperties: IIssueDisplayProperties;
kanBanToggle: any; kanBanToggle: any;
handleKanBanToggle: any; handleKanBanToggle: any;
states: IState[] | null; states: IState[] | null;
@ -93,7 +93,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
listKey, listKey,
handleIssues, handleIssues,
quickActions, quickActions,
display_properties, displayProperties,
kanBanToggle, kanBanToggle,
handleKanBanToggle, handleKanBanToggle,
states, states,
@ -143,7 +143,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
sub_group_id={getValueFromObject(_list, listKey) as string} sub_group_id={getValueFromObject(_list, listKey) as string}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -174,7 +174,7 @@ export interface IKanBanSwimLanes {
action: "update" | "delete" action: "update" | "delete"
) => void; ) => void;
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode; quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
display_properties: any; displayProperties: IIssueDisplayProperties;
kanBanToggle: any; kanBanToggle: any;
handleKanBanToggle: any; handleKanBanToggle: any;
states: IState[] | null; states: IState[] | null;
@ -193,7 +193,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
group_by, group_by,
handleIssues, handleIssues,
quickActions, quickActions,
display_properties, displayProperties,
kanBanToggle, kanBanToggle,
handleKanBanToggle, handleKanBanToggle,
states, states,
@ -322,7 +322,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`id`} listKey={`id`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -344,7 +344,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`key`} listKey={`key`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -366,7 +366,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`key`} listKey={`key`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -388,7 +388,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`id`} listKey={`id`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -410,7 +410,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`member.id`} listKey={`member.id`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}
@ -432,7 +432,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
listKey={`member.id`} listKey={`member.id`}
handleIssues={handleIssues} handleIssues={handleIssues}
quickActions={quickActions} quickActions={quickActions}
display_properties={display_properties} displayProperties={displayProperties}
kanBanToggle={kanBanToggle} kanBanToggle={kanBanToggle}
handleKanBanToggle={handleKanBanToggle} handleKanBanToggle={handleKanBanToggle}
states={states} states={states}

View File

@ -25,6 +25,7 @@ export const GlobalViewLayoutRoot: React.FC<Props> = observer((props) => {
globalViewFilters: globalViewFiltersStore, globalViewFilters: globalViewFiltersStore,
workspaceFilter: workspaceFilterStore, workspaceFilter: workspaceFilterStore,
workspace: workspaceStore, workspace: workspaceStore,
issueDetail: issueDetailStore,
} = useMobxStore(); } = useMobxStore();
const viewDetails = globalViewId ? globalViewsStore.globalViewDetails[globalViewId.toString()] : undefined; const viewDetails = globalViewId ? globalViewsStore.globalViewDetails[globalViewId.toString()] : undefined;
@ -62,14 +63,17 @@ export const GlobalViewLayoutRoot: React.FC<Props> = observer((props) => {
const handleUpdateIssue = useCallback( const handleUpdateIssue = useCallback(
(issue: IIssue, data: Partial<IIssue>) => { (issue: IIssue, data: Partial<IIssue>) => {
if (!workspaceSlug) return; if (!workspaceSlug || !globalViewId) return;
console.log("issue", issue); const payload = {
console.log("data", data); ...issue,
...data,
};
// TODO: add update issue logic here globalViewIssuesStore.updateIssueStructure(globalViewId.toString(), payload);
issueDetailStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, data);
}, },
[workspaceSlug] [globalViewId, globalViewIssuesStore, workspaceSlug, issueDetailStore]
); );
const issues = type const issues = type

View File

@ -33,6 +33,8 @@ export const ProjectLayoutRoot: React.FC = observer(() => {
const issueCount = issueStore.getIssuesCount; const issueCount = issueStore.getIssuesCount;
console.log("issueCount", issueCount);
return ( return (
<div className="relative w-full h-full flex flex-col overflow-hidden"> <div className="relative w-full h-full flex flex-col overflow-hidden">
<ProjectAppliedFiltersRoot /> <ProjectAppliedFiltersRoot />

View File

@ -19,7 +19,7 @@ export const SpreadsheetCreatedOnColumn: React.FC<Props> = ({ issue, expandedIss
return ( return (
<> <>
{renderLongDetailDateFormat(issue.created_at)} <div className="text-xs">{renderLongDetailDateFormat(issue.created_at)}</div>
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&

View File

@ -21,7 +21,7 @@ export const SpreadsheetUpdatedOnColumn: React.FC<Props> = (props) => {
return ( return (
<> <>
{renderLongDetailDateFormat(issue.updated_at)} <div className="text-xs">{renderLongDetailDateFormat(issue.updated_at)}</div>
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&

View File

@ -143,6 +143,7 @@ export const WorkspaceViewForm: React.FC<Props> = observer((props) => {
}} }}
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet} layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
labels={workspaceStore.workspaceLabels ?? undefined} labels={workspaceStore.workspaceLabels ?? undefined}
members={workspaceStore.workspaceMembers?.map((m) => m.member) ?? undefined}
projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined} projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined}
/> />
</FiltersDropdown> </FiltersDropdown>

View File

@ -7,6 +7,7 @@ import { handleIssueQueryParamsByLayout } from "helpers/issue.helper";
// types // types
import { RootStore } from "../root"; import { RootStore } from "../root";
import { IIssue, IIssueFilterOptions, TStaticViewTypes } from "types"; import { IIssue, IIssueFilterOptions, TStaticViewTypes } from "types";
import { sortArrayByDate, sortArrayByPriority } from "constants/kanban-helpers";
export interface IGlobalViewIssuesStore { export interface IGlobalViewIssuesStore {
// states // states
@ -21,6 +22,7 @@ export interface IGlobalViewIssuesStore {
// actions // actions
fetchViewIssues: (workspaceSlug: string, viewId: string, filters: IIssueFilterOptions) => Promise<any>; fetchViewIssues: (workspaceSlug: string, viewId: string, filters: IIssueFilterOptions) => Promise<any>;
fetchStaticIssues: (workspaceSlug: string, type: TStaticViewTypes) => Promise<any>; fetchStaticIssues: (workspaceSlug: string, type: TStaticViewTypes) => Promise<any>;
updateIssueStructure: (viewId: string, issue: IIssue) => Promise<any>;
} }
export class GlobalViewIssuesStore implements IGlobalViewIssuesStore { export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
@ -52,6 +54,7 @@ export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
// actions // actions
fetchViewIssues: action, fetchViewIssues: action,
fetchStaticIssues: action, fetchStaticIssues: action,
updateIssueStructure: action,
}); });
this.rootStore = _rootStore; this.rootStore = _rootStore;
@ -174,4 +177,28 @@ export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
throw error; throw error;
} }
}; };
updateIssueStructure = async (viewId: string, issue: IIssue) => {
let issues = this.viewIssues[viewId];
if (!issues) return null;
const _currentIssueId = issues?.find((_i) => _i?.id === issue.id);
issues = _currentIssueId
? issues?.map((i: IIssue) => (i?.id === issue?.id ? { ...i, ...issue } : i))
: [...(issues ?? []), issue];
const orderBy = this.rootStore?.workspaceFilter?.workspaceDisplayFilters?.order_by || "";
if (orderBy === "-created_at") issues = sortArrayByDate(issues as any, "created_at");
if (orderBy === "-updated_at") issues = sortArrayByDate(issues as any, "updated_at");
if (orderBy === "start_date") issues = sortArrayByDate(issues as any, "updated_at");
if (orderBy === "priority") issues = sortArrayByPriority(issues as any, "priority");
runInAction(() => {
this.viewIssues = { ...this.viewIssues, [viewId]: issues };
});
};
} }