Skip to content

Commit

Permalink
feat(#9598): add training materials page (#9592)
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-panda authored Nov 18, 2024
1 parent 51da792 commit e33cd87
Show file tree
Hide file tree
Showing 55 changed files with 2,514 additions and 837 deletions.
17 changes: 10 additions & 7 deletions api/resources/translations/messages-en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ configuration.sms = SMS
configuration.sms.forms = SMS forms
configuration.sms.forms.title = You need to choose both an XML file and a Meta file before clicking the upload button. You may only upload one app form file at a time and any existing forms will be overwritten.
configuration.sms.settings = Basic settings
configuration.sms.test.description = Use this page to send a test message to the production application without going through the SMS Gateway. Be sure to use a phone number registered to a CHWs profile to mimic a report coming from him or her about a particular patient.
configuration.sms.test.description = Use this page to send a test message to the production application without going through the SMS Gateway. Be sure to use a phone number registered to a CHW?s profile to mimic a report coming from him or her about a particular patient.
configuration.sms.test.from.number = From phone number
configuration.sms.test.message.description = Limit of 144 characters
configuration.sms.test.number.validation.description = Please enter a valid phone number without dashes or punctuation.
Expand All @@ -454,7 +454,7 @@ confirm.destructive.navigation.submit = Exit
confirm.destructive.navigation.title = Exit form?
confirm.logout = You will need an internet connection to log back in.
password.updated = Your password has been successfully updated.
confirm.verification = This report will be verified as correct. This cannot be changed later.
confirm.verification = This report will be verified as ?correct?. This cannot be changed later.
confirm.verification.submit = Verify as correct
confirm.verification.title = Verify report
contact.age = Age
Expand Down Expand Up @@ -654,8 +654,8 @@ enketo.geopicker.altitude = altitude (m)
enketo.geopicker.closepolygon = close polygon
enketo.geopicker.kmlcoords = KML coordinates
enketo.geopicker.kmlpaste = paste KML coordinates here
enketo.geopicker.latitude = latitude (x.y °)
enketo.geopicker.longitude = longitude (x.y °)
enketo.geopicker.latitude = latitude (x.y °)
enketo.geopicker.longitude = longitude (x.y °)
enketo.geopicker.points = points
enketo.geopicker.searchPlaceholder = search for place or address
enketo.geopicker.removePoint = This will completely remove the current geopoint from the list of geopoints and cannot be undone. Are you sure you want to do this?
Expand Down Expand Up @@ -686,7 +686,7 @@ export.dhis.place.all = All Places
export.dhis.place.description = Filter exported data to include data associated with contacts under this place in the hierarchy.
export.dhis.place.label = Filter by place
export.dhis.unconfigured = DHIS2 integration is not configured.
export.feedback.description = Download a log of detected errors and user feedback submitted via the Report bug feature in CSV format. The table below shows the most recently submitted reports.
export.feedback.description = Download a log of detected errors and user feedback submitted via the ?Report bug? feature in CSV format. The table below shows the most recently submitted reports.
export.messages.description = Download all messages that have ever been sent or received in CSV format.
export.people.description = Download all contacts registered in the system in JSON format.
export.reports.description = Download a summary of all the reports that have ever been submitted in CSV format.
Expand Down Expand Up @@ -1215,7 +1215,7 @@ sync.last_success = Last sync
sync.now = Sync now
sync.retry = Retry
sync.feedback.failure.unknown = Sync failed. Unable to connect.
sync.status.in_progress = Currently syncing
sync.status.in_progress = Currently syncing?
sync.status.not_required = All reports synced
sync.status.required = Reports to sync
sync.status.unknown = Unable to connect
Expand Down Expand Up @@ -1264,7 +1264,10 @@ training_cards.confirm.title = Leave training?
training_cards.error.loading = Error loading training. Please contact your supervisor.
training_cards.error.save = Error saving training.
training_cards.form.saved = Training completed.
training_cards.modal.title = Important changes
training_materials.page.no_more_trainings = No more trainings
training_materials.page.no_selected = No training material selected
training_materials.page.no_trainings = No trainings found
training_materials.page.title = Training materials
translation.add = Add new translation key
translation.key = Translation key
unique.id = Unique ID
Expand Down
5 changes: 4 additions & 1 deletion api/resources/translations/messages-es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ training_cards.confirm.title = \¿Salir del entrenamiento\?
training_cards.error.loading = Hubo un error al cargar el entrenamiento. Por favor contacte a su supervisor.
training_cards.error.save = Hubo un error al guardar el entrenamiento.
training_cards.form.saved = Entrenamiento completado.
training_cards.modal.title = Cambios importantes
training_materials.page.no_more_trainings = No hay más entrenamientos
training_materials.page.no_selected = Ningún material de entrenamiento seleccionado
training_materials.page.no_trainings = No se encontraron entrenamientos
training_materials.page.title = Materiales de entrenamiento
translation.add = Agregar Traducción
translation.key = Clave de traducción
unique.id = Identificación única
Expand Down
5 changes: 4 additions & 1 deletion api/resources/translations/messages-fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ training_cards.confirm.title = Quitter l'entraînement?
training_cards.error.loading = Erreur lors du chargement de la formation. Veuillez contacter votre superviseur.
training_cards.error.save = Erreur lors de l'enregistrement de la formation.
training_cards.form.saved = Formation terminée.
training_cards.modal.title = Changements importants
training_materials.page.no_more_trainings = Aucune formation restante
training_materials.page.no_selected = Aucun matériel de formation sélectionné
training_materials.page.no_trainings = Aucune formation trouvée
training_materials.page.title = Matériel de formation
translation.add = Ajouter une traduction
translation.key = Clé de traduction
unique.id = ID unique
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-hi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,10 @@ training_cards.confirm.exit = यह प्रशिक्षण समाप्
training_cards.confirm.button.no = रद्द करें
training_cards.confirm.button.yes = बाहर निकलें
training_cards.confirm.title = प्रशिक्षण छोड़ें?
training_materials.page.no_more_trainings = अब और कोई प्रशिक्षण नहीं है
training_materials.page.no_selected = कोई प्रशिक्षण दस्तावेज़ नहीं चुना गया
training_materials.page.no_trainings = कोई प्रशिक्षण नहीं मिला
training_materials.page.title = प्रशिक्षण दस्तावेज़
translation.add = अनुवाद दर्ज करें
translation.key = अनुवाद का गाइड
unique.id =
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-id.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,10 @@ training_cards.confirm.exit = Pelatihan ini belum selesai. Jika Anda keluar seka
training_cards.confirm.button.no = Batalkan
training_cards.confirm.button.yes = Keluar
training_cards.confirm.title = Keluar dari pelatihan?
training_materials.page.no_more_trainings = Tidak ada lagi pelatihan
training_materials.page.no_selected = Tidak ada materi pelatihan yang dipilih
training_materials.page.no_trainings = Tidak ditemukan pelatihan
training_materials.page.title = Materi pelatihan
translation.add = Tambah terjemahan
translation.key = Kunci terjemahan
unique.id =
Expand Down
5 changes: 4 additions & 1 deletion api/resources/translations/messages-ne.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ training_cards.confirm.title = तालिम छोड्ने हो?
training_cards.error.loading = तालिम लोड गर्दा त्रुटि भयो। तपाइँको सुपरभाइजरलाई सम्पर्क गर्नुहोस्।
training_cards.error.save = तालिम सेभ गर्न त्रुटि।
training_cards.form.saved = तालिम सम्पन्न भयो।
training_cards.modal.title = महत्वपुर्ण परिवर्तनहरु
training_materials.page.no_more_trainings = थप तालिम छैन
training_materials.page.no_selected = कुनै तालिम सामग्री छनोट गरिएको छैन।
training_materials.page.no_trainings = तालिम फेला परेन
training_materials.page.title = तालिम शीर्षक
translation.add = नयाँ अनुवाद कुञ्जी थप्नुहोस्
translation.key = अनुवाद कुञ्जी
unique.id = आईडी
Expand Down
5 changes: 4 additions & 1 deletion api/resources/translations/messages-sw.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ training_cards.confirm.title = Ungependa kuondoka kwenye mafunzo?
training_cards.error.loading = Hitilafu katika kupakia mafunzo. Tafadhali wasiliana na msimamizi wako.
training_cards.error.save = Hitilafu katika kuhifadhi mafunzo.
training_cards.form.saved = Mafunzo yamekamilika.
training_cards.modal.title = Mabadiliko muhimu
training_materials.page.no_more_trainings = Hakuna mafunzo mengine
training_materials.page.no_selected = Hakuna nyenzo za mafunzo zilizochaguliwa
training_materials.page.no_trainings = Hakuna mafunzo yaliyopatikana
training_materials.page.title = Vifaa vya mafunzo
translation.add = Ongeza tafsiri
translation.key = Ufunguo wa tafsiri
unique.id = Kitambulisho cha kipekee
Expand Down
5 changes: 1 addition & 4 deletions tests/e2e/default/enketo/training-cards.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const commonPage = require('@page-objects/default/common/common.wdio.page');
const trainingCardsPage = require('@page-objects/default/enketo/training-cards.wdio.page');
const placeFactory = require('@factories/cht/contacts/place');
const userFactory = require('@factories/cht/users/users');
const personFactory = require('@factories/cht/contacts/person');
const reportsPage = require('@page-objects/default/reports/reports.wdio.page');
const privacyPolicyFactory = require('@factories/cht/settings/privacy-policy');
const privacyPage = require('@page-objects/default/privacy-policy/privacy-policy.wdio.page');
Expand All @@ -26,7 +25,6 @@ describe('Training Cards', () => {
before(async () => {
const parent = placeFactory.place().build({ _id: 'dist1', type: 'district_hospital' });
const user = userFactory.build({ roles: [ 'nurse', 'chw' ] });
const patient = personFactory.build({ parent: { _id: user.place._id, parent: { _id: parent._id } } });
const formDoc = commonPage.createFormDoc(`${__dirname}/forms/training-cards-text-only`);
formDoc._id = `form:${formDocId}`;
formDoc.internalId = formDocId;
Expand All @@ -36,8 +34,7 @@ describe('Training Cards', () => {
duration: 5,
};

await utils.saveDocs([ parent, patient ]);
await utils.saveDoc(formDoc);
await utils.saveDocs([ parent, formDoc ]);
await utils.createUsers([ user ]);
await loginPage.login(user);
await commonPage.waitForPageLoaded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ describe('Service worker cache', () => {
'/img/icon-pregnant-selected.svg',
'/img/icon-pregnant.svg',
'/img/icon-filter.svg',
'/img/icon-check.svg',
'/img/icon.png',
'/img/icon-back.svg',
'/img/layers.png',
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/default/suites.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const SUITES = {
'./more-options-menu/**/*.wdio-spec.js',
'./users/**/*.wdio-spec.js',
'./about/**/*.wdio-spec.js',
'./training-materials/**/*.wdio-spec.js',
'./navigation/**/*.wdio-spec.js',
'./old-navigation/**/*.wdio-spec.js',
'./privacy-policy/**/*.wdio-spec.js',
Expand Down
95 changes: 95 additions & 0 deletions tests/e2e/default/training-materials/forms/expired-training.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms">
<h:head>
<h:title>First Training</h:title>
<model>
<itext>
<translation lang="en">
<text id="/expired_training/action_icons/action_icons_aligment/action_icons_image_1:label">
<value>**Old feature**</value>
</text>
<text id="/expired_training/action_icons/action_icons_aligment/action_icons_image_2:label">
<value>**New feature**</value>
</text>
<text id="/expired_training/action_icons/action_icons_note_1:label">
<value>The "New Action" icon at the bottom of your app has also changed.</value>
</text>
<text id="/expired_training/ending/ending_note_1:label">
<value>If you do not understand these changes, please contact your supervisor.</value>
</text>
<text id="/expired_training/ending/ending_note_2:label">
<value>When you're ready, go ahead and start using your app.</value>
</text>
<text id="/expired_training/intro/intro_note_1:label">
<value>There have been some changes to icons in your app. The next few screens will show you the difference.</value>
</text>
<text id="/expired_training/intro/intro_note_2:label">
<value>Read each screen carefully and tap "Next" if you understand. If you need extra support, please contact your supervisor.</value>
</text>
</translation>
</itext>
<instance>
<expired_training id="expired_training" prefix="J1!expired_training!" delimiter="#" version="2022-06-07 10:17:10">
<intro tag="hidden">
<intro_note_1 tag="hidden"/>
<intro_note_2 tag="hidden"/>
</intro>
<action_icons tag="hidden">
<action_icons_note_1 tag="hidden"/>
<action_icons_aligment>
<action_icons_image_1 tag="hidden"/>
<action_icons_image_2 tag="hidden"/>
</action_icons_aligment>
</action_icons>
<ending tag="hidden">
<ending_note_1 tag="hidden"/>
<ending_note_2 tag="hidden"/>
</ending>
<meta tag="hidden">
<instanceID/>
</meta>
</expired_training>
</instance>
<instance id="contact-summary"/>
<bind nodeset="/expired_training/intro/intro_note_1" readonly="true()" type="string"/>
<bind nodeset="/expired_training/intro/intro_note_2" readonly="true()" type="string"/>
<bind nodeset="/expired_training/action_icons/action_icons_note_1" readonly="true()" type="string"/>
<bind nodeset="/expired_training/action_icons/action_icons_aligment/action_icons_image_1" readonly="true()" type="string"/>
<bind nodeset="/expired_training/action_icons/action_icons_aligment/action_icons_image_2" readonly="true()" type="string"/>
<bind nodeset="/expired_training/ending/ending_note_1" readonly="true()" type="string"/>
<bind nodeset="/expired_training/ending/ending_note_2" readonly="true()" type="string"/>
<bind nodeset="/expired_training/meta/instanceID" type="string" readonly="true()" calculate="concat('uuid:', uuid())"/>
</model>
</h:head>
<h:body class="pages">
<group appearance="field-list" ref="/expired_training/intro">
<input ref="/expired_training/intro/intro_note_1">
<label ref="jr:itext('/expired_training/intro/intro_note_1:label')"/>
</input>
<input ref="/expired_training/intro/intro_note_2">
<label ref="jr:itext('/expired_training/intro/intro_note_2:label')"/>
</input>
</group>
<group appearance="field-list" ref="/expired_training/action_icons">
<input ref="/expired_training/action_icons/action_icons_note_1">
<label ref="jr:itext('/expired_training/action_icons/action_icons_note_1:label')"/>
</input>
<group ref="/expired_training/action_icons/action_icons_aligment">
<input ref="/expired_training/action_icons/action_icons_aligment/action_icons_image_1">
<label ref="jr:itext('/expired_training/action_icons/action_icons_aligment/action_icons_image_1:label')"/>
</input>
<input ref="/expired_training/action_icons/action_icons_aligment/action_icons_image_2">
<label ref="jr:itext('/expired_training/action_icons/action_icons_aligment/action_icons_image_2:label')"/>
</input>
</group>
</group>
<group appearance="field-list" ref="/expired_training/ending">
<input ref="/expired_training/ending/ending_note_1">
<label ref="jr:itext('/expired_training/ending/ending_note_1:label')"/>
</input>
<input ref="/expired_training/ending/ending_note_2">
<label ref="jr:itext('/expired_training/ending/ending_note_2:label')"/>
</input>
</group>
</h:body>
</h:html>
Loading

0 comments on commit e33cd87

Please sign in to comment.