Skip to content

Commit

Permalink
chore: replace refferal word
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Nov 5, 2024
1 parent ba1eab7 commit f8ece37
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 34 deletions.
14 changes: 4 additions & 10 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-25T18:18:11.518Z\n"
"PO-Revision-Date: 2024-10-25T18:18:11.518Z\n"
"POT-Creation-Date: 2024-11-05T09:50:50.070Z\n"
"PO-Revision-Date: 2024-11-05T09:50:50.070Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -1493,26 +1493,20 @@ msgstr "{{ scheduledEvents }} scheduled"
msgid "Stages and Events"
msgstr "Stages and Events"

msgid "Referral details"
msgstr "Referral details"

msgid "View linked event"
msgstr "View linked event"

msgid "An error occurred while loading the widget."
msgstr "An error occurred while loading the widget."

msgid "Refferal response"
msgstr "Refferal response"

msgid "Linked event"
msgstr "Linked event"

msgid ""
"This refferal response event is linked to a Refferal details event. Review "
"This {{stageName}} event is linked to a {{linkedStageName}} event. Review "
"the linked event details before entering data below"
msgstr ""
"This refferal response event is linked to a Refferal details event. Review "
"This {{stageName}} event is linked to a {{linkedStageName}} event. Review "
"the linked event details before entering data below"

msgid "Scheduled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ type DefaultComponents = 'QuickActions'
| 'AssigneeWidget'
| 'NewEventWorkspace'
| 'EditEventWorkspace'
| 'TwoEventWorkspace'
| 'EnrollmentNote'
| 'EventNote'
| 'TrackedEntityRelationship'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const WidgetEventEditPlain = ({
programId={programId}
orgUnitId={orgUnitId}
stageId={stageId}
stage={stage}
/>
<div data-test="widget-enrollment-event">
<Widget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { EnrollmentPageKeys }
from '../../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants';
import { NonBundledDhis2Icon } from '../../NonBundledDhis2Icon';
import type { PlainProps, Props } from './WidgetHeader.types';
import { WidgetTwoEventWorkspaceWrapperTypes } from '../index';

const styles = {
menu: {
Expand All @@ -21,20 +20,11 @@ const styles = {
},
};

const getTitle = ({ type, stage }) => {
if (type === WidgetTwoEventWorkspaceWrapperTypes.EDIT_EVENT) {
return i18n.t('Referral details');
}

return stage.name;
};

const WidgetHeaderPlain = ({ stage, linkedEvent, orgUnitId, currentPage, type, classes }: Props) => {
const WidgetHeaderPlain = ({ linkedStage, linkedEvent, orgUnitId, currentPage, classes }: Props) => {
const [actionsIsOpen, setActionsIsOpen] = useState(false);
const { push } = useHistory();
const { icon } = stage;
const title = getTitle({ type, stage });

const { icon } = linkedStage;
return (
<>
{icon && (
Expand All @@ -48,7 +38,7 @@ const WidgetHeaderPlain = ({ stage, linkedEvent, orgUnitId, currentPage, type, c
/>
</div>
)}
<span> {title} </span>
<span> {linkedStage.name} </span>
{currentPage === EnrollmentPageKeys.VIEW_EVENT && (
<div className={classes.menu}>
<OverflowButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
import { EnrollmentPageKeys }
from '../../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants';
import type { ProgramStage } from '../../../metaData';
import { WidgetTwoEventWorkspaceWrapperTypes } from '../index';

export type PlainProps = {|
orgUnitId: string,
linkedEvent: { event: string },
stage: ProgramStage,
linkedStage: ProgramStage,
currentPage: $Values<typeof EnrollmentPageKeys> | string,
type?: $Values<typeof WidgetTwoEventWorkspaceWrapperTypes>,
|};

export type Props = {|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const WidgetTwoEventWorkspace = ({
programId,
orgUnitId,
currentPage,
stage,
type,
}: Props) => {
const {
Expand All @@ -26,7 +27,7 @@ export const WidgetTwoEventWorkspace = ({

const {
formFoundation,
stage,
stage: linkedStage,
isLoading: isLoadingMetadata,
isError: isMetadataError,
} = useMetadataForProgramStage({
Expand Down Expand Up @@ -56,22 +57,23 @@ export const WidgetTwoEventWorkspace = ({
);
}

if (!linkedEvent || !formFoundation || !stage) {
if (!linkedEvent || !formFoundation || !linkedStage) {
return null;
}

return (
<WidgetWrapper
type={type}
stage={stage}
linkedStage={linkedStage}
widget={
<Widget
header={
<WidgetHeader
stage={stage}
linkedStage={linkedStage}
linkedEvent={linkedEvent}
orgUnitId={orgUnitId}
currentPage={currentPage}
type={type}
/>
}
noncollapsible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import {
EnrollmentPageKeys,
} from '../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants';
import { WidgetTwoEventWorkspaceWrapperTypes } from './index';
import type { ProgramStage } from '../../metaData';

export type Props = {|
programId: string,
eventId: string,
orgUnitId: string,
stageId: string,
currentPage: $Values<typeof EnrollmentPageKeys> | string,
stage?: ProgramStage,
type?: $Values<typeof WidgetTwoEventWorkspaceWrapperTypes>,
|}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const styles = {
},
};

const WidgetWrapperPlain = ({ widget, type, classes }: Props) => {
const WidgetWrapperPlain = ({ widget, type, stage, linkedStage, classes }: Props) => {
if (type === WidgetTwoEventWorkspaceWrapperTypes.EDIT_EVENT) {
return (
<div className={classes.container}>
<div className={classes.header}> {i18n.t('Refferal response')} </div>
<div className={classes.header}> {stage?.name} </div>
<div className={classes.referalResponse}>
<div className={classes.linkedEvent}>
<span className={classes.icon}>
Expand All @@ -53,7 +53,12 @@ const WidgetWrapperPlain = ({ widget, type, classes }: Props) => {
</div>
<div className={classes.decription}>
{i18n.t(
'This refferal response event is linked to a Refferal details event. Review the linked event details before entering data below',
'This {{stageName}} event is linked to a {{linkedStageName}} event. Review the linked event details before entering data below',
{
linkedStageName: linkedStage?.name,
stageName: stage?.name,
interpolation: { escapeValue: false },
},
)}
</div>
{widget}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @flow
import { WidgetTwoEventWorkspaceWrapperTypes } from '../index';
import type { ProgramStage } from '../../../metaData';

type PlainProps = {|
widget: any,
linkedStage: ProgramStage,
stage?: ProgramStage,
type?: $Values<typeof WidgetTwoEventWorkspaceWrapperTypes>,
|};

Expand Down

0 comments on commit f8ece37

Please sign in to comment.