feature: different masses
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
Benno Tielen 2026-06-05 15:50:00 +02:00
parent d1c05bfeb8
commit a12e460448
14 changed files with 26166 additions and 11 deletions

View file

@ -61,6 +61,8 @@ export const Churches: CollectionConfig = {
{ label: 'Heilige Messe', value: 'MASS' },
{ label: 'Familien Messe', value: 'FAMILY' },
{ label: 'Wort-Gottes-Feier', value: 'WORD' },
{ label: 'Fremdsprache', value: 'LANGUAGE' },
{ label: 'Andere', value: 'OTHER' },
],
},
{

View file

@ -44,7 +44,7 @@ export const Worship: CollectionConfig = {
type: 'radio',
options: [
{
label: 'Heilige Messe',
label: 'Eucharistiefeier',
value: 'MASS',
},
{
@ -55,6 +55,14 @@ export const Worship: CollectionConfig = {
label: 'Wort-Gottes-Feier',
value: 'WORD',
},
{
label: 'Fremdsprache',
value: 'LANGUAGE',
},
{
label: 'Andere',
value: 'OTHER',
},
],
required: true,
},

View file

@ -85,7 +85,7 @@ export const Default: Story = {
id: '7',
date: '2024-08-23T11:00:00.000Z',
location: 'St. Marien',
type: 'MASS',
type: 'LANGUAGE',
cancelled: false,
updatedAt: '',
createdAt: '',
@ -186,7 +186,7 @@ export const SevenChurches: Story = {
id: '4',
date: '2024-08-25T17:00:00.000Z',
location: 'St. Christopherus',
type: 'FAMILY',
type: 'LANGUAGE',
cancelled: false,
updatedAt: '',
createdAt: '',

View file

@ -39,6 +39,24 @@ export const Default: Story = {
updatedAt: '',
createdAt: '',
},
{
id: '1',
date: '2024-08-25T11:00:00.000Z',
location: 'St. Christopherus',
type: 'LANGUAGE',
cancelled: false,
updatedAt: '',
createdAt: '',
},
{
id: '1',
date: '2024-08-25T19:00:00.000Z',
location: 'St. Christopherus',
type: 'OTHER',
cancelled: false,
updatedAt: '',
createdAt: '',
},
{
id: '1',
date: '2024-08-26T15:00:00.000Z',

View file

@ -35,6 +35,24 @@ export const LiturgyOfTheWord: Story = {
},
}
export const ForeignLanguage: Story = {
args: {
id: '1',
date: '2024-08-23T15:00:00.000Z',
type: 'LANGUAGE',
cancelled: false,
},
}
export const Other: Story = {
args: {
id: '1',
date: '2024-08-23T15:00:00.000Z',
type: 'OTHER',
cancelled: false,
},
}
export const Cancelled: Story = {
args: {
id: '1',

View file

@ -4,6 +4,7 @@ import styles from './styles.module.scss'
import Image from 'next/image'
import family from './family.svg'
import bible from './bible.svg'
import language from './language.svg'
import { useState } from 'react'
import Link from 'next/link'
import classNames from 'classnames'
@ -12,7 +13,7 @@ import { useTime } from '@/hooks/useTime'
export type MassTableRowProps = {
id: string
date: string
type: 'MASS' | 'FAMILY' | 'WORD'
type: 'MASS' | 'FAMILY' | 'WORD' | 'LANGUAGE' | 'OTHER'
cancelled: boolean
}
@ -50,6 +51,10 @@ export const MassTableRow = ({
{type === 'WORD' && (
<Image src={bible} width={18} height={18} alt={'Wortgottesfeier'} />
)}
{type === 'LANGUAGE' && (
<Image src={language} width={18} height={18} alt={'Fremdsprache'} />
)}
</div>
</div>
</Link>

View file

@ -0,0 +1,24 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg fill="#ffffff" width="201px" height="201px" viewBox="0 0 512.00 512.00" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff" stroke-width="13.312000000000001">
<g id="SVGRepo_bgCarrier" stroke-width="0">
<rect x="0" y="0" width="512.00" height="512.00" rx="256" fill="#728F8D" strokewidth="0"/>
</g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">
<title>ionicons-v5-l</title>
<path d="M478.33,433.6l-90-218a22,22,0,0,0-40.67,0l-90,218a22,22,0,1,0,40.67,16.79L316.66,406H419.33l18.33,44.39A22,22,0,0,0,458,464a22,22,0,0,0,20.32-30.4ZM334.83,362,368,281.65,401.17,362Z"/>
<path d="M267.84,342.92a22,22,0,0,0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73,39.65-53.68,62.11-114.75,71.27-143.49H330a22,22,0,0,0,0-44H214V70a22,22,0,0,0-44,0V90H54a22,22,0,0,0,0,44H251.25c-9.52,26.95-27.05,69.5-53.79,108.36-31.41-41.68-43.08-68.65-43.17-68.87a22,22,0,0,0-40.58,17c.58,1.38,14.55,34.23,52.86,83.93.92,1.19,1.83,2.35,2.74,3.51-39.24,44.35-77.74,71.86-93.85,80.74a22,22,0,1,0,21.07,38.63c2.16-1.18,48.6-26.89,101.63-85.59,22.52,24.08,38,35.44,38.93,36.1a22,22,0,0,0,30.75-4.9Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,9 +1,13 @@
export const useMassType = (type: 'MASS' | 'FAMILY' | 'WORD') => {
export const useMassType = (type: 'MASS' | 'FAMILY' | 'WORD' | 'LANGUAGE' | 'OTHER') => {
switch (type) {
case 'FAMILY':
return 'Familien Messe'
case 'WORD':
return 'Wort-Gottes-Feier'
case 'LANGUAGE':
return 'Fremdsprache'
case 'OTHER':
return 'Andere'
case 'MASS':
default:
return 'Heilige Messe'

View file

@ -103,7 +103,7 @@ export const generateRecurringMassesTask: TaskConfig<{
for (const rawEntry of schedule) {
const entry = rawEntry as ScheduleEntry & {
time?: string | Date | null
type?: 'MASS' | 'FAMILY' | 'WORD'
type?: 'MASS' | 'FAMILY' | 'WORD' | 'LANGUAGE' | 'OTHER'
defaultCelebrant?: string | null
defaultTitle?: string | null
defaultDescription?: string | null

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
ALTER TYPE "public"."enum_church_recurring_schedule_type" ADD VALUE 'LANGUAGE';
ALTER TYPE "public"."enum_church_recurring_schedule_type" ADD VALUE 'OTHER';
ALTER TYPE "public"."enum_worship_type" ADD VALUE 'LANGUAGE';
ALTER TYPE "public"."enum_worship_type" ADD VALUE 'OTHER';
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-06-07T13:08:42.418Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-06-07T13:08:42.705Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-07-05T13:08:42.759Z';`)
}
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "church_recurring_schedule" ALTER COLUMN "type" SET DATA TYPE text;
DROP TYPE "public"."enum_church_recurring_schedule_type";
CREATE TYPE "public"."enum_church_recurring_schedule_type" AS ENUM('MASS', 'FAMILY', 'WORD');
ALTER TABLE "church_recurring_schedule" ALTER COLUMN "type" SET DATA TYPE "public"."enum_church_recurring_schedule_type" USING "type"::"public"."enum_church_recurring_schedule_type";
ALTER TABLE "worship" ALTER COLUMN "type" SET DATA TYPE text;
DROP TYPE "public"."enum_worship_type";
CREATE TYPE "public"."enum_worship_type" AS ENUM('MASS', 'FAMILY', 'WORD');
ALTER TABLE "worship" ALTER COLUMN "type" SET DATA TYPE "public"."enum_worship_type" USING "type"::"public"."enum_worship_type";
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-06-07T12:41:03.305Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-06-07T12:41:03.609Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-07-05T12:41:03.673Z';`)
}

View file

@ -47,6 +47,7 @@ import * as migration_20260504_070356_next_prev_buttons from './20260504_070356_
import * as migration_20260605_095112 from './20260605_095112';
import * as migration_20260605_113107_occurrence_end_time from './20260605_113107_occurrence_end_time';
import * as migration_20260605_124103_gallery_caption from './20260605_124103_gallery_caption';
import * as migration_20260605_130843_add_worship_language_other from './20260605_130843_add_worship_language_other';
export const migrations = [
{
@ -292,6 +293,11 @@ export const migrations = [
{
up: migration_20260605_124103_gallery_caption.up,
down: migration_20260605_124103_gallery_caption.down,
name: '20260605_124103_gallery_caption'
name: '20260605_124103_gallery_caption',
},
{
up: migration_20260605_130843_add_worship_language_other.up,
down: migration_20260605_130843_add_worship_language_other.down,
name: '20260605_130843_add_worship_language_other'
},
];

View file

@ -337,7 +337,7 @@ export interface Church {
*/
recurringSchedule?:
| {
type: 'MASS' | 'FAMILY' | 'WORD';
type: 'MASS' | 'FAMILY' | 'WORD' | 'LANGUAGE' | 'OTHER';
frequency: 'weekly' | 'biweekly' | 'monthlyByWeekday';
day: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
time: string;
@ -927,7 +927,7 @@ export interface Worship {
id: string;
date: string;
location: string | Church;
type: 'MASS' | 'FAMILY' | 'WORD';
type: 'MASS' | 'FAMILY' | 'WORD' | 'LANGUAGE' | 'OTHER';
title?: string | null;
cancelled: boolean;
liturgicalDay?: string | null;

View file

@ -4,14 +4,16 @@ import { EventRowProps } from '@/components/EventRow/EventRow'
/**
* Transform the worship category to a readable string
*/
export const transformCategory = (category: "MASS" | "FAMILY" | "WORD"): string => {
export const transformCategory = (category: "MASS" | "FAMILY" | "WORD" | "LANGUAGE" | "OTHER"): string => {
const type = {
'MASS': 'Eucharistiefeier',
'FAMILY': 'Familienmesse',
'WORD': 'Wort-Gottes-Feier',
'LANGUAGE': 'Eucharistiefeier in Fremdsprache',
'OTHER': 'Gottesdienst',
}
return type[category]
return type[category] ?? 'Gottesdienst'
}
/**