diff --git a/web/core/components/pages/dropdowns/quick-actions.tsx b/web/core/components/pages/dropdowns/quick-actions.tsx index a3a4dd848..21c950200 100644 --- a/web/core/components/pages/dropdowns/quick-actions.tsx +++ b/web/core/components/pages/dropdowns/quick-actions.tsx @@ -9,10 +9,10 @@ import { DeletePageModal } from "@/components/pages"; // helpers import { copyUrlToClipboard } from "@/helpers/string.helper"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { - page: IPageStore; + page: IPage; pageLink: string; parentRef: React.RefObject; }; diff --git a/web/core/components/pages/editor/editor-body.tsx b/web/core/components/pages/editor/editor-body.tsx index 330c626eb..3f859f1a2 100644 --- a/web/core/components/pages/editor/editor-body.tsx +++ b/web/core/components/pages/editor/editor-body.tsx @@ -22,7 +22,7 @@ import { usePageFilters } from "@/hooks/use-page-filters"; // services import { FileService } from "@/services/file.service"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; const fileService = new FileService(); @@ -30,7 +30,7 @@ type Props = { editorRef: React.RefObject; readOnlyEditorRef: React.RefObject; markings: IMarking[]; - page: IPageStore; + page: IPage; sidePeekVisible: boolean; handleEditorReady: (value: boolean) => void; handleReadOnlyEditorReady: (value: boolean) => void; diff --git a/web/core/components/pages/editor/header/extra-options.tsx b/web/core/components/pages/editor/header/extra-options.tsx index c4908b7a0..3a244b074 100644 --- a/web/core/components/pages/editor/header/extra-options.tsx +++ b/web/core/components/pages/editor/header/extra-options.tsx @@ -15,12 +15,12 @@ import { renderFormattedDate } from "@/helpers/date-time.helper"; // hooks import { useInstance } from "@/hooks/store"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { editorRef: React.RefObject; handleDuplicatePage: () => void; - page: IPageStore; + page: IPage; readOnlyEditorRef: React.RefObject; }; diff --git a/web/core/components/pages/editor/header/info-popover.tsx b/web/core/components/pages/editor/header/info-popover.tsx index 270da934b..012686d94 100644 --- a/web/core/components/pages/editor/header/info-popover.tsx +++ b/web/core/components/pages/editor/header/info-popover.tsx @@ -4,10 +4,10 @@ import { Calendar, History, Info } from "lucide-react"; // helpers import { renderFormattedDate } from "@/helpers/date-time.helper"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { - page: IPageStore; + page: IPage; }; export const PageInfoPopover: React.FC = (props) => { diff --git a/web/core/components/pages/editor/header/mobile-root.tsx b/web/core/components/pages/editor/header/mobile-root.tsx index 1bcf5c317..4a73d0a55 100644 --- a/web/core/components/pages/editor/header/mobile-root.tsx +++ b/web/core/components/pages/editor/header/mobile-root.tsx @@ -5,14 +5,14 @@ import { PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/ // hooks import { usePageFilters } from "@/hooks/use-page-filters"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { editorRef: React.RefObject; readOnlyEditorRef: React.RefObject; handleDuplicatePage: () => void; markings: IMarking[]; - page: IPageStore; + page: IPage; sidePeekVisible: boolean; setSidePeekVisible: (sidePeekState: boolean) => void; editorReady: boolean; diff --git a/web/core/components/pages/editor/header/options-dropdown.tsx b/web/core/components/pages/editor/header/options-dropdown.tsx index da7344c81..934c9739b 100644 --- a/web/core/components/pages/editor/header/options-dropdown.tsx +++ b/web/core/components/pages/editor/header/options-dropdown.tsx @@ -11,14 +11,13 @@ import { copyTextToClipboard, copyUrlToClipboard } from "@/helpers/string.helper // hooks import { useAppRouter } from "@/hooks/store"; import { usePageFilters } from "@/hooks/use-page-filters"; - // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { editorRef: EditorRefApi | EditorReadOnlyRefApi | null; handleDuplicatePage: () => void; - page: IPageStore; + page: IPage; }; export const PageOptionsDropdown: React.FC = observer((props) => { diff --git a/web/core/components/pages/editor/header/root.tsx b/web/core/components/pages/editor/header/root.tsx index fdccbddc3..d8051a7d2 100644 --- a/web/core/components/pages/editor/header/root.tsx +++ b/web/core/components/pages/editor/header/root.tsx @@ -7,14 +7,14 @@ import { cn } from "@/helpers/common.helper"; // hooks import { usePageFilters } from "@/hooks/use-page-filters"; // store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; type Props = { editorRef: React.RefObject; readOnlyEditorRef: React.RefObject; handleDuplicatePage: () => void; markings: IMarking[]; - page: IPageStore; + page: IPage; sidePeekVisible: boolean; setSidePeekVisible: (sidePeekState: boolean) => void; editorReady: boolean; diff --git a/web/core/hooks/store/pages/use-page.ts b/web/core/hooks/store/pages/use-page.ts index 1da0e234b..97e0ef98a 100644 --- a/web/core/hooks/store/pages/use-page.ts +++ b/web/core/hooks/store/pages/use-page.ts @@ -2,13 +2,13 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // mobx store -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; -export const usePage = (pageId: string | undefined): IPageStore => { +export const usePage = (pageId: string | undefined): IPage => { const context = useContext(StoreContext); if (context === undefined) throw new Error("usePage must be used within StoreProvider"); - if (!pageId) return {} as IPageStore; + if (!pageId) return {} as IPage; return context.projectPages.data?.[pageId] ?? {}; }; diff --git a/web/core/hooks/use-page-description.ts b/web/core/hooks/use-page-description.ts index 43f602800..245d61395 100644 --- a/web/core/hooks/use-page-description.ts +++ b/web/core/hooks/use-page-description.ts @@ -7,12 +7,12 @@ import { EditorRefApi, generateJSONfromHTML } from "@plane/editor-core"; import useReloadConfirmations from "@/hooks/use-reload-confirmation"; // services import { ProjectPageService } from "@/services/page"; -import { IPageStore } from "@/store/pages/page.store"; +import { IPage } from "@/store/pages/page"; const projectPageService = new ProjectPageService(); type Props = { editorRef: React.RefObject; - page: IPageStore; + page: IPage; projectId: string | string[] | undefined; workspaceSlug: string | string[] | undefined; }; diff --git a/web/core/store/pages/page.store.ts b/web/core/store/pages/page.ts similarity index 99% rename from web/core/store/pages/page.store.ts rename to web/core/store/pages/page.ts index ed52a1825..d6e559ca5 100644 --- a/web/core/store/pages/page.store.ts +++ b/web/core/store/pages/page.ts @@ -12,7 +12,7 @@ import { ProjectPageService } from "@/services/page"; export type TLoader = "submitting" | "submitted" | "saved"; -export interface IPageStore extends TPage { +export interface IPage extends TPage { // observables isSubmitting: TLoader; // computed @@ -44,7 +44,7 @@ export interface IPageStore extends TPage { removeFromFavorites: () => Promise; } -export class PageStore implements IPageStore { +export class Page implements IPage { // loaders isSubmitting: TLoader = "saved"; // page properties diff --git a/web/core/store/pages/project-page.store.ts b/web/core/store/pages/project-page.store.ts index e7b96ca75..fa8c16eab 100644 --- a/web/core/store/pages/project-page.store.ts +++ b/web/core/store/pages/project-page.store.ts @@ -11,7 +11,7 @@ import { RootStore } from "@/plane-web/store/root.store"; // services import { ProjectPageService } from "@/services/page"; // store -import { IPageStore, PageStore } from "@/store/pages/page.store"; +import { IPage, Page } from "@/store/pages/page"; type TLoader = "init-loader" | "mutation-loader" | undefined; @@ -20,7 +20,7 @@ type TError = { title: string; description: string }; export interface IProjectPageStore { // observables loader: TLoader; - data: Record; // pageId => PageStore + data: Record; // pageId => Page error: TError | undefined; filters: TPageFilters; // computed @@ -28,7 +28,7 @@ export interface IProjectPageStore { // helper actions getCurrentProjectPageIds: (pageType: TPageNavigationTabs) => string[] | undefined; getCurrentProjectFilteredPageIds: (pageType: TPageNavigationTabs) => string[] | undefined; - pageById: (pageId: string) => IPageStore | undefined; + pageById: (pageId: string) => IPage | undefined; updateFilters: (filterKey: T, filterValue: TPageFilters[T]) => void; clearAllFilters: () => void; // actions @@ -41,7 +41,7 @@ export interface IProjectPageStore { export class ProjectPageStore implements IProjectPageStore { // observables loader: TLoader = "init-loader"; - data: Record = {}; // pageId => PageStore + data: Record = {}; // pageId => Page error: TError | undefined = undefined; filters: TPageFilters = { searchQuery: "", @@ -162,7 +162,7 @@ export class ProjectPageStore implements IProjectPageStore { const pages = await this.service.fetchAll(workspaceSlug, projectId); runInAction(() => { - for (const page of pages) if (page?.id) set(this.data, [page.id], new PageStore(this.store, page)); + for (const page of pages) if (page?.id) set(this.data, [page.id], new Page(this.store, page)); this.loader = undefined; }); @@ -196,7 +196,7 @@ export class ProjectPageStore implements IProjectPageStore { const page = await this.service.fetchById(workspaceSlug, projectId, pageId); runInAction(() => { - if (page?.id) set(this.data, [page.id], new PageStore(this.store, page)); + if (page?.id) set(this.data, [page.id], new Page(this.store, page)); this.loader = undefined; }); @@ -229,7 +229,7 @@ export class ProjectPageStore implements IProjectPageStore { const page = await this.service.create(workspaceSlug, projectId, pageData); runInAction(() => { - if (page?.id) set(this.data, [page.id], new PageStore(this.store, page)); + if (page?.id) set(this.data, [page.id], new Page(this.store, page)); this.loader = undefined; });