forked from github/plane
fix: global views bugs (#2563)
This commit is contained in:
parent
52474715de
commit
8b7b5c54b9
@ -134,6 +134,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
|
||||
handleFiltersUpdate={handleFiltersUpdate}
|
||||
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
|
||||
labels={workspaceStore.workspaceLabels ?? undefined}
|
||||
members={workspaceStore.workspaceMembers?.map((m) => m.member) ?? undefined}
|
||||
projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined}
|
||||
/>
|
||||
</FiltersDropdown>
|
||||
|
@ -2,7 +2,7 @@ import { Draggable } from "@hello-pangea/dnd";
|
||||
// components
|
||||
import { KanBanProperties } from "./properties";
|
||||
// types
|
||||
import { IEstimatePoint, IIssue, IIssueLabels, IState, IUserLite } from "types";
|
||||
import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IState, IUserLite } from "types";
|
||||
|
||||
interface IssueBlockProps {
|
||||
sub_group_id: string;
|
||||
@ -17,7 +17,7 @@ interface IssueBlockProps {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
displayProperties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
states: IState[] | null;
|
||||
labels: IIssueLabels[] | null;
|
||||
members: IUserLite[] | null;
|
||||
@ -81,7 +81,7 @@ export const KanbanIssueBlock: React.FC<IssueBlockProps> = (props) => {
|
||||
columnId={columnId}
|
||||
issue={issue}
|
||||
handleIssues={updateIssue}
|
||||
display_properties={displayProperties}
|
||||
displayProperties={displayProperties}
|
||||
states={states}
|
||||
labels={labels}
|
||||
members={members}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// components
|
||||
import { KanbanIssueBlock } from "components/issues";
|
||||
import { IEstimatePoint, IIssue, IIssueLabels, IState, IUserLite } from "types";
|
||||
import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IState, IUserLite } from "types";
|
||||
|
||||
interface IssueBlocksListProps {
|
||||
sub_group_id: string;
|
||||
@ -14,7 +14,7 @@ interface IssueBlocksListProps {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
states: IState[] | null;
|
||||
labels: IIssueLabels[] | null;
|
||||
members: IUserLite[] | null;
|
||||
@ -29,7 +29,7 @@ export const KanbanIssueBlocksList: React.FC<IssueBlocksListProps> = (props) =>
|
||||
isDragDisabled,
|
||||
handleIssues,
|
||||
quickActions,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
states,
|
||||
labels,
|
||||
members,
|
||||
@ -47,7 +47,7 @@ export const KanbanIssueBlocksList: React.FC<IssueBlocksListProps> = (props) =>
|
||||
issue={issue}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
displayProperties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
columnId={columnId}
|
||||
sub_group_id={sub_group_id}
|
||||
isDragDisabled={isDragDisabled}
|
||||
|
@ -7,7 +7,7 @@ import { useMobxStore } from "lib/mobx/store-provider";
|
||||
import { KanBanGroupByHeaderRoot } from "./headers/group-by-root";
|
||||
import { KanbanIssueBlocksList, BoardInlineCreateIssueForm } from "components/issues";
|
||||
// types
|
||||
import { IEstimatePoint, IIssue, IIssueLabels, IProject, IState, IUserLite } from "types";
|
||||
import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types";
|
||||
// constants
|
||||
import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue";
|
||||
|
||||
@ -26,7 +26,7 @@ export interface IGroupByKanBan {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
kanBanToggle: any;
|
||||
handleKanBanToggle: any;
|
||||
enableQuickIssueCreate?: boolean;
|
||||
@ -48,7 +48,7 @@ const GroupByKanBan: React.FC<IGroupByKanBan> = observer((props) => {
|
||||
isDragDisabled,
|
||||
handleIssues,
|
||||
quickActions,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
kanBanToggle,
|
||||
handleKanBanToggle,
|
||||
states,
|
||||
@ -104,7 +104,7 @@ const GroupByKanBan: React.FC<IGroupByKanBan> = observer((props) => {
|
||||
isDragDisabled={isDragDisabled}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
states={states}
|
||||
labels={labels}
|
||||
members={members}
|
||||
@ -151,7 +151,7 @@ export interface IKanBan {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
kanBanToggle: any;
|
||||
handleKanBanToggle: any;
|
||||
states: IState[] | null;
|
||||
@ -172,7 +172,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
sub_group_id = "null",
|
||||
handleIssues,
|
||||
quickActions,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
kanBanToggle,
|
||||
handleKanBanToggle,
|
||||
states,
|
||||
@ -200,7 +200,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
@ -223,7 +223,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
@ -246,7 +246,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
@ -269,7 +269,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
@ -292,7 +292,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
@ -315,7 +315,7 @@ export const KanBan: React.FC<IKanBan> = observer((props) => {
|
||||
isDragDisabled={!issueKanBanViewStore?.canUserDragDrop}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||
|
@ -10,14 +10,22 @@ import { IssuePropertyAssignee } from "../properties/assignee";
|
||||
import { IssuePropertyEstimates } from "../properties/estimates";
|
||||
import { IssuePropertyDate } from "../properties/date";
|
||||
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 {
|
||||
sub_group_id: string;
|
||||
columnId: string;
|
||||
issue: IIssue;
|
||||
handleIssues: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => void;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
states: IState[] | null;
|
||||
labels: IIssueLabels[] | null;
|
||||
members: IUserLite[] | null;
|
||||
@ -30,7 +38,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
columnId: group_id,
|
||||
issue,
|
||||
handleIssues,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
states,
|
||||
labels,
|
||||
members,
|
||||
@ -97,7 +105,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
<div className="flex items-center gap-2 flex-wrap whitespace-nowrap">
|
||||
{/* basic properties */}
|
||||
{/* state */}
|
||||
{display_properties && display_properties?.state && (
|
||||
{displayProperties && displayProperties?.state && (
|
||||
<IssuePropertyState
|
||||
value={issue?.state_detail || null}
|
||||
onChange={handleState}
|
||||
@ -108,7 +116,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* priority */}
|
||||
{display_properties && display_properties?.priority && (
|
||||
{displayProperties && displayProperties?.priority && (
|
||||
<IssuePropertyPriority
|
||||
value={issue?.priority || null}
|
||||
onChange={handlePriority}
|
||||
@ -118,7 +126,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* label */}
|
||||
{display_properties && display_properties?.labels && (
|
||||
{displayProperties && displayProperties?.labels && (
|
||||
<IssuePropertyLabels
|
||||
value={issue?.labels || null}
|
||||
onChange={handleLabel}
|
||||
@ -129,7 +137,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* assignee */}
|
||||
{display_properties && display_properties?.assignee && (
|
||||
{displayProperties && displayProperties?.assignee && (
|
||||
<IssuePropertyAssignee
|
||||
value={issue?.assignees || null}
|
||||
hideDropdownArrow={true}
|
||||
@ -140,7 +148,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* start date */}
|
||||
{display_properties && display_properties?.start_date && (
|
||||
{displayProperties && displayProperties?.start_date && (
|
||||
<IssuePropertyDate
|
||||
value={issue?.start_date || null}
|
||||
onChange={(date: string) => handleStartDate(date)}
|
||||
@ -150,7 +158,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* target/due date */}
|
||||
{display_properties && display_properties?.due_date && (
|
||||
{displayProperties && displayProperties?.due_date && (
|
||||
<IssuePropertyDate
|
||||
value={issue?.target_date || null}
|
||||
onChange={(date: string) => handleTargetDate(date)}
|
||||
@ -160,7 +168,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* estimates */}
|
||||
{display_properties && display_properties?.estimate && (
|
||||
{displayProperties && displayProperties?.estimate && (
|
||||
<IssuePropertyEstimates
|
||||
value={issue?.estimate_point || null}
|
||||
onChange={handleEstimate}
|
||||
@ -172,7 +180,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
|
||||
{/* extra render properties */}
|
||||
{/* sub-issues */}
|
||||
{display_properties && display_properties?.sub_issue_count && (
|
||||
{displayProperties && displayProperties?.sub_issue_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">
|
||||
<Layers className="h-3 w-3 flex-shrink-0" strokeWidth={2} />
|
||||
@ -182,7 +190,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* attachments */}
|
||||
{display_properties && display_properties?.attachment_count && (
|
||||
{displayProperties && displayProperties?.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">
|
||||
<Paperclip className="h-3 w-3 flex-shrink-0" strokeWidth={2} />
|
||||
@ -192,7 +200,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
||||
)}
|
||||
|
||||
{/* link */}
|
||||
{display_properties && display_properties?.link && (
|
||||
{displayProperties && displayProperties?.link && (
|
||||
<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">
|
||||
<Link className="h-3 w-3 flex-shrink-0" strokeWidth={2} />
|
||||
|
@ -35,7 +35,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
||||
|
||||
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
|
||||
? "swimlanes"
|
||||
@ -113,7 +113,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
||||
handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -138,7 +138,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
||||
handleRemoveFromCycle={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={cycleIssueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
|
@ -35,7 +35,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
||||
|
||||
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
|
||||
? "swimlanes"
|
||||
@ -113,7 +113,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
||||
handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -138,7 +138,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
||||
handleRemoveFromModule={async () => handleIssues(sub_group_by, group_by, issue, "remove")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={moduleIssueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
|
@ -34,7 +34,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
||||
|
||||
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
|
||||
? "swimlanes"
|
||||
@ -96,7 +96,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
||||
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={issueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -120,7 +120,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
||||
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={issueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
|
@ -35,7 +35,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
||||
|
||||
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
|
||||
? "swimlanes"
|
||||
@ -103,7 +103,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
||||
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={issueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -128,7 +128,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
||||
handleUpdate={async (data) => handleIssues(sub_group_by, group_by, data, "update")}
|
||||
/>
|
||||
)}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={issueKanBanViewStore?.kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
|
@ -7,7 +7,7 @@ import { KanBanGroupByHeaderRoot } from "./headers/group-by-root";
|
||||
import { KanBanSubGroupByHeaderRoot } from "./headers/sub-group-by-root";
|
||||
import { KanBan } from "./default";
|
||||
// types
|
||||
import { IEstimatePoint, IIssue, IIssueLabels, IProject, IState, IUserLite } from "types";
|
||||
import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types";
|
||||
// constants
|
||||
import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue";
|
||||
|
||||
@ -73,7 +73,7 @@ interface ISubGroupSwimlane extends ISubGroupSwimlaneHeader {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
kanBanToggle: any;
|
||||
handleKanBanToggle: any;
|
||||
states: IState[] | null;
|
||||
@ -93,7 +93,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
||||
listKey,
|
||||
handleIssues,
|
||||
quickActions,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
kanBanToggle,
|
||||
handleKanBanToggle,
|
||||
states,
|
||||
@ -143,7 +143,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
||||
sub_group_id={getValueFromObject(_list, listKey) as string}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -174,7 +174,7 @@ export interface IKanBanSwimLanes {
|
||||
action: "update" | "delete"
|
||||
) => void;
|
||||
quickActions: (sub_group_by: string | null, group_by: string | null, issue: IIssue) => React.ReactNode;
|
||||
display_properties: any;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
kanBanToggle: any;
|
||||
handleKanBanToggle: any;
|
||||
states: IState[] | null;
|
||||
@ -193,7 +193,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
group_by,
|
||||
handleIssues,
|
||||
quickActions,
|
||||
display_properties,
|
||||
displayProperties,
|
||||
kanBanToggle,
|
||||
handleKanBanToggle,
|
||||
states,
|
||||
@ -322,7 +322,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`id`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -344,7 +344,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`key`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -366,7 +366,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`key`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -388,7 +388,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`id`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -410,7 +410,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`member.id`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
@ -432,7 +432,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
||||
listKey={`member.id`}
|
||||
handleIssues={handleIssues}
|
||||
quickActions={quickActions}
|
||||
display_properties={display_properties}
|
||||
displayProperties={displayProperties}
|
||||
kanBanToggle={kanBanToggle}
|
||||
handleKanBanToggle={handleKanBanToggle}
|
||||
states={states}
|
||||
|
@ -25,6 +25,7 @@ export const GlobalViewLayoutRoot: React.FC<Props> = observer((props) => {
|
||||
globalViewFilters: globalViewFiltersStore,
|
||||
workspaceFilter: workspaceFilterStore,
|
||||
workspace: workspaceStore,
|
||||
issueDetail: issueDetailStore,
|
||||
} = useMobxStore();
|
||||
|
||||
const viewDetails = globalViewId ? globalViewsStore.globalViewDetails[globalViewId.toString()] : undefined;
|
||||
@ -62,14 +63,17 @@ export const GlobalViewLayoutRoot: React.FC<Props> = observer((props) => {
|
||||
|
||||
const handleUpdateIssue = useCallback(
|
||||
(issue: IIssue, data: Partial<IIssue>) => {
|
||||
if (!workspaceSlug) return;
|
||||
if (!workspaceSlug || !globalViewId) return;
|
||||
|
||||
console.log("issue", issue);
|
||||
console.log("data", data);
|
||||
const payload = {
|
||||
...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
|
||||
|
@ -33,6 +33,8 @@ export const ProjectLayoutRoot: React.FC = observer(() => {
|
||||
|
||||
const issueCount = issueStore.getIssuesCount;
|
||||
|
||||
console.log("issueCount", issueCount);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex flex-col overflow-hidden">
|
||||
<ProjectAppliedFiltersRoot />
|
||||
|
@ -19,7 +19,7 @@ export const SpreadsheetCreatedOnColumn: React.FC<Props> = ({ issue, expandedIss
|
||||
|
||||
return (
|
||||
<>
|
||||
{renderLongDetailDateFormat(issue.created_at)}
|
||||
<div className="text-xs">{renderLongDetailDateFormat(issue.created_at)}</div>
|
||||
|
||||
{isExpanded &&
|
||||
!isLoading &&
|
||||
|
@ -21,7 +21,7 @@ export const SpreadsheetUpdatedOnColumn: React.FC<Props> = (props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{renderLongDetailDateFormat(issue.updated_at)}
|
||||
<div className="text-xs">{renderLongDetailDateFormat(issue.updated_at)}</div>
|
||||
|
||||
{isExpanded &&
|
||||
!isLoading &&
|
||||
|
@ -143,6 +143,7 @@ export const WorkspaceViewForm: React.FC<Props> = observer((props) => {
|
||||
}}
|
||||
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
|
||||
labels={workspaceStore.workspaceLabels ?? undefined}
|
||||
members={workspaceStore.workspaceMembers?.map((m) => m.member) ?? undefined}
|
||||
projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined}
|
||||
/>
|
||||
</FiltersDropdown>
|
||||
|
@ -7,6 +7,7 @@ import { handleIssueQueryParamsByLayout } from "helpers/issue.helper";
|
||||
// types
|
||||
import { RootStore } from "../root";
|
||||
import { IIssue, IIssueFilterOptions, TStaticViewTypes } from "types";
|
||||
import { sortArrayByDate, sortArrayByPriority } from "constants/kanban-helpers";
|
||||
|
||||
export interface IGlobalViewIssuesStore {
|
||||
// states
|
||||
@ -21,6 +22,7 @@ export interface IGlobalViewIssuesStore {
|
||||
// actions
|
||||
fetchViewIssues: (workspaceSlug: string, viewId: string, filters: IIssueFilterOptions) => Promise<any>;
|
||||
fetchStaticIssues: (workspaceSlug: string, type: TStaticViewTypes) => Promise<any>;
|
||||
updateIssueStructure: (viewId: string, issue: IIssue) => Promise<any>;
|
||||
}
|
||||
|
||||
export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
|
||||
@ -52,6 +54,7 @@ export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
|
||||
// actions
|
||||
fetchViewIssues: action,
|
||||
fetchStaticIssues: action,
|
||||
updateIssueStructure: action,
|
||||
});
|
||||
|
||||
this.rootStore = _rootStore;
|
||||
@ -174,4 +177,28 @@ export class GlobalViewIssuesStore implements IGlobalViewIssuesStore {
|
||||
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 };
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user