feat: Add alternate mimetype support, enhance validation for alternate mimetypes, and improve script loading performance
All checks were successful
CI / container-job (push) Successful in 36s
All checks were successful
CI / container-job (push) Successful in 36s
- mime_type.ts: Added a new column `public alternate_mimetype: string;` - MimetypeController.ts: Extended validation and storage logic to accommodate the new `alternate_mimetype` attribute - adonisrc.ts: Integrated new validation rule to validate user-provided mimetypes - vite.ts: Set `defer: true` for script attributes to improve loading performance - update_1_to_mime_types.ts: Added migration for the new `alternate_mimetype` column in the database - UI improvements: Updated components such as AsideMenuLayer.vue, FormCheckRadioGroup.vue, MimeTypeInput.vue, NavBar.vue (lime-green background), NavBarMenu.vue, SectionBannerStarOnGitea.vue, Admin/mimetype/Create.vue, Admin/mimetype/Delete.vue, Admin/mimetype/Index.vue - allowed_extensions_mimetype.ts: Enhanced rule to also check for alternate mimetypes - referenceValidation.ts: Improved validation to allow only ISBNs with a '-' delimiter - package-lock.json: Updated npm dependencie
This commit is contained in:
parent
4c5a8f5a42
commit
a3031169ca
20 changed files with 719 additions and 704 deletions
|
@ -76,7 +76,8 @@ async function validateReference(value: unknown, options: Options, field: FieldC
|
|||
}
|
||||
}
|
||||
} else if (type === ReferenceIdentifierTypes.ISBN) {
|
||||
if (!/^(?=(?:[^0-9]*[0-9]){10}(?:(?:[^0-9]*[0-9]){3})?$)[\d-]+$/.test(value)) {
|
||||
const isbnRegex = /^(?:\d{1,5}-\d{1,7}-\d{1,7}-[\dX]$|97[89]-\d{1,5}-\d{1,7}-\d{1,7}-\d)$/;
|
||||
if (!isbnRegex.test(value)) {
|
||||
field.report('The {{ field }} must be a valid ISBN', 'validateReference', field);
|
||||
} else {
|
||||
try {
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue