Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dhis2/capture-app into hv…
Browse files Browse the repository at this point in the history
…/feat/DHIS2-17991_ShowOrgUnitSelectorInEnterDetailsNow
  • Loading branch information
henrikmv committed Oct 18, 2024
2 parents 9eb051f + fba5ecb commit 51c55f8
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 17 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## [101.12.1](https://github.com/dhis2/capture-app/compare/v101.12.0...v101.12.1) (2024-10-16)


### Bug Fixes

* [DHIS2-17978] use title instead of alt on missing icons ([#3847](https://github.com/dhis2/capture-app/issues/3847)) ([b5940f2](https://github.com/dhis2/capture-app/commit/b5940f21204cf26afce6c28ba88b50c09728265f))

# [101.12.0](https://github.com/dhis2/capture-app/compare/v101.11.2...v101.12.0) (2024-10-15)


### Features

* [DHIS2-17956] Display name for org unit in changelog ([#3826](https://github.com/dhis2/capture-app/issues/3826)) ([5299f37](https://github.com/dhis2/capture-app/commit/5299f37d33448616c0074ec6568a82c9c96f65cb))

## [101.11.2](https://github.com/dhis2/capture-app/compare/v101.11.1...v101.11.2) (2024-10-15)


### Bug Fixes

* [DHIS2-18056] use linkedEntityFormFoundation instead of the searchFormFoundation ([#3835](https://github.com/dhis2/capture-app/issues/3835)) ([cbfe70b](https://github.com/dhis2/capture-app/commit/cbfe70b850554678c7a8bad40e0874ea227fe65c))

## [101.11.1](https://github.com/dhis2/capture-app/compare/v101.11.0...v101.11.1) (2024-10-15)


### Bug Fixes

* [DHIS2-16993] Text and long text DEs are missing arrows in changelog when deleted ([#3827](https://github.com/dhis2/capture-app/issues/3827)) ([5e6dfa6](https://github.com/dhis2/capture-app/commit/5e6dfa6bb4b82a68305741bd4bb672a5a1af8f5f))

# [101.11.0](https://github.com/dhis2/capture-app/compare/v101.10.2...v101.11.0) (2024-10-14)


Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/MainPage/MainPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, Then, defineStep as And } from '@badeball/cypress-cucumber-preprocessor';
import { defineStep as And, Given, Then } from '@badeball/cypress-cucumber-preprocessor';

Given('you are in the search page with Ngelehun and MNCH PNC context', () => {
cy.visit('/#/search?orgUnitId=DiszpKrYNg8&programId=uy2gU8kT1jF');
Expand All @@ -20,13 +20,13 @@ And('you can load the view with the name Events assigned to me', () => {
});

Then('the icon is rendered as a custom icon', () => {
cy.get('[alt="child_program_positive"]')
cy.get('[title="child_program_positive"]')
.invoke('attr', 'src')
.should('match', /\/icons\/child_program_positive\/icon$/);
});

Then('the icon is rendered as an svg', () => {
cy.get('[alt="child_program_positive"]')
cy.get('[title="child_program_positive"]')
.invoke('attr', 'src')
.should('match', /\/icons\/child_program_positive\/icon.svg$/);
});
Expand Down
4 changes: 2 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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-10-14T16:39:37.437Z\n"
"PO-Revision-Date: 2024-10-14T16:39:37.437Z\n"
"POT-Creation-Date: 2024-10-14T14:53:34.553Z\n"
"PO-Revision-Date: 2024-10-14T14:53:34.553Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "capture-app",
"homepage": ".",
"version": "101.11.0",
"version": "101.12.1",
"cacheVersion": "7",
"serverVersion": "38",
"license": "BSD-3-Clause",
Expand All @@ -10,7 +10,7 @@
"packages/rules-engine"
],
"dependencies": {
"@dhis2/rules-engine-javascript": "101.11.0",
"@dhis2/rules-engine-javascript": "101.12.1",
"@dhis2/app-runtime": "^3.9.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-icons": "^1.0.1",
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": "101.11.0",
"version": "101.12.1",
"license": "BSD-3-Clause",
"main": "./build/cjs/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { makeAttributesSelector } from './teiRelationshipSearchResults.selectors
import { CardList } from '../../../../CardList';
import type { CurrentSearchTerms } from '../../../../SearchBox';
import { SearchResultsHeader } from '../../../../SearchResultsHeader';
import { type SearchGroup } from '../../../../../metaData';
import {
type SearchGroup,
getTrackerProgramThrowIfNotFound,
getTrackedEntityTypeThrowIfNotFound,
} from '../../../../../metaData';
import { ResultsPageSizeContext } from '../../../shared-contexts';
import type { ListItem } from '../../../../CardList/CardList.types';
import { convertClientValuesToServer } from '../../../../../converters/helpers/clientToServer';
Expand All @@ -25,7 +29,8 @@ type Props = {|
currentPage: number,
searchGroup: SearchGroup,
searchValues: any,
selectedProgramId: string,
selectedProgramId?: string,
selectedTrackedEntityTypeId: string,
teis: Array<ListItem>,
trackedEntityTypeName: string,
...CssClasses
Expand Down Expand Up @@ -60,6 +65,15 @@ const getStyles = (theme: Theme) => ({
},
});

const getLinkedEntityFormFoundation = (selectedProgramId, selectedTrackedEntityTypeId) => {
if (selectedProgramId) {
const program = getTrackerProgramThrowIfNotFound(selectedProgramId);
return program.enrollment.enrollmentForm;
}
const trackedEntityType = getTrackedEntityTypeThrowIfNotFound(selectedTrackedEntityTypeId);
return trackedEntityType.teiRegistration.form;
};

const CardListButton = ({ handleOnClick, teiId }) => (
<Button
small
Expand All @@ -78,7 +92,11 @@ class TeiRelationshipSearchResultsPlain extends React.Component<Props> {
}

onAddRelationship = (item) => {
const serverValues = convertClientValuesToServer(item.values, this.props.searchGroup.searchForm);
const linkedEntityFormFoundation = getLinkedEntityFormFoundation(
this.props.selectedProgramId,
this.props.selectedTrackedEntityTypeId,
);
const serverValues = convertClientValuesToServer(item.values, linkedEntityFormFoundation);
this.props.onAddRelationship(item.id, serverValues);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const styles = {
const Updated = ({ previousValue, currentValue, classes }) => (
<div className={classes.container}>
<span className={classes.previousValue}>{previousValue}</span>
<IconArrowRight16 />
<span><IconArrowRight16 /></span>
<span className={classes.currentValue}>{currentValue}</span>
</div>
);
Expand All @@ -50,7 +50,7 @@ const Created = ({ currentValue, classes }) => (
const Deleted = ({ previousValue, classes }) => (
<div className={classes.container}>
<span className={classes.previousValue}>{previousValue}</span>
<IconArrowRight16 />
<span><IconArrowRight16 /></span>
<Tag negative>{i18n.t('Deleted')}</Tag>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/core_modules/capture-core/converters/clientToList.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type ImageClientValue = {
previewUrl: string,
};


function convertFileForDisplay(clientValue: FileClientValue) {
// Fallback until https://dhis2.atlassian.net/browse/DHIS2-16994 is implemented
if (typeof clientValue === 'string' || clientValue instanceof String) {
Expand Down Expand Up @@ -88,9 +87,10 @@ function convertStatusForDisplay(clientValue: Object) {
);
}

function convertOrgUnitForDisplay(clientValue: { id: string }) {
function convertOrgUnitForDisplay(clientValue: string | {id: string}) {
const orgUnitId = typeof clientValue === 'string' ? clientValue : clientValue.id;
return (
<TooltipOrgUnit orgUnitId={clientValue.id} />
<TooltipOrgUnit orgUnitId={orgUnitId} />
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const NonBundledIcon = ({
<img
className={classes.image}
src={source}
alt={alternativeText}
title={alternativeText}
// add empty alt to avoid screen readers reading the url
alt={''}
/>
)
}
Expand Down

0 comments on commit 51c55f8

Please sign in to comment.