Skip to content

Commit

Permalink
feat: do not link
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed Nov 4, 2023
1 parent e9ae4bd commit 225f84e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
11 changes: 9 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: 2023-11-04T14:23:15.511Z\n"
"PO-Revision-Date: 2023-11-04T14:23:15.511Z\n"
"POT-Creation-Date: 2023-11-04T15:34:51.698Z\n"
"PO-Revision-Date: 2023-11-04T15:34:51.698Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -1348,6 +1348,13 @@ msgstr ""
"Enter {{referralProgramStageLabel}} details in the next step after "
"completing this {{currentStageLabel}}."

msgid ""
"This {{currentStageLabel}} will be created without a link to "
"{{referralProgramStageLabel}}"
msgstr ""
"This {{currentStageLabel}} will be created without a link to "
"{{referralProgramStageLabel}}"

msgid "Schedule in {{displayName}}"
msgstr "Schedule in {{displayName}}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ const getEventDetailsByReferralMode = ({
referralEvent: null,
linkedEventId,
};
} else if (referralMode === ReferralModes.DO_NOT_LINK_RESPONSE) {
return {
referralEvent: null,
linkedEventId: null,
};
}

log.error(errorCreator(`Referral mode ${referralMode} is not supported`)());
Expand Down Expand Up @@ -85,7 +90,7 @@ export const getConvertedReferralEvent = ({
clientRequestEvent,
});

const relationship = {
const relationship = linkedEventId && {
relationshipType: referralType.id,
from: {
event: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import React, { type ComponentType, useMemo } from 'react';
import i18n from '@dhis2/d2-i18n';
import { Radio, colors, spacers, spacersNum, IconInfo16 } from '@dhis2/ui';
import { Radio, colors, spacers, spacersNum, IconInfo16, IconWarning16 } from '@dhis2/ui';
import { withStyles } from '@material-ui/core';
import { actions as ReferralActionTypes, mainOptionTranslatedTexts, referralStatus } from '../constants';
import { DataSection } from '../../DataSection';
Expand Down Expand Up @@ -106,10 +106,13 @@ export const ReferralActionsPlain = ({
className={classes.infoBox}
>
<IconInfo16 />
{i18n.t('Enter {{referralProgramStageLabel}} details in the next step after completing this {{currentStageLabel}}.', {
referralProgramStageLabel: programStage.stageForm.name,
currentStageLabel,
})}
{i18n.t(
'Enter {{referralProgramStageLabel}} details in the next step after completing this {{currentStageLabel}}.',
{
referralProgramStageLabel: programStage.stageForm.name,
currentStageLabel,
},
)}
</div>
)}

Expand All @@ -122,6 +125,21 @@ export const ReferralActionsPlain = ({
{...passOnProps}
/>
)}

{selectedAction === ReferralActionTypes.DO_NOT_LINK_RESPONSE && (
<div
className={classes.infoBox}
>
<IconWarning16 />
{i18n.t(
'This {{currentStageLabel}} will be created without a link to {{referralProgramStageLabel}}',
{
referralProgramStageLabel: programStage.stageForm.name,
currentStageLabel,
},
)}
</div>
)}
</DataSection>);
};

Expand Down

0 comments on commit 225f84e

Please sign in to comment.