Skip to content

Commit

Permalink
[FEATURE] Ajout de 2 catégories aux Profiles Cibles (PIX-13511)
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Jul 19, 2024
2 parents 04d0d2c + 174678b commit 39bd4a9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions admin/app/models/target-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const categories = {
CUSTOM: 'Parcours sur-mesure',
PIX_PLUS: 'Pix+',
SUBJECT: 'Thématiques',
TARGETED: 'Parcours ciblés',
BACK_TO_SCHOOL: 'Parcours de rentrée / 6e',
};

export const optionsCategoryList = formatList(categories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,20 @@ module('Integration | Component | TargetProfiles::Category', function (hooks) {
// then
assert.dom(screen.getByText('Autres')).exists();
});

test('it should display the tag for type TARGETED', async function (assert) {
// when
const screen = await render(hbs`<TargetProfiles::Category @category='TARGETED' />`);

// then
assert.dom(screen.getByText('Parcours ciblés')).exists();
});

test('it should display the tag for type BACK_TO_SCHOOL', async function (assert) {
// when
const screen = await render(hbs`<TargetProfiles::Category @category='BACK_TO_SCHOOL' />`);

// then
assert.dom(screen.getByText('Parcours de rentrée / 6e')).exists();
});
});
2 changes: 2 additions & 0 deletions api/lib/domain/models/TargetProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const categories = {
PIX_PLUS: 'PIX_PLUS',
PREDEFINED: 'PREDEFINED',
SUBJECT: 'SUBJECT',
TARGETED: 'TARGETED',
BACK_TO_SCHOOL: 'BACK_TO_SCHOOL',
};

class TargetProfile {
Expand Down
2 changes: 2 additions & 0 deletions api/lib/domain/validators/target-profile/base-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const schema = Joi.object({
categories.PIX_PLUS,
categories.PREDEFINED,
categories.SUBJECT,
categories.TARGETED,
categories.BACK_TO_SCHOOL,
)
.required()
.error((errors) => first(errors))
Expand Down
5 changes: 4 additions & 1 deletion orga/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,16 @@
"profiles-collection-info-certificability-calculation": "The “Eligible for certification” status is updated automatically in the '<'a href=\"/eleves\" class=\"{linkClasses}\"'>'Students'</a>' tab."
},
"tags": {
"BACK_TO_SCHOOL": "Back to school",
"COMPETENCES": "Pix Competences",
"CUSTOM": "Created for you",
"DISCIPLINE": "Schools",
"OTHER": "Other",
"PIX_PLUS": "Pix+",
"PREDEFINED": "Ready-made",
"SUBJECT": "Subject"
"SUBJECT": "Subject",
"TARGETED": "Targeted"

},
"tags-title": "Filter:",
"target-profiles-category-label": "Filter customised test by category",
Expand Down
4 changes: 3 additions & 1 deletion orga/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,15 @@
"profiles-collection-info-certificability-calculation": "Le statut Certifiable est mis à jour automatiquement dans l’onglet '<'a href=\"/eleves\" class=\"{linkClasses}\"'>'Élèves'</a>'."
},
"tags": {
"BACK_TO_SCHOOL": "Parcours de rentrée / 6e",
"COMPETENCES": "Les 16 compétences",
"CUSTOM": "Parcours sur-mesure",
"DISCIPLINE": "Disciplinaires",
"OTHER": "Autres",
"PIX_PLUS": "Pix+",
"PREDEFINED": "Parcours prédéfinis",
"SUBJECT": "Thématiques"
"SUBJECT": "Thématiques",
"TARGETED": "Parcours ciblés"
},
"tags-title": "Filtrer la recherche :",
"target-profiles-category-label": "Filtrer les parcours par catégories",
Expand Down

0 comments on commit 39bd4a9

Please sign in to comment.