forked from geolba/tethys.backend
- extend edit form for submitter
- corrected releasUpdate action for submitter - npm updates
This commit is contained in:
parent
4e97e47fbc
commit
5ce4f0b018
7 changed files with 267 additions and 55 deletions
73
app/Models/Coverage.ts
Normal file
73
app/Models/Coverage.ts
Normal file
|
@ -0,0 +1,73 @@
|
|||
import { column, BaseModel, SnakeCaseNamingStrategy, belongsTo, BelongsTo } from '@ioc:Adonis/Lucid/Orm';
|
||||
import { DateTime } from 'luxon';
|
||||
import Dataset from './Dataset';
|
||||
|
||||
export default class Coverage extends BaseModel {
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
public static primaryKey = 'id';
|
||||
public static table = 'coverage';
|
||||
public static selfAssignPrimaryKey = false;
|
||||
|
||||
@column({
|
||||
isPrimary: true,
|
||||
})
|
||||
public id: number;
|
||||
|
||||
@column({})
|
||||
public dataset_id: number;
|
||||
|
||||
@column({})
|
||||
public elevation_min: number;
|
||||
|
||||
@column({})
|
||||
public elevation_max: number;
|
||||
|
||||
@column({})
|
||||
public elevation_absolut: number;
|
||||
|
||||
@column({})
|
||||
public depth_min: number;
|
||||
|
||||
@column({})
|
||||
public depth_max: number;
|
||||
|
||||
@column({})
|
||||
public depth_absolut: number;
|
||||
|
||||
@column.dateTime({})
|
||||
public time_min: DateTime;
|
||||
|
||||
@column.dateTime({})
|
||||
public time_max: DateTime;
|
||||
|
||||
@column.dateTime({})
|
||||
public time_absolut: DateTime;
|
||||
|
||||
@column({})
|
||||
public x_min: number;
|
||||
|
||||
@column({})
|
||||
public x_max: number;
|
||||
|
||||
@column({})
|
||||
public y_min: number;
|
||||
|
||||
@column({})
|
||||
public y_max: number;
|
||||
|
||||
@column.dateTime({
|
||||
autoCreate: true,
|
||||
})
|
||||
public created_at: DateTime;
|
||||
|
||||
@column.dateTime({
|
||||
autoCreate: true,
|
||||
autoUpdate: true,
|
||||
})
|
||||
public updated_at: DateTime;
|
||||
|
||||
@belongsTo(() => Dataset, {
|
||||
foreignKey: 'dataset_id',
|
||||
})
|
||||
public dataset: BelongsTo<typeof Dataset>;
|
||||
}
|
|
@ -9,6 +9,8 @@ import {
|
|||
hasMany,
|
||||
HasMany,
|
||||
computed,
|
||||
hasOne,
|
||||
HasOne,
|
||||
} from '@ioc:Adonis/Lucid/Orm';
|
||||
import { DateTime } from 'luxon';
|
||||
import dayjs from 'dayjs';
|
||||
|
@ -19,6 +21,7 @@ import Description from './Description';
|
|||
import License from './License';
|
||||
import Subject from './Subject';
|
||||
import File from './File';
|
||||
import Coverage from './Coverage';
|
||||
|
||||
export default class Dataset extends BaseModel {
|
||||
public static namingStrategy = new SnakeCaseNamingStrategy();
|
||||
|
@ -56,9 +59,16 @@ export default class Dataset extends BaseModel {
|
|||
@column({})
|
||||
public reviewer_id: number | null = null;
|
||||
|
||||
|
||||
@column({})
|
||||
public reject_editor_note: string | null;
|
||||
|
||||
@column({})
|
||||
public preferred_reviewer: string | null;
|
||||
|
||||
@column({})
|
||||
public preferred_reviewer_email: string | null;
|
||||
|
||||
@column({})
|
||||
public reject_reviewer_note: string | null;
|
||||
|
||||
|
@ -123,6 +133,12 @@ export default class Dataset extends BaseModel {
|
|||
})
|
||||
public files: HasMany<typeof File>;
|
||||
|
||||
@hasOne(() => Coverage, {
|
||||
foreignKey: 'dataset_id',
|
||||
})
|
||||
public coverage: HasOne<typeof Coverage>;
|
||||
|
||||
|
||||
@computed({
|
||||
serializeAs: 'main_title',
|
||||
})
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue