Skip to content

Commit

Permalink
chore: Rename ResearchBlog pages and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
m453h committed Sep 25, 2024
1 parent b61c31a commit 2ccb1a9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions apps/civicsignalblog/src/lib/payload/index.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -24,7 +26,7 @@ async function getCollection(collection, options) {
async function findGlobal(slug, options) {
return payload.findGlobal({
...options,
slug,
slug: `settings-${RESEARCH}-site`,
});
}

Expand Down
3 changes: 2 additions & 1 deletion apps/civicsignalblog/src/payload/collections/Main/Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
3 changes: 2 additions & 1 deletion apps/civicsignalblog/src/payload/fields/links/link.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -72,7 +73,7 @@ const link = ({
pt: "Documento para link para",
},
type: "relationship",
relationTo: ["pages"],
relationTo: [`${RESEARCH}-pages`, `${MAIN}-pages`],
required,
maxDepth: 1,
admin: {
Expand Down
3 changes: 2 additions & 1 deletion apps/civicsignalblog/src/payload/globals/Site/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import canRead from "../../access/applications/main";
import { MAIN } from "../../lib/data/common/applications";
import settings from "../../utils/createGlobalSettings";

import EngagementTab from "./Components/EngagementTab";
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: {
Expand Down
3 changes: 2 additions & 1 deletion apps/civicsignalblog/src/payload/globals/Site/research.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import canRead from "../../access/applications/research";
import { RESEARCH } from "../../lib/data/common/applications";
import settings from "../../utils/createGlobalSettings";

import EngagementTab from "./Components/EngagementTab";
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: {
Expand Down

0 comments on commit 2ccb1a9

Please sign in to comment.