chore: loading state for all layouts (#2588)
* chore: add loading states to layouts * chore: don't show count for 0 inbox issues
This commit is contained in:
parent
1a46c6c399
commit
36152ea2fa
7 changed files with 52 additions and 3 deletions
|
|
@ -15,6 +15,8 @@ import {
|
|||
CycleSpreadsheetLayout,
|
||||
} from "components/issues";
|
||||
import { TransferIssues, TransferIssuesModal } from "components/cycles";
|
||||
// ui
|
||||
import { Spinner } from "@plane/ui";
|
||||
// helpers
|
||||
import { getDateRangeStatus } from "helpers/date-time.helper";
|
||||
|
||||
|
|
@ -57,6 +59,13 @@ export const CycleLayoutRoot: React.FC<Props> = observer(({ openIssuesListModal
|
|||
|
||||
const issueCount = cycleIssueStore.getIssuesCount;
|
||||
|
||||
if (!cycleIssueStore.getIssues)
|
||||
return (
|
||||
<div className="h-full w-full grid place-items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<TransferIssuesModal handleClose={() => setTransferIssuesModal(false)} isOpen={transferIssuesModal} />
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import useSWR from "swr";
|
|||
import { useMobxStore } from "lib/mobx/store-provider";
|
||||
// components
|
||||
import { GlobalViewEmptyState, GlobalViewsAppliedFiltersRoot, SpreadsheetView } from "components/issues";
|
||||
// ui
|
||||
import { Spinner } from "@plane/ui";
|
||||
// types
|
||||
import { IIssue, IIssueDisplayFilterOptions, TStaticViewTypes } from "types";
|
||||
|
||||
|
|
@ -82,6 +84,13 @@ export const GlobalViewLayoutRoot: React.FC<Props> = observer((props) => {
|
|||
? globalViewIssuesStore.viewIssues?.[globalViewId.toString()]
|
||||
: undefined;
|
||||
|
||||
if (!issues)
|
||||
return (
|
||||
<div className="h-full w-full grid place-items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex flex-col overflow-hidden">
|
||||
<GlobalViewsAppliedFiltersRoot />
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import {
|
|||
ModuleListLayout,
|
||||
ModuleSpreadsheetLayout,
|
||||
} from "components/issues";
|
||||
// ui
|
||||
import { Spinner } from "@plane/ui";
|
||||
|
||||
type Props = {
|
||||
openIssuesListModal: () => void;
|
||||
|
|
@ -53,6 +55,13 @@ export const ModuleLayoutRoot: React.FC<Props> = observer(({ openIssuesListModal
|
|||
|
||||
const issueCount = moduleIssueStore.getIssuesCount;
|
||||
|
||||
if (!moduleIssueStore.getIssues)
|
||||
return (
|
||||
<div className="h-full w-full grid place-items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex flex-col overflow-hidden">
|
||||
<ModuleAppliedFiltersRoot />
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {
|
|||
ProjectSpreadsheetLayout,
|
||||
ProjectEmptyState,
|
||||
} from "components/issues";
|
||||
import { Spinner } from "@plane/ui";
|
||||
|
||||
export const ProjectLayoutRoot: React.FC = observer(() => {
|
||||
const router = useRouter();
|
||||
|
|
@ -33,6 +34,13 @@ export const ProjectLayoutRoot: React.FC = observer(() => {
|
|||
|
||||
const issueCount = issueStore.getIssuesCount;
|
||||
|
||||
if (!issueStore.getIssues)
|
||||
return (
|
||||
<div className="h-full w-full grid place-items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex flex-col overflow-hidden">
|
||||
<ProjectAppliedFiltersRoot />
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
ProjectViewGanttLayout,
|
||||
ProjectViewSpreadsheetLayout,
|
||||
} from "components/issues";
|
||||
import { Spinner } from "@plane/ui";
|
||||
|
||||
export const ProjectViewLayoutRoot: React.FC = observer(() => {
|
||||
const router = useRouter();
|
||||
|
|
@ -51,6 +52,13 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {
|
|||
|
||||
const issueCount = projectViewIssuesStore.getIssuesCount;
|
||||
|
||||
if (!projectViewIssuesStore.getIssues)
|
||||
return (
|
||||
<div className="h-full w-full grid place-items-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="relative h-full w-full flex flex-col overflow-hidden">
|
||||
<ProjectViewAppliedFiltersRoot />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue