- add validator for checking languages of translated titles and description

- add notification messages via notiwind.ts
- add Project.ts
- add new component TabelPersons.vue
- add additional routes
- npm updates
This commit is contained in:
Kaimbacher 2023-03-24 11:41:52 +01:00
parent 59a99ff3c8
commit 080c21126b
24 changed files with 979 additions and 349 deletions

View File

@ -22,6 +22,12 @@
"environment": [ "environment": [
"web" "web"
] ]
},
{
"file": "./start/validator",
"environment": [
"web"
]
} }
], ],
"providers": [ "providers": [

View File

@ -26,9 +26,9 @@ export default class AuthorsController {
// users = users.whereRaw('name like %?%', [request.input('search')]) // users = users.whereRaw('name like %?%', [request.input('search')])
const searchTerm = request.input('filter'); const searchTerm = request.input('filter');
authors authors
.where('first_name', 'ilike', `%${searchTerm}%`) .whereILike('first_name', `%${searchTerm}%`)
.orWhere('last_name', 'like', `%${searchTerm}%`) .orWhereILike('last_name', `%${searchTerm}%`);
.orWhere('email', 'like', `%${searchTerm}%`); // .orWhere('email', 'like', `%${searchTerm}%`);
} }
let persons = await authors; let persons = await authors;

View File

@ -3,11 +3,13 @@ import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
// import Role from 'App/Models/Role'; // import Role from 'App/Models/Role';
// import Database from '@ioc:Adonis/Lucid/Database'; // import Database from '@ioc:Adonis/Lucid/Database';
import License from 'App/Models/License'; import License from 'App/Models/License';
import Project from 'App/Models/Project';
// import type { ModelQueryBuilderContract } from '@ioc:Adonis/Lucid/Orm'; // import type { ModelQueryBuilderContract } from '@ioc:Adonis/Lucid/Orm';
// 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 { RenderResponse } from '@ioc:EidelLev/Inertia'; // import { RenderResponse } from '@ioc:EidelLev/Inertia';
import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator'; import { schema, CustomMessages, rules } from '@ioc:Adonis/Core/Validator';
import dayjs from 'dayjs';
enum TitleTypes { enum TitleTypes {
Main = 'Main', Main = 'Main',
@ -30,6 +32,8 @@ export default class DatasetController {
public async create({ inertia }: HttpContextContract) { public async create({ inertia }: HttpContextContract) {
const licenses = await License.query().select('id', 'name_long').pluck('name_long', 'id'); const licenses = await License.query().select('id', 'name_long').pluck('name_long', 'id');
const projects = await Project.query().pluck('label', 'id');
const doctypes = { const doctypes = {
analysisdata: { label: 'Analysis', value: 'analysisdata' }, analysisdata: { label: 'Analysis', value: 'analysisdata' },
measurementdata: { label: 'Measurements', value: 'measurementdata' }, measurementdata: { label: 'Measurements', value: 'measurementdata' },
@ -47,13 +51,20 @@ export default class DatasetController {
// Other: 'Other', // Other: 'Other',
// }; // };
// let test = Object.entries(TitleTypes).map(([key, value]) => ({id: key, value: value}))
// const languages = await Database.from('languages').select('*').where('active', true); // const languages = await Database.from('languages').select('*').where('active', true);
return inertia.render('Submitter/Dataset/Create', { return inertia.render('Submitter/Dataset/Create', {
licenses: licenses, licenses: licenses,
doctypes: doctypes, doctypes: doctypes,
titletypes: Object.values(TitleTypes).filter((x) => x.valueOf() !== 'Main'), titletypes: Object.entries(TitleTypes)
descriptiontypes: Object.values(DescriptionTypes).filter((x) => x.valueOf() !== 'Abstract'), .filter(([value]) => value !== 'Main')
.map(([key, value]) => ({ value: key, label: value })),
descriptiontypes: Object.entries(DescriptionTypes)
.filter(([value]) => value !== 'Abstract')
.map(([key, value]) => ({ value: key, label: value })),
// descriptiontypes: DescriptionTypes // descriptiontypes: DescriptionTypes
projects: projects,
}); });
} }
@ -68,7 +79,7 @@ export default class DatasetController {
try { try {
// Step 2 - Validate request body against the schema // Step 2 - Validate request body against the schema
await request.validate({ schema: newDatasetSchema, messages: this.messages }); await request.validate({ schema: newDatasetSchema, messages: this.messages });
// console.log({ payload }); // console.log({ payload });
} catch (error) { } catch (error) {
@ -81,10 +92,63 @@ export default class DatasetController {
public async secondStep({ request, response }: HttpContextContract) { public async secondStep({ request, response }: HttpContextContract) {
const newDatasetSchema = schema.create({ const newDatasetSchema = schema.create({
// first step
language: schema.string({ trim: true }, [ language: schema.string({ trim: true }, [
rules.regex(/^[a-zA-Z0-9-_]+$/), //Must be alphanumeric with hyphens or underscores rules.regex(/^[a-zA-Z0-9-_]+$/), //Must be alphanumeric with hyphens or underscores
]), ]),
licenses: schema.array([rules.minLength(1)]).members(schema.number()), // define at least one license for the new dataset licenses: schema.array([rules.minLength(1)]).members(schema.number()), // define at least one license for the new dataset
rights: schema.string([rules.equalTo('true')]),
// second step
type: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
creating_corporation: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
titles: schema.array([rules.minLength(1)]).members(
schema.object().members({
value: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
type: schema.enum(Object.values(TitleTypes)),
language: schema.string({ trim: true }, [
rules.minLength(2),
rules.maxLength(255),
rules.translatedLanguage('/language', 'type')
]),
}),
),
descriptions: schema.array([rules.minLength(1)]).members(
schema.object().members({
value: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
type: schema.enum(Object.values(DescriptionTypes)),
language: schema.string({ trim: true }, [
rules.minLength(2),
rules.maxLength(255),
rules.translatedLanguage('/language', 'type')
]),
}),
),
authors: schema.array([rules.minLength(1)]).members(schema.object().members({ email: schema.string({ trim: true }) })),
// project_id: schema.number(),
});
try {
// Step 2 - Validate request body against the schema
await request.validate({ schema: newDatasetSchema, messages: this.messages });
// console.log({ payload });
} catch (error) {
// Step 3 - Handle errors
// return response.badRequest(error.messages);
throw error;
}
return response.redirect().back();
}
public async thirdStep({ request, response }: HttpContextContract) {
const newDatasetSchema = schema.create({
// first step
language: schema.string({ trim: true }, [
rules.regex(/^[a-zA-Z0-9-_]+$/), //Must be alphanumeric with hyphens or underscores
]),
licenses: schema.array([rules.minLength(1)]).members(schema.number()), // define at least one license for the new dataset
rights: schema.string([rules.equalTo('true')]),
// second step
type: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]), type: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
creating_corporation: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]), creating_corporation: schema.string({ trim: true }, [rules.minLength(3), rules.maxLength(255)]),
titles: schema.array([rules.minLength(1)]).members( titles: schema.array([rules.minLength(1)]).members(
@ -101,6 +165,10 @@ export default class DatasetController {
language: schema.string({ trim: true }, [rules.minLength(2), rules.maxLength(255)]), language: schema.string({ trim: true }, [rules.minLength(2), rules.maxLength(255)]),
}), }),
), ),
authors: schema.array([rules.minLength(1)]).members(schema.object().members({ email: schema.string({ trim: true }) })),
// third step
project_id: schema.number.optional(),
embargo_date: schema.date.optional({ format: 'yyyy-MM-dd' }, [rules.after(10, 'days')]),
}); });
try { try {
@ -114,7 +182,6 @@ export default class DatasetController {
} }
return response.redirect().back(); return response.redirect().back();
} }
// public async store({ request, response, session }: HttpContextContract) { // public async store({ request, response, session }: HttpContextContract) {
// // node ace make:validator CreateUser // // node ace make:validator CreateUser
// try { // try {
@ -138,25 +205,31 @@ export default class DatasetController {
// } // }
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',
'required': '{{ field }} is required', 'required': '{{ field }} is required',
'unique': '{{ field }} must be unique, and this value is already taken', 'unique': '{{ field }} must be unique, and this value is already taken',
// 'confirmed': '{{ field }} is not correct', // 'confirmed': '{{ field }} is not correct',
'licences.minLength': 'at least {{ options.minLength }} permission must be defined', 'licences.minLength': 'at least {{ options.minLength }} permission must be defined',
'licences.*.number': 'Define roles as valid numbers', 'licences.*.number': 'Define roles as valid numbers',
'rights.equalTo': 'you must agree to continue', 'rights.equalTo': 'you must agree to continue',
'titles.0.value.minLength': 'Main Title must be at least {{ options.minLength }} characters long', 'titles.0.value.minLength': 'Main Title must be at least {{ options.minLength }} characters long',
'titles.0.value.required': 'Main Title is required', 'titles.0.value.required': 'Main Title is required',
'titles.*.value.required': 'Additional title is required, if defined', 'titles.*.value.required': 'Additional title is required, if defined',
'titles.*.type.required': 'Additional title type is required', 'titles.*.type.required': 'Additional title type is required',
'titles.*.language.required': 'Additional title language is required', 'titles.*.language.required': 'Additional title language is required',
'titles.*.language.translatedLanguage': 'The language of the translated title must be different from the language of the dataset',
'descriptions.0.value.minLength': 'Main Abstract must be at least {{ options.minLength }} characters long', 'descriptions.0.value.minLength': 'Main Abstract must be at least {{ options.minLength }} characters long',
'descriptions.0.value.required': 'Main Abstract is required', 'descriptions.0.value.required': 'Main Abstract is required',
'descriptions.*.value.required': 'Additional description is required, if defined', 'descriptions.*.value.required': 'Additional description is required, if defined',
'descriptions.*.type.required': 'Additional description type is required', 'descriptions.*.type.required': 'Additional description type is required',
'descriptions.*.language.required': 'Additional description language is required', 'descriptions.*.language.required': 'Additional description language is required',
}; 'descriptions.*.language.translatedLanguage': 'The language of the translated description must be different from the language of the dataset',
'authors.minLength': 'at least {{ options.minLength }} author must be defined',
'after': `{{ field }} must be older than ${dayjs().add(10, 'day')}`,
};
} }

View File

@ -26,7 +26,7 @@ export default class Dataset extends BaseModel {
public publisherName: string; public publisherName: string;
@column.dateTime({ columnName: 'embargo_date' }) @column.dateTime({ columnName: 'embargo_date' })
public EmbargoDate: DateTime; public embargoDate: DateTime;
@column({}) @column({})
public type: string; public type: string;

View File

@ -48,24 +48,24 @@ export default class Person extends BaseModel {
}, },
autoCreate: true, autoCreate: true,
}) })
public registeredAt: DateTime; public createdAt: DateTime;
@computed({ @computed({
serializeAs: 'name' serializeAs: 'name'
}) })
public get fullName() { public get fullName() {
return `${this.firstName} ${this.lastName} (${this.email})`; return `${this.firstName} ${this.lastName}`;
} }
@computed() // @computed()
public get progress(): number { // public get progress(): number {
return 50; // return 50;
} // }
@computed() // @computed()
public get created_at() { // public get created_at() {
return '2023-02-17 08:45:56'; // return '2023-03-21 08:45:00';
} // }
@computed() @computed()
public get datasetCount() { public get datasetCount() {

37
app/Models/Project.ts Normal file
View File

@ -0,0 +1,37 @@
import { column, BaseModel, SnakeCaseNamingStrategy } from '@ioc:Adonis/Lucid/Orm';
import { DateTime } from 'luxon';
export default class Project extends BaseModel {
public static namingStrategy = new SnakeCaseNamingStrategy();
public static primaryKey = 'id';
public static table = 'projects';
public static selfAssignPrimaryKey = false;
@column({
isPrimary: true,
})
public id: number;
@column({})
public label: string;
@column({})
public name: string;
@column({})
public description: string;
@column.dateTime({
autoCreate: true,
})
public created_at: DateTime;
@column.dateTime({
autoCreate: true,
autoUpdate: true
})
public updated_at: DateTime;
}

View File

@ -2,21 +2,18 @@ import Database, {
// DatabaseQueryBuilderContract, // DatabaseQueryBuilderContract,
QueryClientContract, QueryClientContract,
TransactionClientContract, TransactionClientContract,
} from "@ioc:Adonis/Lucid/Database"; } from '@ioc:Adonis/Lucid/Database';
import Config from "@ioc:Adonis/Core/Config"; import Config from '@ioc:Adonis/Core/Config';
export function getUserRoles( export function getUserRoles(userId: number, trx?: TransactionClientContract): Promise<Array<string>> {
userId: number, const { userRole } = Config.get('acl.joinTables');
trx?: TransactionClientContract
): Promise<Array<string>> {
const { userRole } = Config.get("acl.joinTables");
return ((trx || Database) as QueryClientContract | TransactionClientContract) return ((trx || Database) as QueryClientContract | TransactionClientContract)
.query() .query()
.from("roles") .from('roles')
.distinct("roles.slug") .distinct('roles.slug')
.leftJoin(userRole, `${userRole}.role_id`, "roles.id") .leftJoin(userRole, `${userRole}.role_id`, 'roles.id')
.where(`${userRole}.user_id`, userId) .where(`${userRole}.user_id`, userId)
.then((res) => { .then((res) => {
return res.map((r) => r.slug); return res.map((r) => r.slug);
}); });
} }

9
contracts/validator.ts Normal file
View File

@ -0,0 +1,9 @@
declare module '@ioc:Adonis/Core/Validator' {
interface Rules {
translatedLanguage(
mainLanguageField: string,
typeField: string
): Rule
}
}

269
package-lock.json generated
View File

@ -25,6 +25,7 @@
"crypto": "^1.0.1", "crypto": "^1.0.1",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"luxon": "^3.2.1", "luxon": "^3.2.1",
"notiwind": "^2.0.0",
"pg": "^8.9.0", "pg": "^8.9.0",
"proxy-addr": "^2.0.7", "proxy-addr": "^2.0.7",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
@ -65,7 +66,7 @@
"prettier": "^2.8.3", "prettier": "^2.8.3",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.2.4",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^4.9.4", "typescript": "^4.9.5",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"youch": "^3.2.0", "youch": "^3.2.0",
@ -2522,9 +2523,9 @@
} }
}, },
"node_modules/@eidellev/inertia-adonisjs": { "node_modules/@eidellev/inertia-adonisjs": {
"version": "8.0.0", "version": "8.0.1",
"resolved": "https://registry.npmjs.org/@eidellev/inertia-adonisjs/-/inertia-adonisjs-8.0.0.tgz", "resolved": "https://registry.npmjs.org/@eidellev/inertia-adonisjs/-/inertia-adonisjs-8.0.1.tgz",
"integrity": "sha512-nnlgS4P6OAjdV8cGcA1HdgdGoo5g6bdifTfSwjSSi3ijl+0aQgGK+R1cnLp+HCdEgQwnbxacAptVNd2r67u0bA==", "integrity": "sha512-TV4bDh2PEyOgf7lWRFPgaugxUXIHjXSV8I+qpRNQIWH+snWp7jYjoc8d/q1KsNewYRLCh2HpbMGQtbqgYEOMxw==",
"dependencies": { "dependencies": {
"@types/md5": "^2.3.2", "@types/md5": "^2.3.2",
"html-entities": "^2.3.3", "html-entities": "^2.3.3",
@ -2556,9 +2557,9 @@
} }
}, },
"node_modules/@eslint-community/regexpp": { "node_modules/@eslint-community/regexpp": {
"version": "4.4.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz",
"integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0" "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
@ -2848,9 +2849,9 @@
} }
}, },
"node_modules/@japa/run-failed-tests/node_modules/fs-extra": { "node_modules/@japa/run-failed-tests/node_modules/fs-extra": {
"version": "11.1.0", "version": "11.1.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz",
"integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"graceful-fs": "^4.2.0", "graceful-fs": "^4.2.0",
@ -3084,9 +3085,9 @@
"dev": true "dev": true
}, },
"node_modules/@mdi/js": { "node_modules/@mdi/js": {
"version": "7.1.96", "version": "7.2.96",
"resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.1.96.tgz", "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.2.96.tgz",
"integrity": "sha512-wlrJs6Ryhaa5CqhK3FjTfMRnb/s7HeLkKMFqwQySkK86cdN1TGdzpSM3O4tsmzCA1dYBeTbXvOwSE/Y42cUrvA==", "integrity": "sha512-paR9M9ZT7rKbh2boksNUynuSZMHhqRYnEZOm/KrZTjQ4/FzyhjLHuvw/8XYzP+E7fS4+/Ms/82EN1pl/OFsiIA==",
"dev": true "dev": true
}, },
"node_modules/@mrmlnc/readdir-enhanced": { "node_modules/@mrmlnc/readdir-enhanced": {
@ -3646,9 +3647,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "8.21.2", "version": "8.21.3",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.2.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.3.tgz",
"integrity": "sha512-EMpxUyystd3uZVByZap1DACsMXvb82ypQnGn89e1Y0a+LYu3JJscUd/gqhRsVFDkaD2MIiWo0MT8EfXr3DGRKw==", "integrity": "sha512-fa7GkppZVEByMWGbTtE5MbmXWJTVbrjjaS8K6uQj+XtuuUv1fsuPAxhygfqLmsb/Ufb3CV8deFCpiMfAgi00Sw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -3804,9 +3805,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.15.3", "version": "18.15.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.6.tgz",
"integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==" "integrity": "sha512-YErOafCZpK4g+Rp3Q/PBgZNAsWKGunQTm9FA3/Pbcm0VCriTEzcrutQ/SxSc0rytAp0NoFWue669jmKhEtd0sA=="
}, },
"node_modules/@types/pino": { "node_modules/@types/pino": {
"version": "6.3.12", "version": "6.3.12",
@ -3947,15 +3948,15 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz",
"integrity": "sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg==", "integrity": "sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.4.0",
"@typescript-eslint/scope-manager": "5.55.0", "@typescript-eslint/scope-manager": "5.56.0",
"@typescript-eslint/type-utils": "5.55.0", "@typescript-eslint/type-utils": "5.56.0",
"@typescript-eslint/utils": "5.55.0", "@typescript-eslint/utils": "5.56.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"grapheme-splitter": "^1.0.4", "grapheme-splitter": "^1.0.4",
"ignore": "^5.2.0", "ignore": "^5.2.0",
@ -3981,14 +3982,14 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.56.0.tgz",
"integrity": "sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw==", "integrity": "sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "5.55.0", "@typescript-eslint/scope-manager": "5.56.0",
"@typescript-eslint/types": "5.55.0", "@typescript-eslint/types": "5.56.0",
"@typescript-eslint/typescript-estree": "5.55.0", "@typescript-eslint/typescript-estree": "5.56.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -4008,13 +4009,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz",
"integrity": "sha512-OK+cIO1ZGhJYNCL//a3ROpsd83psf4dUJ4j7pdNVzd5DmIk+ffkuUIX2vcZQbEW/IR41DYsfJTB19tpCboxQuw==", "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.55.0", "@typescript-eslint/types": "5.56.0",
"@typescript-eslint/visitor-keys": "5.55.0" "@typescript-eslint/visitor-keys": "5.56.0"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -4025,13 +4026,13 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz",
"integrity": "sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA==", "integrity": "sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "5.55.0", "@typescript-eslint/typescript-estree": "5.56.0",
"@typescript-eslint/utils": "5.55.0", "@typescript-eslint/utils": "5.56.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "tsutils": "^3.21.0"
}, },
@ -4052,9 +4053,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz",
"integrity": "sha512-M4iRh4AG1ChrOL6Y+mETEKGeDnT7Sparn6fhZ5LtVJF1909D5O4uqK+C5NPbLmpfZ0XIIxCdwzKiijpZUOvOug==", "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==",
"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"
@ -4065,13 +4066,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz",
"integrity": "sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ==", "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.55.0", "@typescript-eslint/types": "5.56.0",
"@typescript-eslint/visitor-keys": "5.55.0", "@typescript-eslint/visitor-keys": "5.56.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -4142,17 +4143,17 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz",
"integrity": "sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw==", "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.9",
"@types/semver": "^7.3.12", "@types/semver": "^7.3.12",
"@typescript-eslint/scope-manager": "5.55.0", "@typescript-eslint/scope-manager": "5.56.0",
"@typescript-eslint/types": "5.55.0", "@typescript-eslint/types": "5.56.0",
"@typescript-eslint/typescript-estree": "5.55.0", "@typescript-eslint/typescript-estree": "5.56.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"semver": "^7.3.7" "semver": "^7.3.7"
}, },
@ -4190,12 +4191,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "5.55.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.55.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz",
"integrity": "sha512-q2dlHHwWgirKh1D3acnuApXG+VNXpEY5/AwRxDVuEQpxWaB0jCDe0jFMVMALJ3ebSfuOVE8/rMS+9ZOYGg1GWw==", "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.55.0", "@typescript-eslint/types": "5.56.0",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
}, },
"engines": { "engines": {
@ -5588,9 +5589,9 @@
} }
}, },
"node_modules/bonjour-service": { "node_modules/bonjour-service": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.0.tgz", "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz",
"integrity": "sha512-LVRinRB3k1/K0XzZ2p58COnWvkQknIY6sf0zF2rpErvcJXpMBttEPQSxK+HEXSS9VmpZlDoDnQWv8ftJT20B0Q==", "integrity": "sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"array-flatten": "^2.1.2", "array-flatten": "^2.1.2",
@ -5826,9 +5827,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001467", "version": "1.0.30001469",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001467.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz",
"integrity": "sha512-cEdN/5e+RPikvl9AHm4uuLXxeCNq8rFsQ+lPHTfe/OtypP3WwnVVbjn+6uBV7PaFL6xUFzTh+sSCOz1rKhcO+Q==", "integrity": "sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -6484,9 +6485,9 @@
"dev": true "dev": true
}, },
"node_modules/cosmiconfig": { "node_modules/cosmiconfig": {
"version": "8.1.0", "version": "8.1.3",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz",
"integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==", "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
@ -6626,9 +6627,9 @@
} }
}, },
"node_modules/css-declaration-sorter": { "node_modules/css-declaration-sorter": {
"version": "6.3.1", "version": "6.4.0",
"resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.3.1.tgz", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz",
"integrity": "sha512-fBffmak0bPAnyqc/HO8C3n2sHrp9wcqQz6ES9koRF2/mLOVAx9zIQ3Y7R29sYCteTPqMCwns4WYQoCX91Xl3+w==", "integrity": "sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^10 || ^12 || >=14" "node": "^10 || ^12 || >=14"
@ -7413,25 +7414,35 @@
"integrity": "sha512-ORKH7rn/LEfgo0qrgoMMwFPfestNFvTO+dRLDmS+zgulhd9BVXfv/p+V6K3OyEeu2L0ysYp/71uHB31GIDe68A==" "integrity": "sha512-ORKH7rn/LEfgo0qrgoMMwFPfestNFvTO+dRLDmS+zgulhd9BVXfv/p+V6K3OyEeu2L0ysYp/71uHB31GIDe68A=="
}, },
"node_modules/edge-lexer": { "node_modules/edge-lexer": {
"version": "4.0.10", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-4.0.10.tgz", "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-5.0.2.tgz",
"integrity": "sha512-6hvRE0TkYyqogEGTU6GpNW3vf6PDA0U+zLEXIV4ZhsCRy2YX+FuprzitYpe69ZHC+BZdiFpdCn2Zqf1HOebqEg==", "integrity": "sha512-MSpv6JRPD96eZl0uPo8gIvE9cPAXb1eNRfZKlQpFYJ2O8cNdZDpN8RvT2zpu4XqC63HWs/c938qc3dWN+GJhFw==",
"dependencies": { "dependencies": {
"edge-error": "^2.0.8" "edge-error": "^3.0.0"
} }
}, },
"node_modules/edge-lexer/node_modules/edge-error": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/edge-error/-/edge-error-3.0.0.tgz",
"integrity": "sha512-TJE2A6KFqBMIe3EPyl/5V8veGYcMfpEtSNKfZkrSkQAyz3kh27etQ2erU6o0lkAFqDjjUl11YVzBIO2ij5/Zhw=="
},
"node_modules/edge-parser": { "node_modules/edge-parser": {
"version": "8.2.1", "version": "8.2.2",
"resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.1.tgz", "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.2.tgz",
"integrity": "sha512-6x2BdSqwU4Oo4IF+ppu3wchpzhZ8Oq05hBPGLYnTOSoSVrQThSV9PK9t+Oz47XQOQSb5V9fugUOYLuUy8iXZGg==", "integrity": "sha512-48iOLaOD4PAxIU0jnLRNXUL8G6ktO79bA4adOGXzNHg2M+mHfudFI7QPdF6IO8gW0NC1N0TPvwLWK3FVkE9bLQ==",
"dependencies": { "dependencies": {
"acorn": "^8.8.0", "acorn": "^8.8.2",
"astring": "^1.8.3", "astring": "^1.8.4",
"edge-error": "^2.0.8", "edge-error": "^3.0.0",
"edge-lexer": "^4.0.10", "edge-lexer": "^5.0.2",
"js-stringify": "^1.0.2" "js-stringify": "^1.0.2"
} }
}, },
"node_modules/edge-parser/node_modules/edge-error": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/edge-error/-/edge-error-3.0.0.tgz",
"integrity": "sha512-TJE2A6KFqBMIe3EPyl/5V8veGYcMfpEtSNKfZkrSkQAyz3kh27etQ2erU6o0lkAFqDjjUl11YVzBIO2ij5/Zhw=="
},
"node_modules/edge-supercharged": { "node_modules/edge-supercharged": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/edge-supercharged/-/edge-supercharged-3.1.1.tgz", "resolved": "https://registry.npmjs.org/edge-supercharged/-/edge-supercharged-3.1.1.tgz",
@ -7466,20 +7477,25 @@
} }
}, },
"node_modules/edge.js": { "node_modules/edge.js": {
"version": "5.5.0", "version": "5.5.1",
"resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.0.tgz", "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.1.tgz",
"integrity": "sha512-jH6g5wDMJB2xVt+hwSTTlx++hVVItZIPJgt8Q8of/zIt2391eD90IpvHZQM8cG8v2j8H6YdCJ3Rp998ze1BvJA==", "integrity": "sha512-lAhEdj1tW2VOJsP5X38wSHjjaXXwoteZ+8PDAJ50rAKzBxpw4QsdXK2jVzMFgRoTMUf7C+x+Tp51R9yxGTLO0w==",
"dependencies": { "dependencies": {
"@poppinss/inspect": "^1.0.1", "@poppinss/inspect": "^1.0.1",
"@poppinss/utils": "^5.0.0", "@poppinss/utils": "^5.0.0",
"edge-error": "^2.0.8", "edge-error": "^3.0.0",
"edge-lexer": "^4.0.10", "edge-lexer": "^5.0.2",
"edge-parser": "^8.2.1", "edge-parser": "^8.2.1",
"js-stringify": "^1.0.2", "js-stringify": "^1.0.2",
"macroable": "^7.0.1", "macroable": "^7.0.1",
"stringify-attributes": "^2.0.0" "stringify-attributes": "^2.0.0"
} }
}, },
"node_modules/edge.js/node_modules/edge-error": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/edge-error/-/edge-error-3.0.0.tgz",
"integrity": "sha512-TJE2A6KFqBMIe3EPyl/5V8veGYcMfpEtSNKfZkrSkQAyz3kh27etQ2erU6o0lkAFqDjjUl11YVzBIO2ij5/Zhw=="
},
"node_modules/editorconfig": { "node_modules/editorconfig": {
"version": "0.15.3", "version": "0.15.3",
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
@ -7532,9 +7548,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.332", "version": "1.4.337",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.332.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.337.tgz",
"integrity": "sha512-c1Vbv5tuUlBFp0mb3mCIjw+REEsgthRgNE8BlbEDKmvzb8rxjcVki6OkQP83vLN34s0XCxpSkq7AZNep1a6xhw==", "integrity": "sha512-W8gdzXG86mVPoc56eM8YA+QiLxaAxJ8cmDjxZgfhLLWVvZQxyA918w5tX2JEWApZta45T1/sYcmFHTsTOUE3nw==",
"dev": true "dev": true
}, },
"node_modules/emittery": { "node_modules/emittery": {
@ -7739,9 +7755,9 @@
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
"version": "8.7.0", "version": "8.8.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.7.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz",
"integrity": "sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA==", "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==",
"dev": true, "dev": true,
"bin": { "bin": {
"eslint-config-prettier": "bin/cli.js" "eslint-config-prettier": "bin/cli.js"
@ -10293,9 +10309,9 @@
} }
}, },
"node_modules/jest-util/node_modules/@types/yargs": { "node_modules/jest-util/node_modules/@types/yargs": {
"version": "17.0.22", "version": "17.0.23",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.22.tgz", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.23.tgz",
"integrity": "sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g==", "integrity": "sha512-yuogunc04OnzGQCrfHx+Kk883Q4X0aSwmYZhKjI21m+SVYzjIbrWl8dOOwSv5hf2Um2pdCOXWo9isteZTNXUZQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/yargs-parser": "*" "@types/yargs-parser": "*"
@ -10415,9 +10431,9 @@
} }
}, },
"node_modules/js-sdsl": { "node_modules/js-sdsl": {
"version": "4.3.0", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz",
"integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==",
"dev": true, "dev": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -10909,9 +10925,9 @@
} }
}, },
"node_modules/marked": { "node_modules/marked": {
"version": "4.2.12", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
"integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
"dev": true, "dev": true,
"bin": { "bin": {
"marked": "bin/marked.js" "marked": "bin/marked.js"
@ -11224,6 +11240,11 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/mitt": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz",
"integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ=="
},
"node_modules/mixin-deep": { "node_modules/mixin-deep": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
@ -11574,6 +11595,17 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/notiwind": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/notiwind/-/notiwind-2.0.0.tgz",
"integrity": "sha512-TRl3vTVnBEqvNQZM15oFtS63S6hGobkRIWTyvcGyNcOzsTPb8WybE6vuXTelUgUbMqQooSae1L25cqOyFMjTMg==",
"dependencies": {
"mitt": "^3.0.0"
},
"peerDependencies": {
"vue": "^3.2.40"
}
},
"node_modules/npm-run-path": { "node_modules/npm-run-path": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
@ -12424,9 +12456,9 @@
} }
}, },
"node_modules/pino-pretty/node_modules/sonic-boom": { "node_modules/pino-pretty/node_modules/sonic-boom": {
"version": "3.2.1", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.1.tgz", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.3.0.tgz",
"integrity": "sha512-iITeTHxy3B9FGu8aVdiDXUVAcHMF9Ss0cCsAOo2HfCrmVGT3/DT5oYaeu0M/YKZDlKTvChEyPq0zI9Hf33EX6A==", "integrity": "sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g==",
"dependencies": { "dependencies": {
"atomic-sleep": "^1.0.0" "atomic-sleep": "^1.0.0"
} }
@ -13270,9 +13302,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.4", "version": "2.8.6",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz",
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"
@ -14192,9 +14224,9 @@
} }
}, },
"node_modules/set-cookie-parser": { "node_modules/set-cookie-parser": {
"version": "2.5.1", "version": "2.6.0",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
"integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==",
"dev": true "dev": true
}, },
"node_modules/set-value": { "node_modules/set-value": {
@ -16135,9 +16167,9 @@
} }
}, },
"node_modules/webpack": { "node_modules/webpack": {
"version": "5.76.2", "version": "5.76.3",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz",
"integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==", "integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -16329,9 +16361,9 @@
} }
}, },
"node_modules/webpack-dev-server": { "node_modules/webpack-dev-server": {
"version": "4.12.0", "version": "4.13.1",
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.12.0.tgz", "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.1.tgz",
"integrity": "sha512-XRN9YRnvOj3TQQ5w/0pR1y1xDcVnbWtNkTri46kuEbaWUPTHsWUvOyAAI7PZHLY+hsFki2kRltJjKMw7e+IiqA==", "integrity": "sha512-5tWg00bnWbYgkN+pd5yISQKDejRBYGEw15RaEEslH+zdbNDxxaZvEAO2WulaSaFKb5n3YG8JXsGaDsut1D0xdA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/bonjour": "^3.5.9", "@types/bonjour": "^3.5.9",
@ -16379,6 +16411,9 @@
"webpack": "^4.37.0 || ^5.0.0" "webpack": "^4.37.0 || ^5.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"webpack": {
"optional": true
},
"webpack-cli": { "webpack-cli": {
"optional": true "optional": true
} }

View File

@ -65,7 +65,7 @@
"prettier": "^2.8.3", "prettier": "^2.8.3",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.2.4",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^4.9.4", "typescript": "^4.9.5",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"youch": "^3.2.0", "youch": "^3.2.0",
@ -89,6 +89,7 @@
"crypto": "^1.0.1", "crypto": "^1.0.1",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"luxon": "^3.2.1", "luxon": "^3.2.1",
"notiwind": "^2.0.0",
"pg": "^8.9.0", "pg": "^8.9.0",
"proxy-addr": "^2.0.7", "proxy-addr": "^2.0.7",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",

View File

@ -1,37 +1,34 @@
<script> <script>
import { h, defineComponent } from 'vue' import { h, defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'BaseLevel', name: 'BaseLevel',
props: { props: {
mobile: Boolean, mobile: Boolean,
type: { type: {
type: String, type: String,
default: 'justify-between' default: 'justify-between',
} },
}, },
render () { render() {
const parentClass = [this.type, 'items-center'] const parentClass = [this.type, 'items-center'];
const parentMobileClass = ['flex'] const parentMobileClass = ['flex'];
const parentBaseClass = ['block', 'md:flex'] const parentBaseClass = ['block', 'md:flex'];
const childBaseClass = ['flex', 'shrink-0', 'grow-0', 'items-center', 'justify-center'] const childBaseClass = ['flex', 'shrink-0', 'grow-0', 'items-center', 'justify-center'];
return h( return h(
'div', 'div',
{ class: parentClass.concat(this.mobile ? parentMobileClass : parentBaseClass) }, { class: parentClass.concat(this.mobile ? parentMobileClass : parentBaseClass) },
this.$slots.default().map((element, index) => { this.$slots.default().map((element, index) => {
const childClass = (!this.mobile && this.$slots.default().length > index + 1) const childClass =
? childBaseClass.concat(['mb-6', 'md:mb-0']) !this.mobile && this.$slots.default().length > index + 1 ? childBaseClass.concat(['mb-6', 'md:mb-0']) : childBaseClass;
: childBaseClass
return h('div', { class: childClass }, [ return h('div', { class: childClass }, [element]);
element }),
]) );
}) },
) });
}
})
</script> </script>

