Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/core/components/issues/issue-detail/parent-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const IssueParentSelect: React.FC<TIssueParentSelect> = observer((props)
const handleParentIssue = async (_issueId: string | null = null) => {
try {
await issueOperations.update(workspaceSlug, projectId, issueId, { parent_id: _issueId });
await issueOperations.fetch(workspaceSlug, projectId, issueId);
await issueOperations.fetch(workspaceSlug, projectId, issueId, false);
_issueId && (await fetchSubIssues(workspaceSlug, projectId, _issueId));
toggleParentIssueModal(null);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/issues/issue-detail/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { IssueMainContent } from "./main-content";
import { IssueDetailsSidebar } from "./sidebar";

export type TIssueOperations = {
fetch: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
fetch: (workspaceSlug: string, projectId: string, issueId: string, loader?: boolean) => Promise<void>;
update: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
remove: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
archive?: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
Expand Down
31 changes: 4 additions & 27 deletions web/core/components/issues/peek-overview/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { usePathname } from "next/navigation";
import { TIssue } from "@plane/types";
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/ui";
// components
import { IssueView } from "@/components/issues";
import { IssueView, TIssueOperations } from "@/components/issues";
// constants
import { ISSUE_UPDATED, ISSUE_DELETED, ISSUE_ARCHIVED, ISSUE_RESTORED } from "@/constants/event-tracker";
import { EIssuesStoreType } from "@/constants/issue";
Expand All @@ -22,29 +22,6 @@ interface IIssuePeekOverview {
is_draft?: boolean;
}

export type TIssuePeekOperations = {
fetch: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
update: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
remove: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
archive: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
restore: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
addIssueToCycle: (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => Promise<void>;
removeIssueFromCycle: (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => Promise<void>;
addModulesToIssue?: (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => Promise<void>;
removeIssueFromModule?: (
workspaceSlug: string,
projectId: string,
moduleId: string,
issueId: string
) => Promise<void>;
removeModulesFromIssue?: (
workspaceSlug: string,
projectId: string,
issueId: string,
moduleIds: string[]
) => Promise<void>;
};

export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
const { embedIssue = false, embedRemoveCurrentNotification, is_archived = false, is_draft = false } = props;
// router
Expand All @@ -66,11 +43,11 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
const [loader, setLoader] = useState(true);
const [error, setError] = useState(false);

const issueOperations: TIssuePeekOperations = useMemo(
const issueOperations: TIssueOperations = useMemo(
() => ({
fetch: async (workspaceSlug: string, projectId: string, issueId: string) => {
fetch: async (workspaceSlug: string, projectId: string, issueId: string, loader = true) => {
try {
setLoader(true);
setLoader(loader);
setError(false);
await fetchIssue(
workspaceSlug,
Expand Down
6 changes: 6 additions & 0 deletions web/core/store/issue/issue-details/sub_issues.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
this.fetchOtherProjectProperties(workspaceSlug, otherProjectIds);
}

if (subIssues) {
this.rootIssueDetailStore.rootIssueStore.issues.updateIssue(parentIssueId, {
sub_issues_count: subIssues.length,
});
}

runInAction(() => {
set(this.subIssuesStateDistribution, parentIssueId, subIssuesStateDistribution);
set(
Expand Down