Skip to content

Commit

Permalink
#1186 - registeredOn and enrolledOn translations changed to use user …
Browse files Browse the repository at this point in the history
…and date. ProgramEnrolmentsView not getting used anywhere. model version with audit sync changes.
  • Loading branch information
petmongrels committed Jan 11, 2024
1 parent 9a7b73c commit a991b27
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 96 deletions.
14 changes: 7 additions & 7 deletions packages/openchs-android/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 packages/openchs-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lodash": "4.17.21",
"moment": "2.29.4",
"native-base": "3.4.9",
"openchs-models": "1.31.13",
"openchs-models": "1.31.15",
"prop-types": "15.8.1",
"react": "18.2.0",
"react-native": "0.72.3",
Expand Down
1 change: 0 additions & 1 deletion packages/openchs-android/src/service/EntityQueueService.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class EntityQueueService extends BaseService {
.filtered("entity = $0", entityMetaData.entityName)
.sorted("savedAt")
.slice(), 'entityUUID');
General.logDebugTemp("EntityQueueService1", `${entityMetaData.schemaName}: ${items.length}, ${entityMetaData.entityName}`);

const getEntity = ({entityUUID, entity}) => this.findByKey("uuid", entityUUID, entity);
const getEntityResource = (item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class ApprovalDetailsView extends AbstractComponent {

renderEntityDate(entity, I18n) {
const schemaToDatePropertyMap = {
[Individual.schema.name]: {label: I18n.t('registeredOn'), dateProperty: 'registrationDate'},
[ProgramEnrolment.schema.name]: {label: `${I18n.t('enrolmentDate')}: `, dateProperty: 'enrolmentDateTime'},
[Encounter.schema.name]: {label: `${I18n.t('encounterDate')}: `, dateProperty: 'encounterDateTime'},
[ProgramEncounter.schema.name]: {label: `${I18n.t('encounterDate')}: `, dateProperty: 'encounterDateTime'},
[ChecklistItem.schema.name]: {label: `${I18n.t('encounterDate')}: `, dateProperty: 'completionDate'}
[Individual.schema.name]: {messageKey: I18n.t('registeredOn'), dateProperty: 'registrationDate'},
[ProgramEnrolment.schema.name]: {messageKey: `${I18n.t('enrolmentDate')}: `, dateProperty: 'enrolmentDateTime'},
[Encounter.schema.name]: {messageKey: `${I18n.t('encounterDate')}: `, dateProperty: 'encounterDateTime'},
[ProgramEncounter.schema.name]: {messageKey: `${I18n.t('encounterDate')}: `, dateProperty: 'encounterDateTime'},
[ChecklistItem.schema.name]: {messageKey: `${I18n.t('encounterDate')}: `, dateProperty: 'completionDate'}
};
const {label, dateProperty} = schemaToDatePropertyMap[entity.getSchemaName()];
const {messageKey, dateProperty} = schemaToDatePropertyMap[entity.getSchemaName()];
return <Text
style={styles.entityDateStyle}>{`${I18n.t(label)}${General.toDisplayDate(entity[dateProperty])}`}</Text>
style={styles.entityDateStyle}>{`${I18n.t(messageKey, {date: General.toDisplayDate(entity[dateProperty]), user: entity["createdBy"]})}`}</Text>;
}

renderEditButton(entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class SubjectDashboardProfileTab extends AbstractComponent {
{this.I18n.t("registrationInformation")}
</Text>
<Text style={{fontSize: Fonts.Medium, color: Colors.DefaultPrimaryColor}}>
{`${this.I18n.t("registeredOn")}${General.toDisplayDate(this.state.individual.registrationDate)}`}
{`${this.I18n.t("registeredOn", {date: General.toDisplayDate(this.state.individual.registrationDate), user: this.state.individual.createdBy})}`}
</Text>
</View>
<View style={{right: 2, position: 'absolute', alignSelf: 'center'}}>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SubjectDashboardProgramsTab extends AbstractComponent {
getHeaderMessage(enrolment) {
return (
<View>
<Text>{`${this.I18n.t("enrolledOn")} ${moment(enrolment.enrolmentDateTime).format("DD-MM-YYYY")}`}</Text>
<Text>{`${this.I18n.t("enrolledOn", {date: General.toDisplayDate(enrolment.enrolmentDateTime), user: enrolment.createdBy})}`}</Text>
{!_.isNil(this.state.enrolment.programExitDateTime) &&
<Text>{`${this.I18n.t("exitedOn")} ${moment(enrolment.programExitDateTime).format("DD-MM-YYYY")}`}</Text>}
<Text>{`${this.I18n.t("programName")} ${this.I18n.t(_.get(enrolment, 'program.displayName'))}`}</Text>
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"scheduledDate": "Scheduled",
"lastVisitDate": "Last Visited",
"allEnrolmentsInProgram": "All enrolments in",
"enrolledOn": "Enrolled on:",
"enrolledOn": "Enrolled on: {{date}}, by: {{user}}",
"exitedOn": "Exited on:",
"enrolmentAttributes": "Enrolment Attributes",
"viewSchedule": "VIEW SCHEDULE",
Expand Down Expand Up @@ -266,7 +266,7 @@
"viewAll": "VIEW ALL",
"unplannedVisit": "Unplanned Visit",
"registrationInformation": "Registration Details",
"registeredOn": "Registration Date: ",
"registeredOn": "Registered on: {{date}}, by: {{user}}",
"addRelative": "Add Relative",
"noRelativeAdded": "No Relative Added",
"profile": "Profile",
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/gu_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"scheduledDate": "અનુસૂચિત",
"lastVisitDate": "છેલ્લે મુલાકાત લીધી",
"allEnrolmentsInProgram": "All enrolments in",
"enrolledOn": "આના પર નોંધાયેલ:",
"enrolledOn": "આના પર નોંધાયેલ: {{date}}, દ્વારા: {{user}}",
"exitedOn": "આના પર બહાર આવ્યું:",
"enrolmentAttributes": "નોંધણી લક્ષણો",
"viewSchedule": "શેડ્યૂલ જુઓ",
Expand Down Expand Up @@ -293,7 +293,7 @@
"programName": "પ્રોગ્રામનું નામ:",
"rolesNotConfigured": "ભૂમિકાઓ ગોઠવેલ નથી",
"rolesNotConfiguredDescription": "સભ્ય ઉમેરવા માટે ભૂમિકાઓ ગોઠવો.",
"registeredOn": "નોંધણી તારીખ: ",
"registeredOn": "નોંધણી તારીખ: {{date}}, દ્વારા: {{user}}",
"disableAutoRefresh": "ડેશબોર્ડ ઓટો રિફ્રેશને અક્ષમ કરો",
"autoRefresh": "ડેશબોર્ડ ઓટો રિફ્રેશ",
"trackLocation": "ટ્રૅક સ્થાન",
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"scheduledDate": "प्लान तारिख",
"lastVisitDate": "पिछला विजिट तारिख",
"allEnrolmentsInProgram": "सभी इंरोलमेंटस",
"enrolledOn": "इंरोलमेंटस तारिख",
"enrolledOn": "इंरोलमेंटस तारिख {{date}}, द्वारा: {{user}}",
"noEnrolments": "कोई एनरोलमेंट नहीं",
"enrolments": "इंरोल्मेंट",
"programList": "प्रोग्राम लिस्ट",
Expand Down Expand Up @@ -346,7 +346,7 @@
"GlificMessagesList": "ग्लिफिक संदेश सूची",
"checklistOverviewSection": "टीकाकरण अवलोकन",
"dueChecklist": "ड्यू",
"registeredOn": "पंजीकरण की तारीख: ",
"registeredOn": "पंजीकरण की तारीख: {{date}}, द्वारा: {{user}}",
"disableAutoRefresh": "डैशबोर्ड ऑटो रिफ्रेश को अक्षम करें",
"autoRefresh": "डैशबोर्ड ऑटो रिफ्रेश",
"trackLocation": "ट्रैक स्थान",
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/ka_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"scheduledDate": "ನಿಗದಿತ",
"lastVisitDate": "ಕೊನೆಯದಾಗಿ ಭೇಟಿ ನೀಡಲಾಗಿದೆ",
"allEnrolmentsInProgram": "ಎಲ್ಲಾ ದಾಖಲಾತಿಗಳು",
"enrolledOn": "ನೋಂದಾಯಿಸಲಾಗಿದೆ:",
"enrolledOn": "ನೋಂದಾಯಿಸಲಾಗಿದೆ: {{date}}, ಮೂಲಕ: {{user}}",
"exitedOn": "ಇಲ್ಲಿಂದ ನಿರ್ಗಮಿಸಲಾಗಿದೆ:",
"enrolmentAttributes": "ದಾಖಲಾತಿ ಗುಣಲಕ್ಷಣಗಳು",
"viewSchedule": "ವೇಳಾಪಟ್ಟಿಯನ್ನು ವೀಕ್ಷಿಸಿ",
Expand Down Expand Up @@ -262,7 +262,7 @@
"viewAll": "ಎಲ್ಲವನ್ನೂ ವೀಕ್ಷಿಸಿ",
"unplannedVisit": "ಪ್ಲಾನ್‌ ಮಾಡದ ಭೇಟಿ",
"registrationInformation": "ನೋಂದಣಿ ವಿವರಗಳು",
"registeredOn": "ನೋಂದಣಿ ದಿನಾಂಕ:",
"registeredOn": "ನೋಂದಣಿ ದಿನಾಂಕ: {{date}}, ಮೂಲಕ: {{user}}",
"addRelative": "ಸಂಬಂಧಿಕರು",
"noRelativeAdded": "ಯಾವುದೇ ಸಂಬಂಧಿತರನ್ನು ಸೇರಿಸಲಾಗಿಲ್ಲ",
"profile": "ವಿವರ",
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/mr_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"scheduledDate": "नियोजीलेले",
"lastVisitDate": "शेवटची भेट",
"allEnrolmentsInProgram": "सर्व इंरोलमेंटस ",
"enrolledOn": "या तारखेस इंरोलमेंट केले:",
"enrolledOn": "या तारखेस इंरोलमेंट केले: {{date}}, द्वारे: {{user}}",
"enrolmentAttributes": "इंरोलमेंट च्या विळी आवश्यक बाबी",
"viewSchedule": "नियोजन पहा",
"noOpenEncounters": "कोणत्याही उरलेल्या/शिल्लक भेटी नाहीत ",
Expand Down Expand Up @@ -245,7 +245,7 @@
"plannedVisits": "नियोजित भेट",
"visitsCompleted": "दिलेल्या भेटी",
"unplannedVisit": "अनियोजित भेट",
"registeredOn": "नोंदणीची तारीख: ",
"registeredOn": "नोंदणीची तारीख: {{date}}, द्वारे: {{user}}",
"home": "होम",
"Program": "कार्यक्रम",
"Choose type": "पर्याय निवडा",
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/ta_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"scheduledDate": "திட்டமிடப்பட்ட",
"lastVisitDate": "கடைசியாகச் சந்தித்தது ",
"allEnrolmentsInProgram": "அனைத்து பதிவுகளும்",
"enrolledOn": "சேர்க்கப்பட்ட நாள்",
"enrolledOn": "சேர்க்கப்பட்ட நாள் {{date}}, மூலம்: {{user}}",
"exitedOn": "முடிக்கப்பட்ட நாள்",
"enrolmentAttributes": "சேர்க்கை பண்புகள்",
"viewSchedule": "அட்டவணையைப் பார்க்க",
Expand Down Expand Up @@ -262,7 +262,7 @@
"viewAll": "அனைத்தையும் காண்க",
"unplannedVisit": "திட்டமிடப்படாத வருகை",
"registrationInformation": "பதிவு விவரங்கள்",
"registeredOn": "பதிவுத் தேதி:",
"registeredOn": "பதிவுத் தேதி: {{date}}, மூலம்: {{user}}",
"addRelative": "உறவினர் சேர்க்கவும்",
"noRelativeAdded": "உறவினர் சேர்க்கப்படவில்லை",
"profile": "சுயவிவரம்",
Expand Down

0 comments on commit a991b27

Please sign in to comment.