View File

@ -112,7 +112,7 @@ if (props.ctrlKFocus) {
<div class="relative"> <div class="relative">
<select v-if="computedType === 'select'" :id="id" v-model="computedValue" :name="name" :class="inputElClass"> <select v-if="computedType === 'select'" :id="id" v-model="computedValue" :name="name" :class="inputElClass">
<option v-if="placeholder" class="text-opacity-25" value="" disabled selected>{{ placeholder }}</option> <option v-if="placeholder" class="text-opacity-25" value="" disabled selected>{{ placeholder }}</option>
<option v-for="option in options" :key="option.id ?? option" :value="option.value ?? option"> <option v-for="(option, index) in options" :key="index" :value="option.value ?? index">
{{ option.label ?? option }} {{ option.label ?? option }}
</option> </option>
</select> </select>

View File

@ -0,0 +1,66 @@
<script setup lang="ts">
import { Notification, NotificationGroup } from '@/notiwind';
</script>
<template>
<NotificationGroup position="bottom">
<div class="z-50 fixed inset-x-0 top-0 flex items-start justify-end p-6 px-4 py-6 pointer-events-none">
<div class="w-full max-w-sm">
<Notification
v-slot="{ notifications }"
enter="transform ease-out duration-300 transition"
enter-from="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-4"
enter-to="translate-y-0 opacity-100 sm:translate-x-0"
leave="transition ease-in duration-500"
leave-from="opacity-100"
leave-to="opacity-0"
move="transition duration-500"
move-delay="delay-300"
>
<div v-for="notification in notifications" :key="notification.id">
<div
v-if="notification.type === 'info'"
class="flex w-full max-w-sm mx-auto mt-4 overflow-hidden bg-white rounded-lg shadow-md"
>
<div class="flex items-center justify-center w-12 bg-blue-500">
<svg class="w-6 h-6 text-white fill-current" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
<path
d="M20 3.33331C10.8 3.33331 3.33337 10.8 3.33337 20C3.33337 29.2 10.8 36.6666 20 36.6666C29.2 36.6666 36.6667 29.2 36.6667 20C36.6667 10.8 29.2 3.33331 20 3.33331ZM21.6667 28.3333H18.3334V25H21.6667V28.3333ZM21.6667 21.6666H18.3334V11.6666H21.6667V21.6666Z"
/>
</svg>
</div>
<div class="px-4 py-2 -mx-3">
<div class="mx-3">
<span class="font-semibold text-blue-500">{{ notification.title }}</span>
<p class="text-sm text-gray-600">T{{ notification.text }}</p>
</div>
</div>
</div>
<div
class="flex w-full max-w-sm mx-auto mt-4 overflow-hidden bg-white rounded-lg shadow-md"
v-if="notification.type === 'warning'"
>
<div class="flex items-center justify-center w-12 bg-yellow-500">
<svg class="w-6 h-6 text-white fill-current" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
<path
d="M20 3.33331C10.8 3.33331 3.33337 10.8 3.33337 20C3.33337 29.2 10.8 36.6666 20 36.6666C29.2 36.6666 36.6667 29.2 36.6667 20C36.6667 10.8 29.2 3.33331 20 3.33331ZM21.6667 28.3333H18.3334V25H21.6667V28.3333ZM21.6667 21.6666H18.3334V11.6666H21.6667V21.6666Z"
/>
</svg>
</div>
<div class="px-4 py-2 -mx-3">
<div class="mx-3">
<span class="font-semibold text-yellow-500">{{ notification.title }}</span>
<p class="text-sm text-gray-600">{{ notification.text }}</p>
</div>
</div>
</div>
</div>
</Notification>
</div>
</div>
</NotificationGroup>
</template>

View File

@ -1,56 +1,42 @@
<script setup> <script setup>
import { computed } from 'vue' import { computed } from 'vue';
import { colorsBgLight, colorsOutline } from '@/colors.js' import { colorsBgLight, colorsOutline } from '@/colors.js';
import BaseIcon from '@/Components/BaseIcon.vue' import BaseIcon from '@/Components/BaseIcon.vue';
const props = defineProps({ const props = defineProps({
text: { text: {
type: String, type: String,
required: true required: true,
}, },
type: { type: {
type: String, type: String,
required: true required: true,
}, },
icon: { icon: {
type: String, type: String,
default: null default: null,
}, },
small: Boolean, small: Boolean,
outline: Boolean, outline: Boolean,
wrapped: Boolean wrapped: Boolean,
}) });
const componentClass = computed(() => { const componentClass = computed(() => {
const baseColor = props.outline ? colorsOutline[props.type] : colorsBgLight[props.type] const baseColor = props.outline ? colorsOutline[props.type] : colorsBgLight[props.type];
const base = [ const base = ['border', props.small ? 'py-1 px-4 text-xs rounded-full' : 'py-2 px-6 rounded-full', baseColor];
'border',
props.small ? 'py-1 px-4 text-xs rounded-full' : 'py-2 px-6 rounded-full',
baseColor
]
if (!props.wrapped) { if (!props.wrapped) {
base.push(props.small ? 'mr-1.5' : 'mr-3', 'last:mr-0') base.push(props.small ? 'mr-1.5' : 'mr-3', 'last:mr-0');
} }
return base return base;
}) });
</script> </script>
<template> <template>
<div <div class="inline-flex items-center capitalize" :class="componentClass">
class="inline-flex items-center capitalize" <BaseIcon v-if="icon" :path="icon" h="h-4" w="w-4" :class="small ? 'mr-1' : 'mr-2'" :size="small ? 14 : 16" />
:class="componentClass" <span>{{ text }}</span>
> </div>
<BaseIcon
v-if="icon"
:path="icon"
h="h-4"
w="w-4"
:class="small ? 'mr-1' : 'mr-2'"
:size="small ? 14 : 16"
/>
<span>{{ text }}</span>
</div>
</template> </template>

View File

@ -17,68 +17,72 @@
</ul> --> </ul> -->
<!-- <div class="flex-col justify-center relative"> --> <!-- <div class="flex-col justify-center relative"> -->
<div class="relative"> <div class="mb-6 mx-2 mt-2">
<input <div class="relative">
v-model="data.search" <input
type="text" v-model="data.search"
:class="inputElClass" type="text"
:name="props.name" :class="inputElClass"
:placeholder="placeholder" :name="props.name"
autocomplete="off" :placeholder="placeholder"
@keydown.down="onArrowDown" autocomplete="off"
@keydown.up="onArrowUp" @keydown.down="onArrowDown"
/> @keydown.up="onArrowUp"
<svg @keydown.enter="onEnter"
class="w-4 h-4 absolute left-2.5 top-3.5" />
xmlns="http://www.w3.org/2000/svg" <svg
fill="none" class="w-4 h-4 absolute left-2.5 top-3.5"
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
stroke="currentColor" fill="none"
> viewBox="0 0 24 24"
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /> stroke="currentColor"
</svg> >
</div> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
<!-- <ul v-if="data.isOpen" class="bg-white border border-gray-100 w-full mt-2 max-h-28 overflow-y-auto"> --> </svg>
<!-- :ref="(el) => { ul[i] = el }" --> </div>
<ul v-if="data.isOpen" class="bg-white dark:bg-slate-800 w-full mt-2 max-h-28 overflow-y-auto scroll-smooth"> <!-- <ul v-if="data.isOpen" class="bg-white border border-gray-100 w-full mt-2 max-h-28 overflow-y-auto"> -->
<li <!-- :ref="(el) => { ul[i] = el }" -->
class="pl-8 pr-2 py-1 border-b-2 border-gray-100 relative cursor-pointer hover:bg-yellow-50 hover:text-gray-900" <ul v-if="data.isOpen" class="bg-white dark:bg-slate-800 w-full mt-2 max-h-28 overflow-y-auto scroll-smooth">
:class="{ <li
'bg-yellow-50 text-gray-900': i == selectedIndex, class="pl-8 pr-2 py-1 border-b-2 border-gray-100 relative cursor-pointer hover:bg-yellow-50 hover:text-gray-900"
}" :class="{
v-for="(result, i) in data.results" 'bg-yellow-50 text-gray-900': i == selectedIndex,
:key="i" }"
:ref=" v-for="(result, i) in data.results"
(el: HTMLLIElement | null) => { :key="i"
@click.prevent="setResult(result)"
:ref="
(el: HTMLLIElement) => {
ul[i] = el; ul[i] = el;
} }
" "
> >
<svg class="absolute w-4 h-4 left-2 top-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> <svg class="absolute w-4 h-4 left-2 top-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path <path
fill-rule="evenodd" fill-rule="evenodd"
d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z" d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
clip-rule="evenodd" clip-rule="evenodd"
/> />
</svg> </svg>
<!-- <b>Gar</b>{{ result.name }} --> <!-- <b>Gar</b>{{ result.name }} -->
<!-- <span> <!-- <span>
{{ makeBold(result.name) }} {{ makeBold(result.name) }}
</span> --> </span> -->
<span <span
v-for="(item, index) in makeBold(result.name)" v-for="(item, index) in makeBold(result.name)"
:key="index" :key="index"
:class="{ :class="{
'font-bold': data.search.toLowerCase().includes(item.toLowerCase()), 'font-bold': data.search.toLowerCase().includes(item.toLowerCase()),
'is-active': index == selectedIndex, 'is-active': index == selectedIndex,
}" }"
> >
{{ item }} {{ item }}
</span> </span>
</li> <span> - {{ result.email }}</span>
</ul> </li>
<!-- </div> --> </ul>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -119,6 +123,8 @@ let props = defineProps({
ctrlKFocus: Boolean, ctrlKFocus: Boolean,
}); });
const emit = defineEmits(['person']);
const inputElClass = computed(() => { const inputElClass = computed(() => {
const base = [ const base = [
'px-3 py-2 max-w-full focus:ring focus:outline-none border-gray-700 rounded w-full', 'px-3 py-2 max-w-full focus:ring focus:outline-none border-gray-700 rounded w-full',
@ -143,11 +149,11 @@ let data = reactive({
let error = ref(''); let error = ref('');
let selectedIndex: Ref<number> = ref(0); let selectedIndex: Ref<number> = ref(0);
// const listItem = ref(null); // const listItem = ref(null);
const ul: Ref<Array<HTMLLIElement | null>> = ref([]); const ul: Ref<Array<HTMLLIElement>> = ref([]);
watch(selectedIndex, (selectedIndex) => { watch(selectedIndex, (selectedIndex: number) => {
if (selectedIndex != null && ul.value != null) { if (selectedIndex != null && ul.value != null) {
const currentElement: HTMLLIElement | null = ul.value[selectedIndex]; const currentElement: HTMLLIElement = ul.value[selectedIndex];
currentElement && currentElement &&
currentElement.scrollIntoView({ currentElement.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
@ -161,13 +167,6 @@ watch(search, async () => {
await onChange(); await onChange();
}); });
// function clear() {
// data.search = "";
// data.isOpen = false;
// data.results = [];
// error.value = "";
// // this.$emit("clear");
// }
// function onChange() { // function onChange() {
// if (!props.source || !data.search) { // if (!props.source || !data.search) {
@ -278,4 +277,30 @@ function onArrowUp() {
selectedIndex.value = selectedIndex.value == 0 || selectedIndex.value == -1 ? data.results.length - 1 : selectedIndex.value - 1; selectedIndex.value = selectedIndex.value == 0 || selectedIndex.value == -1 ? data.results.length - 1 : selectedIndex.value - 1;
} }
} }
function setResult(person) {
// this.search = person.full_name;
clear();
// this.$emit('person', person);
emit('person', person);
}
function clear() {
data.search = '';
data.isOpen = false;
data.results = [];
error.value = '';
// this.$emit("clear");
}
function onEnter() {
if (Array.isArray(data.results) && data.results.length && selectedIndex.value !== -1 && selectedIndex.value < data.results.length) {
//this.display = this.results[this.selectedIndex];
const person = data.results[selectedIndex.value];
// this.$emit('person', person);
emit('person', person);
clear();
selectedIndex.value = -1;
}
}
</script> </script>

View File

@ -0,0 +1,157 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
// import { MainService } from '@/Stores/main';
import { StyleService } from '@/Stores/style';
import { mdiTrashCan } from '@mdi/js';
// import CardBoxModal from '@/Components/CardBoxModal.vue';
// import TableCheckboxCell from '@/Components/TableCheckboxCell.vue';
import BaseLevel from '@/Components/BaseLevel.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import BaseButton from '@/Components/BaseButton.vue';
import UserAvatar from '@/Components/UserAvatar.vue';
// import Person from 'App/Models/Person';
import { Person } from '@/Stores/main';
const props = defineProps({
checkable: Boolean,
persons: {
type: Array<Person>,
default: () => [],
},
});
const styleService = StyleService();
// const mainService = MainService();
const items = computed(() => props.persons);
// const isModalActive = ref(false);
// const isModalDangerActive = ref(false);
const perPage = ref(5);
const currentPage = ref(0);
// const checkedRows = ref([]);
const itemsPaginated = computed(() => items.value.slice(perPage.value * currentPage.value, perPage.value * (currentPage.value + 1)));
const numPages = computed(() => Math.ceil(items.value.length / perPage.value));
const currentPageHuman = computed(() => currentPage.value + 1);
const pagesList = computed(() => {
const pagesList: Array<number> = [];
for (let i = 0; i < numPages.value; i++) {
pagesList.push(i);
}
return pagesList;
});
const removeAuthor = (key) => {
items.value.splice(key, 1);
};
// const remove = (arr, cb) => {
// const newArr = [];
// arr.forEach((item) => {
// if (!cb(item)) {
// newArr.push(item);
// }
// });
// return newArr;
// };
// const checked = (isChecked, client) => {
// if (isChecked) {
// checkedRows.value.push(client);
// } else {
// checkedRows.value = remove(checkedRows.value, (row) => row.id === client.id);
// }
// };
</script>
<template>
<!-- <CardBoxModal v-model="isModalActive" title="Sample modal">
<p>Lorem ipsum dolor sit amet <b>adipiscing elit</b></p>
<p>This is sample modal</p>
</CardBoxModal>
<CardBoxModal v-model="isModalDangerActive" large-title="Please confirm" button="danger" has-cancel>
<p>Lorem ipsum dolor sit amet <b>adipiscing elit</b></p>
<p>This is sample modal</p>
</CardBoxModal> -->
<!-- <div v-if="checkedRows.length" class="p-3 bg-gray-100/50 dark:bg-slate-800">
<span v-for="checkedRow in checkedRows" :key="checkedRow.id"
class="inline-block px-2 py-1 rounded-sm mr-2 text-sm bg-gray-100 dark:bg-slate-700">
{{ checkedRow.name }}
</span>
</div> -->
<table>
<thead>
<tr>
<!-- <th v-if="checkable" /> -->
<th class="hidden lg:table-cell"></th>
<th>Name</th>
<th>Email</th>
<!-- <th>Name Type</th> -->
<!-- <th>Progress</th> -->
<th>Created</th>
<th />
</tr>
</thead>
<tbody>
<tr v-for="(client, index) in itemsPaginated" :key="client.id">
<!-- <TableCheckboxCell v-if="checkable" @checked="checked($event, client)" /> -->
<td class="border-b-0 lg:w-6 before:hidden hidden lg:table-cell">
<UserAvatar :username="client.name" class="w-24 h-24 mx-auto lg:w-6 lg:h-6" />
</td>
<td data-label="Name">
{{ client.name }}
</td>
<td data-label="Email">
{{ client.email }}
</td>
<!-- <td data-label="Name Type">
{{ client.name_type }}
</td> -->
<!-- <td data-label="Orcid">
{{ client.identifier_orcid }}
</td> -->
<!-- <td data-label="Progress" class="lg:w-32">
<progress class="flex w-2/5 self-center lg:w-full" max="100" v-bind:value="client.progress">
{{ client.progress }}
</progress>
</td> -->
<td data-label="Created" class="lg:w-1 whitespace-nowrap">
<small class="text-gray-500 dark:text-slate-400" :title="client.created_at">{{ client.created_at }}</small>
</td>
<td class="before:hidden lg:w-1 whitespace-nowrap">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<!-- <BaseButton color="info" :icon="mdiEye" small @click="isModalActive = true" /> -->
<BaseButton color="danger" :icon="mdiTrashCan" small @click.prevent="removeAuthor(index)" />
</BaseButtons>
</td>
</tr>
</tbody>
</table>
<!-- :class="[ pagesList.length > 1 ? 'block' : 'hidden']" -->
<div class="p-3 lg:px-6 border-t border-gray-100 dark:border-slate-800" >
<BaseLevel>
<BaseButtons>
<BaseButton
v-for="page in pagesList"
:key="page"
:active="page === currentPage"
:label="page + 1"
small
:outline="styleService.darkMode"
@click="currentPage = page"
/>
</BaseButtons>
<small>Page {{ currentPageHuman }} of {{ numPages }}</small>
</BaseLevel>
</div>
</template>

View File

@ -1,15 +1,12 @@
<script setup> <script setup>
import { computed } from 'vue' import { computed } from 'vue';
// import { usePage } from '@inertiajs/vue3' // import { usePage } from '@inertiajs/vue3'
import { usePage } from '@inertiajs/vue3' import { usePage } from '@inertiajs/vue3';
import UserAvatar from '@/Components/UserAvatar.vue' import UserAvatar from '@/Components/UserAvatar.vue';
const userName = computed(() => usePage().props.auth?.user.name) const userName = computed(() => usePage().props.auth?.user.name);
</script> </script>
<template> <template>
<UserAvatar <UserAvatar v-bind:username="'userName'" api="initials" />
v-bind:username="'userName'" </template>
api="initials"
/>
</template>

View File

@ -1,7 +1,7 @@
import { Ref } from 'vue'; import { Ref } from 'vue';
export interface Dataset { export interface Dataset {
[key: string]: string | Ref<string>| boolean | Array<Title> | (IErrorMessage | undefined); [key: string]: string | Ref<string>| boolean | Array<Title> | Array<Description>| Array<Person> | number | (IErrorMessage | undefined);
language: Ref<string>; language: Ref<string>;
// licenses: Array<number>; // licenses: Array<number>;
rights: boolean; rights: boolean;
@ -9,6 +9,10 @@ export interface Dataset {
creating_corporation: string; creating_corporation: string;
titles: Array<Title>; titles: Array<Title>;
descriptions: Array<Description>; descriptions: Array<Description>;
authors: Array<Person>;
contributors: Array<Person>;
project_id?: number;
embargo_date?: string,
errors?: IErrorMessage; errors?: IErrorMessage;
// async (user): Promise<void>; // async (user): Promise<void>;
} }
@ -25,6 +29,16 @@ export interface Description {
language: string | Ref<string>; language: string | Ref<string>;
} }
export interface Person {
id: number;
name: string;
email: string;
name_type: string;
identifier_orcid: string;
datasetCount: string;
created_at: string;
}
interface IErrorMessage { interface IErrorMessage {
[key: string]: Array<string>; [key: string]: Array<string>;
} }

View File

@ -4,6 +4,7 @@ import { StyleService } from '@/Stores/style';
import NavBar from '@/Components/NavBar.vue'; import NavBar from '@/Components/NavBar.vue';
import AsideMenu from '@/Components/AsideMenu.vue'; import AsideMenu from '@/Components/AsideMenu.vue';
import FooterBar from '@/Components/FooterBar.vue'; import FooterBar from '@/Components/FooterBar.vue';
import NotificationToast from '@/Components/NotificationToast.vue';
const styleService = StyleService(); const styleService = StyleService();
@ -34,4 +35,5 @@ const layoutService = LayoutService();
<FooterBar /> <FooterBar />
</div> </div>
</div> </div>
<NotificationToast></NotificationToast>
</template> </template>

View File

@ -1,8 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { Head, useForm } from '@inertiajs/vue3'; import { Head, useForm } from '@inertiajs/vue3';
import { ref } from 'vue'; import { ref } from 'vue';
import { Dataset, Title } from '@/Dataset'; import { Dataset, Description, Title } from '@/Dataset';
import { mdiDatabasePlus, mdiMinusCircle, mdiPlusCircle, mdiFinance, mdiInformationOutline, mdiBookOpenPageVariant } from '@mdi/js'; import {
mdiDatabasePlus,
mdiMinusCircle,
mdiPlusCircle,
mdiFinance,
mdiInformationOutline,
mdiBookOpenPageVariant,
mdiImageText,
} from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue'; import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue'; import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue'; import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
@ -24,6 +32,10 @@ import IconLanguage from '@/Components/Icons/Language.vue';
import IconRecommendet from '@/Components/Icons/Recommendet.vue'; import IconRecommendet from '@/Components/Icons/Recommendet.vue';
import IconConfirm from '@/Components/Icons/Confirm.vue'; import IconConfirm from '@/Components/Icons/Confirm.vue';
import SearchAutocomplete from '@/Components/SearchAutocomplete.vue'; import SearchAutocomplete from '@/Components/SearchAutocomplete.vue';
import TablePersons from '@/Components/TablePersons.vue';
import { MainService } from '@/Stores/main';
import { notify } from '@/notiwind';
// import NotificationToast from '@/Components/NotificationToast.vue';
const props = defineProps({ const props = defineProps({
licenses: { licenses: {
@ -42,12 +54,18 @@ const props = defineProps({
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
projects: {
type: Object,
default: () => ({}),
},
errors: { errors: {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
}); });
const mainService = MainService();
// const form = useForm({ // const form = useForm({
// language: '', // language: '',
// licenses: [], // licenses: [],
@ -56,17 +74,57 @@ const props = defineProps({
// }); // });
// let language: (string | Ref<string>) = ref(''); // let language: (string | Ref<string>) = ref('');
let language = ref(''); let language = ref('');
let dataset = { let dataset: Dataset;
language: language, if (Object.keys(mainService.dataset).length == 0) {
licenses: [], // language = ref('');
rights: false, dataset = {
type: '', language: language,
creating_corporation: 'Tethys RDR', licenses: [],
titles: [{ value: '', type: 'Main', language: language }], rights: false,
descriptions: [{ value: '', type: 'Abstract', language: language }], type: '',
// errors: undefined, creating_corporation: 'Tethys RDR',
}; titles: [{ value: '', type: 'Main', language: language }],
// const form = useForm({ descriptions: [{ value: '', type: 'Abstract', language: language }],
authors: [],
contributors: [],
project_id: undefined,
embargo_date: '',
// errors: undefined,
};
// mainService.setDataset(dataset, language);
} else {
// console.log(mainService.dataset);
language = ref(mainService.dataset.language);
// dataset = mainService.dataset;
dataset = {
language: language,
licenses: mainService.dataset.licenses,
rights: mainService.dataset.rights,
type: mainService.dataset.type,
creating_corporation: mainService.dataset.creating_corporation,
titles: mainService.dataset.titles,
descriptions: mainService.dataset.descriptions,
authors: mainService.dataset.authors,
contributors: mainService.dataset.contributors,
project_id: mainService.dataset.project_id,
embargo_date: mainService.dataset.embargo_date,
};
for (let index in mainService.dataset.titles) {
let title: Title = mainService.dataset.titles[index];
if (title.type == 'Main') {
title.language = language;
}
}
for (let index in mainService.dataset.descriptions) {
let description: Description = mainService.dataset.descriptions[index];
if (description.type == 'Abstract') {
description.language = language;
}
}
}
// const form = useForm<Dataset>({
// language: language, // language: language,
// licenses: [], // licenses: [],
// rights: false, // rights: false,
@ -98,9 +156,13 @@ const formStep = ref(1);
// }; // };
const nextStep = async () => { const nextStep = async () => {
let route = stardust.route('dataset.first.step'); let route;
if (formStep.value == 2) { if (formStep.value == 1) {
route = stardust.route('dataset.first.step');
} else if (formStep.value == 2) {
route = stardust.route('dataset.second.step'); route = stardust.route('dataset.second.step');
} else if (formStep.value == 3) {
route = stardust.route('dataset.third.step');
} }
// formStep.value++; // formStep.value++;
await form await form
@ -111,6 +173,8 @@ const nextStep = async () => {
.post(route, { .post(route, {
form, form,
onSuccess: () => { onSuccess: () => {
// console.log(form.data());
mainService.setDataset(form.data());
formStep.value++; formStep.value++;
}, },
}); });
@ -137,6 +201,29 @@ const addDescription = () => {
const removeDescription = (key) => { const removeDescription = (key) => {
form.descriptions.splice(key, 1); form.descriptions.splice(key, 1);
}; };
const onAddAuthor = (person) => {
if (form.authors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as author' }, 4000);
} else if (form.contributors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as contributor' });
} else {
form.authors.push(person);
notify({ type: 'info', text: 'person has been successfully added as author' });
}
};
const onAddContributor = (person) => {
if (form.contributors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as contributor' }, 4000);
} else if (form.authors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as author' }, 4000);
} else {
// person.pivot = { contributor_type: '' };
// // person.pivot = { name_type: '', contributor_type: '' };
form.contributors.push(person);
notify({ type: 'info', text: 'person has been successfully added as contributor' }, 4000);
}
};
</script> </script>
<template> <template>
@ -161,6 +248,7 @@ const removeDescription = (key) => {
<SectionTitleLineWithButton :icon="mdiDatabasePlus" title="Submit dataset" main> <SectionTitleLineWithButton :icon="mdiDatabasePlus" title="Submit dataset" main>
<!-- <BaseButton :route-name="stardust.route('user.index')" :icon="mdiArrowLeftBoldOutline" label="Back" <!-- <BaseButton :route-name="stardust.route('user.index')" :icon="mdiArrowLeftBoldOutline" label="Back"
color="white" rounded-full small /> --> color="white" rounded-full small /> -->
{{ formStep }}
</SectionTitleLineWithButton> </SectionTitleLineWithButton>
<CardBox> <CardBox>
@ -202,7 +290,7 @@ const removeDescription = (key) => {
:type="'select'" :type="'select'"
placeholder="[Enter Language]" placeholder="[Enter Language]"
:errors="form.errors.language" :errors="form.errors.language"
:options="['de', 'en']" :options="{ de: 'de', en: 'en' }"
> >
<div class="text-red-400 text-sm" v-if="form.errors.language"> <div class="text-red-400 text-sm" v-if="form.errors.language">
{{ form.errors.language.join(', ') }} {{ form.errors.language.join(', ') }}
@ -298,7 +386,7 @@ const removeDescription = (key) => {
<!-- titles --> <!-- titles -->
<CardBox <CardBox
class="mb-6" class="mb-6 shadow"
:has-form-data="true" :has-form-data="true"
title="Titles" title="Titles"
:icon="mdiFinance" :icon="mdiFinance"
@ -394,7 +482,7 @@ const removeDescription = (key) => {
required required
v-model="form.titles[index].language" v-model="form.titles[index].language"
type="select" type="select"
:options="['de', 'en']" :options="{ de: 'de', en: 'en' }"
placeholder="[select title language]" placeholder="[select title language]"
> >
<div class="text-red-400 text-sm" v-if="form.errors[`titles.${index}.language`]"> <div class="text-red-400 text-sm" v-if="form.errors[`titles.${index}.language`]">
@ -410,7 +498,8 @@ const removeDescription = (key) => {
<!-- Descriptions --> <!-- Descriptions -->
<CardBox <CardBox
class="mb-6" :icon="mdiImageText"
class="mb-6 shadow"
:has-form-data="true" :has-form-data="true"
title="Descriptions" title="Descriptions"
:header-icon="mdiPlusCircle" :header-icon="mdiPlusCircle"
@ -523,7 +612,7 @@ const removeDescription = (key) => {
required required
v-model="form.descriptions[index].language" v-model="form.descriptions[index].language"
type="select" type="select"
:options="['de', 'en']" :options="{ de: 'de', en: 'en' }"
placeholder="[select title language]" placeholder="[select title language]"
> >
<div <div
@ -539,31 +628,76 @@ const removeDescription = (key) => {
</div> </div>
</CardBox> </CardBox>
<CardBox class="mb-6" :has-form-data="true" title="Authors" :icon="mdiBookOpenPageVariant" > <!-- authors -->
<CardBox class="mb-6 shadow" has-table title="Authors" :icon="mdiBookOpenPageVariant">
<SearchAutocomplete <SearchAutocomplete
source="/api/persons" source="/api/persons"
:response-property="'first_name'" :response-property="'first_name'"
placeholder="search in person table...." placeholder="search in person table...."
v-on:person="onAddAuthor"
></SearchAutocomplete> ></SearchAutocomplete>
<TablePersons :persons="form.authors" v-if="form.authors.length > 0" />
<div class="text-red-400 text-sm" v-if="errors.authors && Array.isArray(errors.authors)">
{{ errors.authors.join(', ') }}
</div>
</CardBox>
<!-- contributors -->
<CardBox class="mb-6 shadow" has-table title="Contributors" :icon="mdiBookOpenPageVariant">
<SearchAutocomplete
source="/api/persons"
:response-property="'first_name'"
placeholder="search in person table...."
v-on:person="onAddContributor"
></SearchAutocomplete>
<TablePersons :persons="form.contributors" v-if="form.contributors.length > 0" />
</CardBox> </CardBox>
<!-- <SectionTitleLineWithButton :icon="mdiChartPie" title="Trends overview (to do publications per year)" class="flex flex-col md:flex-row" >
</SectionTitleLineWithButton> -->
</div> </div>
<!-- <label>To Do: Recommendet</label> -->
<div v-if="formStep == 3"> <div v-if="formStep == 3">
<label>To Do: Recommendet</label> <div class="flex flex-col md:flex-row">
<!-- <div class="w-full mx-2 flex-1 svelte-1l8159u"> <FormField
<div class="font-bold h-6 mt-3 text-gray-600 text-xs leading-8 uppercase">Username</div> label="Project.."
<div class="bg-white my-2 p-1 flex border border-gray-200 rounded svelte-1l8159u"> help="project is optional"
<input placeholder="Just a hint.." class="p-1 px-2 appearance-none outline-none w-full text-gray-800" /> :class="{ 'text-red-400': errors.project_id }"
</div> class="w-full mx-2 flex-1"
</div> >
<div class="w-full mx-2 flex-1 svelte-1l8159u"> <FormControl
<div class="font-bold h-6 mt-3 text-gray-600 text-xs leading-8 uppercase">Your Email</div> required
<div class="bg-white my-2 p-1 flex border border-gray-200 rounded svelte-1l8159u"> v-model="form.project_id"
<input placeholder="jhon@doe.com" class="p-1 px-2 appearance-none outline-none w-full text-gray-800" /> :type="'select'"
</div> placeholder="[Select Project]"
</div> --> :errors="form.errors.project_id"
:options="projects"
>
<div class="text-red-400 text-sm" v-if="form.errors.project_id">
{{ form.errors.project_id.join(', ') }}
</div>
</FormControl>
</FormField>
<FormField
label="Embargo Date.."
help="embargo date is optional"
:class="{ 'text-red-400': errors.embargo_date }"
class="w-full mx-2 flex-1"
>
<FormControl
required
v-model="form.embargo_date"
:type="'date'"
placeholder="date('y-m-d')"
:errors="form.errors.embargo_date"
>
<div class="text-red-400 text-sm" v-if="form.errors.embargo_date">
{{ form.errors.embargo_date.join(', ') }}
</div>
</FormControl>
</FormField>
</div>
</div> </div>
<div v-if="formStep == 4"> <div v-if="formStep == 4">

View File

@ -1,10 +1,13 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import axios from 'axios'; import axios from 'axios';
import { Dataset } from '@/Dataset';
interface Person { export interface Person {
id: number; id: number;
name: string; name: string;
email: string; email: string;
name_type: string;
identifier_orcid: string;
datasetCount: string; datasetCount: string;
created_at: string; created_at: string;
} }
@ -12,7 +15,7 @@ interface Person {
interface TransactionItem { interface TransactionItem {
amount: number; amount: number;
account: string; account: string;
name: string; name: string;
date: string; date: string;
type: string; type: string;
business: string; business: string;
@ -31,8 +34,13 @@ export const MainService = defineStore('main', {
/* Sample data for starting dashboard(commonly used) */ /* Sample data for starting dashboard(commonly used) */
clients: [], clients: [],
history: [] as Array<TransactionItem>, history: [] as Array<TransactionItem>,
// api based data
authors: [] as Array<Person>, authors: [] as Array<Person>,
// persons: [] as Array<Person>,
datasets: [], datasets: [],
dataset: {} as Dataset,
}), }),
actions: { actions: {
// payload = authenticated user // payload = authenticated user
@ -48,6 +56,27 @@ export const MainService = defineStore('main', {
} }
}, },
setDataset(payload) {
this.dataset = payload;
// this.dataset = {
// language: language,
// licenses: payload.licenses,
// rights: payload.rights,
// type: payload.type,
// creating_corporation: payload.creating_corporation,
// titles: payload.titles,
// descriptions: payload.descriptions,
// authors: payload.authors,
// project_id: payload.project_id,
// embargo_date: payload.embargo_date,
// } as Dataset;
// for (let index in payload.titles) {
// let title = payload.titles[index];
// title.language = language;
// }
},
fetch(sampleDataKey) { fetch(sampleDataKey) {
// sampleDataKey= clients or history // sampleDataKey= clients or history
axios axios

16
resources/js/notiwind.ts Normal file
View File

@ -0,0 +1,16 @@
// notiwind.ts
import {
createNotifier,
NotificationGroup,
defineNotificationComponent,
} from "notiwind";
export type NotificationSchema = {
type: string;
title?: string;
text: string;
};
export const notify = createNotifier<NotificationSchema>();
export const Notification = defineNotificationComponent<NotificationSchema>();
export { NotificationGroup };

View File

@ -133,6 +133,9 @@ Route.group(() => {
Route.post('/dataset/second/second-step', 'DatasetController.secondStep') Route.post('/dataset/second/second-step', 'DatasetController.secondStep')
.as('dataset.second.step') .as('dataset.second.step')
.middleware(['auth', 'can:dataset-submit']); .middleware(['auth', 'can:dataset-submit']);
Route.post('/dataset/second/third-step', 'DatasetController.thirdStep')
.as('dataset.third.step')
.middleware(['auth', 'can:dataset-submit']);
// Route.get('/user/:id', 'UsersController.show').as('user.show').where('id', Route.matchers.number()); // Route.get('/user/:id', 'UsersController.show').as('user.show').where('id', Route.matchers.number());
// Route.get('/user/:id/edit', 'UsersController.edit').as('user.edit').where('id', Route.matchers.number()); // Route.get('/user/:id/edit', 'UsersController.edit').as('user.edit').where('id', Route.matchers.number());
// Route.put('/user/:id/update', 'UsersController.update').as('user.update').where('id', Route.matchers.number()); // Route.put('/user/:id/update', 'UsersController.update').as('user.update').where('id', Route.matchers.number());

46
start/validator.ts Normal file
View File

@ -0,0 +1,46 @@
/*
|--------------------------------------------------------------------------
| Preloaded File
|--------------------------------------------------------------------------
|
| Any code written inside this file will be executed during the application
| boot.
https://issuehunt.io/r/adonisjs/validator/issues/84
|
*/
// import { string } from '@ioc:Adonis/Core/Helpers';
import { validator } from '@ioc:Adonis/Core/Validator';
validator.rule(
'translatedLanguage',
(value, [mainLanguageField, typeField], { root, tip, pointer, arrayExpressionPointer, errorReporter }) => {
if (typeof value !== 'string') {
return;
}
// const fieldValue = validator. getValue(data, field)
// this should return the "category_id" value present in "root", but i got undefined
const mainLanguage = validator.helpers.getFieldValue(mainLanguageField, root, tip);
const type = validator.helpers.getFieldValue(typeField, root, tip);
if (type && type == 'Translated') {
if (value == mainLanguage) {
errorReporter.report(
pointer,
'translatedLanguage', // Keep an eye on this
'translatedLanguage validation failed',
arrayExpressionPointer,
{ mainLanguage },
);
}
}
// if (value !== string.camelCase(value)) {
// options.errorReporter.report(
// options.pointer,
// 'camelCase',
// 'camelCase validation failed',
// options.arrayExpressionPointer
// );
// }
},
);