Skip to content

Commit

Permalink
refactor: work on vjsf 3 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed Nov 19, 2024
1 parent 7f1cc3c commit 7b85921
Show file tree
Hide file tree
Showing 10 changed files with 1,532 additions and 1,316 deletions.
30 changes: 19 additions & 11 deletions api/types/permission/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
properties: {
profile: {
type: 'string',
title: 'Profil',
title: 'profil',
default: 'read',
oneOf: [
{ const: 'read', title: "lecture - permet d'accéder aux informations essentielles du traitement dont les logs, mais pas aux informations sensibles" },
Expand All @@ -23,19 +23,20 @@ export default {
},
target: {
type: 'object',
oneOfLayout: {
label: 'type de cible'
},
oneOf: [
{
title: 'utilisateur désigné par son email',
required: ['email'],
properties: {
type: {
const: 'userEmail',
title: 'Type de cible',
'x-options': { hideInArrayItem: true }
const: 'userEmail'
},
email: {
type: 'string',
title: 'Email'
title: 'email'
}
}
},
Expand All @@ -48,12 +49,18 @@ export default {
},
organization: {
type: 'object',
title: 'Organisation',
title: 'organisation',
additionalProperties: true,
'x-fromUrl': '{context.directoryUrl}/api/organizations/{context.owner.id}',
'x-itemsProp': 'partners',
'x-itemKey': 'id',
'x-itemTitle': 'name',
layout: {
cols: 8,
getItems: {
// eslint-disable-next-line no-template-curly-in-string
url: '${context.directoryUrl}/api/organizations/${context.owner.id}',
itemsResults: 'data.partners',
itemKey: 'data.id',
itemTitle: 'data.name'
}
},
properties: {
id: {
type: 'string'
Expand All @@ -65,8 +72,9 @@ export default {
},
roles: {
type: 'array',
title: 'Rôles',
title: 'rôles',
default: ['admin'],
layout: { cols: 4 },
items: {
type: 'string',
enum: ['admin', 'contrib', 'user']
Expand Down
23 changes: 15 additions & 8 deletions api/types/processing/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ export default {
$ref: 'https://github.com/data-fair/lib/account',
readOnly: true
},
permissions: {
type: 'array',
title: 'Permissions',
items: {
$ref: 'https://github.com/data-fair/processings/permission'
}
},
plugin: {
type: 'string',
readOnly: true
Expand All @@ -90,12 +83,26 @@ export default {
layout: {
messages: {
addItem: 'Ajouter une règle de planification'
}
},
cols: 6
},
items: {
$ref: 'https://github.com/data-fair/processings/scheduling'
}
},
permissions: {
type: 'array',
title: 'Permissions',
layout: {
messages: {
addItem: 'Ajouter une permission'
},
cols: 6
},
items: {
$ref: 'https://github.com/data-fair/processings/permission'
}
},
updated: {
type: 'object',
additionalProperties: false,
Expand Down
30 changes: 15 additions & 15 deletions api/types/scheduling/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ export default {
title: 'scheduling',
type: 'object',
oneOfLayout: {
emptyData: true
emptyData: true,
},
oneOf: [
{
title: 'Mensuel',
properties: {
type: { const: 'monthly' },
dayOfWeek: { type: 'string', const: '*' },
dayOfMonth: { type: 'integer', minimum: 1, maximum: 28, default: 1, 'x-cols': 6, 'x-class': 'pr-1' },
hour: { type: 'integer', minimum: 0, maximum: 23, default: 0, 'x-cols': 6 },
minute: { type: 'integer', minimum: 0, maximum: 59, default: 0, 'x-cols': 6, 'x-class': 'pr-1' },
month: { type: 'string', const: '*' },
dayOfMonth: { title: 'jour du mois', type: 'integer', minimum: 1, maximum: 28, default: 1, layout: { cols: 6 } },
hour: { title: 'heure', type: 'integer', minimum: 0, maximum: 23, default: 0, layout: { cols: 6 } },
minute: { title: 'minute', type: 'integer', minimum: 0, maximum: 59, default: 0, layout: { cols: 6 } },
month: { title: 'mois', type: 'string', const: '*' },
timeZone: {
type: 'string',
title: 'Fuseau horaire',
title: 'fuseau horaire',
default: 'Europe/Paris',
layout: { comp: 'autocomplete', cols: 6, getItems: 'context.utcs' }
}
Expand All @@ -31,6 +31,7 @@ export default {
properties: {
type: { const: 'weekly' },
dayOfWeek: {
title: 'jour de la semaine',
type: 'string',
oneOf: [
{ const: '1', title: 'lundi' },
Expand All @@ -42,11 +43,10 @@ export default {
{ const: '0', title: 'dimanche' }
],
default: '1',
'x-cols': 6,
'x-class': 'pr-1'
layout: { cols: 6 }
},
hour: { type: 'integer', minimum: 0, maximum: 23, default: 0, 'x-cols': 6, 'x-class': 'pl-1' },
minute: { type: 'integer', minimum: 0, maximum: 59, default: 0, 'x-cols': 6, 'x-class': 'pr-1' },
hour: { title: 'heure', type: 'integer', minimum: 0, maximum: 23, default: 0, layout: { cols: 6 } },
minute: { title: 'minute', type: 'integer', minimum: 0, maximum: 59, default: 0, layout: { cols: 6 } },
dayOfMonth: { type: 'string', const: '*' },
month: { type: 'string', const: '*' },
timeZone: {
Expand All @@ -62,13 +62,13 @@ export default {
properties: {
type: { const: 'daily' },
dayOfWeek: { type: 'string', const: '*' },
hour: { type: 'integer', minimum: 0, maximum: 23, default: 0, 'x-cols': 6, 'x-class': 'pr-1' },
minute: { type: 'integer', minimum: 0, maximum: 59, default: 0, 'x-cols': 6, 'x-class': 'pr-1' },
hour: { title: 'heure', type: 'integer', minimum: 0, maximum: 23, default: 0, layout: { cols: 6 } },
minute: { title: 'minute', type: 'integer', minimum: 0, maximum: 59, default: 0, layout: { cols: 6 } },
dayOfMonth: { type: 'string', const: '*' },
month: { type: 'string', const: '*' },
timeZone: {
type: 'string',
title: 'Fuseau horaire',
title: 'fuseau horaire',
default: 'Europe/Paris',
layout: { comp: 'autocomplete', cols: 6, getItems: 'context.utcs' }
}
Expand All @@ -80,8 +80,8 @@ export default {
type: { const: 'hours' },
dayOfWeek: { type: 'string', const: '*' },
hour: { type: 'string', const: '*' },
hourStep: { type: 'integer', minimum: 1, maximum: 12, default: 1, 'x-cols': 6, 'x-class': 'pl-1' },
minute: { type: 'integer', minimum: 0, maximum: 59, default: 0, 'x-cols': 6, 'x-class': 'pl-1' },
hourStep: { title: 'interval en heures', type: 'integer', minimum: 1, maximum: 12, default: 1, layout: { cols: 6 } },
minute: { title: 'minute', type: 'integer', minimum: 0, maximum: 59, default: 0, layout: { cols: 6 } },
dayOfMonth: { type: 'string', const: '*' },
month: { type: 'string', const: '*' }
}
Expand Down
Loading

0 comments on commit 7b85921

Please sign in to comment.