fix: inbox issue bug fixes and improvements. (#3460)

* style: fix create comment card overflow issue.

* chore: improved loader and filter selection logic.

* chore: implement inbox issue navigation functionality.

* chore: loaders in inbox issue sidebar and the content root

* chore: inbox issue detail sidebar revamp.

---------

Co-authored-by: gurusainath <gurusainath007@gmail.com>
This commit is contained in:
Prateek Shourya 2024-01-25 13:41:02 +05:30 committed by GitHub
parent 2956c43ed5
commit 03cbad5110
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 316 additions and 209 deletions

View file

@ -17,21 +17,24 @@ import type {
TInboxDetailedStatus,
TIssue,
} from "@plane/types";
// constants
import { INBOX_ISSUE_SOURCE } from "constants/inbox";
type TInboxIssueLoader = "fetch" | undefined;
type TLoader = "init-loader" | "mutation" | undefined;
export interface IInboxIssue {
// observables
loader: TInboxIssueLoader;
loader: TLoader;
inboxIssues: TInboxIssueDetailIdMap;
inboxIssueMap: TInboxIssueDetailMap;
// helper methods
getInboxIssuesByInboxId: (inboxId: string) => string[] | undefined;
getInboxIssueByIssueId: (inboxId: string, issueId: string) => TInboxIssueDetail | undefined;
// actions
fetchInboxIssues: (workspaceSlug: string, projectId: string, inboxId: string) => Promise<TInboxIssueExtendedDetail[]>;
fetchInboxIssues: (
workspaceSlug: string,
projectId: string,
inboxId: string,
loaderType?: TLoader
) => Promise<TInboxIssueExtendedDetail[]>;
fetchInboxIssueById: (
workspaceSlug: string,
projectId: string,
@ -63,7 +66,7 @@ export interface IInboxIssue {
export class InboxIssue implements IInboxIssue {
// observables
loader: TInboxIssueLoader = "fetch";
loader: TLoader = "init-loader";
inboxIssues: TInboxIssueDetailIdMap = {};
inboxIssueMap: TInboxIssueDetailMap = {};
// root store
@ -104,9 +107,14 @@ export class InboxIssue implements IInboxIssue {
});
// actions
fetchInboxIssues = async (workspaceSlug: string, projectId: string, inboxId: string) => {
fetchInboxIssues = async (
workspaceSlug: string,
projectId: string,
inboxId: string,
loaderType: TLoader = "init-loader"
) => {
try {
this.loader = "fetch";
this.loader = loaderType;
const queryParams = this.rootStore.inbox.inboxFilter.inboxAppliedFilters ?? {};
const response = await this.inboxIssueService.fetchInboxIssues(workspaceSlug, projectId, inboxId, queryParams);