Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import useSWR from "swr";
|
|
// plane web imports
|
|
import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@/constants/fetch-keys";
|
|
import { useWorkspaceIssuePropertiesExtended } from "@/plane-web/hooks/use-workspace-issue-properties-extended";
|
|
// plane imports
|
|
import { useProjectEstimates } from "./store/estimates";
|
|
import { useCycle } from "./store/use-cycle";
|
|
import { useLabel } from "./store/use-label";
|
|
import { useModule } from "./store/use-module";
|
|
|
|
export const useWorkspaceIssueProperties = (workspaceSlug: string | string[] | undefined) => {
|
|
const { fetchWorkspaceLabels } = useLabel();
|
|
|
|
const { getWorkspaceEstimates } = useProjectEstimates();
|
|
|
|
const { fetchWorkspaceModules } = useModule();
|
|
|
|
const { fetchWorkspaceCycles } = useCycle();
|
|
|
|
// fetch workspace Modules
|
|
useSWR(
|
|
workspaceSlug ? WORKSPACE_MODULES(workspaceSlug.toString()) : null,
|
|
workspaceSlug ? () => fetchWorkspaceModules(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace Cycles
|
|
useSWR(
|
|
workspaceSlug ? WORKSPACE_CYCLES(workspaceSlug.toString()) : null,
|
|
workspaceSlug ? () => fetchWorkspaceCycles(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace labels
|
|
useSWR(
|
|
workspaceSlug ? WORKSPACE_LABELS(workspaceSlug.toString()) : null,
|
|
workspaceSlug ? () => fetchWorkspaceLabels(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace estimates
|
|
useSWR(
|
|
workspaceSlug ? WORKSPACE_ESTIMATES(workspaceSlug.toString()) : null,
|
|
workspaceSlug ? () => getWorkspaceEstimates(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch extended issue properties
|
|
useWorkspaceIssuePropertiesExtended(workspaceSlug);
|
|
};
|