Skip to content

Commit

Permalink
[FEATURE] Ajouter 3 nouveaux types de contenus formatif (PIX-10173).
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Nov 29, 2023
2 parents 07f35de + 202388b commit 5767266
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions admin/app/models/training.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { memberAction } from 'ember-api-actions';
export const typeCategories = {
webinaire: 'Webinaire',
autoformation: "Parcours d'autoformation",
'e-learning': 'Formation en ligne',
'hybrid-training': 'Formation hybride',
'in-person-training': 'Formation en présentiel',
};

export const optionsTypeList = formatList(typeCategories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module('Integration | Component | Trainings::CreateOrUpdateTrainingForm', functi
form = {
title: 'Un contenu formatif',
link: 'https://un-contenu-formatif',
type: 'Webinaire',
type: 'webinaire',
locale: 'fr-fr',
editorName: 'Un éditeur de contenu formatif',
editorLogoUrl: 'un-logo.svg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module('Integration | Component | Trainings::TrainingDetailsCard', function (hoo
this.set('training', {
title: 'Un contenu formatif',
link: 'https://un-contenu-formatif',
type: 'Webinaire',
type: 'webinaire',
locale: 'fr-fr',
editorName: 'Un éditeur de contenu formatif',
editorLogoUrl: 'un-logo.svg',
Expand All @@ -28,7 +28,7 @@ module('Integration | Component | Trainings::TrainingDetailsCard', function (hoo
// then
assert.dom(screen.getByText('Un contenu formatif')).exists();
assert.dom(screen.getByText('https://un-contenu-formatif')).exists();
assert.dom(screen.getByText('Webinaire')).exists();
assert.dom(screen.getByText('webinaire')).exists();
assert.dom(screen.getByText('2j')).exists();
assert.dom(screen.getByText('Franco-français (fr-fr)')).exists();
assert.dom(screen.getByText('Un éditeur de contenu formatif')).exists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module('Unit | Controller | authenticated/trainings/new', function (hooks) {
id: 3,
title: 'Ma formation',
link: 'https://mon-lien',
type: 'Webinaire',
type: 'webinaire',
locale: 'fr-fr',
editorLogoUrl: 'https//images.fr/mon-logo.svg',
editorName: 'Un éditeur de contenu formatif',
Expand Down
2 changes: 1 addition & 1 deletion api/db/seeds/data/team-contenu/data-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ async function _createTraining(databaseBuilder) {
trainingId: TEAM_CONTENU_OFFSET_ID,
title: 'Contenu formatif / équipe contenu',
link: 'https://www.youtube.com/watch?v=qq09UkPRdFY',
type: 'Webinaire',
type: 'webinaire',
duration: '00:04:08',
locale: 'fr-fr',
editorName: 'Mariah Carey',
Expand Down
8 changes: 6 additions & 2 deletions api/src/devcomp/application/trainings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ const register = async function (server) {
hours: Joi.number().min(0).max(23).default(0),
minutes: Joi.number().min(0).max(59).default(0),
}).required(),
type: Joi.string().valid('autoformation', 'webinaire').required(),
type: Joi.string()
.valid('autoformation', 'e-learning', 'hybrid-training', 'in-person-training', 'webinaire')
.required(),
locale: Joi.string().valid('fr-fr', 'fr', 'en-gb').required(),
'editor-name': Joi.string().required(),
'editor-logo-url': Joi.string().uri().required(),
Expand Down Expand Up @@ -169,7 +171,9 @@ const register = async function (server) {
hours: Joi.number().min(0).max(23).required(),
minutes: Joi.number().min(0).max(59).required(),
}).allow(null),
type: Joi.string().valid('autoformation', 'webinaire').allow(null),
type: Joi.string()
.valid('autoformation', 'e-learning', 'hybrid-training', 'in-person-training', 'webinaire')
.allow(null),
locale: Joi.string().valid('fr-fr', 'fr', 'en-gb').allow(null),
'editor-name': Joi.string().allow(null),
'editor-logo-url': Joi.string().allow(null),
Expand Down
3 changes: 3 additions & 0 deletions mon-pix/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@
"editor": "Training provided by",
"type": {
"autoformation": "Autoformation course",
"e-learning": "E-Learning",
"hybrid-training": "Hybrid training",
"in-person-training": "In person training",
"webinaire": "Webinar"
}
},
Expand Down
3 changes: 3 additions & 0 deletions mon-pix/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@
"editor": "Contenu formatif proposé par",
"type": {
"autoformation": "Parcours d'autoformation",
"e-learning": "Formation à distance",
"hybrid-training": "Formation hybride",
"in-person-training": "Formation en présentiel",
"webinaire": "Webinaire"
}
},
Expand Down

0 comments on commit 5767266

Please sign in to comment.