From fe1a7b1043203a25a1072aadc31e1e62441e343b Mon Sep 17 00:00:00 2001 From: eirikhaugstulen Date: Thu, 17 Oct 2024 19:11:53 +0200 Subject: [PATCH] chore: self-review --- i18n/en.pot | 7 +++++-- .../EnrollmentEditEventPage.container.js | 6 +++++- .../Header/EventWorkingListsInitHeader.js | 20 ++++++++++++++++++- .../Pages/MainPage/MainPage.component.js | 4 ---- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 0dfd5677f8..71a7f46f88 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-14T14:53:34.553Z\n" -"PO-Revision-Date: 2024-10-14T14:53:34.553Z\n" +"POT-Creation-Date: 2024-10-17T17:11:55.065Z\n" +"PO-Revision-Date: 2024-10-17T17:11:55.065Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -774,6 +774,9 @@ msgstr "Program Stages could not be loaded" msgid "Stage" msgstr "Stage" +msgid "Registered events" +msgstr "Registered events" + msgid "" "The category option is not valid for the selected organisation unit. Please " "select a valid combination." diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.container.js b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.container.js index 8532981589..7b9015c53d 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.container.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.container.js @@ -137,6 +137,10 @@ const EnrollmentEditEventPageWithContextPlain = ({ const programStage = [...program.stages?.values()].find(item => item.id === stageId); const hideWidgets = useHideWidgetByRuleLocations(program.programRules.concat(programStage?.programRules)); + const onDeleteTrackedEntitySuccess = useCallback(() => { + history.push(`/?${buildUrlQueryString({ orgUnitId, programId })}`); + }, [history, orgUnitId, programId]); + const onBackToMainPage = useCallback(() => { history.push(`/?${buildUrlQueryString({ orgUnitId, programId })}`); }, [history, orgUnitId, programId]); @@ -264,7 +268,7 @@ const EnrollmentEditEventPageWithContextPlain = ({ trackedEntityName={trackedEntityName} program={program} onDelete={onDelete} - onDeleteTrackedEntitySuccess={onBackToMainPage} + onDeleteTrackedEntitySuccess={onDeleteTrackedEntitySuccess} onAddNew={onAddNew} orgUnitId={orgUnitId} eventDate={eventDate} diff --git a/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsInit/Header/EventWorkingListsInitHeader.js b/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsInit/Header/EventWorkingListsInitHeader.js index ca5c2a09dd..37a869ea4c 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsInit/Header/EventWorkingListsInitHeader.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsInit/Header/EventWorkingListsInitHeader.js @@ -1,5 +1,6 @@ // @flow import { colors, spacers } from '@dhis2/ui'; +import i18n from '@dhis2/d2-i18n'; import React, { type ComponentType } from 'react'; import { withStyles } from '@material-ui/core/styles'; import type { Props } from './eventWorkingListsInitHeader.types'; @@ -12,11 +13,28 @@ const getStyles = () => ({ borderRadius: 3, padding: spacers.dp16, }, + headerContainer: { + marginBottom: spacers.dp16, + }, + title: { + fontSize: 16, + color: colors.grey800, + fontWeight: 500, + }, }); const EventWorkingListsInitHeaderPlain = - ({ children, classes: { container, listContainer } }: Props) => ( + ({ children, classes: { container, headerContainer, listContainer, title } }: Props) => (
+
+ + {i18n.t('Registered events')} + +
diff --git a/src/core_modules/capture-core/components/Pages/MainPage/MainPage.component.js b/src/core_modules/capture-core/components/Pages/MainPage/MainPage.component.js index 222fc6398e..2c4e880bb8 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/MainPage.component.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/MainPage.component.js @@ -19,10 +19,6 @@ import { const getStyles = () => ({ listContainer: { padding: 24, - paddingTop: 10, - display: 'flex', - flexDirection: 'column', - gap: spacers.dp12, }, container: { display: 'flex',