[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:
rahulramesha 2024-07-22 16:01:46 +05:30 committed by GitHub
parent 2ee6cd20d8
commit 8577a56068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 2772 additions and 484 deletions

View file

@ -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";

View 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;
};

View 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;
};

View 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;
};