[WEB-1255] chore: Required Spaces refactor (#5177)
* Changes required to enable Publish Views * default views to not found page * refactor exports * remove uncessary view service * fix review comments
This commit is contained in:
parent
2ee6cd20d8
commit
8577a56068
77 changed files with 2772 additions and 484 deletions
|
|
@ -7,3 +7,6 @@ export * from "./use-issue-details";
|
|||
export * from "./use-issue-filter";
|
||||
export * from "./use-state";
|
||||
export * from "./use-label";
|
||||
export * from "./use-cycle";
|
||||
export * from "./use-module";
|
||||
export * from "./use-member";
|
||||
|
|
|
|||
11
space/core/hooks/store/use-cycle.ts
Normal file
11
space/core/hooks/store/use-cycle.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/store-provider";
|
||||
// store
|
||||
import { ICycleStore } from "@/store/cycle.store";
|
||||
|
||||
export const useCycle = (): ICycleStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useCycle must be used within StoreProvider");
|
||||
return context.cycle;
|
||||
};
|
||||
11
space/core/hooks/store/use-member.ts
Normal file
11
space/core/hooks/store/use-member.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/store-provider";
|
||||
// store
|
||||
import { IIssueMemberStore } from "@/store/members.store";
|
||||
|
||||
export const useMember = (): IIssueMemberStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useMember must be used within StoreProvider");
|
||||
return context.member;
|
||||
};
|
||||
11
space/core/hooks/store/use-module.ts
Normal file
11
space/core/hooks/store/use-module.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/store-provider";
|
||||
// store
|
||||
import { IIssueModuleStore } from "@/store/module.store";
|
||||
|
||||
export const useModule = (): IIssueModuleStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useModule must be used within StoreProvider");
|
||||
return context.module;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue