Remove public event feature (#1645)

This commit is contained in:
Alex Christoffer Rasmussen
2025-06-19 18:07:42 +02:00
committed by GitHub
parent 4e561cf01f
commit c522860d28
99 changed files with 173 additions and 1129 deletions
@@ -53,8 +53,6 @@ export async function createProjectFile(req: Request, res: Response<{ filename:
project: {
title: req.body?.title ?? '',
description: req.body?.description ?? '',
publicUrl: req.body?.publicUrl ?? '',
publicInfo: req.body?.publicInfo ?? '',
backstageUrl: req.body?.backstageUrl ?? '',
backstageInfo: req.body?.backstageInfo ?? '',
projectLogo: req.body?.projectLogo ?? null,
@@ -11,8 +11,6 @@ export const validateNewProject = [
body('filename').optional().isString().trim(),
body('title').optional().isString().trim(),
body('description').optional().isString().trim(),
body('publicUrl').optional().isString().trim(),
body('publicInfo').optional().isString().trim(),
body('backstageUrl').optional().isString().trim(),
body('backstageInfo').optional().isString().trim(),
body('projectLogo').optional().isString().trim(),
@@ -56,7 +56,6 @@ describe('parseExcel()', () => {
title: 'Guest Welcome',
timerType: 'count-down',
endAction: 'none',
isPublic: true,
skip: false,
note: 'Ballyhoo',
custom: {
@@ -76,7 +75,6 @@ describe('parseExcel()', () => {
title: 'A song from the hearth',
timerType: 'clock',
endAction: 'load-next',
isPublic: false,
skip: true,
note: 'Rainbow chase',
custom: {},
@@ -117,7 +115,6 @@ describe('parseExcel()', () => {
title: 'Guest Welcome',
timerType: 'count-down',
endAction: 'none',
isPublic: true,
skip: false,
note: 'Ballyhoo',
custom: {},
@@ -132,7 +129,6 @@ describe('parseExcel()', () => {
title: 'A song from the hearth',
timerType: 'clock',
endAction: 'load-next',
isPublic: false,
skip: true,
note: 'Rainbow chase',
custom: {},
@@ -434,7 +430,6 @@ describe('getCustomFieldData()', () => {
cue: 'cue',
title: 'title',
countToEnd: 'count to end',
isPublic: 'public',
skip: 'skip',
note: 'notes',
colour: 'colour',
@@ -487,7 +482,6 @@ describe('getCustomFieldData()', () => {
cue: 'cue',
title: 'title',
countToEnd: 'count to end',
isPublic: 'public',
skip: 'skip',
note: 'notes',
colour: 'colour',
@@ -9,7 +9,6 @@ export const dataFromExcelTemplate = [
'End Action',
'Timer type',
'Count to end',
'Public',
'Skip',
'Notes',
't0',
@@ -27,7 +26,6 @@ export const dataFromExcelTemplate = [
'', // <-- endAction
'', // <-- timerType
'x', // <-- count to end
'x', // <-- public
'', // <-- skip
'Ballyhoo', // <-- notes
'a0', // <-- t0
@@ -45,7 +43,6 @@ export const dataFromExcelTemplate = [
'load-next', // <-- endAction
'clock', // timerType
'x', // <-- count to end
'', // <-- public
'x', // <-- skip
'Rainbow chase', // <-- notes
'b0', // <-- t0
@@ -69,7 +69,6 @@ export const parseExcel = (
let colourIndex: number | null = null;
// options: booleans
let isPublicIndex: number | null = null;
let skipIndex: number | null = null;
let countToEndIndex: number | null = null;
@@ -128,10 +127,6 @@ export const parseExcel = (
countToEndIndex = col;
rundownMetadata['countToEnd'] = { row, col };
},
[importMap.isPublic]: (row: number, col: number) => {
isPublicIndex = col;
rundownMetadata['isPublic'] = { row, col };
},
[importMap.skip]: (row: number, col: number) => {
skipIndex = col;
rundownMetadata['skip'] = { row, col };
@@ -203,8 +198,6 @@ export const parseExcel = (
entry.cue = makeString(column, '');
} else if (j === countToEndIndex) {
entry.countToEnd = parseBooleanString(column);
} else if (j === isPublicIndex) {
entry.isPublic = parseBooleanString(column);
} else if (j === skipIndex) {
entry.skip = parseBooleanString(column);
} else if (j === notesIndex) {
@@ -17,8 +17,6 @@ export function parseProjectData(data: Partial<DatabaseModel>, emitError?: Error
return {
title: data.project.title ?? dbModel.project.title,
description: data.project.description ?? dbModel.project.description,
publicUrl: data.project.publicUrl ?? dbModel.project.publicUrl,
publicInfo: data.project.publicInfo ?? dbModel.project.publicInfo,
backstageUrl: data.project.backstageUrl ?? dbModel.project.backstageUrl,
backstageInfo: data.project.backstageInfo ?? dbModel.project.backstageInfo,
projectLogo: data.project.projectLogo ?? dbModel.project.projectLogo,
@@ -21,8 +21,6 @@ router.post('/', projectSanitiser, async (req: Request, res: Response<ProjectDat
const newData: Partial<ProjectData> = removeUndefined({
title: req.body?.title,
description: req.body?.description,
publicUrl: req.body?.publicUrl,
publicInfo: req.body?.publicInfo,
backstageUrl: req.body?.backstageUrl,
backstageInfo: req.body?.backstageInfo,
endMessage: req.body?.endMessage,
@@ -5,8 +5,6 @@ export const projectSanitiser = [
body().notEmpty().withMessage('No object found in request'),
body('title').optional().isString().trim(),
body('description').optional().isString().trim(),
body('publicUrl').optional().isString().trim(),
body('publicInfo').optional().isString().trim(),
body('backstageUrl').optional().isString().trim(),
body('backstageInfo').optional().isString().trim(),
body('endMessage').optional().isString().trim(),
@@ -20,7 +20,6 @@ describe('test event validator', () => {
timeStart: expect.any(Number),
timeEnd: expect.any(Number),
countToEnd: expect.any(Boolean),
isPublic: expect.any(Boolean),
skip: expect.any(Boolean),
revision: expect.any(Number),
type: expect.any(String),
@@ -107,7 +106,6 @@ describe('doesInvalidateMetadata()', () => {
note: 'note',
endAction: EndAction.LoadNext,
timerType: TimerType.Clock,
isPublic: false,
colour: 'colour',
timeWarning: 1,
timeDanger: 2,
@@ -83,7 +83,6 @@ export function createPatch(originalEvent: OntimeEvent, patchEvent: Partial<Onti
endAction: validateEndAction(patchEvent.endAction, originalEvent.endAction),
timerType: validateTimerType(patchEvent.timerType, originalEvent.timerType),
countToEnd: typeof patchEvent.countToEnd === 'boolean' ? patchEvent.countToEnd : originalEvent.countToEnd,
isPublic: typeof patchEvent.isPublic === 'boolean' ? patchEvent.isPublic : originalEvent.isPublic,
skip: typeof patchEvent.skip === 'boolean' ? patchEvent.skip : originalEvent.skip,
note: makeString(patchEvent.note, originalEvent.note),
colour: makeString(patchEvent.colour, originalEvent.colour),
@@ -214,7 +213,6 @@ enum RegenerateWhitelist {
'endAction',
'timerType',
'countToEnd',
'isPublic',
'colour',
'timeWarning',
'timeDanger',