Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
Browse files Browse the repository at this point in the history
…ChangeCommentToNote
  • Loading branch information
henrikmv committed Jul 5, 2024
2 parents a3cd5ea + bb44911 commit 0b62005
Show file tree
Hide file tree
Showing 19 changed files with 572 additions and 521 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## [100.70.6](https://github.com/dhis2/capture-app/compare/v100.70.5...v100.70.6) (2024-07-05)


### Bug Fixes

* [DHIS2-16196] set MaxHeight to "more filters" in working lists ([#3696](https://github.com/dhis2/capture-app/issues/3696)) ([f3fdbd4](https://github.com/dhis2/capture-app/commit/f3fdbd483c54b88ff9f38f513ad6bc80b1e91a17))
* [DHIS2-16852] confusing-ui-when-there-is-more-than-one-warning ([#3702](https://github.com/dhis2/capture-app/issues/3702)) ([4920c04](https://github.com/dhis2/capture-app/commit/4920c041100465bfc51a8d121888e44c8bb27c82))

## [100.70.5](https://github.com/dhis2/capture-app/compare/v100.70.4...v100.70.5) (2024-07-04)


### Bug Fixes

* [DHIS2-17694] Edit button not showing on profile widget ([#3704](https://github.com/dhis2/capture-app/issues/3704)) ([d354da8](https://github.com/dhis2/capture-app/commit/d354da808f8a118ae95122bf2b20839fe1403931))

## [100.70.4](https://github.com/dhis2/capture-app/compare/v100.70.3...v100.70.4) (2024-07-03)


### Bug Fixes

* chrome crashes when opening applications-tab ([#3698](https://github.com/dhis2/capture-app/issues/3698)) ([da2fa7b](https://github.com/dhis2/capture-app/commit/da2fa7bba8fd5cac4a29237e0adad248340af9b2))

## [100.70.3](https://github.com/dhis2/capture-app/compare/v100.70.2...v100.70.3) (2024-07-03)


### Bug Fixes

* [DHIS2-17531] use new image endpoint in search tracked entity results ([#3673](https://github.com/dhis2/capture-app/issues/3673)) ([184ce8d](https://github.com/dhis2/capture-app/commit/184ce8dfee8788e20e2c357e4bf1eaf371a496f6))

## [100.70.2](https://github.com/dhis2/capture-app/compare/v100.70.1...v100.70.2) (2024-07-03)


Expand Down
10 changes: 5 additions & 5 deletions cypress/support/step_definitions/common/baseSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,21 @@ When(/^the user selects the org unit (.*)$/, (orgUnit) => {

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="opt-in"]').length > 0) {
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="dhis2-uicore-button"]', 'Yes, opt in').click();
cy.contains('[data-test="dhis2-uicore-button"]', `Opt out for ${program}`);
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="dhis2-uicore-button"]', `Opt out 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="dhis2-uicore-button"]', `Opt out for ${program}`).click();
cy.contains('[data-test="opt-out-button"]', `Opt out for ${program}`).click();
cy.wait('@optOutEnrollmentDashboard', { timeout: 30000 });
});

Expand Down
7 changes: 5 additions & 2 deletions i18n/ru.po
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
#
# Translators:
# Ulanbek Abakirov <ulans@mail.ru>, 2020
# Wanda <wanda@frontlineaids.org>, 2021
# Viktor Varland <viktor@dhis2.org>, 2023
# Philip Larsen Donnelly, 2024
# Yury Rogachev <yury@dhis2.org>, 2024
#
#
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
Expand All @@ -22,6 +22,9 @@ msgstr ""
msgid "Choose one or more dates..."
msgstr "Выбрать одну или несколько дат..."

msgid "Clear selections"
msgstr "Очистить выбор"

msgid "Choose a date..."
msgstr "Выбрать дату..."

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "capture-app",
"homepage": ".",
"version": "100.70.2",
"version": "100.70.6",
"cacheVersion": "7",
"serverVersion": "38",
"license": "BSD-3-Clause",
Expand All @@ -10,15 +10,15 @@
"packages/rules-engine"
],
"dependencies": {
"@dhis2/rules-engine-javascript": "100.70.2",
"@dhis2/rules-engine-javascript": "100.70.6",
"@dhis2/app-runtime": "^3.9.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-icons": "^1.0.1",
"@dhis2/d2-ui-app": "^2.0.0",
"@dhis2/d2-ui-org-unit-tree": "^7.3.3",
"@dhis2/d2-ui-rich-text": "^7.4.0",
"@dhis2/d2-ui-sharing-dialog": "^7.3.3",
"@dhis2/ui": "^9.1.1",
"@dhis2/ui": "^9.10.1",
"@joakim_sm/react-infinite-calendar": "^2.4.2",
"@material-ui/core": "3.9.4",
"@material-ui/icons": "3",
Expand Down Expand Up @@ -135,7 +135,7 @@
"@dhis2/app-runtime": "^3.10.2",
"react-scripts": "4.0.3",
"@babel/preset-react": "7.16.7",
"@dhis2/ui": "^9.1.1",
"@dhis2/ui": "^9.10.1",
"@js-temporal/polyfill": "0.4.3",
"core-js": "2.5.7",
"i18next": "^20.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/rules-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/rules-engine-javascript",
"version": "100.70.2",
"version": "100.70.6",
"license": "BSD-3-Clause",
"main": "./build/cjs/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{
"src": "favicon.ico",
"sizes": "48x48",
"type": "image/png"
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import isObject from 'd2-utilizr/lib/isObject';
const styles = (theme: Theme) => ({
base: {
paddingTop: 10,
marginLeft: 0,
paddingLeft: 0,
},
error: {
color: colors.red600,
Expand Down Expand Up @@ -35,6 +37,9 @@ const styles = (theme: Theme) => ({
marginTop: 1,
marginRight: 4,
},
listItem: {
listStylePosition: 'inside',
},
});

const messageTypes = {
Expand All @@ -57,6 +62,7 @@ type Props = {
validating: string,
validatingContainer: string,
validatingIndicator: string,
listItem: string
}
};

Expand All @@ -67,7 +73,7 @@ type MessageContainer = {

const getDisplayMessagesHOC = (InnerComponent: React.ComponentType<any>) =>
class DisplayMessagesHOC extends React.Component<Props> {
static createMessageElement(text, baseClass, messageClass, validatorClasses, type) {
static createMessageElement(text, baseClass, messageClass, validatorClasses, listItemClass, type) {
if (type === messageTypes.validating) {
return (
<div
Expand All @@ -92,16 +98,16 @@ const getDisplayMessagesHOC = (InnerComponent: React.ComponentType<any>) =>
}

return (
<div
<ul
data-test="error-message"
className={classNames(baseClass, messageClass)}
>
{Array.isArray(text) ? text?.map(message => (
<span>
<li className={listItemClass}>
{message}<br />
</span>
</li>
)) : text}
</div>
</ul>
);
}

Expand All @@ -113,6 +119,7 @@ const getDisplayMessagesHOC = (InnerComponent: React.ComponentType<any>) =>
}

const { classes } = this.props;

return {
element: DisplayMessagesHOC.createMessageElement(
message,
Expand All @@ -122,6 +129,7 @@ const getDisplayMessagesHOC = (InnerComponent: React.ComponentType<any>) =>
container: classes.validatingContainer,
indicator: classes.validatingIndicator,
},
classes.listItem,
messageType,
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const getStyles = (theme: Theme) => ({
textTransform: 'none',
},
menuPaper: {
maxHeight: 30,
maxHeight: 280,
overflowY: 'auto',
},
menuItemRoot: {
padding: 6,
Expand Down Expand Up @@ -184,7 +185,7 @@ class FilterRestMenuPlain extends React.Component<Props, State> {
style={{ transformOrigin: '0 0 0' }}
timeout={{ exit: 0, enter: 200 }}
>
<Paper>
<Paper className={classes.menuPaper}>
<MenuList role="menu">
{this.renderMenuItems()}
</MenuList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const TopBar = ({
title={trackedEntityName}
displayOnly
/>
{enrollmentsAsOptions?.length > 0 && (
{enrollmentsAsOptions?.length > 0 ? (
<SingleLockedSelect
ready
onClear={() => resetEnrollmentId()}
Expand All @@ -74,7 +74,7 @@ export const TopBar = ({
selectedValue={enrollmentId}
title={i18n.t('Enrollment')}
/>
)}
) : <></>}
<TopBarActions selectedProgramId={programId} selectedOrgUnitId={orgUnitId} />
</ScopeSelector>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const TopBar = ({
onStartAgain={() => reset()}
formIsOpen={formIsOpen}
>
{teiId && (
{teiId ? (
<SingleLockedSelect
displayOnly
ready={Boolean(trackedEntityName && teiDisplayName)}
Expand All @@ -97,7 +97,7 @@ export const TopBar = ({
title={trackedEntityName}
isUserInteractionInProgress={isUserInteractionInProgress}
/>
)}
) : <></>}
<TopBarActions
selectedProgramId={programId}
selectedOrgUnitId={orgUnitId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const searchTei = ({
getTrackerProgram(selectedProgramId).attributes :
getTrackedEntityType(selectedTrackedEntityTypeId).attributes;

return from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource)).pipe(
return from(
getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource, selectedProgramId),
).pipe(
map(({ trackedEntityInstanceContainers, pagingData }) =>
searchTeiResultRetrieved(
{ trackedEntityInstanceContainers, currentPage: pagingData.currentPage },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ export const loadSearchGroupDuplicatesForReviewEpic = (
...contextParam,
};
const attributes = getAttributesFromScopeId(selectedScopeId);
const programId = scopeType === scopeTypes.TRACKER_PROGRAM ? selectedScopeId : null;

const stream$: Stream = from(
getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource),
getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource, programId),
);
return stream$.pipe(
map(({ trackedEntityInstanceContainers: searchResults, pagingData }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const searchViaUniqueIdStream = ({
absoluteApiPath: string,
querySingleResource: QuerySingleResource,
}) =>
from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource)).pipe(
from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource, programId)).pipe(
flatMap(({ trackedEntityInstanceContainers }) => {
const searchResults = trackedEntityInstanceContainers;
if (searchResults.length > 0) {
Expand Down Expand Up @@ -92,8 +92,22 @@ const handleErrors = ({ httpStatusCode, message }) => {
return of(showErrorViewOnSearchBox());
};

const searchViaAttributesStream = ({ queryArgs, attributes, triggeredFrom, absoluteApiPath, querySingleResource }) =>
from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource)).pipe(
const searchViaAttributesStream = ({
queryArgs,
attributes,
triggeredFrom,
absoluteApiPath,
querySingleResource,
programId,
}: {
queryArgs: any,
attributes: any,
triggeredFrom: string,
absoluteApiPath: string,
querySingleResource: QuerySingleResource,
programId?: string,
}) =>
from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource, programId)).pipe(
map(({ trackedEntityInstanceContainers: searchResults, pagingData }) => {
if (searchResults.length > 0) {
return showSuccessResultsViewOnSearchBox(
Expand Down Expand Up @@ -204,6 +218,7 @@ export const searchViaAttributesOnScopeProgramEpic = (
triggeredFrom,
absoluteApiPath,
querySingleResource,
programId,
});
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const searchTei = ({
getTrackerProgram(selectedProgramId).attributes :
getTrackedEntityType(selectedTrackedEntityTypeId).attributes;

return from(getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource)).pipe(
return from(
getTrackedEntityInstances(queryArgs, attributes, absoluteApiPath, querySingleResource, selectedProgramId),
).pipe(
map(({ trackedEntityInstanceContainers, pagingData }) =>
searchTeiResultRetrieved(
{ trackedEntityInstanceContainers, currentPage: pagingData.currentPage },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const useContainsAutoGeneratedEvent = program =>

const useCanAddNew = (enrollments, programId, tetAccess) =>
useMemo(
() => tetAccess?.write &&
() => tetAccess?.data?.write &&
enrollments
.filter(item => item.program === programId)
.every(item => item.status !== plainStatus.ACTIVE),
[enrollments, programId, tetAccess?.write],
[enrollments, programId, tetAccess],
);

const useEnrollmentEvents = externalData => useMemo(() => externalData.events || [], [externalData]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const WidgetProfilePlain = ({
} = useUserRoles();

const isEditable = useMemo(() =>
trackedEntityInstanceAttributes.length > 0 && trackedEntityTypeAccess.write && !readOnlyMode,
trackedEntityInstanceAttributes.length > 0 && trackedEntityTypeAccess?.data?.write && !readOnlyMode,
[trackedEntityInstanceAttributes, readOnlyMode, trackedEntityTypeAccess]);

const loading = programsLoading || trackedEntityInstancesLoading || userRolesLoading;
Expand Down
Loading

0 comments on commit 0b62005

Please sign in to comment.