fix issue quick add

This commit is contained in:
rahulramesha 2024-03-26 13:08:48 +05:30
parent eea1cce926
commit 295fdc9386

View File

@ -39,9 +39,9 @@ import isEqual from "date-fns/isEqual";
export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null> | "target_date"; export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null> | "target_date";
export enum EIssueGroupedAction { export enum EIssueGroupedAction {
ADD, ADD = "ADD",
DELETE, DELETE = "DELETE",
REORDER, REORDER = "REORDER",
} }
export const ALL_ISSUES = "All Issues"; export const ALL_ISSUES = "All Issues";
@ -154,9 +154,14 @@ export class BaseIssuesStore implements IBaseIssuesStore {
onfetchNexIssues: action.bound, onfetchNexIssues: action.bound,
clear: action.bound, clear: action.bound,
getPaginationData: action.bound, getPaginationData: action.bound,
addIssue: action.bound,
removeIssueFromList: action.bound,
createIssue: action, createIssue: action,
updateIssue: action, updateIssue: action,
createDraftIssue: action,
updateDraftIssue: action,
issueQuickAdd: action.bound,
removeIssue: action, removeIssue: action,
archiveIssue: action, archiveIssue: action,
removeBulkIssues: action, removeBulkIssues: action,
@ -661,7 +666,8 @@ export class BaseIssuesStore implements IBaseIssuesStore {
getDifference = ( getDifference = (
current: string[], current: string[],
previous: string[] previous: string[],
action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE
): { [EIssueGroupedAction.ADD]: string[]; [EIssueGroupedAction.DELETE]: string[] } => { ): { [EIssueGroupedAction.ADD]: string[]; [EIssueGroupedAction.DELETE]: string[] } => {
const ADD = []; const ADD = [];
const DELETE = []; const DELETE = [];
@ -675,7 +681,11 @@ export class BaseIssuesStore implements IBaseIssuesStore {
DELETE.push(previousValue); DELETE.push(previousValue);
} }
return { [EIssueGroupedAction.ADD]: ADD, [EIssueGroupedAction.DELETE]: DELETE }; if (!action) return { [EIssueGroupedAction.ADD]: ADD, [EIssueGroupedAction.DELETE]: DELETE };
if (action === EIssueGroupedAction.ADD)
return { [EIssueGroupedAction.ADD]: [...ADD, ...DELETE], [EIssueGroupedAction.DELETE]: [] };
else return { [EIssueGroupedAction.DELETE]: [...ADD, ...DELETE], [EIssueGroupedAction.ADD]: [] };
}; };
issueDisplayFiltersDefaultData = (groupBy: string | null): string[] => { issueDisplayFiltersDefaultData = (groupBy: string | null): string[] => {