mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: empty module mutation and issue view flicker fix (#1158)
This commit is contained in:
parent
c8caa925b1
commit
c949c4d244
@ -186,7 +186,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
|
||||
mutate<IIssue>(PROJECT_ISSUES_DETAILS, (prevData) => ({ ...prevData, ...res }), false);
|
||||
} else {
|
||||
if (issueView === "calendar") mutate(calendarFetchKey);
|
||||
else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(activeProject ?? "", params));
|
||||
mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(activeProject ?? "", params));
|
||||
}
|
||||
|
||||
if (payload.cycle && payload.cycle !== "") addIssueToCycle(res.id, payload.cycle);
|
||||
|
@ -190,6 +190,19 @@ export const reducer: ReducerFunctionType = (state, action) => {
|
||||
};
|
||||
|
||||
const saveDataToServer = async (workspaceSlug: string, projectID: string, state: any) => {
|
||||
mutate<IProjectMember>(
|
||||
workspaceSlug && projectID ? USER_PROJECT_VIEW(projectID as string) : null,
|
||||
(prevData) => {
|
||||
if (!prevData) return prevData;
|
||||
|
||||
return {
|
||||
...prevData,
|
||||
view_props: state,
|
||||
};
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
await projectService.setProjectView(workspaceSlug, projectID, {
|
||||
view_props: state,
|
||||
});
|
||||
|
@ -172,47 +172,15 @@ const SingleModule: React.FC = () => {
|
||||
}
|
||||
>
|
||||
<AnalyticsProjectModal isOpen={analyticsModal} onClose={() => setAnalyticsModal(false)} />
|
||||
{moduleIssues ? (
|
||||
moduleIssues.length > 0 ? (
|
||||
<div className={`h-full ${moduleSidebar ? "mr-[24rem]" : ""} duration-300`}>
|
||||
<IssuesView type="module" openIssuesListModal={openIssuesListModal} />
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
className={`flex h-full flex-col items-center justify-center px-4 ${
|
||||
moduleSidebar ? "mr-[24rem]" : ""
|
||||
} duration-300`}
|
||||
>
|
||||
<EmptySpace
|
||||
title="You don't have any issue yet."
|
||||
description="Modules are smaller, focused projects that help you group and organize issues within a specific time frame."
|
||||
Icon={RectangleStackIcon}
|
||||
>
|
||||
<EmptySpaceItem
|
||||
title="Create a new issue"
|
||||
description="Click to create a new issue inside the module."
|
||||
Icon={PlusIcon}
|
||||
action={() => {
|
||||
const e = new KeyboardEvent("keydown", {
|
||||
key: "c",
|
||||
});
|
||||
document.dispatchEvent(e);
|
||||
}}
|
||||
/>
|
||||
<EmptySpaceItem
|
||||
title="Add an existing issue"
|
||||
description="Open list"
|
||||
Icon={ListBulletIcon}
|
||||
action={openIssuesListModal}
|
||||
/>
|
||||
</EmptySpace>
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div
|
||||
className={`h-full ${moduleSidebar ? "mr-[24rem]" : ""} ${
|
||||
analyticsModal ? "mr-[50%]" : ""
|
||||
} duration-300`}
|
||||
>
|
||||
<IssuesView type="module" openIssuesListModal={openIssuesListModal} />
|
||||
</div>
|
||||
|
||||
<ModuleDetailsSidebar
|
||||
issues={moduleIssues ?? []}
|
||||
module={moduleDetails}
|
||||
|
Loading…
Reference in New Issue
Block a user