diff --git a/web/components/pages/editor/title.tsx b/web/components/pages/editor/title.tsx index aecce77a9..f472ecb6d 100644 --- a/web/components/pages/editor/title.tsx +++ b/web/components/pages/editor/title.tsx @@ -38,7 +38,7 @@ export const PageEditorTitle: React.FC = observer((props) => { style={{ lineHeight: "1.2", }} - placeholder="Untitled Page" + placeholder="Untitled" onKeyDown={(e) => { if (e.key === "Enter") { e.preventDefault(); @@ -60,7 +60,7 @@ export const PageEditorTitle: React.FC = observer((props) => { > 255, + "text-red-500": title.length > 255, })} > {title.length} diff --git a/web/components/pages/list/block.tsx b/web/components/pages/list/block.tsx index 69f667377..d46d07e74 100644 --- a/web/components/pages/list/block.tsx +++ b/web/components/pages/list/block.tsx @@ -3,6 +3,8 @@ import { observer } from "mobx-react"; // components import { ListItem } from "@/components/core/list"; import { BlockItemAction } from "@/components/pages/list"; +// helpers +import { getPageName } from "@/helpers/page.helper"; // hooks import { usePage } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; @@ -23,9 +25,11 @@ export const PageListBlock: FC = observer((props) => { return ( } + actionableItems={ + + } isMobile={isMobile} parentRef={parentRef} /> diff --git a/web/helpers/page.helper.ts b/web/helpers/page.helper.ts index a8d34af32..d1b027104 100644 --- a/web/helpers/page.helper.ts +++ b/web/helpers/page.helper.ts @@ -72,3 +72,14 @@ export const shouldFilterPage = (page: TPage, filters: TPageFilterProps | undefi return fallsInFilters; }; + +/** + * @description returns the name of the project after checking for untitled page + * @param {string | undefined} name + * @returns {string} + */ +export const getPageName = (name: string | undefined) => { + if (name === undefined) return ""; + if (!name || name.trim() === "") return "Untitled"; + return name; +}; diff --git a/web/store/pages/project-page.store.ts b/web/store/pages/project-page.store.ts index 33acde27c..1ae5454a6 100644 --- a/web/store/pages/project-page.store.ts +++ b/web/store/pages/project-page.store.ts @@ -5,7 +5,7 @@ import { computedFn } from "mobx-utils"; // types import { TPage, TPageFilters, TPageNavigationTabs } from "@plane/types"; // helpers -import { filterPagesByPageType, orderPages, shouldFilterPage } from "@/helpers/page.helper"; +import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@/helpers/page.helper"; // services import { PageService } from "@/services/page.service"; // store @@ -105,7 +105,7 @@ export class ProjectPageStore implements IProjectPageStore { let filteredPages = pagesByType.filter( (p) => p.project === projectId && - p.name?.toLowerCase().includes(this.filters.searchQuery.toLowerCase()) && + getPageName(p.name).toLowerCase().includes(this.filters.searchQuery.toLowerCase()) && shouldFilterPage(p, this.filters.filters) ); filteredPages = orderPages(filteredPages, this.filters.sortKey, this.filters.sortBy);