Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [DHIS2-17956] Display name for org unit in changelog #3826

Merged
merged 12 commits into from
Oct 15, 2024
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 | Object) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: improve the flow type clientValue: string | {id: string}

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

Expand Down
Loading