diff --git a/apps/civicsignalblog/src/lib/payload/index.js b/apps/civicsignalblog/src/lib/payload/index.js index 8bb041faf..f677c4aa7 100644 --- a/apps/civicsignalblog/src/lib/payload/index.js +++ b/apps/civicsignalblog/src/lib/payload/index.js @@ -1,9 +1,11 @@ import payload from "payload"; +import { RESEARCH } from "../../payload/lib/data/common/applications"; + async function findPage(slug, options) { return payload.find({ ...options, - collection: "pages", + collection: `${RESEARCH}-pages`, where: { ...options?.where, slug: { @@ -24,7 +26,7 @@ async function getCollection(collection, options) { async function findGlobal(slug, options) { return payload.findGlobal({ ...options, - slug, + slug: `settings-${RESEARCH}-site`, }); } diff --git a/apps/civicsignalblog/src/payload/collections/Main/Pages.js b/apps/civicsignalblog/src/payload/collections/Main/Pages.js index eb754e0fa..aeae6a6d8 100644 --- a/apps/civicsignalblog/src/payload/collections/Main/Pages.js +++ b/apps/civicsignalblog/src/payload/collections/Main/Pages.js @@ -5,10 +5,11 @@ import FeaturedStories from "../../blocks/FeaturedStories"; import LongForm from "../../blocks/LongForm"; import PageHeader from "../../blocks/PageHeader"; import Posts from "../../blocks/Posts"; +import { MAIN } from "../../lib/data/common/applications"; import pages from "../../utils/createPagesCollection"; const Pages = pages({ - pageSlug: "main-pages", + pageSlug: `${MAIN}-pages`, label: "Pages", group: "Publication", defaultColumns: ["fullTitle", "updatedAt"], diff --git a/apps/civicsignalblog/src/payload/collections/Research/Pages.js b/apps/civicsignalblog/src/payload/collections/Research/Pages.js index 13e46bd57..90356848a 100644 --- a/apps/civicsignalblog/src/payload/collections/Research/Pages.js +++ b/apps/civicsignalblog/src/payload/collections/Research/Pages.js @@ -5,10 +5,11 @@ import FeaturedStories from "../../blocks/FeaturedStories"; import LongForm from "../../blocks/LongForm"; import PageHeader from "../../blocks/PageHeader"; import Posts from "../../blocks/Posts"; +import { RESEARCH } from "../../lib/data/common/applications"; import pages from "../../utils/createPagesCollection"; const Pages = pages({ - pageSlug: "pages", + pageSlug: `${RESEARCH}-pages`, label: "Pages", group: "Publication", defaultColumns: ["fullTitle", "updatedAt"], diff --git a/apps/civicsignalblog/src/payload/fields/links/link.js b/apps/civicsignalblog/src/payload/fields/links/link.js index 88d80d0a7..2518eff0e 100644 --- a/apps/civicsignalblog/src/payload/fields/links/link.js +++ b/apps/civicsignalblog/src/payload/fields/links/link.js @@ -1,5 +1,6 @@ import { deepmerge } from "@mui/utils"; +import { RESEARCH, MAIN } from "../../lib/data/common/applications"; import mapLinkTypeToHref from "../../utils/mapLinkTypeToHref"; export async function mapLinkToHrefBeforeValidate({ @@ -72,7 +73,7 @@ const link = ({ pt: "Documento para link para", }, type: "relationship", - relationTo: ["pages"], + relationTo: [`${RESEARCH}-pages`, `${MAIN}-pages`], required, maxDepth: 1, admin: { diff --git a/apps/civicsignalblog/src/payload/globals/Site/main.js b/apps/civicsignalblog/src/payload/globals/Site/main.js index cc7a48ab4..8f74ccebe 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/main.js +++ b/apps/civicsignalblog/src/payload/globals/Site/main.js @@ -1,4 +1,5 @@ import canRead from "../../access/applications/main"; +import { MAIN } from "../../lib/data/common/applications"; import settings from "../../utils/createGlobalSettings"; import EngagementTab from "./Components/EngagementTab"; @@ -6,7 +7,7 @@ import GeneralTab from "./Components/GeneralTab"; import NavigationTab from "./Components/NavigationTab"; const Main = settings({ - slug: "settings-main-site", + slug: `settings-${MAIN}-site`, label: "Site", group: "Settings", access: { diff --git a/apps/civicsignalblog/src/payload/globals/Site/research.js b/apps/civicsignalblog/src/payload/globals/Site/research.js index 7ee51ccba..f0fbd5256 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/research.js +++ b/apps/civicsignalblog/src/payload/globals/Site/research.js @@ -1,4 +1,5 @@ import canRead from "../../access/applications/research"; +import { RESEARCH } from "../../lib/data/common/applications"; import settings from "../../utils/createGlobalSettings"; import EngagementTab from "./Components/EngagementTab"; @@ -6,7 +7,7 @@ import GeneralTab from "./Components/GeneralTab"; import NavigationTab from "./Components/NavigationTab"; const Research = settings({ - slug: "settings-site", + slug: `settings-${RESEARCH}-site`, label: " Site", group: "Settings", access: {