Skip to content

Commit

Permalink
chore(release): stop support for 2.38
Browse files Browse the repository at this point in the history
To keep a manageable codebase, we have decided to support only the same version range as the backend. However, in contrast to the backend, we will release new features for all the supported versions as long as we have the backend support.

BREAKING CHANGE: Bump version to 101.0.0 to facilitate potential fixes for 2.38
  • Loading branch information
JoakimSM committed Aug 12, 2024
1 parent bae6e7a commit 4ee2767
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion d2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
type: 'app',

id: '92b75fd0-34cc-451c-942f-3dd0f283bcbd',
minDHIS2Version: '2.38',
minDHIS2Version: '2.39',
coreApp: true,

entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
export const FEATURES = Object.freeze({
programStageWorkingList: 'programStageWorkingList',
storeProgramStageWorkingList: 'storeProgramStageWorkingList',
multiText: 'multiText',
customIcons: 'customIcons',
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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]);
};

0 comments on commit 4ee2767

Please sign in to comment.