mirror of
https://github.com/gosticks/plane.git
synced 2025-10-16 12:45:33 +00:00
* refactor: remove barrel exports from some compoennt modules * refactor: remove barrel exports from issue components * refactor: remove barrel exports from page components * chore: update type improts * refactor: remove barrel exports from cycle components * refactor: remove barrel exports from dropdown components * refactor: remove barrel exports from ce components * refactor: remove barrel exports from some more components * refactor: remove barrel exports from profile and sidebar components * chore: update type imports * refactor: remove barrel exports from store hooks * chore: dynamically load sticky editor * fix: lint * chore: revert sticky dynamic import * refactor: remove barrel exports from ce issue components * refactor: remove barrel exports from ce issue components * refactor: remove barrel exports from ce issue components --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@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 { useCycle } from "./store/use-cycle";
|
|
import { useProjectEstimates } from "./store/estimates";
|
|
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);
|
|
};
|