mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-28 02:19:07 +00:00
refactor(rundown): cap rundown names to 64 characters
This commit is contained in:
committed by
Carlos Valente
parent
514b6c3a02
commit
608247157b
@@ -46,7 +46,7 @@ export function ManageRundownForm({ onClose }: ManageRundownForm) {
|
|||||||
<Panel.Section>
|
<Panel.Section>
|
||||||
<label>
|
<label>
|
||||||
<Panel.Description>Rundown title</Panel.Description>
|
<Panel.Description>Rundown title</Panel.Description>
|
||||||
<Input {...register('title')} fluid placeholder='Your rundown name' />
|
<Input {...register('title')} maxLength={64} fluid placeholder='Your rundown name' />
|
||||||
</label>
|
</label>
|
||||||
</Panel.Section>
|
</Panel.Section>
|
||||||
<Panel.InlineElements relation='inner' align='end'>
|
<Panel.InlineElements relation='inner' align='end'>
|
||||||
|
|||||||
+1
@@ -59,6 +59,7 @@ export default function RundownRenameForm({ onSubmit, onCancel, initialTitle }:
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
|
maxLength={64}
|
||||||
fluid
|
fluid
|
||||||
/>
|
/>
|
||||||
{errors.title && <Panel.Error>{errors.title.message}</Panel.Error>}
|
{errors.title && <Panel.Error>{errors.title.message}</Panel.Error>}
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
import { body, param } from 'express-validator';
|
import { body, param } from 'express-validator';
|
||||||
import type { EntryId, InsertOptions, OntimeGroup, Rundown } from 'ontime-types';
|
import { type EntryId, type InsertOptions, type OntimeGroup, type Rundown } from 'ontime-types';
|
||||||
|
|
||||||
import { requestValidationFunction } from '../validation-utils/validationFunction.js';
|
import { requestValidationFunction } from '../validation-utils/validationFunction.js';
|
||||||
|
|
||||||
// #region operations on project rundowns =========================
|
// #region operations on project rundowns =========================
|
||||||
|
|
||||||
export const rundownPostValidator = [body('title').isString().trim().notEmpty(), requestValidationFunction];
|
const rundownTitleValidator = body('title')
|
||||||
|
.isString()
|
||||||
|
.trim()
|
||||||
|
.notEmpty()
|
||||||
|
.withMessage('No title provided')
|
||||||
|
.bail()
|
||||||
|
.isLength({ max: 64 })
|
||||||
|
.withMessage('Title must be 64 characters or fewer');
|
||||||
|
|
||||||
|
export const rundownPostValidator = [rundownTitleValidator, requestValidationFunction];
|
||||||
export const rundownPatchValidator = [
|
export const rundownPatchValidator = [
|
||||||
param('id').isString().trim().notEmpty(),
|
param('id').isString().trim().notEmpty(),
|
||||||
body('title').isString().trim().notEmpty().withMessage('No title provided'),
|
rundownTitleValidator,
|
||||||
requestValidationFunction,
|
requestValidationFunction,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user