Skip to content

Commit

Permalink
Merge branch 'master' into DHIS2-18018
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Jan 27, 2025
2 parents 91c1893 + 7343c7e commit 3e9f419
Show file tree
Hide file tree
Showing 52 changed files with 518 additions and 218 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [101.23.0](https://github.com/dhis2/capture-app/compare/v101.22.0...v101.23.0) (2025-01-24)


### Features

* [DHIS2-18325] Show orgunit selector in the new event form ([#3879](https://github.com/dhis2/capture-app/issues/3879)) ([f07b4d4](https://github.com/dhis2/capture-app/commit/f07b4d47c219a21db2769cdc525135aa007ffe96))

# [101.22.0](https://github.com/dhis2/capture-app/compare/v101.21.6...v101.22.0) (2025-01-24)


### Features

* [DHIS2-17192] show related stages widget on registration page ([#3880](https://github.com/dhis2/capture-app/issues/3880)) ([03c156a](https://github.com/dhis2/capture-app/commit/03c156a8aa19708c5fc40140aa390ef547e18d25))

## [101.21.6](https://github.com/dhis2/capture-app/compare/v101.21.5...v101.21.6) (2025-01-16)


Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/ScopeSelector/ScopeSelector.feature
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ Feature: User uses the ScopeSelector to navigate
When you reset the program selection
Then you see message explaining you need to select a program

Scenario: Enrollment event new page > resetting the org unit
Given you land on a enrollment page domain by having typed /#/enrollmentEventNew?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8&stageId=A03MvHHogjR
When you reset the org unit selection
Then you see the enrollment event New page but there is no org unit id in the url

Scenario: Enrollment event new page > resetting the enrollment
Given you land on a enrollment page domain by having typed /#/enrollmentEventNew?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8&stageId=A03MvHHogjR
When you reset the enrollment selection
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/ScopeSelector/ScopeSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,6 @@ And('you see the enrollment event Edit page but there is no org unit id in the u
cy.get('[data-test="widget-enrollment-event-view"]').should('exist');
});

And('you see the enrollment event New page but there is no org unit id in the url', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollmentEventNew?enrollmentId=gPDueU02tn8&programId=IpHINAT79UW&stageId=A03MvHHogjR&teiId=fhFQhO0xILJ`);
cy.contains('Choose an organisation unit to start reporting');
});

And('you see the enrollment event New page but there is no stage id in the url', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollmentEventNew?enrollmentId=gPDueU02tn8&orgUnitId=UgYg0YW7ZIh&programId=IpHINAT79UW&teiId=fhFQhO0xILJ`);
cy.contains('Choose a stage for a new event');
Expand Down
25 changes: 14 additions & 11 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-12-15T15:25:38.375Z\n"
"PO-Revision-Date: 2024-12-15T15:25:38.375Z\n"
"POT-Creation-Date: 2025-01-02T13:08:32.303Z\n"
"PO-Revision-Date: 2025-01-02T13:08:32.303Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -709,9 +709,6 @@ msgstr "There was an error opening the Page"
msgid "There was an error loading the page"
msgstr "There was an error loading the page"

msgid "Choose an organisation unit to start reporting"
msgstr "Choose an organisation unit to start reporting"

msgid "Program stage is invalid"
msgstr "Program stage is invalid"

Expand Down Expand Up @@ -768,6 +765,9 @@ msgstr ""
"You don't have access to create a {{trackedEntityName}} in the current "
"selections"

msgid "Choose an organisation unit to start reporting"
msgstr "Choose an organisation unit to start reporting"

msgid "Choose the {{missingCategories}} to start reporting"
msgstr "Choose the {{missingCategories}} to start reporting"

Expand Down Expand Up @@ -1231,12 +1231,21 @@ msgstr "Add coordinates"
msgid "Add area"
msgstr "Add area"

msgid "Please add or cancel the note before saving the event"
msgstr "Please add or cancel the note before saving the event"

msgid "Please provide an valid organisation unit"
msgstr "Please provide an valid organisation unit"

msgid "organisation unit could not be retrieved. Please try again later."
msgstr "organisation unit could not be retrieved. Please try again later."

msgid "Saving to {{stageName}} for {{programName}} in {{orgUnitName}}"
msgstr "Saving to {{stageName}} for {{programName}} in {{orgUnitName}}"

msgid "Saving to {{stageName}} for {{programName}}"
msgstr "Saving to {{stageName}} for {{programName}}"

msgid "program or stage is invalid"
msgstr "program or stage is invalid"

Expand All @@ -1258,9 +1267,6 @@ msgstr "Warning"
msgid "stage not found in rules execution"
msgstr "stage not found in rules execution"

msgid "Please provide an valid organisation unit"
msgstr "Please provide an valid organisation unit"

msgid "Delete event"
msgstr "Delete event"

Expand Down Expand Up @@ -1313,9 +1319,6 @@ msgid_plural "There are {{count}} scheduled event in {{orgUnitName}} on this day
msgstr[0] "There are {{count}} scheduled event in {{orgUnitName}} on this day."
msgstr[1] "There are {{count}} scheduled events in {{orgUnitName}} on this day."

msgid "Scheduling an event in {{stageName}} for {{programName}} in {{orgUnitName}}"
msgstr "Scheduling an event in {{stageName}} for {{programName}} in {{orgUnitName}}"

msgid "Schedule info"
msgstr "Schedule info"

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "capture-app",
"homepage": ".",
"version": "101.21.6",
"version": "101.23.0",
"cacheVersion": "7",
"serverVersion": "38",
"license": "BSD-3-Clause",
Expand All @@ -10,7 +10,7 @@
"packages/rules-engine"
],
"dependencies": {
"@dhis2/rules-engine-javascript": "101.21.6",
"@dhis2/rules-engine-javascript": "101.23.0",
"@dhis2/app-runtime": "^3.9.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-icons": "^1.0.1",
Expand Down Expand Up @@ -115,7 +115,7 @@
"eslint-config-react-app": "^6.0.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-import-resolver-exports": "^1.0.0-beta.5",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-import-resolver-webpack": "^0.13.10",
"eslint-plugin-flowtype": "^5.10.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "^5.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/rules-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/rules-engine-javascript",
"version": "101.21.6",
"version": "101.23.0",
"license": "BSD-3-Clause",
"main": "./build/cjs/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
export type D2FunctionsInput = $ReadOnly<{|
dateUtils: IDateUtils,
variablesHash: RuleVariables,
selectedOrgUnit: OrgUnit,
selectedOrgUnit: ?OrgUnit,
selectedUserRoles: Array<string>,
|}>;

Expand Down
2 changes: 1 addition & 1 deletion packages/rules-engine/src/rulesEngine.types.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export type RulesEngineInput = {|
selectedEntity?: ?TEIValues,
trackedEntityAttributes?: ?TrackedEntityAttributes,
selectedEnrollment?: ?Enrollment,
selectedOrgUnit: OrgUnit,
selectedOrgUnit: ?OrgUnit,
selectedUserRoles?: ?Array<string>,
optionSets: OptionSets,
|}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type SourceData = {
selectedEntity: ?TEIValues,
selectedEnrollment: ?Enrollment,
optionSets: OptionSets,
selectedOrgUnit: OrgUnit,
selectedOrgUnit: ?OrgUnit,
};

const variableSourceTypesDataElementSpecific = {
Expand Down Expand Up @@ -516,7 +516,7 @@ export class VariableService {
return variables;
}

getOrganisationContextVariables(orgUnit: OrgUnit) {
getOrganisationContextVariables(orgUnit: ?OrgUnit) {
const variables = {};
variables.orgunit_code = this.buildContextVariable(orgUnit?.code, typeKeys.TEXT);
return variables;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export type VariableServiceInput = {|
selectedEntity: ?TEIValues,
trackedEntityAttributes: ?TrackedEntityAttributes,
selectedEnrollment: ?Enrollment,
selectedOrgUnit: OrgUnit,
selectedOrgUnit: ?OrgUnit,
optionSets: OptionSets,
constants: ?Constants,
|};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const getGeometrySettings = () => ({
dialogLabel: i18n.t('Area'),
required: false,
orientation: getOrientation(props.formHorizontal),
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
}

Expand All @@ -249,7 +249,7 @@ const getGeometrySettings = () => ({
required: false,
orientation: getOrientation(props.formHorizontal),
shrinkDisabled: props.formHorizontal,
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
},
getPropName: () => 'geometry',
Expand Down Expand Up @@ -330,6 +330,7 @@ type FinalTeiDataEntryProps = {
programId: string,
id: string,
orgUnitId: string,
orgUnit: OrgUnit,
onUpdateDataEntryField: Function,
onUpdateFormFieldAsync: Function,
onUpdateFormField: Function,
Expand Down Expand Up @@ -459,6 +460,7 @@ export class EnrollmentDataEntryComponent extends React.Component<PreEnrollmentD
onUpdateDataEntryField,
onStartAsyncUpdateField,
onGetUnsavedAttributeValues,
orgUnit,
...passOnProps
} = this.props;

Expand All @@ -469,6 +471,8 @@ export class EnrollmentDataEntryComponent extends React.Component<PreEnrollmentD
onUpdateFormField={this.handleUpdateField}
onUpdateDataEntryField={this.handleUpdateDataEntryField}
onUpdateFormFieldAsync={this.handleStartAsyncUpdateField}
orgUnit={orgUnit}
orgUnitId={orgUnit?.id}
{...passOnProps}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const getStageGeometrySettings = () => ({
dialogLabel: i18n.t('Area'),
required: false,
orientation: getOrientation(props.formHorizontal),
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
}

Expand All @@ -139,7 +139,7 @@ const getStageGeometrySettings = () => ({
required: false,
orientation: getOrientation(props.formHorizontal),
shrinkDisabled: props.formHorizontal,
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
},
getPropName: () => stageMainDataIds.GEOMETRY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getSectionId = sectionId =>
(sectionId === Section.MAIN_SECTION_ID ? `${Section.MAIN_SECTION_ID}-stage` : sectionId);

export const EnrollmentWithFirstStageDataEntry = (props: Props) => {
const { firstStageMetaData, relatedStageRef, relatedStageActionsOptions, ...passOnProps } = props;
const { firstStageMetaData, orgUnit, relatedStageRef, relatedStageActionsOptions, ...passOnProps } = props;
const {
stage: { stageForm: firstStageFormFoundation, name: stageName },
} = firstStageMetaData;
Expand All @@ -23,6 +23,8 @@ export const EnrollmentWithFirstStageDataEntry = (props: Props) => {
<>
<FirstStageDataEntry
{...passOnProps}
orgUnit={orgUnit}
orgUnitId={orgUnit?.id}
firstStageMetaData={firstStageMetaData}
dataEntrySections={dataEntrySections}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @flow
import type { OrgUnit } from '@dhis2/rules-engine-javascript';
import type { ProgramStage, RenderFoundation } from '../../../../metaData';
import type { RelatedStageRefPayload } from '../../../WidgetRelatedStages';
import { relatedStageActions } from '../../../WidgetRelatedStages';
Expand All @@ -8,6 +9,7 @@ export type Props = {
stage: ProgramStage,
},
formFoundation: RenderFoundation,
orgUnit: ?OrgUnit,
programId: string,
relatedStageRef?: { current: ?RelatedStageRefPayload },
relatedStageActionsOptions?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const buildGeometrySettingsFn = () => ({
dialogLabel: i18n.t('Area'),
required: false,
orientation: getOrientation(props.formHorizontal),
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
}

Expand All @@ -247,7 +247,7 @@ const buildGeometrySettingsFn = () => ({
required: false,
orientation: getOrientation(props.formHorizontal),
shrinkDisabled: props.formHorizontal,
orgUnit: props.orgUnit,
orgUnitId: props.orgUnit?.id,
});
},
getPropName: () => 'geometry',
Expand Down Expand Up @@ -637,6 +637,7 @@ class NewEventDataEntry extends Component<Props> {
dataEntrySections={this.dataEntrySections}
relationshipsRef={this.setRelationshipsInstance}
orgUnit={orgUnit}
orgUnitId={orgUnit?.id}
{...passOnProps}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export {
} from './actions/dataEntry.actions';
export { actionTypes as loadNewActionTypes } from './actions/dataEntryLoadNew.actions';
export { actionTypes as loadEditActionTypes, cleanUpDataEntry } from './actions/dataEntry.actions';
export { getDataEntryKey } from './common/getDataEntryKey';

Loading

0 comments on commit 3e9f419

Please sign in to comment.