feat: Enhance dataset management and improve frontend components
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
- Added preloads 'allowed_extensions_mimetypes' and 'dependent_array_min_length' in adonisrc.ts - Updated @symfony/webpack-encore from ^4.6.1 to ^5.0.1 - AdminuserController: Implemented pagination for 10 records in index method - Enabled reviewers to reject datasets to editors with email notifications (DatasetController.ts) - Submitter DatasetController: Files now loaded in ascending order (sort_order) in edit mode - file.ts: Removed serialization of fileData due to browser issues - Modified FileUpload.vue to mark already uploaded files as deleted - Improved keyword search in SearchCategoryAutocomplete.vue - Started development on Category.vue for submitters to categorize DDC - Added new route /dataset/categorize in routes.ts - Introduced 2 new rules in start/rules: allowed_extensions_mimetypes.ts and dependent_array_min_length.ts - Performed npm updates
This commit is contained in:
parent
49bd96ee77
commit
f67b736a88
23 changed files with 2392 additions and 2759 deletions
|
@ -1,14 +1,14 @@
|
|||
import vine, { SimpleMessagesProvider } from '@vinejs/vine';
|
||||
import { TitleTypes, DescriptionTypes, ContributorTypes, ReferenceIdentifierTypes, RelationTypes } from '#contracts/enums';
|
||||
import dayjs from 'dayjs';
|
||||
import MimeType from '#models/mime_type';
|
||||
// import MimeType from '#models/mime_type';
|
||||
|
||||
const enabledExtensions = await MimeType.query().select('file_extension').where('enabled', true).exec();
|
||||
const extensions = enabledExtensions
|
||||
.map((extension) => {
|
||||
return extension.file_extension.split('|');
|
||||
})
|
||||
.flat();
|
||||
// const enabledExtensions = await MimeType.query().select('file_extension').where('enabled', true).exec();
|
||||
// const extensions = enabledExtensions
|
||||
// .map((extension) => {
|
||||
// return extension.file_extension.split('|');
|
||||
// })
|
||||
// .flat();
|
||||
|
||||
/**
|
||||
* Validates the dataset's creation action
|
||||
|
@ -137,8 +137,9 @@ export const createDatasetValidator = vine.compile(
|
|||
vine
|
||||
.myfile({
|
||||
size: '512mb',
|
||||
extnames: extensions,
|
||||
//extnames: extensions,
|
||||
})
|
||||
.allowedMimetypeExtensions()
|
||||
.filenameLength({ clientNameSizeLimit: 100 })
|
||||
.fileScan({ removeInfected: true }),
|
||||
)
|
||||
|
@ -267,13 +268,25 @@ export const updateDatasetValidator = vine.compile(
|
|||
.minLength(3)
|
||||
.distinct('value'),
|
||||
// last step
|
||||
files: vine.array(
|
||||
vine.myfile({
|
||||
size: '512mb',
|
||||
extnames: extensions,
|
||||
}),
|
||||
files: vine
|
||||
.array(
|
||||
vine
|
||||
.myfile({
|
||||
size: '512mb',
|
||||
//extnames: extensions,
|
||||
})
|
||||
.allowedMimetypeExtensions()
|
||||
.filenameLength({ clientNameSizeLimit: 100 })
|
||||
.fileScan({ removeInfected: true }),
|
||||
).dependentArrayMinLength({ dependentArray: 'fileInputs', min: 1}),
|
||||
fileInputs: vine
|
||||
.array(
|
||||
vine
|
||||
.object({
|
||||
label: vine.string().trim().maxLength(100),
|
||||
//extnames: extensions,
|
||||
})
|
||||
),
|
||||
// .minLength(1),
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue