diff --git a/components/blocks/textBlock/OneThirdColumnsContent.tsx b/components/blocks/textBlock/OneThirdColumnsContent.tsx
index 2096688..31ddbfa 100644
--- a/components/blocks/textBlock/OneThirdColumnsContent.tsx
+++ b/components/blocks/textBlock/OneThirdColumnsContent.tsx
@@ -1,7 +1,6 @@
import type { ReactElement } from 'react';
import type { ContentColumnProps } from '@/types/payload/Blocks';
import FullColumnContent from '@blocks/textBlock/FullColumnContent';
-import TwoThirdsColumnsContent from '@blocks/textBlock/TwoThirdsColumnsContent';
import RichText from 'components/blocks/richTextBlock/RichText';
interface Props {
@@ -10,48 +9,26 @@ interface Props {
thirdColumn?: ContentColumnProps;
}
-const OneThirdColumnsContent = ({
- firstColumn,
- secondColumn,
- thirdColumn,
-}: Props): ReactElement | null => {
- if (secondColumn === undefined) {
- console.warn(
- 'Falling back to full column instead of oneThird since second column is missing',
- );
+const OneThirdColumnsContent = ({ firstColumn, secondColumn, thirdColumn }: Props): ReactElement => {
+ if (secondColumn === undefined || thirdColumn === undefined) {
+ console.warn('Falling back to full since second or third column is missing');
return
;
}
- // Three Columns
- if (secondColumn.width === 'oneThird') {
- if (thirdColumn === undefined) {
- console.warn(
- 'Falling back to two columns instead of oneThird since third column is missing',
- );
-
- return (
-
- );
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
+ return (
+
+
+
- );
- }
-
- // Two Columns.
- return
;
+
+
+
+
+
+
+
+ );
};
export default OneThirdColumnsContent;
diff --git a/components/blocks/textBlock/TwoThirdsColumnsContent.tsx b/components/blocks/textBlock/TwoThirdsColumnsContent.tsx
index 8c99ae8..68066f9 100644
--- a/components/blocks/textBlock/TwoThirdsColumnsContent.tsx
+++ b/components/blocks/textBlock/TwoThirdsColumnsContent.tsx
@@ -8,11 +8,9 @@ interface Props {
secondColumn?: ContentColumnProps;
}
-const TwoThirdsColumnsContent = ({ firstColumn, secondColumn }: Props): ReactElement | null => {
+const TwoThirdsColumnsContent = ({ firstColumn, secondColumn, }: Props): ReactElement => {
if (secondColumn === undefined) {
- console.warn(
- 'Falling back to full column instead of twoThirds since second column is missing',
- );
+ console.warn('Falling back to full column instead of twoThirds since second column is missing');
return
;
}
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 9e42655..e8b8d31 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -40,6 +40,7 @@ export default [
'tailwindcss/no-custom-classname': 'error',
+ '@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
diff --git a/hooks/build b/hooks/build
old mode 100644
new mode 100755
index b2dc312..dd0b508
--- a/hooks/build
+++ b/hooks/build
@@ -1,5 +1,20 @@
#!/bin/bash
+# Docker Hub Automated Build Hook
+#
+# This script is automatically executed by Docker Hub's Automated Build system
+# when code is pushed to the connected GitHub repository. Docker Hub provides
+# the following environment variables:
+# - SOURCE_BRANCH: The git branch being built (e.g., "main", "develop")
+# - SOURCE_COMMIT: The git commit hash (short format)
+# - IMAGE_NAME: The name of the Docker image being built
+# - DOCKER_REPO: The Docker Hub repository path (e.g., "seebruecke/bside-website")
+#
+# Additional environment variables (PAYLOAD_URL_*, FRONTEND_URL_*, etc.) are
+# configured in the Docker Hub repository settings and injected during build.
+#
+# Docker Hub is configured to only trigger builds for 'main' and 'dev' branches.
+
if [ $SOURCE_BRANCH = "main" ]
then
PAYLOAD_URL=$PAYLOAD_URL_PROD
diff --git a/lib/payload/getPayloadResponse.ts b/lib/payload/getPayloadResponse.ts
index b6b567a..5584077 100644
--- a/lib/payload/getPayloadResponse.ts
+++ b/lib/payload/getPayloadResponse.ts
@@ -13,7 +13,7 @@ const getPayloadResponse = async
(path: string, preview: boolean = false): Pr
);
if (!fetchResponse.ok) {
- throw new Error();
+ throw new Error(`Error code ${fetchResponse.status} while fetching ${path}: ${fetchResponse.statusText}`);
}
return fetchResponse.json() as T;
diff --git a/next.config.js b/next.config.js
index a55eca8..9eff1e8 100644
--- a/next.config.js
+++ b/next.config.js
@@ -12,6 +12,11 @@ const nextConfig = {
hostname: 'cms.b-side.ms',
pathname: '**',
},
+ {
+ protocol: 'http',
+ hostname: 'localhost',
+ pathname: '**',
+ },
],
minimumCacheTTL: 60 * 60 * 24,
formats: ['image/webp', 'image/avif'],
diff --git a/types/payload/Blocks.ts b/types/payload/Blocks.ts
index 923c3bb..6b13d0d 100644
--- a/types/payload/Blocks.ts
+++ b/types/payload/Blocks.ts
@@ -18,9 +18,9 @@ export interface ContentColumnProps {
}
export interface ContentProps {
- columns?: Array;
- backgroundColor?: string;
- backgroundWidth?: string;
+ columns: Array;
+ backgroundColor?: 'white' | 'black';
+ backgroundWidth?: 'full' | 'block';
}
export interface MediaContentBlockProps {
@@ -28,20 +28,20 @@ export interface MediaContentBlockProps {
richText: SlateChildren;
alignment: MediaContentAlignment;
backgroundColor?: MediaContentBackgroundColor;
- headline?: string;
+ headline?: string | null;
previousBlock?: string;
- effects?: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'>;
+ effects?: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'> | null;
}
export interface MediaBlockProps {
media: Media | string;
size?: 'normal' | 'wide' | 'event';
- caption?: string;
- effects?: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'>;
+ caption?: string | null;
+ effects?: Array<'blur' | 'grayscale' | 'desaturated' | 'darker'> | null;
}
export interface CallToActionBlockProps {
- title: string | undefined;
+ title?: string | null;
text: string;
href: string;
}
diff --git a/types/payload/payload-types.ts b/types/payload/payload-types.ts
index acea000..3006da2 100644
--- a/types/payload/payload-types.ts
+++ b/types/payload/payload-types.ts
@@ -1,5 +1,5 @@
/* tslint:disable */
-/* eslint-disable */
+
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
@@ -60,18 +60,7 @@ export interface Event {
eventOrganizer?: string | null;
eventExtra?: string | null;
category?:
- | (
- | 'concert'
- | 'movie'
- | 'theater'
- | 'plenum'
- | 'workshop'
- | 'party'
- | 'exhibition'
- | 'reading'
- | 'lecture'
- | 'other'
- )[]
+ | ('concert' | 'movie' | 'theater' | 'plenum' | 'workshop' | 'party' | 'exhibition' | 'reading' | 'lecture' | 'other')[]
| null;
displayOnHome?: boolean | null;
displayOnOverview?: boolean | null;
@@ -187,22 +176,20 @@ export interface Circle {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;
@@ -296,22 +283,20 @@ export interface Organisation {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;
@@ -432,22 +417,20 @@ export interface News {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;
@@ -551,22 +534,20 @@ export interface Page {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;
@@ -839,22 +820,20 @@ export interface EventPage {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;
@@ -956,22 +935,20 @@ export interface EventArchive {
| {
backgroundColor: 'white' | 'black';
backgroundWidth: 'full' | 'block';
- columns?:
- | {
- width: 'full' | 'half' | 'oneThird' | 'twoThirds';
- richText: {
- [k: string]: unknown;
- }[];
- id?: string | null;
- }[]
- | null;
+ columns: {
+ width: 'full' | 'half' | 'oneThird' | 'twoThirds';
+ richText: {
+ [k: string]: unknown;
+ }[];
+ id?: string | null;
+ }[];
id?: string | null;
blockName?: string | null;
blockType: 'content';
}
| {
media: string | Media;
- size?: ('normal' | 'wide' | 'event') | null;
+ size: 'normal' | 'wide' | 'event';
effects?: ('blur' | 'grayscale' | 'desaturated' | 'darker')[] | null;
caption?: string | null;
id?: string | null;