mirror of
https://github.com/gosticks/plane.git
synced 2025-10-16 12:45:33 +00:00
* chore(repo): migrate to pnpm * chore(repo): cleanup pnpm integration with turbo * chore(repo): run lint * chore(repo): cleanup tsconfigs * chore: align TypeScript to 5.8.3 across monorepo; update pnpm override and catalog; pnpm install to update lockfile * chore(repo): revert logger.ts changes * fix: type errors * fix: build errors * fix: pnpm home setup in dockerfiles --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com> Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
import useSWR from "swr";
|
|
// plane web imports
|
|
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}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceModules(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace Cycles
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_CYCLES_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceCycles(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace labels
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_LABELS_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => fetchWorkspaceLabels(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch workspace estimates
|
|
useSWR(
|
|
workspaceSlug ? `WORKSPACE_ESTIMATES_${workspaceSlug}` : null,
|
|
workspaceSlug ? () => getWorkspaceEstimates(workspaceSlug.toString()) : null,
|
|
{ revalidateIfStale: false, revalidateOnFocus: false }
|
|
);
|
|
|
|
// fetch extended issue properties
|
|
useWorkspaceIssuePropertiesExtended(workspaceSlug);
|
|
};
|