diff --git a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature index e21de7e069..bdefbaa55c 100644 --- a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature +++ b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature @@ -60,8 +60,7 @@ Feature: User interacts with Stages and Events Widget Given you open the enrollment page by typing #enrollment?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8 Then you should see the disabled button New Birth event - # Waiting for pipline to update DB/DB update for 39 and 41 - @user:trackerAutoTestRestricted @v=38 @v=40 @v=42 + @user:trackerAutoTestRestricted Scenario: Program stage is hidden if no data read access And you open the enrollment page by typing #enrollment?enrollmentId=iNEq9d22Nyp&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=k4ODejBytgv Then the Care at birth program stage should be hidden diff --git a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature index af604635ee..a80e857fcd 100644 --- a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature +++ b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiWorkingListsUser/TeiWorkingListsUser.feature @@ -131,7 +131,6 @@ Then the new My custom list is created When you delete the name My custom list Then the My custom list is deleted -@v>=39 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 @@ -141,7 +140,6 @@ 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 -@v>=39 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 @@ -154,7 +152,6 @@ And you set the WHOMCH Smoking filter to No And you apply the current filter Then the list should display 1 row of data -@v>=39 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 @@ -166,7 +163,6 @@ 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 -@v>=39 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 @@ -176,7 +172,6 @@ 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 -@v>=39 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 @@ -189,20 +184,17 @@ And you select the events scheduled today And you apply the current filter Then you see the selected option in the scheduledAt filter -@v>=39 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 -@v>=39 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 -@v>=39 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 diff --git a/d2.config.js b/d2.config.js index 300d6a336b..e909aff221 100644 --- a/d2.config.js +++ b/d2.config.js @@ -4,7 +4,7 @@ const config = { type: 'app', id: '92b75fd0-34cc-451c-942f-3dd0f283bcbd', - minDHIS2Version: '2.38', + minDHIS2Version: '2.39', coreApp: true, entryPoints: { diff --git a/src/core_modules/capture-core-utils/featuresSupport/support.js b/src/core_modules/capture-core-utils/featuresSupport/support.js index 682ec6dd01..637439c74b 100644 --- a/src/core_modules/capture-core-utils/featuresSupport/support.js +++ b/src/core_modules/capture-core-utils/featuresSupport/support.js @@ -1,6 +1,5 @@ // @flow export const FEATURES = Object.freeze({ - programStageWorkingList: 'programStageWorkingList', storeProgramStageWorkingList: 'storeProgramStageWorkingList', multiText: 'multiText', customIcons: 'customIcons', @@ -14,7 +13,6 @@ export const FEATURES = Object.freeze({ // The first minor version that supports the feature const MINOR_VERSION_SUPPORT = Object.freeze({ - [FEATURES.programStageWorkingList]: 39, [FEATURES.storeProgramStageWorkingList]: 40, [FEATURES.multiText]: 41, [FEATURES.customIcons]: 41, diff --git a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/Setup/hooks/useProgramStageFilters.js b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/Setup/hooks/useProgramStageFilters.js index fe9fbe9622..d17f1be4b1 100644 --- a/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/Setup/hooks/useProgramStageFilters.js +++ b/src/core_modules/capture-core/components/WorkingLists/TeiWorkingLists/Setup/hooks/useProgramStageFilters.js @@ -1,7 +1,6 @@ // @flow import { useMemo } from 'react'; import i18n from '@dhis2/d2-i18n'; -import { useFeature, FEATURES } from 'capture-core-utils'; import { statusTypes, translatedStatusTypes } from 'capture-core/events/statusTypes'; import { type TrackerProgram, type ProgramStage } from '../../../../../metaData'; import { ADDITIONAL_FILTERS, ADDITIONAL_FILTERS_LABELS } from '../../helpers'; @@ -34,94 +33,90 @@ const useProgramStageDropdowOptions = stages => ); export const useProgramStageFilters = ({ stages }: TrackerProgram, programStageId?: string) => { - const supportsProgramStageWorkingLists = useFeature(FEATURES.programStageWorkingList); const { hideDueDate, occurredAtLabel, scheduledAtLabel } = useProgramStageData(programStageId, stages); const options: Array<{ text: string, value: string }> = useProgramStageDropdowOptions(stages); return useMemo(() => { - if (supportsProgramStageWorkingLists) { - const translatedStatus = translatedStatusTypes(); - return [ - { - id: ADDITIONAL_FILTERS.programStage, - type: 'TEXT', - header: i18n.t(ADDITIONAL_FILTERS_LABELS.programStage), - options, - mainButton: true, - transformRecordsFilter: () => null, + const translatedStatus = translatedStatusTypes(); + return [ + { + id: ADDITIONAL_FILTERS.programStage, + type: 'TEXT', + header: i18n.t(ADDITIONAL_FILTERS_LABELS.programStage), + options, + mainButton: true, + transformRecordsFilter: () => null, + }, + { + id: ADDITIONAL_FILTERS.occurredAt, + type: 'DATE', + header: occurredAtLabel, + disabled: !programStageId, + tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { + label: occurredAtLabel, + interpolation: { escapeValue: false }, + }), + transformRecordsFilter: (filter: string) => { + const queryArgs = {}; + const filterParts = filter.split(':'); + const indexGe = filterParts.indexOf('ge'); + const indexLe = filterParts.indexOf('le'); + if (indexGe !== -1 && filterParts[indexGe + 1]) { + queryArgs.occurredAfter = filterParts[indexGe + 1]; + } + if (indexLe !== -1 && filterParts[indexLe + 1]) { + queryArgs.occurredBefore = filterParts[indexLe + 1]; + } + return queryArgs; }, - { - id: ADDITIONAL_FILTERS.occurredAt, - type: 'DATE', - header: occurredAtLabel, - disabled: !programStageId, - tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { - label: occurredAtLabel, - interpolation: { escapeValue: false }, - }), - transformRecordsFilter: (filter: string) => { - const queryArgs = {}; - const filterParts = filter.split(':'); - const indexGe = filterParts.indexOf('ge'); - const indexLe = filterParts.indexOf('le'); - if (indexGe !== -1 && filterParts[indexGe + 1]) { - queryArgs.occurredAfter = filterParts[indexGe + 1]; - } - if (indexLe !== -1 && filterParts[indexLe + 1]) { - queryArgs.occurredBefore = filterParts[indexLe + 1]; - } - return queryArgs; - }, - }, - { - id: ADDITIONAL_FILTERS.status, - type: 'TEXT', - header: i18n.t(ADDITIONAL_FILTERS_LABELS.status), - options: [ - { text: translatedStatus.ACTIVE, value: statusTypes.ACTIVE }, - { text: translatedStatus.SCHEDULE, value: statusTypes.SCHEDULE }, - { text: translatedStatus.COMPLETED, value: statusTypes.COMPLETED }, - { text: translatedStatus.OVERDUE, value: statusTypes.OVERDUE }, - { text: translatedStatus.SKIPPED, value: statusTypes.SKIPPED }, - ], - disabled: !programStageId, - tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { - label: ADDITIONAL_FILTERS_LABELS.status, - interpolation: { escapeValue: false }, - }), - transformRecordsFilter: (rawFilter: string) => ({ - status: rawFilter.split(':')[1], - }), - }, - ...(hideDueDate === false - ? [ - { - id: ADDITIONAL_FILTERS.scheduledAt, - type: 'DATE', - header: scheduledAtLabel, - disabled: !programStageId, - tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { - label: scheduledAtLabel, - interpolation: { escapeValue: false }, - }), - transformRecordsFilter: (filter: string) => { - const queryArgs = {}; - const filterParts = filter.split(':'); - const indexGe = filterParts.indexOf('ge'); - const indexLe = filterParts.indexOf('le'); - if (indexGe !== -1 && filterParts[indexGe + 1]) { - queryArgs.scheduledAfter = filterParts[indexGe + 1]; - } - if (indexLe !== -1 && filterParts[indexLe + 1]) { - queryArgs.scheduledBefore = filterParts[indexLe + 1]; - } - return queryArgs; - }, + }, + { + id: ADDITIONAL_FILTERS.status, + type: 'TEXT', + header: i18n.t(ADDITIONAL_FILTERS_LABELS.status), + options: [ + { text: translatedStatus.ACTIVE, value: statusTypes.ACTIVE }, + { text: translatedStatus.SCHEDULE, value: statusTypes.SCHEDULE }, + { text: translatedStatus.COMPLETED, value: statusTypes.COMPLETED }, + { text: translatedStatus.OVERDUE, value: statusTypes.OVERDUE }, + { text: translatedStatus.SKIPPED, value: statusTypes.SKIPPED }, + ], + disabled: !programStageId, + tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { + label: ADDITIONAL_FILTERS_LABELS.status, + interpolation: { escapeValue: false }, + }), + transformRecordsFilter: (rawFilter: string) => ({ + status: rawFilter.split(':')[1], + }), + }, + ...(hideDueDate === false + ? [ + { + id: ADDITIONAL_FILTERS.scheduledAt, + type: 'DATE', + header: scheduledAtLabel, + disabled: !programStageId, + tooltipContent: i18n.t('Choose a program stage to filter by {{label}}', { + label: scheduledAtLabel, + interpolation: { escapeValue: false }, + }), + transformRecordsFilter: (filter: string) => { + const queryArgs = {}; + const filterParts = filter.split(':'); + const indexGe = filterParts.indexOf('ge'); + const indexLe = filterParts.indexOf('le'); + if (indexGe !== -1 && filterParts[indexGe + 1]) { + queryArgs.scheduledAfter = filterParts[indexGe + 1]; + } + if (indexLe !== -1 && filterParts[indexLe + 1]) { + queryArgs.scheduledBefore = filterParts[indexLe + 1]; + } + return queryArgs; }, - ] - : []), - ]; - } - return []; - }, [programStageId, supportsProgramStageWorkingLists, occurredAtLabel, scheduledAtLabel, hideDueDate, options]); + }, + ] + : []), + ]; + }, [programStageId, occurredAtLabel, scheduledAtLabel, hideDueDate, options]); };