From 19776d076b6a5dc94c42ca3245282dd76130b59c Mon Sep 17 00:00:00 2001 From: Em Date: Mon, 11 Jul 2022 15:19:54 -0700 Subject: [PATCH 1/4] move server status components to siteStatus directory --- .../{serverStatus/ServerStatus.jsx => siteStatus/SiteStatus.jsx} | 0 src/pages/{serverStatus => siteStatus}/components/LegendItem.jsx | 0 src/pages/{serverStatus => siteStatus}/components/SummaryCard.jsx | 0 .../{serverStatus => siteStatus}/components/WaffleSquare.jsx | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/pages/{serverStatus/ServerStatus.jsx => siteStatus/SiteStatus.jsx} (100%) rename src/pages/{serverStatus => siteStatus}/components/LegendItem.jsx (100%) rename src/pages/{serverStatus => siteStatus}/components/SummaryCard.jsx (100%) rename src/pages/{serverStatus => siteStatus}/components/WaffleSquare.jsx (100%) diff --git a/src/pages/serverStatus/ServerStatus.jsx b/src/pages/siteStatus/SiteStatus.jsx similarity index 100% rename from src/pages/serverStatus/ServerStatus.jsx rename to src/pages/siteStatus/SiteStatus.jsx diff --git a/src/pages/serverStatus/components/LegendItem.jsx b/src/pages/siteStatus/components/LegendItem.jsx similarity index 100% rename from src/pages/serverStatus/components/LegendItem.jsx rename to src/pages/siteStatus/components/LegendItem.jsx diff --git a/src/pages/serverStatus/components/SummaryCard.jsx b/src/pages/siteStatus/components/SummaryCard.jsx similarity index 100% rename from src/pages/serverStatus/components/SummaryCard.jsx rename to src/pages/siteStatus/components/SummaryCard.jsx diff --git a/src/pages/serverStatus/components/WaffleSquare.jsx b/src/pages/siteStatus/components/WaffleSquare.jsx similarity index 100% rename from src/pages/serverStatus/components/WaffleSquare.jsx rename to src/pages/siteStatus/components/WaffleSquare.jsx From a892fc5be782bf2a86a7fde55ed2dc1a8553016b Mon Sep 17 00:00:00 2001 From: Em Date: Mon, 11 Jul 2022 15:28:54 -0700 Subject: [PATCH 2/4] Change server status text to site status --- locale/en.json | 2 +- src/AuthenticatedSwitch.jsx | 4 ++-- src/pages/siteStatus/SiteStatus.jsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/en.json b/locale/en.json index 2d462f88a..b6b2ca040 100644 --- a/locale/en.json +++ b/locale/en.json @@ -727,7 +727,7 @@ "LOCATION_DESCRIPTION": "The precise decimal latitude and longitude where the sighting took place.", "WEBSITE": "Website", "REVIEW_MATCH_CANDIDATES": "Review match candidates", - "SERVER_STATUS": "Server Status", + "SITE_STATUS_PAGE_TITLE": "Site Status", "YOUR_NAME": "Your name", "CHOOSE_PHOTO": "Choose photo", "EMAIL_ADDRESS": "Email address", diff --git a/src/AuthenticatedSwitch.jsx b/src/AuthenticatedSwitch.jsx index 1e20d649c..524ec7b10 100644 --- a/src/AuthenticatedSwitch.jsx +++ b/src/AuthenticatedSwitch.jsx @@ -6,7 +6,7 @@ import { TransitionGroup } from 'react-transition-group'; import AuthenticatedAppHeader from './components/AuthenticatedAppHeader'; import SaveCustomField from './pages/fieldManagement/settings/saveField/SaveField'; import GeneralSettings from './pages/generalSettings/GeneralSettings'; -import ServerStatus from './pages/serverStatus/ServerStatus'; +import SiteStatus from './pages/siteStatus/SiteStatus'; import SplashSettings from './pages/splashSettings/SplashSettings'; import FieldManagement from './pages/fieldManagement/FieldManagement'; import UserManagement from './pages/userManagement/UserManagement'; @@ -100,7 +100,7 @@ export default function AuthenticatedSwitch({ - + diff --git a/src/pages/siteStatus/SiteStatus.jsx b/src/pages/siteStatus/SiteStatus.jsx index 1d9b87def..24d59c94a 100644 --- a/src/pages/siteStatus/SiteStatus.jsx +++ b/src/pages/siteStatus/SiteStatus.jsx @@ -62,13 +62,13 @@ const categoryData = { }, }; -export default function ServerStatus() { +export default function SiteStatus() { const theme = useTheme(); const isXs = useMediaQuery(theme.breakpoints.only('xs')); const { data: siteInfo, loading: siteInfoLoading } = useGetSiteInfo(); - useDocumentTitle('SERVER_STATUS'); + useDocumentTitle('SITE_STATUS_PAGE_TITLE'); const { data, error, isLoading } = useSageJobs(); const { lastHour, twoWeeks, byStatus } = @@ -106,9 +106,9 @@ export default function ServerStatus() { variant="h3" component="h3" style={{ padding: '16px 0 16px 16px' }} - id="SERVER_STATUS" + id="SITE_STATUS_PAGE_TITLE" /> - +
Date: Mon, 11 Jul 2022 15:36:22 -0700 Subject: [PATCH 3/4] Add server status SuperText keys, prevent 'hide' prop from passing to Text --- src/components/SuperText.jsx | 2 +- src/pages/siteStatus/SiteStatus.jsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/SuperText.jsx b/src/components/SuperText.jsx index f6d3a6aa7..f736298ba 100644 --- a/src/components/SuperText.jsx +++ b/src/components/SuperText.jsx @@ -20,7 +20,7 @@ function SuperTextElement({ datum }) { const spaces = datum?.spaces || 1; if (isSpacer) return repeat(' ', spaces); - const textProps = omit(datum, ['type']); + const textProps = omit(datum, ['type', 'hide']); return ; } diff --git a/src/pages/siteStatus/SiteStatus.jsx b/src/pages/siteStatus/SiteStatus.jsx index 24d59c94a..84d34c2e5 100644 --- a/src/pages/siteStatus/SiteStatus.jsx +++ b/src/pages/siteStatus/SiteStatus.jsx @@ -124,6 +124,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'version', types: superTextTypes.text, children: version.packageVersion, hide: !version.packageVersion, @@ -148,6 +149,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'version', types: superTextTypes.text, children: houstonVersion, hide: !houstonVersion, @@ -172,6 +174,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'version', types: superTextTypes.text, children: sageVersion, hide: !sageVersion, @@ -196,6 +199,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'build-date', types: superTextTypes.text, children: edmBuildDate, hide: !edmBuildDate, @@ -225,6 +229,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'commit-hash', types: superTextTypes.text, children: version.commitHash, hide: !version.commitHash, @@ -249,6 +254,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'commit-hash', types: superTextTypes.text, children: houstonHash, hide: !houstonHash, @@ -273,6 +279,7 @@ export default function SiteStatus() { type: superTextTypes.spacer, }, { + key: 'commit-hash', types: superTextTypes.text, children: edmHash, hide: !edmHash, From 62d7b61efa7c882b5c3c1700cf4b0ec89e74f81d Mon Sep 17 00:00:00 2001 From: Em Date: Mon, 11 Jul 2022 17:43:47 -0700 Subject: [PATCH 4/4] Internationalize aria labels in site status components --- locale/en.json | 2 ++ src/pages/siteStatus/components/LegendItem.jsx | 9 ++++++++- src/pages/siteStatus/components/WaffleSquare.jsx | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/locale/en.json b/locale/en.json index b6b2ca040..9bf86f08e 100644 --- a/locale/en.json +++ b/locale/en.json @@ -974,6 +974,8 @@ "SERVER_TOOLTIP_JOBCOUNTER_LABEL": "Jobcounter:", "SERVER_TOOLTIP_STATUS_LABEL": "Status:", "SERVER_TOOLTIP_DATE_RECEIVED_LABEL": "Received on:", + "SERVER_TOOLTIP_SUMMARY": "Jobcounter: {jobcounter}; Status: {status}; Received on: {dateReceived}", + "SERVER_COLOR_LEGEND_BOX": "{color} legend box", "PRINTABLE_PHOTOBOOK": "Printable Photobook", "NO_IMAGES": "There are no images for this individual.", "TASKS": "Tasks", diff --git a/src/pages/siteStatus/components/LegendItem.jsx b/src/pages/siteStatus/components/LegendItem.jsx index e4de09f4d..b6131fd8f 100644 --- a/src/pages/siteStatus/components/LegendItem.jsx +++ b/src/pages/siteStatus/components/LegendItem.jsx @@ -1,11 +1,18 @@ import React from 'react'; +import { useIntl } from 'react-intl'; + import Text from '../../../components/Text'; export default function LegendItem({ color, label }) { + const intl = useIntl(); + return (