- add model DatasetReference.ts

- add references inside Creta.vue for Submitter /dataset
- npm updates
- extended enum types
- added relations for Dataset.ts
This commit is contained in:
Kaimbacher 2023-08-01 17:06:51 +02:00
parent 5ce4f0b018
commit f6d735d0fd
10 changed files with 580 additions and 592 deletions

View File

@ -6,6 +6,7 @@ import Project from 'App/Models/Project';
import Title from 'App/Models/Title'; import Title from 'App/Models/Title';
import Description from 'App/Models/Description'; import Description from 'App/Models/Description';
import Language from 'App/Models/Language'; import Language from 'App/Models/Language';
import Coverage from 'App/Models/Coverage';
// import CreateUserValidator from 'App/Validators/CreateUserValidator'; // import CreateUserValidator from 'App/Validators/CreateUserValidator';
// import UpdateUserValidator from 'App/Validators/UpdateUserValidator'; // import UpdateUserValidator from 'App/Validators/UpdateUserValidator';
import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator'; import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator';
@ -15,8 +16,9 @@ import Database from '@ioc:Adonis/Lucid/Database';
import { TransactionClientContract } from '@ioc:Adonis/Lucid/Database'; import { TransactionClientContract } from '@ioc:Adonis/Lucid/Database';
import Subject from 'App/Models/Subject'; import Subject from 'App/Models/Subject';
import CreateDatasetValidator from 'App/Validators/CreateDatasetValidator'; import CreateDatasetValidator from 'App/Validators/CreateDatasetValidator';
import { TitleTypes, DescriptionTypes, ContributorTypes, PersonNameTypes } from 'Contracts/enums'; import { TitleTypes, DescriptionTypes, ContributorTypes, PersonNameTypes, ReferenceIdentifierTypes, RelationTypes } from 'Contracts/enums';
import type { ModelQueryBuilderContract } from '@ioc:Adonis/Lucid/Orm'; import type { ModelQueryBuilderContract } from '@ioc:Adonis/Lucid/Orm';
import DatasetReference from 'App/Models/DatasetReference';
export default class DatasetController { export default class DatasetController {
public async index({ auth, request, inertia }: HttpContextContract) { public async index({ auth, request, inertia }: HttpContextContract) {
@ -115,6 +117,10 @@ export default class DatasetController {
.map(([key, value]) => ({ value: key, label: value })), .map(([key, value]) => ({ value: key, label: value })),
// descriptiontypes: DescriptionTypes // descriptiontypes: DescriptionTypes
projects: projects, projects: projects,
referenceIdentifierTypes: Object.entries(ReferenceIdentifierTypes)
.map(([key, value]) => ({ value: key, label: value })),
relationTypes: Object.entries(RelationTypes)
.map(([key, value]) => ({ value: key, label: value })),
}); });
} }
@ -239,6 +245,17 @@ export default class DatasetController {
depth_min: schema.number.optional([rules.requiredIfExists('depth_max')]), depth_min: schema.number.optional([rules.requiredIfExists('depth_max')]),
depth_max: schema.number.optional([rules.requiredIfExists('depth_min')]), depth_max: schema.number.optional([rules.requiredIfExists('depth_min')]),
}), }),
references: schema.array([rules.uniqueArray('value')]).members(
schema.object().members({
value: schema.string({ trim: true }, [
rules.minLength(3),
rules.maxLength(255),
]),
type: schema.enum(Object.values(ReferenceIdentifierTypes)),
relation: schema.enum(Object.values(RelationTypes)),
// language: schema.string({ trim: true }, [rules.minLength(2), rules.maxLength(255)]),
}),
),
subjects: schema.array([rules.minLength(3), rules.uniqueArray('value')]).members( subjects: schema.array([rules.minLength(3), rules.uniqueArray('value')]).members(
schema.object().members({ schema.object().members({
value: schema.string({ trim: true }, [ value: schema.string({ trim: true }, [
@ -263,6 +280,7 @@ export default class DatasetController {
} }
return response.redirect().back(); return response.redirect().back();
} }
public async store({ auth, request, response, session }: HttpContextContract) { public async store({ auth, request, response, session }: HttpContextContract) {
// node ace make:validator CreateDataset // node ace make:validator CreateDataset
try { try {
@ -277,134 +295,15 @@ export default class DatasetController {
throw error; throw error;
} }
// const user = new User();
// user.email = 'example@example.com';
// user.password = 'password';
// await user.useTransaction(trx).save();
let trx: TransactionClientContract | null = null; let trx: TransactionClientContract | null = null;
try { try {
trx = await Database.transaction(); trx = await Database.transaction();
const user = (await User.find(auth.user?.id)) as User; const user = (await User.find(auth.user?.id)) as User;
// const dataset = await user.related('datasets').create({ await this.createDatasetAndAssociations(user, request, trx);
// type: request.input('type'),
// creatingCorporation: request.input('creating_corporation'),
// language: request.input('language'),
// });
// Create a new instance of the Dataset model:
const dataset = new Dataset();
dataset.type = request.input('type');
dataset.creatingCorporation = request.input('creating_corporation');
dataset.language = request.input('language');
dataset.embargoDate = request.input('embargo_date');
//await dataset.related('user').associate(user); // speichert schon ab
// Dataset.$getRelation('user').boot();
// Dataset.$getRelation('user').setRelated(dataset, user);
// dataset.$setRelated('user', user);
await user.useTransaction(trx).related('datasets').save(dataset);
//store licenses:
const licenses: number[] = request.input('licenses', []);
dataset.useTransaction(trx).related('licenses').sync(licenses);
const authors = request.input('authors', []);
for (const [key, person] of authors.entries()) {
const pivotData = { role: 'author', sort_order: key + 1 };
if (person.id !== undefined) {
await dataset
.useTransaction(trx)
.related('persons')
.attach({
[person.id]: {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
},
});
} else {
const dataPerson = new Person();
// use overwritten fill method
dataPerson.fill(person);
await dataset.useTransaction(trx).related('persons').save(dataPerson, false, {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
});
}
}
const contributors = request.input('contributors', []);
for (const [key, person] of contributors.entries()) {
const pivotData = { role: 'contributor', sort_order: key + 1 };
if (person.id !== undefined) {
await dataset
.useTransaction(trx)
.related('persons')
.attach({
[person.id]: {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
},
});
} else {
const dataPerson = new Person();
// use overwritten fill method
dataPerson.fill(person);
await dataset.useTransaction(trx).related('persons').save(dataPerson, false, {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
});
}
}
//save main and additional titles
const titles = request.input('titles', []);
for (const titleData of titles) {
const title = new Title();
title.value = titleData.value;
title.language = titleData.language;
title.type = titleData.type;
await dataset.useTransaction(trx).related('titles').save(title);
}
//save abstract and additional descriptions
const descriptions = request.input('descriptions', []);
for (const descriptionData of descriptions) {
// $descriptionReference = new Description($description);
// $dataset->abstracts()->save($descriptionReference);
const description = new Description();
description.value = descriptionData.value;
description.language = descriptionData.language;
description.type = descriptionData.type;
await dataset.useTransaction(trx).related('descriptions').save(description);
}
//save keywords
const keywords = request.input('subjects', []);
for (const keywordData of keywords) {
// $dataKeyword = new Subject($keyword);
// $dataset->subjects()->save($dataKeyword);
const keyword = await Subject.firstOrNew({ value: keywordData.value, type: keywordData.type }, keywordData);
if (keyword.$isNew === true) {
await dataset.useTransaction(trx).related('subjects').save(keyword);
} else {
await dataset.useTransaction(trx).related('subjects').attach([keyword.id]);
}
}
// Dataset.$getRelation('persons').boot();
// Dataset.$getRelation('persons').pushRelated(dataset, person)
// dataset.$pushRelated('persons', person);
await trx.commit(); await trx.commit();
console.log('Dataset and related models created successfully');
console.log('Users and posts created successfully');
} catch (error) { } catch (error) {
if (trx !== null) { if (trx !== null) {
await trx.rollback(); await trx.rollback();
@ -425,8 +324,6 @@ export default class DatasetController {
// fieldName: 'file' // fieldName: 'file'
// size: 135624 // size: 135624
//const datasetFolder = 'files/' . dataset->id;
// await coverImage.moveToDisk('./') // await coverImage.moveToDisk('./')
await coverImage.moveToDisk( await coverImage.moveToDisk(
'/test_dataset2', '/test_dataset2',
@ -444,6 +341,110 @@ export default class DatasetController {
return response.redirect().back(); return response.redirect().back();
} }
private async createDatasetAndAssociations(user: User, request: HttpContextContract['request'], trx: TransactionClientContract) {
// Create a new instance of the Dataset model:
const dataset = new Dataset();
dataset.type = request.input('type');
dataset.creatingCorporation = request.input('creating_corporation');
dataset.language = request.input('language');
dataset.embargoDate = request.input('embargo_date');
//await dataset.related('user').associate(user); // speichert schon ab
// Dataset.$getRelation('user').boot();
// Dataset.$getRelation('user').setRelated(dataset, user);
// dataset.$setRelated('user', user);
await user.useTransaction(trx).related('datasets').save(dataset);
//store licenses:
const licenses: number[] = request.input('licenses', []);
dataset.useTransaction(trx).related('licenses').sync(licenses);
// save authors and contributors
await this.savePersons(dataset, request.input('authors', []), 'author', trx);
await this.savePersons(dataset, request.input('contributors', []), 'contributor', trx);
//save main and additional titles
const titles = request.input('titles', []);
for (const titleData of titles) {
const title = new Title();
title.value = titleData.value;
title.language = titleData.language;
title.type = titleData.type;
await dataset.useTransaction(trx).related('titles').save(title);
}
// save descriptions
const descriptions = request.input('descriptions', []);
for (const descriptionData of descriptions) {
const description = new Description();
description.value = descriptionData.value;
description.language = descriptionData.language;
description.type = descriptionData.type;
await dataset.useTransaction(trx).related('descriptions').save(description);
}
//save references
const references = request.input('references', []);
for (const referencePayload of references) {
const dataReference = new DatasetReference();
dataReference.fill(referencePayload);
// $dataReference = new DatasetReference($reference);
dataset.related('references').save(dataReference);
}
//save keywords
const keywords = request.input('subjects', []);
for (const keywordData of keywords) {
// $dataKeyword = new Subject($keyword);
// $dataset->subjects()->save($dataKeyword);
const keyword = await Subject.firstOrNew({ value: keywordData.value, type: keywordData.type }, keywordData);
if (keyword.$isNew === true) {
await dataset.useTransaction(trx).related('subjects').save(keyword);
} else {
await dataset.useTransaction(trx).related('subjects').attach([keyword.id]);
}
}
// save coverage
const coverageData = request.input('coverage');
if (coverageData) {
// const formCoverage = request.input('coverage');
const coverage = new Coverage();
coverage.fill(coverageData);
// await dataset.coverage().save(coverageData);
await dataset.useTransaction(trx).related('coverage').save(coverage);
// Alternatively, you can associate the dataset with the coverage and then save it:
// await coverage.dataset().associate(dataset).save();
// await coverage.useTransaction(trx).related('dataset').associate(dataset);
}
}
private async savePersons(dataset: Dataset, persons: any[], role: string, trx: TransactionClientContract) {
for (const [key, person] of persons.entries()) {
const pivotData = { role: role, sort_order: key + 1 };
if (person.id !== undefined) {
await dataset
.useTransaction(trx)
.related('persons')
.attach({
[person.id]: {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
},
});
} else {
const dataPerson = new Person();
dataPerson.fill(person);
await dataset.useTransaction(trx).related('persons').save(dataPerson, false, {
role: pivotData.role,
sort_order: pivotData.sort_order,
allow_email_contact: false,
});
}
}
}
public messages: CustomMessages = { public messages: CustomMessages = {
'minLength': '{{ field }} must be at least {{ options.minLength }} characters long', 'minLength': '{{ field }} must be at least {{ options.minLength }} characters long',
'maxLength': '{{ field }} must be less then {{ options.maxLength }} characters long', 'maxLength': '{{ field }} must be less then {{ options.maxLength }} characters long',

View File

@ -7,6 +7,21 @@ export default class Coverage extends BaseModel {
public static primaryKey = 'id'; public static primaryKey = 'id';
public static table = 'coverage'; public static table = 'coverage';
public static selfAssignPrimaryKey = false; public static selfAssignPrimaryKey = false;
public static fillable: string[] = [
'elevation_min',
'elevation_max',
'elevation_absolut',
'depth_min',
'depth_max',
'depth_absolut',
'time_min',
'time_max',
'time_absolut',
'x_min',
'x_max',
'y_min',
'y_max',
];
@column({ @column({
isPrimary: true, isPrimary: true,

View File

@ -22,6 +22,7 @@ import License from './License';
import Subject from './Subject'; import Subject from './Subject';
import File from './File'; import File from './File';
import Coverage from './Coverage'; import Coverage from './Coverage';
import DatasetReference from './DatasetReference';
export default class Dataset extends BaseModel { export default class Dataset extends BaseModel {
public static namingStrategy = new SnakeCaseNamingStrategy(); public static namingStrategy = new SnakeCaseNamingStrategy();
@ -138,6 +139,11 @@ export default class Dataset extends BaseModel {
}) })
public coverage: HasOne<typeof Coverage>; public coverage: HasOne<typeof Coverage>;
@hasMany(() => DatasetReference, {
foreignKey: 'document_id',
})
public references: HasMany<typeof DatasetReference>;
@computed({ @computed({
serializeAs: 'main_title', serializeAs: 'main_title',

View File

@ -0,0 +1,49 @@
import { column, BaseModel, SnakeCaseNamingStrategy, belongsTo, BelongsTo } from '@ioc:Adonis/Lucid/Orm';
import { DateTime } from 'luxon';
import Dataset from './Dataset';
export default class DatasetReference extends BaseModel {
public static namingStrategy = new SnakeCaseNamingStrategy();
public static primaryKey = 'id';
public static table = 'document_references';
public static fillable: string[] = ['value', 'label', 'type', 'relation'];
@column({
isPrimary: true,
})
public id: number;
@column({})
public document_id: number;
@column({})
public related_document_id?: number;
@column({})
public type: string;
@column({})
public relation: string;
@column({})
public value: string;
@column({})
public label: string;
@column.dateTime({
autoCreate: true,
})
public created_at?: DateTime;
@column.dateTime({
autoCreate: true,
autoUpdate: true,
})
public updated_at?: DateTime;
@belongsTo(() => Dataset, {
foreignKey: 'document_id',
})
public dataset: BelongsTo<typeof Dataset>;
}

View File

@ -1,7 +1,7 @@
import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator'; import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator';
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { TitleTypes, DescriptionTypes } from 'Contracts/enums'; import { TitleTypes, DescriptionTypes, RelationTypes, ReferenceIdentifierTypes } from 'Contracts/enums';
export default class CreateDatasetValidator { export default class CreateDatasetValidator {
constructor(protected ctx: HttpContextContract) {} constructor(protected ctx: HttpContextContract) {}
@ -73,6 +73,17 @@ export default class CreateDatasetValidator {
depth_min: schema.number.optional([rules.requiredIfExists('depth_max')]), depth_min: schema.number.optional([rules.requiredIfExists('depth_max')]),
depth_max: schema.number.optional([rules.requiredIfExists('depth_min')]), depth_max: schema.number.optional([rules.requiredIfExists('depth_min')]),
}), }),
references: schema.array([rules.uniqueArray('value')]).members(
schema.object().members({
value: schema.string({ trim: true }, [
rules.minLength(3),
rules.maxLength(255),
]),
type: schema.enum(Object.values(ReferenceIdentifierTypes)),
relation: schema.enum(Object.values(RelationTypes)),
// language: schema.string({ trim: true }, [rules.minLength(2), rules.maxLength(255)]),
}),
),
subjects: schema.array([rules.minLength(3), rules.uniqueArray('value')]).members( subjects: schema.array([rules.minLength(3), rules.uniqueArray('value')]).members(
schema.object().members({ schema.object().members({
value: schema.string({ trim: true }, [ value: schema.string({ trim: true }, [

View File

@ -79,3 +79,24 @@ export enum ContributorTypes {
export enum SubjectTypes { export enum SubjectTypes {
uncontrolled = 'uncontrolled', uncontrolled = 'uncontrolled',
} }
export enum ReferenceIdentifierTypes {
DOI = 'DOI',
Handle = 'Handle',
ISBN = 'ISBN',
ISSN = 'ISSN',
URL = 'URL',
URN = 'URN',
}
export enum RelationTypes {
IsSupplementTo = 'IsSupplementTo',
IsSupplementedBy = 'IsSupplementedBy',
IsContinuedBy = 'IsContinuedBy',
Continues = 'Continues',
IsNewVersionOf = 'IsNewVersionOf',
IsPartOf = 'IsPartOf',
HasPart = 'HasPart',
Compiles = 'Compiles',
IsVariantFormOf = 'IsVariantFormOf',
}

102
package-lock.json generated
View File

@ -33,7 +33,6 @@
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"saxon-js": "^2.5.0", "saxon-js": "^2.5.0",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"vue-facing-decorator": "^2.1.13",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
"xmlbuilder2": "^3.1.1" "xmlbuilder2": "^3.1.1"
}, },
@ -74,6 +73,7 @@
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^5.1.3", "typescript": "^5.1.3",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-facing-decorator": "^3.0.0",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"xslt3": "^2.5.0", "xslt3": "^2.5.0",
"youch": "^3.2.0", "youch": "^3.2.0",
@ -2699,9 +2699,9 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.1.0", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz",
"integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
@ -2767,9 +2767,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.44.0", "version": "8.46.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz",
"integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -4168,9 +4168,9 @@
} }
}, },
"node_modules/@types/validator": { "node_modules/@types/validator": {
"version": "13.7.17", "version": "13.9.0",
"resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.7.17.tgz", "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.9.0.tgz",
"integrity": "sha512-aqayTNmeWrZcvnG2MG9eGYI6b7S5fl+yKgPs6bAjOTwPS316R5SxBGKvtSExfyoJU7pIeHJfsHI0Ji41RVMkvQ==" "integrity": "sha512-NclP0IbzHj/4tJZKFqKh8E7kZdgss+MCUYV9G+TLltFfDA4lFgE4PKPpDIyS2FlcdANIfSx273emkupvChigbw=="
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "8.5.5", "version": "8.5.5",
@ -5864,9 +5864,9 @@
} }
}, },
"node_modules/browserslist": { "node_modules/browserslist": {
"version": "4.21.9", "version": "4.21.10",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz",
"integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -5883,9 +5883,9 @@
} }
], ],
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001503", "caniuse-lite": "^1.0.30001517",
"electron-to-chromium": "^1.4.431", "electron-to-chromium": "^1.4.477",
"node-releases": "^2.0.12", "node-releases": "^2.0.13",
"update-browserslist-db": "^1.0.11" "update-browserslist-db": "^1.0.11"
}, },
"bin": { "bin": {
@ -6081,9 +6081,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001517", "version": "1.0.30001518",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz",
"integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", "integrity": "sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -7950,9 +7950,9 @@
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.4.475", "version": "1.4.479",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.475.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.479.tgz",
"integrity": "sha512-mTye5u5P98kSJO2n7zYALhpJDmoSQejIGya0iR01GpoRady8eK3bw7YHHnjA1Rfi4ZSLdpuzlAC7Zw+1Zu7Z6A==", "integrity": "sha512-ABv1nHMIR8I5n3O3Een0gr6i0mfM+YcTZqjHy3pAYaOjgFG+BMquuKrSyfYf5CbEkLr9uM05RA3pOk4udNB/aQ==",
"dev": true "dev": true
}, },
"node_modules/emittery": { "node_modules/emittery": {
@ -8011,9 +8011,9 @@
} }
}, },
"node_modules/enquirer": { "node_modules/enquirer": {
"version": "2.4.0", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.0.tgz", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz",
"integrity": "sha512-ehu97t6FTYK2I3ZYtnp0BZ9vt0mvEL/cnHBds7Ct6jo9VX1VIkiFhOvVRWh6eblQqd7KOoICIQV+syZ3neXO/Q==", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==",
"dependencies": { "dependencies": {
"ansi-colors": "^4.1.1", "ansi-colors": "^4.1.1",
"strip-ansi": "^6.0.1" "strip-ansi": "^6.0.1"
@ -8101,27 +8101,27 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.45.0", "version": "8.46.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz",
"integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.0", "@eslint/eslintrc": "^2.1.1",
"@eslint/js": "8.44.0", "@eslint/js": "^8.46.0",
"@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/config-array": "^0.11.10",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
"ajv": "^6.10.0", "ajv": "^6.12.4",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"cross-spawn": "^7.0.2", "cross-spawn": "^7.0.2",
"debug": "^4.3.2", "debug": "^4.3.2",
"doctrine": "^3.0.0", "doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"eslint-scope": "^7.2.0", "eslint-scope": "^7.2.2",
"eslint-visitor-keys": "^3.4.1", "eslint-visitor-keys": "^3.4.2",
"espree": "^9.6.0", "espree": "^9.6.1",
"esquery": "^1.4.2", "esquery": "^1.4.2",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
@ -8212,9 +8212,9 @@
} }
}, },
"node_modules/eslint-scope": { "node_modules/eslint-scope": {
"version": "7.2.1", "version": "7.2.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
"integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esrecurse": "^4.3.0", "esrecurse": "^4.3.0",
@ -8228,9 +8228,9 @@
} }
}, },
"node_modules/eslint-visitor-keys": { "node_modules/eslint-visitor-keys": {
"version": "3.4.1", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz",
"integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -12710,13 +12710,13 @@
} }
}, },
"node_modules/pg": { "node_modules/pg": {
"version": "8.11.1", "version": "8.11.2",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.11.1.tgz", "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.2.tgz",
"integrity": "sha512-utdq2obft07MxaDg0zBJI+l/M3mBRfIpEN3iSemsz0G5F2/VXx+XzqF4oxrbIZXQxt2AZzIUzyVg/YM6xOP/WQ==", "integrity": "sha512-l4rmVeV8qTIrrPrIR3kZQqBgSN93331s9i6wiUiLOSk0Q7PmUxZD/m1rQI622l3NfqBby9Ar5PABfS/SulfieQ==",
"dependencies": { "dependencies": {
"buffer-writer": "2.0.0", "buffer-writer": "2.0.0",
"packet-reader": "1.0.0", "packet-reader": "1.0.0",
"pg-connection-string": "^2.6.1", "pg-connection-string": "^2.6.2",
"pg-pool": "^3.6.1", "pg-pool": "^3.6.1",
"pg-protocol": "^1.6.0", "pg-protocol": "^1.6.0",
"pg-types": "^2.1.0", "pg-types": "^2.1.0",
@ -12784,6 +12784,11 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/pg/node_modules/pg-connection-string": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz",
"integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA=="
},
"node_modules/pgpass": { "node_modules/pgpass": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
@ -16716,9 +16721,10 @@
} }
}, },
"node_modules/vue-facing-decorator": { "node_modules/vue-facing-decorator": {
"version": "2.1.20", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/vue-facing-decorator/-/vue-facing-decorator-2.1.20.tgz", "resolved": "https://registry.npmjs.org/vue-facing-decorator/-/vue-facing-decorator-3.0.0.tgz",
"integrity": "sha512-Xv987Q+XhhWTPXxzG4HllHxckMahV04wDcRebdd/AWlU/hYm7+tGRo2eD84mpl3rZLZQ74Cr41UlWbGbEQptNA==", "integrity": "sha512-NnbFHlJCYzQv8Mx9ehm486NLxidx/KeqbSDgi4V9kLXakLIijzLHqRWMpuEWW4hsQFxRh3bTtPCTCZMP2OL+4Q==",
"dev": true,
"peerDependencies": { "peerDependencies": {
"vue": "^3.0.0" "vue": "^3.0.0"
} }

View File

@ -55,6 +55,7 @@
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^5.1.3", "typescript": "^5.1.3",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-facing-decorator": "^3.0.0",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"xslt3": "^2.5.0", "xslt3": "^2.5.0",
"youch": "^3.2.0", "youch": "^3.2.0",
@ -86,7 +87,6 @@
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"saxon-js": "^2.5.0", "saxon-js": "^2.5.0",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"vue-facing-decorator": "^2.1.13",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
"xmlbuilder2": "^3.1.1" "xmlbuilder2": "^3.1.1"
} }

View File

@ -11,6 +11,7 @@ export interface Dataset {
| number | number
| (IErrorMessage | undefined) | (IErrorMessage | undefined)
| Coverage | Coverage
| Array<DatasetReference>
| Array<File>; | Array<File>;
language: Ref<string>; language: Ref<string>;
// licenses: Array<number>; // licenses: Array<number>;
@ -27,6 +28,7 @@ export interface Dataset {
errors?: IErrorMessage; errors?: IErrorMessage;
// async (user): Promise<void>; // async (user): Promise<void>;
subjects: Array<Subject>; subjects: Array<Subject>;
references: Array<DatasetReference>;
files: Array<TestFile> | undefined; files: Array<TestFile> | undefined;
// upload: TethysFile // upload: TethysFile
} }
@ -53,6 +55,13 @@ export interface Subject {
value: string; value: string;
external_key?: string; external_key?: string;
} }
export interface DatasetReference {
// id: number;
value: string;
label: string;
type: string;
relation: string;
}
export interface Title { export interface Title {
value: string; value: string;

File diff suppressed because it is too large Load Diff