From c9b82927b0b65e96ac2b932f112a8aa50fd92f15 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Mon, 9 Oct 2023 11:51:52 +0200 Subject: [PATCH 1/2] ONI-168: make a notice message larger --- src/components/HomePageContainer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/HomePageContainer.js b/src/components/HomePageContainer.js index 421eff3..991df12 100644 --- a/src/components/HomePageContainer.js +++ b/src/components/HomePageContainer.js @@ -10,7 +10,7 @@ import { useModulesManager, useTranslations, } from "@openimis/fe-core"; -import { useDispatch, useSelector } from "react-redux"; +import { useSelector } from "react-redux"; import { DEFAULT, MODULE_NAME, DAYS_HF_STATUS } from "../constants"; import { useFetchData } from "../hooks/useFetchData"; @@ -21,9 +21,11 @@ const useStyles = makeStyles((theme) => ({ messageTitle: { textAlign: "center", color: "red", + fontSize: "16px" }, messageDate: { textAlign: "center", + fontSize: "16px", }, healthFacilityLongTimeActive: { textAlign: "center", @@ -36,6 +38,9 @@ const useStyles = makeStyles((theme) => ({ textAlign: "center", color: "red", }, + messageNotice: { + fontSize: "16px" + } })); const HomePageContainer = () => { @@ -114,7 +119,7 @@ const HomePageContainer = () => { {formatMessage("HomePageContainer.messageTitle")}

{messageData?.date}

-
+
)} From 889c4c1aa7167ec47275b71c9b20b1ad1512d397 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Mon, 9 Oct 2023 16:02:31 +0200 Subject: [PATCH 2/2] ONI-168: if user has no hf, show info about that instead of contract details --- src/components/HomePageContainer.js | 20 ++++++++++++++------ src/constants.js | 1 + src/translations/en.json | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/HomePageContainer.js b/src/components/HomePageContainer.js index 991df12..24f4101 100644 --- a/src/components/HomePageContainer.js +++ b/src/components/HomePageContainer.js @@ -63,7 +63,7 @@ const HomePageContainer = () => { const showHealthFacilityMessage = modulesManager.getConf( "fe-home", "HomePageContainer.showHealthFacilityMessage", - false + DEFAULT.SHOW_HEALTH_FACILITY_MESSAGE ); const { user } = useUserQuery(); @@ -105,10 +105,15 @@ const HomePageContainer = () => { {showHealthFacilityMessage && (

- {formatMessageWithValues("HomePageContainer.healthFacilityStatus", { - date: `${formatDateFromISO(dateToCheck)}`, - days: `${timeDelta}`, - })} + {userHealthFacility + ? formatMessageWithValues( + "HomePageContainer.healthFacilityStatus", + { + date: `${formatDateFromISO(dateToCheck)}`, + days: `${timeDelta}`, + } + ) + : formatMessage("HomePageContainer.noHealthFacilityAssigned")}

)} @@ -119,7 +124,10 @@ const HomePageContainer = () => { {formatMessage("HomePageContainer.messageTitle")}

{messageData?.date}

-
+
)} diff --git a/src/constants.js b/src/constants.js index 63fe3e4..9c75b35 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,7 @@ export const DEFAULT = { SHOW_HOME_MESSAGE: false, HOME_MESSAGE_URL: "", + SHOW_HEALTH_FACILITY_MESSAGE: false, }; export const DAYS_HF_STATUS = { diff --git a/src/translations/en.json b/src/translations/en.json index 7aca543..1655279 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1,5 +1,6 @@ { "home.HomePageContainer.welcomeMessage": "Welcome {otherNames} {lastName}!", "home.HomePageContainer.messageTitle": "Notice", - "home.HomePageContainer.healthFacilityStatus": "Your Hospital Contract is expiring on {date}: (Remaining days: {days})" + "home.HomePageContainer.healthFacilityStatus": "Your Hospital Contract is expiring on {date}: (Remaining days: {days})", + "home.HomePageContainer.noHealthFacilityAssigned": "User has no Health Facility assigned and there is no information on when the contract will expire." } \ No newline at end of file