Skip to content

Commit

Permalink
Merge branch 'master' of github.com:medic/cht-core into 9547-change-p…
Browse files Browse the repository at this point in the history
…assword
  • Loading branch information
Benmuiruri committed Nov 28, 2024
2 parents 4312722 + 44c9583 commit 424fe87
Show file tree
Hide file tree
Showing 123 changed files with 3,213 additions and 1,472 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ https://docs.communityhealthtoolkit.org/contribute/code/workflow/#commit-message

# Code review checklist
<!-- Remove or comment out any items that do not apply to this PR; in the remaining boxes, replace the [ ] with [x]. -->
- [ ] UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable `can_view_old_navigation` permission to see the old design.
- [ ] Readable: Concise, well named, follows the [style guide](https://docs.communityhealthtoolkit.org/contribute/code/style-guide/), documented if necessary.
- [ ] Documented: Configuration and user documentation on [cht-docs](https://github.com/medic/cht-docs/)
- [ ] Tested: Unit and/or e2e where appropriate
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-conf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ runs:
shell: bash
working-directory: ${{ inputs.directory }}
- name: run cht
run: npx cht --url=https://${{ inputs.username }}:${{ inputs.password }}@${{ inputs.hostname }} compile-app-settings convert-app-forms convert-collect-forms convert-contact-forms upload-app-settings upload-app-forms upload-collect-forms upload-contact-forms upload-resources upload-custom-translations --force
run: npx cht --url=https://${{ inputs.username }}:${{ inputs.password }}@${{ inputs.hostname }} compile-app-settings convert-app-forms convert-collect-forms convert-contact-forms convert-training-forms upload-app-settings upload-app-forms upload-collect-forms upload-contact-forms upload-training-forms upload-resources upload-custom-translations --force
shell: bash
working-directory: ${{ inputs.directory }}
17 changes: 10 additions & 7 deletions api/resources/translations/messages-en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,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 @@ -459,7 +459,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 @@ -659,8 +659,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 @@ -691,7 +691,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 @@ -1223,7 +1223,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 @@ -1272,7 +1272,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 @@ -1272,7 +1272,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 @@ -1272,7 +1272,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 @@ -1176,6 +1176,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 @@ -1272,7 +1272,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 @@ -1272,7 +1272,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
1 change: 1 addition & 0 deletions couchdb/10-docker-default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ os_process_timeout = 60000
max_dbs_open = 5000
attachment_stream_buffer_size = 16384
max_document_size = 4294967296 ; 4 GB
changes_doc_ids_optimization_threshold = 40000

[chttpd]
port = 5984
Expand Down
2 changes: 1 addition & 1 deletion couchdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM couchdb:3.3.3 as base_couchdb_build
FROM couchdb:3.4.2 as base_couchdb_build

COPY --chown=couchdb:couchdb 10-docker-default.ini /opt/couchdb/etc/default.d/
COPY --chown=couchdb:couchdb vm.args /opt/couchdb/etc/
Expand Down
53 changes: 20 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"bowser": "^2.11.0",
"buffer-shims": "^1.0.0",
"cht-nootils": "^4.2.0",
"compression": "^1.7.4",
"compression": "^1.7.5",
"cron-validator": "^1.3.1",
"epi-week": "^0.0.1",
"express": "^4.21.1",
Expand Down
34 changes: 20 additions & 14 deletions sentinel/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,26 @@ const waitForApi = () => new Promise(resolve => {
});

logger.info('Running server checks...');
serverChecks
.check(environment.couchUrl)
.then(waitForApi)
.then(() => {
// Even requiring this boots translations, so has to be required after
// api has booted

(async () => {
try {
await serverChecks.check(environment.couchUrl);
await waitForApi();

const config = require('./src/config');
return config.init().then(() => {
require('./src/schedule').init();
logger.info('startup complete.');
});
})
.catch(err => {
logger.error('Fatal error intialising sentinel');
await config.init();

const schedule = require('./src/schedule');
schedule.init();

logger.info('startup complete.');

const processHooks = require('./src/process-hooks');
processHooks.init();

} catch (err) {
logger.error('Fatal error initialising sentinel');
logger.error('%o', err);
process.exit(1);
});
}
})();
44 changes: 23 additions & 21 deletions sentinel/src/lib/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const MAX_QUEUE_SIZE = 100;

let request;
let processed = 0;
let processing;

const enqueue = change => changeQueue.push(change);

Expand Down Expand Up @@ -100,33 +101,34 @@ changeQueue.drain(() => {
resumeProcessing();
});

/**
* Start listening from the last processed seq. Will restart
* automatically on error.
*/
const listen = () => {
logger.info('Starting transition processing');
processing = true;
changeQueue.resume();
return resumeProcessing();
};

module.exports = {
/**
* Stops listening for changes. Must be restarted manually
* by calling listen.
*/
const cancel = () => {
logger.info('Suspending transition processing');
processing = false;
changeQueue.pause();
if (request) {
request.cancel && request.cancel();
request = null;
}
};

/**
* Start listening from the last processed seq. Will restart
* automatically on error.
*/
module.exports = {
listen,
cancel,

/**
* Stops listening for changes. Must be restarted manually
* by calling listen.
*/
cancel: () => {
changeQueue.pause();
if (request) {
request.cancel && request.cancel();
request = null;
}
},

// exposed for testing
_changeQueue: changeQueue,
_transitionsLib: transitionsLib,
_enqueue: enqueue,
toggle: () => processing ? cancel() : listen()
};
13 changes: 13 additions & 0 deletions sentinel/src/process-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const feed = require('./lib/feed');
const schedule = require('./schedule');

module.exports = {
init: () => {
process.on('SIGUSR1', () => {
feed.toggle();
});
process.on('SIGUSR2', () => {
schedule.runTasks();
});
}
};
1 change: 1 addition & 0 deletions sentinel/src/schedule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ exports.init = () => {
runTasks();
interval = setInterval(runTasks, RUN_EVERY_MS);
};
exports.runTasks = runTasks;
Loading

0 comments on commit 424fe87

Please sign in to comment.