[WEB-4017] fix: hooks and store refactoring for issue-details (#7107)
* fix: hooks and store splitting for issue-details * fix: refactoring * fix: refactoring * fix: refactor * fix: css
This commit is contained in:
parent
9cdfb2224a
commit
c7d17d00b7
7 changed files with 32 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ import {
|
|||
ISSUE_RESTORED,
|
||||
EUserPermissions,
|
||||
EUserPermissionsLevel,
|
||||
EIssueServiceType,
|
||||
} from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TIssue, IWorkItemPeekOverview } from "@plane/types";
|
||||
|
|
@ -23,6 +24,7 @@ import { IssueView, TIssueOperations } from "@/components/issues";
|
|||
// hooks
|
||||
import { useEventTracker, useIssueDetail, useIssues, useUserPermissions } from "@/hooks/store";
|
||||
import { useIssueStoreType } from "@/hooks/use-issue-layout-store";
|
||||
import { useWorkItemProperties } from "@/plane-web/hooks/use-issue-properties";
|
||||
|
||||
|
||||
export const IssuePeekOverview: FC<IWorkItemPeekOverview> = observer((props) => {
|
||||
|
|
@ -51,6 +53,13 @@ export const IssuePeekOverview: FC<IWorkItemPeekOverview> = observer((props) =>
|
|||
const storeType = issueStoreFromProps ?? issueStoreType;
|
||||
const { issues } = useIssues(storeType);
|
||||
const { captureIssueEvent } = useEventTracker();
|
||||
|
||||
useWorkItemProperties(
|
||||
peekIssue?.projectId,
|
||||
peekIssue?.workspaceSlug,
|
||||
peekIssue?.issueId,
|
||||
storeType === EIssuesStoreType.EPIC ? EIssueServiceType.EPICS : EIssueServiceType.ISSUES
|
||||
);
|
||||
// state
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const SettingsContentWrapper = observer((props: TProps) => {
|
|||
return (
|
||||
<div
|
||||
className={cn("flex flex-col w-full items-center mx-auto py-4 md:py-0", {
|
||||
"md:p-4 max-w-[800px] 2xl:max-w-[1000px]": size === "md",
|
||||
"md:px-4 max-w-[800px] 2xl:max-w-[1000px]": size === "md",
|
||||
"md:px-16": size === "lg",
|
||||
})}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { TIssueServiceType } from "@plane/types";
|
|||
// mobx store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
// types
|
||||
import { IIssueDetail } from "@/store/issue/issue-details/root.store";
|
||||
import { IIssueDetail } from "@/plane-web/store/issue/issue-details/root.store";
|
||||
|
||||
export const useIssueDetail = (serviceType: TIssueServiceType = EIssueServiceType.ISSUES): IIssueDetail => {
|
||||
const context = useContext(StoreContext);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ export interface IIssueDetail
|
|||
relation: IIssueRelationStore;
|
||||
}
|
||||
|
||||
export class IssueDetail implements IIssueDetail {
|
||||
export abstract class IssueDetail implements IIssueDetail {
|
||||
// observables
|
||||
peekIssue: TPeekIssue | undefined = undefined;
|
||||
relationKey: TIssueRelationTypes | null = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue