Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [DHIS2-17225] cannot add TET with polygon or coordiante #3618

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cypress/e2e/NewPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,15 @@ Feature: User creates a new entries from the registration page
Scenario: First stage appears on registration page
Given you are in Child programme registration page
Then the first stage appears on registration page

Scenario: New malaria entity without enrollment
Given you are in the registration page with Ngelehun CHC org unit selected
And you select Malaria Entity from the available tracked entity types
And you click the location button
Then the map opens

Scenario: New focus area without enrollment
Given you are in the registration page with Ngelehun CHC org unit selected
And you select Focus area from the available tracked entity types
And the user clicks the element containing the text: Choose area on map
Then the map opens
21 changes: 21 additions & 0 deletions cypress/e2e/NewPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ And('you are on the default registration page', () => {
cy.visit('/#/new');
});

Given('you are in the registration page with Ngelehun CHC org unit selected', () => {
cy.visit('/#/new?orgUnitId=DiszpKrYNg8');
});

And('there should be informative message explaining you need to select an organisation unit', () => {
cy.get('[data-test="informative-paper"]')
.contains('Choose a registering unit to start reporting')
Expand Down Expand Up @@ -638,3 +642,20 @@ And('you delete the recently added tracked entity', () => {
});
cy.url().should('include', 'selectedTemplateId=IpHINAT79UW');
});

And(/^you select (.*) from the available tracked entity types/, (selection) => {
cy.get('[data-test="dhis2-uicore-select-input"]')
.click();
cy.contains(selection)
.click();
});

And('you click the location button', () => {
cy.get('[data-test="mapIconButton"]')
.click();
});

Then('the map opens', () => {
cy.get('.leaflet-container').should('exist');
});

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import type { TeiRegistration } from '../../../metaData';

type FinalTeiDataEntryProps = {
orgUnitId: string,
teiRegistrationMetadata: TeiRegistration,
};
// final step before the generic dataEntry is inserted
Expand All @@ -19,10 +20,11 @@ class FinalTeiDataEntry extends React.Component<FinalTeiDataEntryProps> {
}

render() {
const { teiRegistrationMetadata, ...passOnProps } = this.props;
const { teiRegistrationMetadata, orgUnitId, ...passOnProps } = this.props;
return (
<DataEntry
{...passOnProps}
orgUnit={{ id: orgUnitId }}
formFoundation={teiRegistrationMetadata.form}
/>
);
Expand Down Expand Up @@ -62,7 +64,6 @@ export class PreTeiDataEntry extends React.Component<PreTeiDataEntryProps> {

render() {
const {
orgUnitId,
trackedEntityTypeId,
onUpdateField,
onStartAsyncUpdateField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export class CoordinateField extends React.Component<Props, State> {
<div className={mapIconContainerClass}>
<IconButton
disabled={!!disabled}
dataTest="mapIconButton"
style={{ height: 42, width: 42, borderRadius: 0, padding: 0 }}
className={classNames(defaultClasses.mapIcon, mapIconCustomClass)}
onClick={this.openMap}
Expand Down
Loading