From e8d228203f8ac28ee7da4ef0fd75f5a3bd45f2d3 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Mon, 4 Nov 2024 09:37:04 +0100 Subject: [PATCH 1/6] fix: related stages UI tweaks --- i18n/en.pot | 30 ++- .../WidgetEventEditWrapper.js | 24 +- .../WidgetEventEdit.container.js | 220 +++++++----------- .../WidgetHeader/WidgetHeader.container.js | 128 ++++++++++ .../WidgetHeader/WidgetHeader.types.js | 16 ++ .../WidgetEventEdit/WidgetHeader/index.js | 2 + .../WidgetHeader/WidgetHeader.container.js | 86 +++++++ .../WidgetHeader/WidgetHeader.types.js | 19 ++ .../WidgetHeader/index.js | 2 + .../WidgetTwoEventWorkspace.container.js | 123 +++------- .../WidgetTwoEventWorkspace.types.js | 10 +- .../WidgetTwoEventWorkspaceWrapper.const.js | 5 + .../WidgetWrapper/WidgetWrapper.container.js | 68 ++++++ .../WidgetWrapper/WidgetWrapper.types.js | 12 + .../WidgetWrapper/index.js | 2 + .../WidgetTwoEventWorkspace/index.js | 1 + 16 files changed, 493 insertions(+), 255 deletions(-) create mode 100644 src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js create mode 100644 src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.types.js create mode 100644 src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/index.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.container.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.types.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/index.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspaceWrapper.const.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js create mode 100644 src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/index.js diff --git a/i18n/en.pot b/i18n/en.pot index d299bcedcf..9ad316e1d3 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -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-09-02T11:08:16.281Z\n" -"PO-Revision-Date: 2024-09-02T11:08:16.281Z\n" +"POT-Creation-Date: 2024-11-04T07:46:23.442Z\n" +"PO-Revision-Date: 2024-11-04T07:46:23.442Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -980,6 +980,9 @@ msgstr "Loading" msgid "An error occurred while loading the form" msgstr "An error occurred while loading the form" +msgid "Back to all stages and events" +msgstr "Back to all stages and events" + msgid "Possible duplicates found" msgstr "Possible duplicates found" @@ -1329,9 +1332,6 @@ msgstr "Event completed" msgid "The event cannot be edited after it has been completed" msgstr "The event cannot be edited after it has been completed" -msgid "Back to all stages and events" -msgstr "Back to all stages and events" - msgid "Notes about this event" msgstr "Notes about this event" @@ -1538,12 +1538,28 @@ msgstr "{{ scheduledEvents }} scheduled" msgid "Stages and Events" msgstr "Stages and Events" -msgid "An error occurred while loading the widget." -msgstr "An error occurred while loading the widget." +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 " +"the linked event details before entering data below" +msgstr "" +"This refferal response event is linked to a Refferal details event. Review " +"the linked event details before entering data below" + msgid "Scheduled" msgstr "Scheduled" diff --git a/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js b/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js index 2968d8b1ef..dfc0572ed6 100644 --- a/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js +++ b/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js @@ -1,5 +1,6 @@ // @flow import React from 'react'; +import { IconArrowLeft24, Button } from '@dhis2/ui'; import i18n from '@dhis2/d2-i18n'; import { pageStatuses } from '../../EnrollmentEditEvent/EnrollmentEditEventPage.constants'; import { IncompleteSelectionsMessage } from '../../../IncompleteSelectionsMessage'; @@ -16,6 +17,7 @@ export const WidgetEventEditWrapper = ({ pageStatus, ...passOnProps }: WidgetPro const { programId, stageId, + onGoBack, } = passOnProps; const { @@ -56,12 +58,20 @@ export const WidgetEventEditWrapper = ({ pageStatus, ...passOnProps }: WidgetPro } return ( - + <> +
+ +
+ + ); }; diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js index f953852223..1d31384c01 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js @@ -1,40 +1,41 @@ // @flow import React, { type ComponentType, useState, useEffect } from 'react'; import { dataEntryIds, dataEntryKeys } from 'capture-core/constants'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { spacersNum, - Button, colors, - IconEdit24, - IconArrowLeft24, - IconMore16, - FlyoutMenu, - MenuItem, spacers, } from '@dhis2/ui'; import { withStyles } from '@material-ui/core'; -import i18n from '@dhis2/d2-i18n'; -import { ConditionalTooltip } from 'capture-core/components/Tooltips/ConditionalTooltip'; import { useEnrollmentEditEventPageMode, useAvailableProgramStages } from 'capture-core/hooks'; import { useCoreOrgUnit } from 'capture-core/metadataRetrieval/coreOrgUnit'; import type { PlainProps, ComponentProps } from './widgetEventEdit.types'; -import { startShowEditEventDataEntry } from './WidgetEventEdit.actions'; import { Widget } from '../Widget'; import { EditEventDataEntry } from './EditEventDataEntry/'; import { ViewEventDataEntry } from './ViewEventDataEntry/'; import { LoadingMaskElementCenter } from '../LoadingMasks'; -import { NonBundledDhis2Icon } from '../NonBundledDhis2Icon'; -import { getProgramEventAccess } from '../../metaData'; -import { useCategoryCombinations } from '../DataEntryDhis2Helpers/AOC/useCategoryCombinations'; -import { OverflowButton } from '../Buttons'; import { EventChangelogWrapper } from './EventChangelogWrapper'; import { FEATURES, useFeature } from '../../../capture-core-utils'; import { inMemoryFileStore } from '../DataEntry/file/inMemoryFileStore'; -import { eventStatuses } from './constants/status.const'; -import { useAuthorities } from './hooks'; +import { WidgetHeader } from './WidgetHeader'; +import { WidgetTwoEventWorkspace, WidgetTwoEventWorkspaceWrapperTypes } from '../WidgetTwoEventWorkspace'; const styles = { + container: { + backgroundColor: 'white', + borderRadius: 3, + borderStyle: 'solid', + borderColor: colors.grey400, + borderWidth: 1, + '& > div:nth-child(2)': { + margin: spacersNum.dp16, + borderRadius: 3, + borderStyle: 'solid', + borderColor: colors.grey400, + borderWidth: 1, + }, + }, header: { display: 'flex', alignItems: 'center', @@ -73,7 +74,6 @@ export const WidgetEventEditPlain = ({ initialScheduleDate, stage, formFoundation, - onGoBack, onCancelEditEvent, onHandleScheduleSave, onSaveExternal, @@ -90,147 +90,89 @@ export const WidgetEventEditPlain = ({ classes, }: PlainProps) => { useEffect(() => inMemoryFileStore.clear, []); - const dispatch = useDispatch(); const supportsChangelog = useFeature(FEATURES.changelogs); const { currentPageMode } = useEnrollmentEditEventPageMode(eventStatus); const { orgUnit, error } = useCoreOrgUnit(orgUnitId); const [changeLogIsOpen, setChangeLogIsOpen] = useState(false); - const [actionsIsOpen, setActionsIsOpen] = useState(false); // "Edit event"-button depends on loadedValues. Delay rendering component until loadedValues has been initialized. const loadedValues = useSelector(({ viewEventPage }) => viewEventPage.loadedValues); - const eventAccess = getProgramEventAccess(programId, stageId); - const { canEditCompletedEvent } = useAuthorities(); - const blockEntryForm = stage.blockEntryForm && !canEditCompletedEvent && eventStatus === eventStatuses.COMPLETED; - const disableEdit = !eventAccess?.write || blockEntryForm; - - const tooltipContent = blockEntryForm ? - i18n.t('The event cannot be edited after it has been completed') : - i18n.t('You don\'t have access to edit this event'); - const availableProgramStages = useAvailableProgramStages(stage, teiId, enrollmentId, programId); - const { programCategory } = useCategoryCombinations(programId); if (error) { return error.errorComponent; } - const { icon, name } = stage; return orgUnit && loadedValues ? ( -
-
- - - {currentPageMode === dataEntryKeys.VIEW && ( -
- - - - - {supportsChangelog && ( - setActionsIsOpen(prev => !prev)} - icon={} - small - secondary - dataTest={'widget-event-edit-overflow-button'} - component={( - - { - setChangeLogIsOpen(true); - setActionsIsOpen(false); - }} - /> - - )} +
+ +
+ + } + noncollapsible + borderless + > +
+ {currentPageMode === dataEntryKeys.VIEW ? ( + + ) : ( + )}
+
+ + {supportsChangelog && changeLogIsOpen && ( + )}
- - {icon && ( -
- -
- )} - {name} -
- } - noncollapsible - > -
- {currentPageMode === dataEntryKeys.VIEW ? ( - - ) : ( - - )} -
- - - {supportsChangelog && changeLogIsOpen && ( - - )}
) : ; }; diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js new file mode 100644 index 0000000000..712201a025 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js @@ -0,0 +1,128 @@ +// @flow +import React, { type ComponentType, useState, useEffect } from 'react'; +import { dataEntryKeys } from 'capture-core/constants'; +import { useDispatch } from 'react-redux'; +import { spacersNum, Button, IconEdit24, IconMore16, FlyoutMenu, MenuItem, spacers } from '@dhis2/ui'; +import { withStyles } from '@material-ui/core'; +import i18n from '@dhis2/d2-i18n'; +import { FEATURES, useFeature } from 'capture-core-utils'; +import { ConditionalTooltip } from 'capture-core/components/Tooltips/ConditionalTooltip'; +import { useEnrollmentEditEventPageMode } from 'capture-core/hooks'; +import { startShowEditEventDataEntry } from '../WidgetEventEdit.actions'; +import { NonBundledDhis2Icon } from '../../NonBundledDhis2Icon'; +import { getProgramEventAccess } from '../../../metaData'; +import { useCategoryCombinations } from '../../DataEntryDhis2Helpers/AOC/useCategoryCombinations'; +import { OverflowButton } from '../../Buttons'; +import { inMemoryFileStore } from '../../DataEntry/file/inMemoryFileStore'; +import { eventStatuses } from '../constants/status.const'; +import { useAuthorities } from '../hooks'; +import type { PlainProps, Props } from './WidgetHeader.types'; + +const styles = { + icon: { + paddingRight: spacersNum.dp8, + }, + menu: { + marginLeft: 'auto', + }, + menuActions: { + display: 'flex', + alignItems: 'center', + gap: spacers.dp4, + }, + tooltip: { + display: 'inline-flex', + }, +}; + +export const WidgetHeaderPlain = ({ + eventStatus, + stage, + programId, + orgUnit, + setChangeLogIsOpen, + classes, +}: Props) => { + useEffect(() => inMemoryFileStore.clear, []); + const dispatch = useDispatch(); + + const supportsChangelog = useFeature(FEATURES.changelogs); + const { currentPageMode } = useEnrollmentEditEventPageMode(eventStatus); + const [actionsIsOpen, setActionsIsOpen] = useState(false); + + const eventAccess = getProgramEventAccess(programId, stage.id); + const { canEditCompletedEvent } = useAuthorities(); + const blockEntryForm = stage.blockEntryForm && !canEditCompletedEvent && eventStatus === eventStatuses.COMPLETED; + const disableEdit = !eventAccess?.write || blockEntryForm; + + const tooltipContent = blockEntryForm + ? i18n.t('The event cannot be edited after it has been completed') + : i18n.t("You don't have access to edit this event"); + + const { programCategory } = useCategoryCombinations(programId); + + const { icon, name } = stage; + + return ( + <> + {icon && ( +
+ +
+ )} + {name} +
+ {currentPageMode === dataEntryKeys.VIEW && ( +
+ + + + + {supportsChangelog && ( + setActionsIsOpen(prev => !prev)} + icon={} + small + secondary + dataTest={'widget-event-edit-overflow-button'} + component={ + + { + setChangeLogIsOpen(true); + setActionsIsOpen(false); + }} + /> + + } + /> + )} +
+ )} +
+ + ); +}; + +export const WidgetHeader: ComponentType = withStyles(styles)(WidgetHeaderPlain); diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.types.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.types.js new file mode 100644 index 0000000000..df70f89e0e --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.types.js @@ -0,0 +1,16 @@ +// @flow +import type { OrgUnit } from '@dhis2/rules-engine-javascript'; +import { ProgramStage } from '../../../metaData'; + +export type PlainProps = {| + eventStatus?: string, + stage: ProgramStage, + programId: string, + orgUnit: OrgUnit, + setChangeLogIsOpen: (toggle: boolean) => void, +|}; + +export type Props = {| + ...PlainProps, + ...CssClasses, +|}; diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/index.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/index.js new file mode 100644 index 0000000000..efff17d3ce --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/index.js @@ -0,0 +1,2 @@ +// @flow +export { WidgetHeader } from './WidgetHeader.container'; diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.container.js new file mode 100644 index 0000000000..342a417cc5 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.container.js @@ -0,0 +1,86 @@ +// @flow +import React, { type ComponentType, useState } from 'react'; +import { useHistory } from 'react-router-dom'; +import { FlyoutMenu, IconMore16, MenuItem, spacersNum } from '@dhis2/ui'; +import i18n from '@dhis2/d2-i18n'; +import { withStyles } from '@material-ui/core/'; +import { OverflowButton } from '../../Buttons'; +import { buildUrlQueryString } from '../../../utils/routing'; +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: { + marginLeft: 'auto', + }, + icon: { + marginRight: spacersNum.dp8, + }, +}; + +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 [actionsIsOpen, setActionsIsOpen] = useState(false); + const { push } = useHistory(); + const { icon } = stage; + const title = getTitle({ type, stage }); + + return ( + <> + {icon && ( +
+ +
+ )} + {title} + {currentPage === EnrollmentPageKeys.VIEW_EVENT && ( +
+ setActionsIsOpen(prev => !prev)} + icon={} + small + secondary + dataTest={'widget-event-navigate-to-linked-event'} + component={ + + { + push( + `/enrollmentEventEdit?${buildUrlQueryString({ + eventId: linkedEvent.event, + orgUnitId, + })}`, + ); + setActionsIsOpen(false); + }} + /> + + } + /> +
+ )} + + ); +}; + +export const WidgetHeader: ComponentType = withStyles(styles)(WidgetHeaderPlain); + diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.types.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.types.js new file mode 100644 index 0000000000..5fb6ab914d --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/WidgetHeader.types.js @@ -0,0 +1,19 @@ +// @flow +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, + currentPage: $Values | string, + type?: $Values, +|}; + +export type Props = {| + ...PlainProps, + ...CssClasses, +|}; + diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/index.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/index.js new file mode 100644 index 0000000000..efff17d3ce --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetHeader/index.js @@ -0,0 +1,2 @@ +// @flow +export { WidgetHeader } from './WidgetHeader.container'; diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js index a889aace6b..2b257c3f22 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js @@ -1,55 +1,22 @@ // @flow -import React, { useState } from 'react'; -import { useHistory } from 'react-router-dom'; -import { colors, FlyoutMenu, IconMore16, MenuItem, spacersNum } from '@dhis2/ui'; +import React from 'react'; import i18n from '@dhis2/d2-i18n'; -import { withStyles } from '@material-ui/core/'; import type { Props } from './WidgetTwoEventWorkspace.types'; import { useMetadataForProgramStage } from '../DataEntries/common/ProgramStage/useMetadataForProgramStage'; import { Widget } from '../Widget'; import { useLinkedEventByOriginId } from './hooks/useLinkedEventByOriginId'; import { WidgetTwoEventWorkspaceComponent } from './WidgetTwoEventWorkspace.component'; -import { OverflowButton } from '../Buttons'; -import { buildUrlQueryString } from '../../utils/routing'; -import { - EnrollmentPageKeys, -} from '../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants'; -import { NonBundledDhis2Icon } from '../NonBundledDhis2Icon'; import { useClientDataValues } from './hooks/useClientDataValues'; +import { WidgetWrapper } from './WidgetWrapper'; +import { WidgetHeader } from './WidgetHeader'; -const styles = { - menu: { - display: 'flex', - alignItems: 'center', - padding: spacersNum.dp8, - justifyContent: 'end', - background: colors.white, - borderTopLeftRadius: 3, - borderTopRightRadius: 3, - borderStyle: 'solid', - borderColor: colors.grey400, - borderWidth: 1, - borderBottomWidth: 0, - }, - header: { - display: 'flex', - alignItems: 'center', - padding: spacersNum.dp8, - }, - icon: { - marginRight: spacersNum.dp8, - }, -}; - -const WidgetTwoEventWorkspacePlain = ({ +export const WidgetTwoEventWorkspace = ({ eventId, programId, orgUnitId, currentPage, - classes, + type, }: Props) => { - const [actionsIsOpen, setActionsIsOpen] = useState(false); - const { push } = useHistory(); const { linkedEvent, dataValues, @@ -94,64 +61,28 @@ const WidgetTwoEventWorkspacePlain = ({ } return ( -
- {currentPage === EnrollmentPageKeys.VIEW_EVENT && ( -
- setActionsIsOpen(prev => !prev)} - icon={} - small - secondary - dataTest={'widget-event-navigate-to-linked-event'} - component={( - - { - push(`/enrollmentEventEdit?${buildUrlQueryString({ - eventId: linkedEvent.event, - orgUnitId, - })}`); - setActionsIsOpen(false); - }} - /> - - )} + + } + noncollapsible + > + -
- )} - - - {stage.icon && ( -
- -
- )} - {stage.name} -
- } - noncollapsible - > - - -
+ + } + /> ); }; - -export const WidgetTwoEventWorkspace = withStyles( - styles, -)(WidgetTwoEventWorkspacePlain); diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js index 52aff39ded..59b50aca9a 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js @@ -2,13 +2,15 @@ import { EnrollmentPageKeys, } from '../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants'; +import { WidgetTwoEventWorkspaceWrapperTypes } from './index'; -type PlainProps = {| +export type Props = {| programId: string, eventId: string, orgUnitId: string, stageId: string, - currentPage: $Values, + currentPage: $Values | string, + type?: $Values, |} export type LinkedEvent = {| @@ -18,7 +20,3 @@ export type LinkedEvent = {| orgUnit: string, |} -export type Props = {| - ...PlainProps, - ...CssClasses, -|} diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspaceWrapper.const.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspaceWrapper.const.js new file mode 100644 index 0000000000..421d827ca5 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspaceWrapper.const.js @@ -0,0 +1,5 @@ +// @flow + +export const WidgetTwoEventWorkspaceWrapperTypes = { + EDIT_EVENT: 'editEvent', +}; diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js new file mode 100644 index 0000000000..d740486392 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js @@ -0,0 +1,68 @@ +// @flow +import React from 'react'; +import { colors, spacersNum, IconLink16 } from '@dhis2/ui'; +import i18n from '@dhis2/d2-i18n'; +import { withStyles } from '@material-ui/core/'; +import type { Props } from './WidgetWrapper.types'; +import { WidgetTwoEventWorkspaceWrapperTypes } from '../index'; + +const styles = { + container: { + marginBottom: '16px', + margin: '16px', + }, + header: { + display: 'flex', + alignItems: 'center', + paddingBottom: spacersNum.dp16, + fontWeight: 500, + fontSize: 16, + color: colors.grey800, + }, + referalResponse: { + padding: spacersNum.dp16, + backgroundColor: colors.blue100, + borderRadius: '3px', + }, + linkedEvent: { + color: colors.blue600, + verticalAlign: 'middle', + display: 'flex', + fontSize: '16px', + fontWeight: '500', + }, + icon: { + marginRight: spacersNum.dp8, + }, + decription: { + margin: `${spacersNum.dp8}px 0`, + }, +}; + +const WidgetWrapperPlain = ({ widget, type, classes }: Props) => { + if (type === WidgetTwoEventWorkspaceWrapperTypes.EDIT_EVENT) { + return ( +
+
{i18n.t('Refferal response')}
+
+
+ + + +
{i18n.t('Linked event')}
+
+
+ {i18n.t( + 'This refferal response event is linked to a Refferal details event. Review the linked event details before entering data below', + )} +
+ {widget} +
+
+ ); + } + + return <>{widget}; +}; + +export const WidgetWrapper = withStyles(styles)(WidgetWrapperPlain); diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js new file mode 100644 index 0000000000..43d6370b59 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js @@ -0,0 +1,12 @@ +// @flow +import { WidgetTwoEventWorkspaceWrapperTypes } from '../index'; + +type PlainProps = {| + widget: any, + type?: $Values, +|}; + +export type Props = {| + ...PlainProps, + ...CssClasses, +|}; diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/index.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/index.js new file mode 100644 index 0000000000..adb87f9498 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/index.js @@ -0,0 +1,2 @@ +// @flow +export { WidgetWrapper } from './WidgetWrapper.container'; diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/index.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/index.js index 27320f9e8c..b057d60b99 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/index.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/index.js @@ -1,3 +1,4 @@ // @flow export { WidgetTwoEventWorkspace } from './WidgetTwoEventWorkspace.container'; +export { WidgetTwoEventWorkspaceWrapperTypes } from './WidgetTwoEventWorkspaceWrapper.const'; From 612523b36467f76e427ec68b73a0c4dc2f5d483a Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Mon, 4 Nov 2024 15:12:42 +0100 Subject: [PATCH 2/6] fix: cypress tests --- .../EnrollmentEditEventPageForm.js | 6 ++---- .../EnrollmentEditEventPageNavigation.js | 5 +---- cypress/e2e/TopBarActions/TopBarActions.js | 2 +- .../e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js | 3 +-- .../WidgetsForEnrollmentAddEventPage.js | 4 +--- .../WidgetsForEnrollmentDashboard.js | 4 +--- .../PageLayout/DefaultPageLayout.constants.js | 4 ---- .../common/WidgetEventEditWrapper/WidgetEventEditWrapper.js | 2 +- .../WidgetEventEdit/WidgetHeader/WidgetHeader.container.js | 1 + 9 files changed, 9 insertions(+), 22 deletions(-) diff --git a/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageForm/EnrollmentEditEventPageForm.js b/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageForm/EnrollmentEditEventPageForm.js index bd8c7855fc..94d45f69b3 100644 --- a/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageForm/EnrollmentEditEventPageForm.js +++ b/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageForm/EnrollmentEditEventPageForm.js @@ -59,8 +59,7 @@ Given(/^you land on the enrollment event page with selected (.*) by having typed When(/^the user clicks on the edit button/, () => cy .get('[data-test="widget-enrollment-event"]') - .find('[data-test="dhis2-uicore-button"]') - .eq(1) + .find('[data-test="widget-enrollment-event-edit-button"]') .click(), ); @@ -206,7 +205,6 @@ And('you open the Birth stage event', () => { Then('the edit button should be disabled', () => { cy.get('[data-test="widget-enrollment-event"]') - .find('[data-test="dhis2-uicore-button"]') - .eq(1) + .find('[data-test="widget-enrollment-event-edit-button"]') .should('be.disabled'); }); diff --git a/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageNavigation/EnrollmentEditEventPageNavigation.js b/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageNavigation/EnrollmentEditEventPageNavigation.js index 76fbb1915c..944f83297b 100644 --- a/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageNavigation/EnrollmentEditEventPageNavigation.js +++ b/cypress/e2e/EnrollmentEditEventPage/EnrollmentEditEventPageNavigation/EnrollmentEditEventPageNavigation.js @@ -21,10 +21,7 @@ When('the user clicks the first second antenatal care visit event', () => { }); When(/^the user clicks the "Back to all stages and events" button/, () => - cy - .get('[data-test="widget-enrollment-event"]') - .find('[data-test="dhis2-uicore-button"]') - .eq(0) + cy.get('[data-test="enrollment-edit-event-back-button"]') .click(), ); diff --git a/cypress/e2e/TopBarActions/TopBarActions.js b/cypress/e2e/TopBarActions/TopBarActions.js index 81d8cc996e..7ee8a08b56 100644 --- a/cypress/e2e/TopBarActions/TopBarActions.js +++ b/cypress/e2e/TopBarActions/TopBarActions.js @@ -6,7 +6,7 @@ Given(/^you land on a enrollment page domain by having typed (.*)$/, (url) => { }); When(/^the user clicks on the edit button/, () => - cy.get('[data-test="widget-enrollment-event"]').find('[data-test="dhis2-uicore-button"]').eq(1).click(), + cy.get('[data-test="widget-enrollment-event"]').find('[data-test="widget-enrollment-event-edit-button"]').click(), ); When('the user clicks the arrow button to see the dropdown', () => { diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js index 9f45c31e2f..07403f7566 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js @@ -12,8 +12,7 @@ When('you assign the user Geetha in the view mode', () => { When('you assign the user Tracker demo User in the edit mode', () => { cy .get('[data-test="widget-enrollment-event"]') - .find('[data-test="dhis2-uicore-button"]') - .eq(1) + .find('[data-test="widget-enrollment-event-edit-button"]') .click(); cy.get('[data-test="widget-assignee"]').within(() => { diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.js index ebb0f1293a..24f07d7593 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.js @@ -16,9 +16,7 @@ Then('you can assign a user when scheduling the event', () => { }); When(/^the user clicks the "Back to all stages and events" button/, () => - cy - .get('[data-test="widget-enrollment-event"]') - .contains('Back to all stages and events') + cy.get('[data-test="enrollment-edit-event-back-button"]') .click(), ); diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.js index 81034e2507..96a583bd38 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.js @@ -51,9 +51,7 @@ Then(/^the scope selector list contains the text (.*)$/, (name) => { }); When(/^the user clicks the "Back to all stages and events" button/, () => - cy - .get('[data-test="widget-enrollment-event"]') - .contains('Back to all stages and events') + cy.get('[data-test="enrollment-edit-event-back-button"]') .click(), ); diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/PageLayout/DefaultPageLayout.constants.js b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/PageLayout/DefaultPageLayout.constants.js index e4c0feb93d..0a8065a405 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/PageLayout/DefaultPageLayout.constants.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/PageLayout/DefaultPageLayout.constants.js @@ -22,10 +22,6 @@ export const WidgetsForEnrollmentEventEdit: $ReadOnly<{ [key: string]: WidgetCon export const DefaultPageLayout: PageLayoutConfig = { leftColumn: [ - { - type: WidgetTypes.COMPONENT, - name: 'TwoEventWorkspace', - }, { type: WidgetTypes.COMPONENT, name: 'EditEventWorkspace', diff --git a/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js b/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js index dfc0572ed6..aa99aae4e4 100644 --- a/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js +++ b/src/core_modules/capture-core/components/Pages/common/WidgetEventEditWrapper/WidgetEventEditWrapper.js @@ -60,7 +60,7 @@ export const WidgetEventEditWrapper = ({ pageStatus, ...passOnProps }: WidgetPro return ( <>
- diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js index 81432263e6..8e86f36fdc 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetHeader/WidgetHeader.container.js @@ -91,6 +91,7 @@ export const WidgetHeaderPlain = ({ disabled={disableEdit} icon={} onClick={() => dispatch(startShowEditEventDataEntry(orgUnit, programCategory))} + data-test="widget-enrollment-event-edit-button" > {i18n.t('Edit event')} From ba1eab751f7fb2071ae5d50d62bb592aacf48207 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Mon, 4 Nov 2024 16:01:27 +0100 Subject: [PATCH 3/6] fix: cypress tests --- .../e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js index 2a1c5200ef..72680e4d35 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js @@ -5,7 +5,9 @@ Then('the enrollment widget should be loaded', () => { }); When('you click edit mode', () => { - cy.contains('[data-test="dhis2-uicore-button"]', 'Edit event') + cy + .get('[data-test="widget-enrollment-event"]') + .find('[data-test="widget-enrollment-event-edit-button"]') .click(); cy.contains('Enrollment: Edit Event').should('exist'); }); From f8ece377d91ad090208417b2302e254075d741ae Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 5 Nov 2024 10:50:47 +0100 Subject: [PATCH 4/6] chore: replace refferal word --- i18n/en.pot | 14 ++++---------- .../DefaultEnrollmentLayout.types.js | 1 - .../WidgetEventEdit/WidgetEventEdit.container.js | 1 + .../WidgetHeader/WidgetHeader.container.js | 16 +++------------- .../WidgetHeader/WidgetHeader.types.js | 4 +--- .../WidgetTwoEventWorkspace.container.js | 10 ++++++---- .../WidgetTwoEventWorkspace.types.js | 2 ++ .../WidgetWrapper/WidgetWrapper.container.js | 11 ++++++++--- .../WidgetWrapper/WidgetWrapper.types.js | 3 +++ 9 files changed, 28 insertions(+), 34 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 61c515fbca..162da26bd4 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -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..." @@ -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" diff --git a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types.js b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types.js index 922a2071fc..cbb1bea87a 100644 --- a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types.js +++ b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types.js @@ -8,7 +8,6 @@ type DefaultComponents = 'QuickActions' | 'AssigneeWidget' | 'NewEventWorkspace' | 'EditEventWorkspace' - | 'TwoEventWorkspace' | 'EnrollmentNote' | 'EventNote' | 'TrackedEntityRelationship' diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js index 1d31384c01..8dbb57dd44 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/WidgetEventEdit.container.js @@ -112,6 +112,7 @@ export const WidgetEventEditPlain = ({ programId={programId} orgUnitId={orgUnitId} stageId={stageId} + stage={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 && ( @@ -48,7 +38,7 @@ const WidgetHeaderPlain = ({ stage, linkedEvent, orgUnitId, currentPage, type, c />
)} - {title} + {linkedStage.name} {currentPage === EnrollmentPageKeys.VIEW_EVENT && (
| string, - type?: $Values, |}; export type Props = {| diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js index 2b257c3f22..645f84064a 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.container.js @@ -15,6 +15,7 @@ export const WidgetTwoEventWorkspace = ({ programId, orgUnitId, currentPage, + stage, type, }: Props) => { const { @@ -26,7 +27,7 @@ export const WidgetTwoEventWorkspace = ({ const { formFoundation, - stage, + stage: linkedStage, isLoading: isLoadingMetadata, isError: isMetadataError, } = useMetadataForProgramStage({ @@ -56,22 +57,23 @@ export const WidgetTwoEventWorkspace = ({ ); } - if (!linkedEvent || !formFoundation || !stage) { + if (!linkedEvent || !formFoundation || !linkedStage) { return null; } return ( } noncollapsible diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js index 59b50aca9a..c79a68c5d5 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetTwoEventWorkspace.types.js @@ -3,6 +3,7 @@ import { EnrollmentPageKeys, } from '../Pages/common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.constants'; import { WidgetTwoEventWorkspaceWrapperTypes } from './index'; +import type { ProgramStage } from '../../metaData'; export type Props = {| programId: string, @@ -10,6 +11,7 @@ export type Props = {| orgUnitId: string, stageId: string, currentPage: $Values | string, + stage?: ProgramStage, type?: $Values, |} diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js index d740486392..c25a8e618c 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js @@ -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 (
-
{i18n.t('Refferal response')}
+
{stage?.name}
@@ -53,7 +53,12 @@ const WidgetWrapperPlain = ({ widget, type, classes }: Props) => {
{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 }, + }, )}
{widget} diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js index 43d6370b59..ae72f04aa3 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.types.js @@ -1,8 +1,11 @@ // @flow import { WidgetTwoEventWorkspaceWrapperTypes } from '../index'; +import type { ProgramStage } from '../../../metaData'; type PlainProps = {| widget: any, + linkedStage: ProgramStage, + stage?: ProgramStage, type?: $Values, |}; From 21ae002af21ccfb61acd06aebce0a774f8dfba16 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 19 Nov 2024 10:31:21 +0100 Subject: [PATCH 5/6] fix: text color Co-authored-by: Joe Cooper <33054985+cooper-joe@users.noreply.github.com> --- .../WidgetWrapper/WidgetWrapper.container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js index 65abf51ae1..b9b4c4cf2b 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js @@ -26,7 +26,7 @@ const styles = { borderRadius: '3px', }, linkedEvent: { - color: colors.blue600, + color: colors.blue900, verticalAlign: 'middle', display: 'flex', fontSize: '16px', From a87dfc71b4365f93d929b07f5cfc11d1643a78df Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 19 Nov 2024 10:36:14 +0100 Subject: [PATCH 6/6] fix: set icon color to blue800 --- .../WidgetWrapper/WidgetWrapper.container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js index b9b4c4cf2b..dcc0defdc9 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/WidgetWrapper/WidgetWrapper.container.js @@ -48,7 +48,7 @@ const WidgetWrapperPlain = ({ widget, type, stage, linkedStage, classes }: Props
- +
{i18n.t('Linked event')}