forked from github/plane
Fix/inbox issue bugs (#3477)
* fix: inbox pending_issue_count updation from the store * fix: inbox list item overflow issue on issue title * fix: inbox issue mutation --------- Co-authored-by: gurusainath <gurusainath007@gmail.com>
This commit is contained in:
parent
ebc891b985
commit
e78c1f2060
@ -65,7 +65,7 @@ export const InboxIssueListItem: FC<TInboxIssueListItem> = observer((props) => {
|
||||
} ${inboxIssueDetail.status !== -2 ? "opacity-60" : ""}`}
|
||||
>
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<div className="flex items-center gap-x-2">
|
||||
<div className="relative flex items-center gap-x-2 overflow-hidden">
|
||||
<p className="flex-shrink-0 text-xs text-custom-text-200">
|
||||
{getProjectById(issue.project_id)?.identifier}-{issue.sequence_id}
|
||||
</p>
|
||||
|
@ -152,7 +152,7 @@ export class InboxIssue implements IInboxIssue {
|
||||
|
||||
runInAction(() => {
|
||||
const { ["issue_inbox"]: issueInboxDetail, ...issue } = response;
|
||||
this.rootStore.inbox.rootStore.issue.issues.addIssue([issue]);
|
||||
this.rootStore.inbox.rootStore.issue.issues.updateIssue(issue.id, issue);
|
||||
const { ["id"]: omittedId, ...inboxIssue } = issueInboxDetail[0];
|
||||
set(this.inboxIssueMap, [inboxId, response.id], inboxIssue);
|
||||
});
|
||||
@ -186,6 +186,7 @@ export class InboxIssue implements IInboxIssue {
|
||||
this.rootStore.inbox.rootStore.issue.issues.addIssue([issue]);
|
||||
const { ["id"]: omittedId, ...inboxIssue } = issueInboxDetail[0];
|
||||
set(this.inboxIssueMap, [inboxId, response.id], inboxIssue);
|
||||
update(this.rootStore.inbox.inbox.inboxMap, [inboxId, "pending_issue_count"], (count: number = 0) => count + 1);
|
||||
});
|
||||
|
||||
runInAction(() => {
|
||||
@ -216,7 +217,7 @@ export class InboxIssue implements IInboxIssue {
|
||||
|
||||
runInAction(() => {
|
||||
const { ["issue_inbox"]: issueInboxDetail, ...issue } = response;
|
||||
this.rootStore.inbox.rootStore.issue.issues.addIssue([issue]);
|
||||
this.rootStore.inbox.rootStore.issue.issues.updateIssue(issue.id, issue);
|
||||
const { ["id"]: omittedId, ...inboxIssue } = issueInboxDetail[0];
|
||||
set(this.inboxIssueMap, [inboxId, response.id], inboxIssue);
|
||||
});
|
||||
@ -242,6 +243,8 @@ export class InboxIssue implements IInboxIssue {
|
||||
runInAction(() => {
|
||||
pull(this.inboxIssues[inboxId], inboxIssueId);
|
||||
delete this.inboxIssueMap[inboxId][inboxIssueId];
|
||||
this.rootStore.inbox.rootStore.issue.issues.removeIssue(inboxIssueId);
|
||||
update(this.rootStore.inbox.inbox.inboxMap, [inboxId, "pending_issue_count"], (count: number = 0) => count - 1);
|
||||
});
|
||||
|
||||
await this.rootStore.issue.issueDetail.fetchActivities(workspaceSlug, projectId, inboxIssueId);
|
||||
@ -267,11 +270,15 @@ export class InboxIssue implements IInboxIssue {
|
||||
data
|
||||
);
|
||||
|
||||
const pendingStatus = -2;
|
||||
runInAction(() => {
|
||||
const { ["issue_inbox"]: issueInboxDetail, ...issue } = response;
|
||||
this.rootStore.inbox.rootStore.issue.issues.addIssue([issue]);
|
||||
const { ["id"]: omittedId, ...inboxIssue } = issueInboxDetail[0];
|
||||
set(this.inboxIssueMap, [inboxId, response.id], inboxIssue);
|
||||
update(this.rootStore.inbox.inbox.inboxMap, [inboxId, "pending_issue_count"], (count: number = 0) =>
|
||||
data.status === pendingStatus ? count + 1 : count - 1
|
||||
);
|
||||
});
|
||||
|
||||
runInAction(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user