Skip to content

Commit

Permalink
chore: [DHIS2-17915] remove opt-in functionality (#3796)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru authored Oct 14, 2024
1 parent ff859dc commit ab3c532
Show file tree
Hide file tree
Showing 32 changed files with 19 additions and 564 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Feature: User interacts with the Enrollment New Event Workspace

Scenario: User should be asked to create new event after completing a stage and choose to cancel
Given you land on the enrollment new event page by having typed #/enrollmentEventNew?enrollmentId=zRfAPUpjoG3&orgUnitId=DiszpKrYNg8&programId=M3xtLkYBlKI&stageId=CWaAcQYKVpq&teiId=S3JjTA4QMNe
And the data store is clean
Then you see the following Enrollment: New Event
And you see the widget header Foci investigation & classification
And you type 2022-01-01 in the input number 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Feature: Breaking the glass page
@skip
Scenario: User with search scope access tries to access an enrollment in a protected program
Given the tei created by this test is cleared from the database
And the data store is clean
And you create a new tei in Child programme from Ngelehun CHC
And you change program to WHO RMNCH Tracker
And you enroll the tei from Njandama MCHP
Expand Down
9 changes: 0 additions & 9 deletions cypress/e2e/MainPage/MainPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ Feature: User interacts with Main page
Then the current url is /#/?orgUnitId=DiszpKrYNg8&programId=uy2gU8kT1jF&selectedTemplateId=uy2gU8kT1jF-default
And the TEI working list is displayed

Scenario: The admin user can optout from using the new Enrollment Dashboard
Given you open the main page with Ngelehun and child programme context
And the data store is clean
And you see the opt out component for Child Programme
When you opt out to use the new enrollment Dashboard for Child Programme
Then you see the opt in component for Child Programme
When you opt in to use the new enrollment Dashboard for Child Programme
Then you see the opt out component for Child Programme

@v<41
Scenario: The icon is rendered as an svg
Given you are in the main page with no selections made
Expand Down
6 changes: 0 additions & 6 deletions cypress/e2e/NewPage/NewPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Feature: User creates a new entries from the registration page
@v>=41
Scenario: New person in Tracker Program > Filling the Allergies with multiple options
Given you are in the WHO RMNCH program registration page
And the data store is clean
When you fill in multiple Allergies options
Then you can see the multiple selections in the form
And you fill the WHO RMNCH program registration form with its required unique values
Expand Down Expand Up @@ -103,14 +102,12 @@ Feature: User creates a new entries from the registration page

Scenario: New person > Submitting the form with unique name navigates you to the user dashboard
Given you are in the Person registration page
And the data store is clean
When you fill in a unique first name
And you click the save person submit button
Then you are navigated to the enrollment dashboard page without enrollment

Scenario: New person > Submitting the form from the duplicates modal navigates you to the user dashboard
Given you are in the Person registration page
And the data store is clean
When you fill in the first name with value that has duplicates
And you click the save person submit button
And you see the possible duplicates modal
Expand Down Expand Up @@ -152,7 +149,6 @@ Feature: User creates a new entries from the registration page

Scenario: New person in Tracker Program > Submitting the form with unique values navigates you to the user dashboard
Given you are in the WHO RMNCH program registration page
And the data store is clean
When you fill the WHO RMNCH program registration form with its required unique values
And you click the save person submit button
Then you see the enrollment event Edit page
Expand All @@ -166,7 +162,6 @@ Feature: User creates a new entries from the registration page

Scenario: New person in Tracker Program > Submitting the form from the duplicates modal navigates you to the user dashboard
Given you are in the WHO RMNCH program registration page
And the data store is clean
When you fill the WHO RMNCH program registration form with its required values
And you click the save person submit button
And you see the possible duplicates modal
Expand All @@ -192,7 +187,6 @@ Feature: User creates a new entries from the registration page

Scenario: Go to enrollment event when Open data entry form after enrollment is checked
Given you are in the Malaria case diagnosis, treatment and investigation program registration page
And the data store is clean
And you fill the Malaria case diagnosis registration form with values
And you click the save malaria entity submit button
Then you see the enrollment event Edit page
Expand Down
4 changes: 0 additions & 4 deletions cypress/e2e/SearchPage/SearchPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Feature: User interacts with Search page

Scenario: Searching using unique identifier returns results
Given you are on the default search page
And the data store is clean
When you select the search domain WHO RMNCH Tracker
And you fill in the unique identifier field with values that will return a tracked entity instance
And you click find
Expand Down Expand Up @@ -97,7 +96,6 @@ Feature: User interacts with Search page

Scenario: Searching using attributes in Tracker Program navigates user to the dashboard view
Given you are on the default search page
And the data store is clean
When you select the search domain WHO RMNCH Tracker
And you expand the attributes search area
And you fill in the last name with values that will return results
Expand All @@ -108,7 +106,6 @@ Feature: User interacts with Search page

Scenario: Searching using attributes in TEType navigates user to dashboard view
Given you are on the default search page
And the data store is clean
When you select the search domain Person
And you expand the attributes search area
And you fill in the the form with first name value: Cla
Expand Down Expand Up @@ -165,7 +162,6 @@ Feature: User interacts with Search page

Scenario: Pressing enter should trigger search unique identifier returns results
Given you are on the default search page
And the data store is clean
When you select the search domain WHO RMNCH Tracker
And you press enter after filling in the unique identifier field with values that will return a tracked entity instance
Then you are navigated to the enrollment dashboard page
Expand Down
30 changes: 0 additions & 30 deletions cypress/support/step_definitions/common/baseSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,33 +181,3 @@ When(/^the user selects the org unit (.*)$/, (orgUnit) => {
cy.contains(orgUnit)
.click();
});

When(/^you opt in to use the new enrollment Dashboard for (.*)$/, (program) => {
cy.get('[data-test="main-page-working-list"]').then(($wrapper) => {
if ($wrapper.find('[data-test="dhis2-uicore-button"]').length > 0) {
cy.contains('[data-test="dhis2-uicore-button"]', `Opt in for ${program}`).click();
cy.contains('[data-test="opt-in-button"]', 'Yes, opt in').click();
cy.contains('[data-test="opt-out-button"]', `Opt out for ${program}`);
}
});
});

Then(/^you see the opt out component for (.*)$/, (program) => {
cy.contains('[data-test="opt-out-button"]', `Opt out for ${program}`);
});

When(/^you opt out to use the new enrollment Dashboard for (.*)$/, (program) => {
cy.intercept('PUT', '**/dataStore/capture/useNewDashboard').as('optOutEnrollmentDashboard');
cy.contains('[data-test="opt-out-button"]', `Opt out for ${program}`).click();
cy.wait('@optOutEnrollmentDashboard', { timeout: 30000 });
});

Then(/^you see the opt in component for (.*)$/, (program) => {
cy.contains('[data-test="dhis2-uicore-button"]', `Opt in for ${program}`);
});

And('the data store is clean', () => {
cy.buildApiUrl('dataStore/capture/useNewDashboard')
.then(dataStoreUrl =>
cy.request({ method: 'DELETE', url: dataStoreUrl, failOnStatusCode: false }));
});
14 changes: 0 additions & 14 deletions docs/user/using-the-capture-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -821,20 +821,6 @@ For performance reasons the Capture app caches metadata in the client browser. W

## Enrollment dashboard

### Enabling the enrollment dashboard

#### Opt in

Enable the enrollment dashboard for a Tracker program for all the users. The dialog is visible for users with program write access.

![](resources/images/enrollment-dash-opt-in.png)

#### Opt out

Disable the enrollment dashboard for a Tracker program for all the users.

![](resources/images/enrollment-dash-opt-out.png)

### Reaching the enrollment dashboard via url

You reach the enrollment dashboard either by typing in the address bar of your browser or using the user interface of the capture app.
Expand Down
48 changes: 0 additions & 48 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -616,54 +616,6 @@ msgstr "Notice"
msgid "Close the notice"
msgstr "Close the notice"

msgid "Use new Enrollment dashboard for {{programName}}"
msgstr "Use new Enrollment dashboard for {{programName}}"

msgid "Opt in for {{programName}}"
msgstr "Opt in for {{programName}}"

msgid ""
"By clicking opt-in below, you will start using the new enrollment dashboard "
"in the Capture app for this Tracker program. At the moment, there is "
"certain functionality from Tracker Capture that has not yet been added, "
"including relationship and referral functionality. The work on including "
"this Tracker functionality in Capture is ongoing and will be added in "
"upcoming app releases."
msgstr ""
"By clicking opt-in below, you will start using the new enrollment dashboard "
"in the Capture app for this Tracker program. At the moment, there is "
"certain functionality from Tracker Capture that has not yet been added, "
"including relationship and referral functionality. The work on including "
"this Tracker functionality in Capture is ongoing and will be added in "
"upcoming app releases."

msgid ""
"The core team appreciates any feedback on this new functionality which is "
"currently being beta tested, please report any issues and feedback in the "
"DHIS2 JIRA project."
msgstr ""
"The core team appreciates any feedback on this new functionality which is "
"currently being beta tested, please report any issues and feedback in the "
"DHIS2 JIRA project."

msgid ""
"Click the button below to opt-in to the new enrollment dashboard "
"functionality in the Capture app (beta) for this Tracker program for all "
"users."
msgstr ""
"Click the button below to opt-in to the new enrollment dashboard "
"functionality in the Capture app (beta) for this Tracker program for all "
"users."

msgid "Yes, opt in"
msgstr "Yes, opt in"

msgid "Stop using new Enrollment dashboard for {{programName}}"
msgstr "Stop using new Enrollment dashboard for {{programName}}"

msgid "Opt out for {{programName}}"
msgstr "Opt out for {{programName}}"

msgid "Enrollment with id \"{{enrollmentId}}\" does not exist"
msgstr "Enrollment with id \"{{enrollmentId}}\" does not exist"

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,22 @@ import { ofType } from 'redux-observable';
import { switchMap } from 'rxjs/operators';
import { EMPTY } from 'rxjs';
import { actionTypes as NavigateToEnrollmentOverviewActionTypes } from './navigateToEnrollmentOverview.actions';
import { buildUrlQueryString, getLocationQuery, shouldUseNewDashboard } from '../../utils/routing';
import { scopeHierarchyTypes } from './navigateToEnrollmentOverview.constants';
import { buildUrlQueryString } from '../../utils/routing';

// TODO This will be removed when the link between capture and tracker capture is not relevant
const redirectToTracker = ({ teiId, orgUnitId, dependencies }) => {
const baseUrl = dependencies.absoluteApiPath;
const { search, pathname } = dependencies.history.location;
const { programId: queryProgramId, trackedEntityTypeId: queryTrackedEntityTypeId } = getLocationQuery();

const instanceBaseUrl = baseUrl.split('/api')[0];
const scopeHierarchy = queryProgramId ? scopeHierarchyTypes.PROGRAM : scopeHierarchyTypes.TRACKED_ENTITY_TYPE;
const selectedScopeId = queryTrackedEntityTypeId || queryProgramId;
const scopeSearchParam = `${scopeHierarchy.toLowerCase()}=${selectedScopeId}`;
const base64Url = btoa(`/dhis-web-capture/#${pathname}${search}`);
setTimeout(() => {
window.location.href = `${instanceBaseUrl}/dhis-web-tracker-capture/#/dashboard?tei=${teiId}&ou=${orgUnitId}&${scopeSearchParam}&returnUrl=${base64Url}`;
}, 50);
};

const redirectToEnrollmentDashboard = ({ dependencies, teiId, programId, orgUnitId, enrollmentId }) => {
dependencies.history.push(
`/enrollment?${buildUrlQueryString({
teiId,
programId,
orgUnitId,
enrollmentId,
})}`,
);
};

export const navigateToEnrollmentOverviewEpic = (action$: InputObservable, store: ReduxStore, dependencies: any) =>
export const navigateToEnrollmentOverviewEpic = (action$: InputObservable, store: ReduxStore, { history }: ApiUtils) =>
action$.pipe(
ofType(NavigateToEnrollmentOverviewActionTypes.NAVIGATE_TO_ENROLLMENT_OVERVIEW),
switchMap((action) => {
const { teiId, programId, orgUnitId } = action.payload;
const enrollmentId = programId && (action.payload?.enrollmentId || 'AUTO');
const { dataStore, userDataStore } = store.value.useNewDashboard;

if (dataStore || userDataStore) {
const shouldRedirectToEnrollmentDashboard = shouldUseNewDashboard({
userDataStore,
dataStore,
programId,
history.push(
`/enrollment?${buildUrlQueryString({
teiId,
});
if (shouldRedirectToEnrollmentDashboard) {
redirectToEnrollmentDashboard({ dependencies, teiId, programId, orgUnitId, enrollmentId });
return EMPTY;
}
}

redirectToTracker({ dependencies, store, teiId, orgUnitId });
programId,
orgUnitId,
enrollmentId,
})}`,
);
return EMPTY;
}),
);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ab3c532

Please sign in to comment.