diff --git a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature index 3bf9fbfaf8..db142862ee 100644 --- a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature +++ b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature @@ -8,311 +8,316 @@ Feature: User interacts with tei working lists When you change the sharing settings Then you see the new sharing settings -Scenario: User opens the default working list for a tracker program -Given you open the main page with Ngelehun and child programe context -Then the default working list should be displayed -And rows per page should be set to 15 -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show only teis with completed enrollments using the predefined working list -Given you open the main page with Ngelehun and child programe context -When you select the working list called completed enrollments -Then the enrollment status filter button should show that the completed filter is in effect -And the list should display teis with a completed enrollment -And rows per page should be set to 15 -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show only teis with completed enrollments using the filter -Given you open the main page with Ngelehun and child programe context -When you set the enrollment status filter to completed -And you apply the current filter -Then the enrollment status filter button should show that the completed filter is in effect -And the list should display teis with a completed enrollment -And rows per page should be set to 15 -And for a tracker program the page navigation should show that you are on the first page - -# DHIS2-13960: /trackedEntities filter by assignee results are not consistent -@skip -Scenario: Show only teis with active enrollments and unassinged events using the filter -Given you open the main page with Ngelehun and Malaria focus investigation context -When you set the enrollment status filter to active -And you apply the current filter -And you set the assginee filter to None -And you apply the current filter -Then the enrollment status filter button should show that the active filter is in effect -And the assignee filter button should show that None filter is in effect -And the list should display teis with an active enrollment and unassinged events -And rows per page should be set to 15 -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show only teis with first name containig John using the filter -Given you open the main page with Ngelehun and child programe context -When you set the first name filter to John -And you apply the current filter -Then the first name filter button should show that the filter is in effect -And the list should display teis with John as the first name -And rows per page should be set to 15 -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show the registering unit column -Given you open the main page with Ngelehun and child programe context -When you open the column selector -And you select the organisation unit and save from the column selector -Then the organisation unit should display in the list - -Scenario: Show next page -Given you open the main page with Ngelehun and child programe context -When you click the next page button -Then the list should display data for the second page -And the pagination for the tei working list should show the second page - -Scenario: Show next page then previous page -Given you open the main page with Ngelehun and child programe context -When you click the next page button -Then the list should display data for the second page -And the pagination for the tei working list should show the second page -When you click the previous page button -Then the default working list should be displayed -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show next page then first page -Given you open the main page with Ngelehun and child programe context -When you click the next page button -Then the list should display data for the second page -And the pagination for the tei working list should show the second page -When you click the first page button -Then the default working list should be displayed -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show 10 rows per page -Given you open the main page with Ngelehun and child programe context -When you change rows per page to 10 -Then the list should display 10 rows of data -And for a tracker program the page navigation should show that you are on the first page - -Scenario: Show teis ordered ascendingly by first name -Given you open the main page with Ngelehun and child programe context -When you click the first name column header -Then the sort arrow should indicate ascending order -And the list should display data ordered ascendingly by first name -And for a tracker program the page navigation should show that you are on the first page - -Scenario: The TEI custom working lists is loaded -Given you open the main page with Ngelehun and Malaria focus investigation context -Then you see the custom TEI working lists -And you can load the view with the name Events assigned to me - - - -Scenario: The user creates, updates and deletes a TEI custom working list -Given you open the main page with Ngelehun and Malaria case diagnosis context -And you set the enrollment status filter to completed -And you apply the current filter -And you set the enrollment date to a relative range -And you apply the current filter -When you save the list with the name My custom list -Then the new My custom list is created -And the enrollment status filter button should show that the completed filter is in effect -When you set the enrollment status filter to active -And you apply the current filter -When you update the list with the name My custom list -Then the enrollment status filter button should show that the active filter is in effect -And you delete the name My custom list -Then the My custom list is deleted - -Scenario: The user can delete a TEI working list right immediately after creating it. -Given you open the main page with Ngelehun and Malaria case diagnosis context -And you set the enrollment status filter to completed -And you apply the current filter -And you set the enrollment date to a relative range -And you apply the current filter -When you save the list with the name My custom list -Then the new My custom list is created -When you delete the name My custom list -Then the My custom list is deleted - -Scenario: The user can open and select a program stage filter -Given you open the main page with Ngelehun and Malaria focus investigation context -When you open the program stage filters from the more filters dropdown menu -When you select the Foci response program stage -And you apply the current filter -And you open the column selector -And you select a data element columns and save from the column selector -Then you see data elements specific filters and columns - -Scenario: While in a program stage working list, the user can filter by both TEA and data elements -Given you open the main page with Ngelehun, WHO RMNCH Tracker and First antenatal care visit context -When you set the enrollment status filter to active -And you apply the current filter -And you set the event status filter to completed -And you apply the current filter -And you set the first name filter to Urzula -And you apply the current filter -And you set the WHOMCH Smoking filter to No -And you apply the current filter -Then the list should display 1 row of data - -Scenario: While in a program stage working list, the user can sort by both TEA and data elements -Given you open the main page with Ngelehun, WHO RMNCH Tracker and First antenatal care visit context -And you set the first name filter to u -And you apply the current filter -When you click the last name column header -Then the sort arrow should indicate ascending order -And the list should display data ordered ascendingly by last name -When you click the WHOMCH Hemoglobin value column header -Then the sort arrow should indicate descending order -And the list should display data ordered descending by WHOMCH Hemoglobin - -Scenario: The user can remove the program stage filter -Given you open the main page with Ngelehun and WHO RMNCH Tracker context -When you open the program stage filters from the more filters dropdown menu -And you select the First antenatal care visit program stage -And you apply the current filter -Then you see program stage working list events -When you remove the program stage filter -Then you don't see program stage working list events - -Scenario: The user can filter the events by scheduledAt date -Given you open the main page with Ngelehun and WHO RMNCH Tracker context -When you open the program stage filters from the more filters dropdown menu -And you select the First antenatal care visit program stage -And you apply the current filter -Then you see scheduledAt filter -And you open the column selector -When you select a scheduledAt column and save from the column selector -And you select the events scheduled today -And you apply the current filter -Then you see the selected option in the scheduledAt filter - -Scenario: The program stage working list configureation is kept when navigating -Given you open the main page with Ngelehun and WHO RMNCH Tracker context and configure a program stage working list -When you open an enrollment event from the working list -And you go back using the browser button -Then the program stage working list is loaded - -Scenario: The program stage working list without a orgUnit selected redirects to a tracker event -Given you open the main page with all accesible records in the WHO RMNCH Tracker context and configure a program stage working list -When you open an enrollment event from the working list -Then the tracker event URL contains the orgUnitId - -Scenario: The user can open a program stage list without events -Given you open the main page with Ngelehun and WHO RMNCH Tracker context and configure a program stage working list -And you set the event visit date to Today -And you apply the current filter -Then the working list is empty - -Scenario: The user can filter the Foci response assigned events -Given you open the main page with Ngelehun and Malaria focus investigation context -When you open the program stage filters from the more filters dropdown menu -And you select the Foci response program stage -And you apply the current filter -And you set the assginee filter to Anyone -And you apply the current filter -Then the assignee filter button should show that Anyone filter is in effect -And the assignee column is displayed - -Scenario: The assigned user data is kept when switching between working list types -Given you open the main page with Ngelehun and Malaria focus investigation context -And you filter by assigned Foci investigation & classification events -And the assignee filter button should show that Anyone filter is in effect -When you remove the program stage filter -Then you don't see program stage working list events -And the assignee filter button should show that Anyone filter is in effect -When you set the assginee filter to None -And you apply the current filter -Then the assignee filter button should show that None filter is in effect -When you open the program stage filters from the more filters dropdown menu -And you select the Foci response program stage -And you apply the current filter -Then the assignee filter button should show that None filter is in effect - -@v>=40 -Scenario: The user can create and delete a program stage working list for Foci investigation & classification assigned events -Given you open the main page with Ngelehun and Malaria focus investigation context -And you filter by assigned Foci investigation & classification events -When you save the list with the name Custom Program stage list -Then the new Custom Program stage list is created -And you delete the name Custom Program stage list -Then the Custom Program stage list is deleted - -@v>=40 -Scenario: The user creates, updates and deletes a Program stage custom working list -Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context -And you set the enrollment status filter to completed -And you apply the current filter -And you set the enrollment date to a relative range -And you apply the current filter -When you save the list with the name Custom Program stage list -Then the new Custom Program stage list is created -And the enrollment status filter button should show that the completed filter is in effect -When you set the enrollment status filter to active -And you apply the current filter -When you update the list with the name Custom Program stage list -Then the enrollment status filter button should show that the active filter is in effect -And you delete the name Custom Program stage list -Then the Custom Program stage list is deleted - -@v>=40 -Scenario: The user can delete a Program stage working list right immediately after creating it. -Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context -When you save the list with the name Custom Program stage list -Then the new Custom Program stage list is created -And you delete the name Custom Program stage list -Then the Custom Program stage list is deleted - -# For the program stage WL scenarios I need to create/delete my own because there are no program stage working lists in the demo database. -@v>=40 -Scenario: The Program stage custom working can be shared -Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context -And you save the list with the name Custom Program stage list -When you change the sharing settings -Then you see the new sharing settings - -@v>=40 -Scenario: The Program stage working list configuration is kept when changing the org unit -Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context -And you save the list with the name Custom Program stage list -Then the new Custom Program stage list is created -And you set the event status filter to completed -And you apply the current filter -And you change the org unit -Then the working list configuration was kept -And you delete the name Custom Program stage list -And the Custom Program stage list is deleted - -@v>=40 -Scenario: The user can save a program stage working list, based on a TEI working list configuration -Given you open a clean main page with Ngelehun and Malaria focus investigation context -Then you see the custom TEI working lists -And you can load the view with the name Ongoing foci responses -And you open the program stage filters from the more filters dropdown menu -And you select the Foci response program stage -And you apply the current filter -Then you are redirect to the default templete -When you save the list with the name Custom Program stage list -Then the new Custom Program stage list is created -And the TEI working list initial configuration was kept -And you delete the name Custom Program stage list -Then the Custom Program stage list is deleted - -@v>=40 -Scenario: The user can download the tracked entity working list -Given you open the main page with Ngelehun and child programe context -And you open the menu and click the "Download data..." button -Then the download dialog opens -Then the CSV button exists -Then the JSON button exists - -@v<40 -Scenario: The user can download the tracked entity working list -Given you open the main page with Ngelehun and child programe context -And you open the menu and click the "Download data..." button -Then the download dialog opens -Then the JSON button exists - -Scenario: The user cannot download the tracked entity working list when no orgUnit is selected -Given you open the main page with child programe context -And the user clicks the element containing the text: Or see all records accessible to you in Child Programme -And you open the menu -Then the "Download data..." button is hidden + Scenario: User opens the default working list for a tracker program + Given you open the main page with Ngelehun and child programe context + Then the default working list should be displayed + And rows per page should be set to 15 + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show only teis with completed enrollments using the predefined working list + Given you open the main page with Ngelehun and child programe context + When you select the working list called completed enrollments + Then the enrollment status filter button should show that the completed filter is in effect + And the list should display teis with a completed enrollment + And rows per page should be set to 15 + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show only teis with completed enrollments using the filter + Given you open the main page with Ngelehun and child programe context + When you set the enrollment status filter to completed + And you apply the current filter + Then the enrollment status filter button should show that the completed filter is in effect + And the list should display teis with a completed enrollment + And rows per page should be set to 15 + And for a tracker program the page navigation should show that you are on the first page + + # DHIS2-13960: /trackedEntities filter by assignee results are not consistent + @skip + Scenario: Show only teis with active enrollments and unassinged events using the filter + Given you open the main page with Ngelehun and Malaria focus investigation context + When you set the enrollment status filter to active + And you apply the current filter + And you set the assginee filter to None + And you apply the current filter + Then the enrollment status filter button should show that the active filter is in effect + And the assignee filter button should show that None filter is in effect + And the list should display teis with an active enrollment and unassinged events + And rows per page should be set to 15 + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show only teis with first name containig John using the filter + Given you open the main page with Ngelehun and child programe context + When you set the first name filter to John + And you apply the current filter + Then the first name filter button should show that the filter is in effect + And the list should display teis with John as the first name + And rows per page should be set to 15 + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show the registering unit column + Given you open the main page with Ngelehun and child programe context + When you open the column selector + And you select the organisation unit and save from the column selector + Then the organisation unit should display in the list + + Scenario: Show next page + Given you open the main page with Ngelehun and child programe context + When you click the next page button + Then the list should display data for the second page + And the pagination for the tei working list should show the second page + + Scenario: Show next page then previous page + Given you open the main page with Ngelehun and child programe context + When you click the next page button + Then the list should display data for the second page + And the pagination for the tei working list should show the second page + When you click the previous page button + Then the default working list should be displayed + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show next page then first page + Given you open the main page with Ngelehun and child programe context + When you click the next page button + Then the list should display data for the second page + And the pagination for the tei working list should show the second page + When you click the first page button + Then the default working list should be displayed + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show 10 rows per page + Given you open the main page with Ngelehun and child programe context + When you change rows per page to 10 + Then the list should display 10 rows of data + And for a tracker program the page navigation should show that you are on the first page + + Scenario: Show teis ordered ascendingly by first name + Given you open the main page with Ngelehun and child programe context + When you click the first name column header + Then the sort arrow should indicate ascending order + And the list should display data ordered ascendingly by first name + And for a tracker program the page navigation should show that you are on the first page + + Scenario: The TEI custom working lists is loaded + Given you open the main page with Ngelehun and Malaria focus investigation context + Then you see the custom TEI working lists + And you can load the view with the name Events assigned to me + + Scenario: The user creates, updates and deletes a TEI custom working list + Given you open the main page with Ngelehun and Malaria case diagnosis context + And you set the enrollment status filter to completed + And you apply the current filter + And you set the enrollment date to a relative range + And you apply the current filter + When you save the list with the name My custom list + Then the new My custom list is created + And the enrollment status filter button should show that the completed filter is in effect + When you set the enrollment status filter to active + And you apply the current filter + When you update the list with the name My custom list + Then the enrollment status filter button should show that the active filter is in effect + And you delete the name My custom list + Then the My custom list is deleted + + Scenario: The user is navigated back to the selected working list after closing a TEI + Given you open the main page with Ngelehun and child programe context + And you select the working list called completed enrollments + When you open a tei from the working list + And you deselect the tracked entity from the context selector + Then the working list called completed enrollments should be selected + + Scenario: The user can delete a TEI working list right immediately after creating it. + Given you open the main page with Ngelehun and Malaria case diagnosis context + And you set the enrollment status filter to completed + And you apply the current filter + And you set the enrollment date to a relative range + And you apply the current filter + When you save the list with the name My custom list + Then the new My custom list is created + When you delete the name My custom list + Then the My custom list is deleted + + Scenario: The user can open and select a program stage filter + Given you open the main page with Ngelehun and Malaria focus investigation context + When you open the program stage filters from the more filters dropdown menu + When you select the Foci response program stage + And you apply the current filter + And you open the column selector + And you select a data element columns and save from the column selector + Then you see data elements specific filters and columns + + Scenario: While in a program stage working list, the user can filter by both TEA and data elements + Given you open the main page with Ngelehun, WHO RMNCH Tracker and First antenatal care visit context + When you set the enrollment status filter to active + And you apply the current filter + And you set the event status filter to completed + And you apply the current filter + And you set the first name filter to Urzula + And you apply the current filter + And you set the WHOMCH Smoking filter to No + And you apply the current filter + Then the list should display 1 row of data + + Scenario: While in a program stage working list, the user can sort by both TEA and data elements + Given you open the main page with Ngelehun, WHO RMNCH Tracker and First antenatal care visit context + And you set the first name filter to u + And you apply the current filter + When you click the last name column header + Then the sort arrow should indicate ascending order + And the list should display data ordered ascendingly by last name + When you click the WHOMCH Hemoglobin value column header + Then the sort arrow should indicate descending order + And the list should display data ordered descending by WHOMCH Hemoglobin + + Scenario: The user can remove the program stage filter + Given you open the main page with Ngelehun and WHO RMNCH Tracker context + When you open the program stage filters from the more filters dropdown menu + And you select the First antenatal care visit program stage + And you apply the current filter + Then you see program stage working list events + When you remove the program stage filter + Then you don't see program stage working list events + + Scenario: The user can filter the events by scheduledAt date + Given you open the main page with Ngelehun and WHO RMNCH Tracker context + When you open the program stage filters from the more filters dropdown menu + And you select the First antenatal care visit program stage + And you apply the current filter + Then you see scheduledAt filter + And you open the column selector + When you select a scheduledAt column and save from the column selector + And you select the events scheduled today + And you apply the current filter + Then you see the selected option in the scheduledAt filter + + Scenario: The program stage working list configureation is kept when navigating + Given you open the main page with Ngelehun and WHO RMNCH Tracker context and configure a program stage working list + When you open an enrollment event from the working list + And you go back using the browser button + Then the program stage working list is loaded + + Scenario: The program stage working list without a orgUnit selected redirects to a tracker event + Given you open the main page with all accesible records in the WHO RMNCH Tracker context and configure a program stage working list + When you open an enrollment event from the working list + Then the tracker event URL contains the orgUnitId + + Scenario: The user can open a program stage list without events + Given you open the main page with Ngelehun and WHO RMNCH Tracker context and configure a program stage working list + And you set the event visit date to Today + And you apply the current filter + Then the working list is empty + + Scenario: The user can filter the Foci response assigned events + Given you open the main page with Ngelehun and Malaria focus investigation context + When you open the program stage filters from the more filters dropdown menu + And you select the Foci response program stage + And you apply the current filter + And you set the assginee filter to Anyone + And you apply the current filter + Then the assignee filter button should show that Anyone filter is in effect + And the assignee column is displayed + + Scenario: The assigned user data is kept when switching between working list types + Given you open the main page with Ngelehun and Malaria focus investigation context + And you filter by assigned Foci investigation & classification events + And the assignee filter button should show that Anyone filter is in effect + When you remove the program stage filter + Then you don't see program stage working list events + And the assignee filter button should show that Anyone filter is in effect + When you set the assginee filter to None + And you apply the current filter + Then the assignee filter button should show that None filter is in effect + When you open the program stage filters from the more filters dropdown menu + And you select the Foci response program stage + And you apply the current filter + Then the assignee filter button should show that None filter is in effect + + @v>=40 + Scenario: The user can create and delete a program stage working list for Foci investigation & classification assigned events + Given you open the main page with Ngelehun and Malaria focus investigation context + And you filter by assigned Foci investigation & classification events + When you save the list with the name Custom Program stage list + Then the new Custom Program stage list is created + And you delete the name Custom Program stage list + Then the Custom Program stage list is deleted + + @v>=40 + Scenario: The user creates, updates and deletes a Program stage custom working list + Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context + And you set the enrollment status filter to completed + And you apply the current filter + And you set the enrollment date to a relative range + And you apply the current filter + When you save the list with the name Custom Program stage list + Then the new Custom Program stage list is created + And the enrollment status filter button should show that the completed filter is in effect + When you set the enrollment status filter to active + And you apply the current filter + When you update the list with the name Custom Program stage list + Then the enrollment status filter button should show that the active filter is in effect + And you delete the name Custom Program stage list + Then the Custom Program stage list is deleted + + @v>=40 + Scenario: The user can delete a Program stage working list right immediately after creating it. + Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context + When you save the list with the name Custom Program stage list + Then the new Custom Program stage list is created + And you delete the name Custom Program stage list + Then the Custom Program stage list is deleted + + # For the program stage WL scenarios I need to create/delete my own because there are no program stage working lists in the demo database. + @v>=40 + Scenario: The Program stage custom working can be shared + Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context + And you save the list with the name Custom Program stage list + When you change the sharing settings + Then you see the new sharing settings + + @v>=40 + Scenario: The Program stage working list configuration is kept when changing the org unit + Given you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context + And you save the list with the name Custom Program stage list + Then the new Custom Program stage list is created + And you set the event status filter to completed + And you apply the current filter + And you change the org unit + Then the working list configuration was kept + And you delete the name Custom Program stage list + And the Custom Program stage list is deleted + + @v>=40 + Scenario: The user can save a program stage working list, based on a TEI working list configuration + Given you open a clean main page with Ngelehun and Malaria focus investigation context + Then you see the custom TEI working lists + And you can load the view with the name Ongoing foci responses + And you open the program stage filters from the more filters dropdown menu + And you select the Foci response program stage + And you apply the current filter + Then you are redirect to the default templete + When you save the list with the name Custom Program stage list + Then the new Custom Program stage list is created + And the TEI working list initial configuration was kept + And you delete the name Custom Program stage list + Then the Custom Program stage list is deleted + + @v>=40 + Scenario: The user can download the tracked entity working list + Given you open the main page with Ngelehun and child programe context + And you open the menu and click the "Download data..." button + Then the download dialog opens + Then the CSV button exists + Then the JSON button exists + + @v<40 + Scenario: The user can download the tracked entity working list + Given you open the main page with Ngelehun and child programe context + And you open the menu and click the "Download data..." button + Then the download dialog opens + Then the JSON button exists + + Scenario: The user cannot download the tracked entity working list when no orgUnit is selected + Given you open the main page with child programe context + And the user clicks the element containing the text: Or see all records accessible to you in Child Programme + And you open the menu + Then the "Download data..." button is hidden diff --git a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.js b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.js index 260e312422..0ea736c26a 100644 --- a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.js +++ b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.js @@ -1,4 +1,4 @@ -import { Given, When, Then, defineStep as And } from '@badeball/cypress-cucumber-preprocessor'; +import { defineStep as And, Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; import { v4 as uuid } from 'uuid'; import '../sharedSteps'; @@ -654,6 +654,25 @@ When('you remove the program stage filter', () => { .click(); }); +When('you open a tei from the working list', () => { + cy.get('[data-test="tei-working-lists"]') + .contains('Filona') + .click(); +}); + +When('you deselect the tracked entity from the context selector', () => { + cy.get('[data-test="person-selector-container-clear-icon"]') + .click(); +}); + +// the working list called completed enrollments should be selected +Then('the working list called completed enrollments should be selected', () => { + cy.get('[data-test="workinglist-template-selector-chip"]') + .contains('Completed enrollments') + .parent() + .should('have.class', 'selected'); +}); + Then('you see scheduledAt filter', () => { cy.get('[data-test="tei-working-lists"]') .contains('Appointment date') diff --git a/i18n/en.pot b/i18n/en.pot index c098e29ad6..9b56b6db68 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -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-09-02T11:08:16.281Z\n" -"PO-Revision-Date: 2024-09-02T11:08:16.281Z\n" +"POT-Creation-Date: 2024-10-10T14:29:59.249Z\n" +"PO-Revision-Date: 2024-10-10T14:29:59.249Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -1071,6 +1071,9 @@ msgstr "Create new event" msgid "Search for a {{trackedEntityName}} in {{programName}}" msgstr "Search for a {{trackedEntityName}} in {{programName}}" +msgid "Back to list" +msgstr "Back to list" + msgid "No tracked entity types available" msgstr "No tracked entity types available" diff --git a/src/core_modules/capture-core/components/Pages/MainPage/MainPage.container.js b/src/core_modules/capture-core/components/Pages/MainPage/MainPage.container.js index 52a10ab4e4..32ac19a65b 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/MainPage.container.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/MainPage.container.js @@ -1,7 +1,7 @@ // @flow -import React, { useEffect, useMemo, useCallback } from 'react'; +import React, { useCallback, useEffect, useMemo } from 'react'; // $FlowFixMe -import { connect, useSelector, shallowEqual, useDispatch } from 'react-redux'; +import { connect, shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { programCollection } from 'capture-core/metaDataMemoryStores/programCollection/programCollection'; import { MainPageComponent } from './MainPage.component'; @@ -68,9 +68,11 @@ const useMainPageStatus = ({ const useSelectorMainPage = () => useSelector( - ({ currentSelections, activePage }) => ({ + ({ currentSelections, activePage, workingListsTemplates, workingListsContext }) => ({ categories: currentSelections.categories, selectedCategories: currentSelections.categoriesMeta, + reduxSelectedTemplateId: workingListsTemplates.teiList?.selectedTemplateId, + workingListProgramId: workingListsContext.teiList?.programIdView, ready: !activePage.isLoading && !activePage.lockedSelectorLoads, error: activePage.selectionsError && activePage.selectionsError.error, }), @@ -103,6 +105,8 @@ const MainPageContainer = () => { const { categories, selectedCategories, + reduxSelectedTemplateId, + workingListProgramId, error, ready, } = useSelectorMainPage(); @@ -131,7 +135,18 @@ const MainPageContainer = () => { }, [showAllAccessible, dispatch]); useEffect(() => { - if (programId && trackedEntityTypeId && displayFrontPageList && selectedTemplateId === undefined) { + if (programId && trackedEntityTypeId && selectedTemplateId === undefined) { + if (reduxSelectedTemplateId && workingListProgramId === programId) { + handleChangeTemplateUrl({ + programId, + orgUnitId, + selectedTemplateId: reduxSelectedTemplateId, + showAllAccessible, + history, + }); + return; + } + if (!displayFrontPageList) return; handleChangeTemplateUrl({ programId, orgUnitId, @@ -148,6 +163,8 @@ const MainPageContainer = () => { trackedEntityTypeId, displayFrontPageList, history, + reduxSelectedTemplateId, + workingListProgramId, ]); return (