Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/dhaprojects' into feat/dhap…
Browse files Browse the repository at this point in the history
…rojects
  • Loading branch information
ctot-nondef committed May 27, 2024
2 parents f40a515 + 8e8cbdc commit 19cd540
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 44 deletions.
122 changes: 82 additions & 40 deletions keystatic.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,75 +396,117 @@ const collections = {
validation: { isRequired: true },
}),
startDate: fields.date({
label: "Start Date",
validation: { isRequired: true },
label: "Start date",
// validation: { isRequired: true },
}),
endDate: fields.date({
label: "End Date",
validation: { isRequired: false },
label: "End date",
// validation: { isRequired: false },
}),
image: fields.image({
label: "Image",
...createAssetPaths(assetPath),
validation: { isRequired: true },
}),
additionalImages: fields.array(
fields.object({
image: fields.image({
label: "Additional images",
...createAssetPaths(assetPath),
}),
alt: fields.text({
label: "Alternative text",
}),
license: fields.text({
label: "License",
}),
}),
fields.object(
{
image: fields.image({
label: "Image",
...createAssetPaths(assetPath),
validation: { isRequired: true },
}),
alt: fields.text({
label: "Alternative text",
// validation: { isRequired: false },
}),
license: fields.text({
label: "License",
// validation: { isRequired: false },
}),
},
{
label: "Image",
},
),
{
label: "Additional images",
itemLabel: (props) => props.fields.alt.value,
itemLabel(props) {
return props.fields.alt.value;
},
},
),
attachments: fields.array(
fields.object({
file: fields.file({
label: "Attachments",
...createAssetPaths(assetPath),
}),
label: fields.text({
label: "Label",
validation: { isRequired: true },
}),
}),
fields.object(
{
file: fields.file({
label: "File",
...createAssetPaths(assetPath),
validation: { isRequired: true },
}),
label: fields.text({
label: "Label",
validation: { isRequired: true },
}),
},
{
label: "Attachment",
},
),
{
label: "Attachments",
itemLabel: (props) => props.fields.label.value,
itemLabel(props) {
return props.fields.label.value;
},
},
),
links: fields.array(
fields.object(
{
label: fields.text({ label: "Label" }),
url: fields.url({ label: "Url" }),
label: fields.text({
label: "Label",
validation: { isRequired: true },
}),
url: fields.url({
label: "URL",
validation: { isRequired: true },
}),
},
{
label: "Url",
label: "Link",
},
),
{
label: "Links",
itemLabel: (props) => props.fields.label.value,
itemLabel(props) {
return props.fields.label.value;
},
},
),
responsiblePersons: fields.array(
fields.text({
label: "Name",
validation: { isRequired: true },
}),
{
label: "Responsible Person(s)",
itemLabel(props) {
return props.value;
},
},
),
hostingOrganizations: fields.array(
fields.text({
label: "Name",
validation: { isRequired: true },
}),
{
label: "Hosting Organization(s)",
itemLabel(props) {
return props.value;
},
},
),
responsiblePersons: fields.array(fields.text({ label: "Name" }), {
label: "Responsible Person(s)",
itemLabel: (props) => props.value,
}),
hostingOrganizations: fields.array(fields.text({ label: "Name" }), {
label: "Hosting Organization(s)",
itemLabel: (props) => props.value,
}),
content: fields.mdx({
label: "Content",
options: {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/lib/content/get-collection-name.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Locale } from "@/config/i18n.config";

export function getCollectionName<T extends "consortium" | "events" | "news" | "pages">(
collection: T,
locale: Locale,
) {
export function getCollectionName<
T extends "consortium" | "events" | "news" | "pages" | "projects",
>(collection: T, locale: Locale) {
return `${locale}_${collection}` as const;
}

0 comments on commit 19cd540

Please sign in to comment.