Skip to content

Commit

Permalink
Merge branch 'develop' into feature/single-project-page
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Sep 29, 2023
2 parents f5a67a5 + b14ba68 commit 306ca7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 12 additions & 6 deletions apps/codeforafrica/src/payload/collections/Projects.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import image from "../fields/image";
import link from "../fields/links/link";
import linkArray from "../fields/links/linkArray";
import linkGroup from "../fields/links/linkGroup";
import richText from "../fields/richText";
Expand Down Expand Up @@ -82,6 +83,7 @@ const Projects = {
admin: {
date: {
pickerAppearance: "dayOnly",
displayFormat: "yyyy-MM-dd",
},
},
},
Expand All @@ -91,25 +93,29 @@ const Projects = {
name: "description",
}),
linkArray({
linkConfig: {
defaultValue: "custom",
disableLinkTypeSelection: true,
labelFields: [
overrides: {
fields: [
{
name: "type",
label: { en: "Type of Link" },
label: { en: "Type" },
type: "select",
options: [
{
value: "source",
label: { en: "Source" },
label: { en: "Source code" },
},
{
value: "data",
label: { en: "Data" },
},
],
required: true,
},
link({
defaultValue: "custom",
disableLinkTypeSelection: true,
disableOpenInNewTab: true,
}),
],
},
}),
Expand Down
8 changes: 1 addition & 7 deletions apps/codeforafrica/src/payload/fields/links/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const link = ({
disableOpenInNewTab = false,
overrides = {},
required = true,
labelFields: fields = [],
} = {}) => {
const linkResult = {
type: "row",
Expand Down Expand Up @@ -130,12 +129,7 @@ const link = ({
},
];
}
linkResult.fields = [
...labelFields,
...fields,
...linkResult.fields,
...linkTypes,
];
linkResult.fields = [...labelFields, ...linkResult.fields, ...linkTypes];
if (!disableOpenInNewTab) {
linkResult.fields.push({
type: "row",
Expand Down

0 comments on commit 306ca7d

Please sign in to comment.