From 595c64524a08e824bfd5c48a3bda4eb963237a56 Mon Sep 17 00:00:00 2001 From: Zane Woodfin Date: Mon, 27 Jul 2020 15:52:36 -0400 Subject: [PATCH] Move link text into subtitle translations --- public/locales/en-US.json | 5 ++-- .../__snapshots__/pageHeader.test.js.snap | 28 +------------------ src/components/pageLayout/pageHeader.js | 26 ++++++++--------- 3 files changed, 14 insertions(+), 45 deletions(-) diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 88c184e02..0a0a6ed33 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -78,10 +78,9 @@ "tourDescription": "We'll walk you through each step, and include insight into how Red Hat collects and uses subscription data." }, "curiosity-view": { - "learnMore": "Learn more about Subscription Watch reporting", "OpenShiftTitle": "Red Hat OpenShift", - "OpenShiftSubtitle": "Monitor your Red Hat OpenShift usage by socket or core usage, based on your subscription terms.", + "OpenShiftSubtitle": "Monitor your Red Hat OpenShift usage by socket or core usage, based on your subscription terms. <0>Learn more about Subscription Watch reporting", "RHELTitle": "Red Hat Enterprise Linux", - "RHELSubtitle": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets." + "RHELSubtitle": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets. <0>Learn more about Subscription Watch reporting" } } diff --git a/src/components/pageLayout/__tests__/__snapshots__/pageHeader.test.js.snap b/src/components/pageLayout/__tests__/__snapshots__/pageHeader.test.js.snap index 6ea4adcb4..c61d94173 100644 --- a/src/components/pageLayout/__tests__/__snapshots__/pageHeader.test.js.snap +++ b/src/components/pageLayout/__tests__/__snapshots__/pageHeader.test.js.snap @@ -2,7 +2,6 @@ exports[`PageHeader Component should render a basic component: basic 1`] = ` @@ -46,7 +45,6 @@ exports[`PageHeader Component should render a basic component: basic 1`] = ` exports[`PageHeader Component should render string node types: string 1`] = ` @@ -80,7 +78,6 @@ exports[`PageHeader Component should render string node types: string 1`] = ` exports[`PageHeader Component should render the subtitle when viewId is provided: with subtitle 1`] = ` @@ -108,30 +105,7 @@ exports[`PageHeader Component should render the subtitle when viewId is provided

- t(curiosity-view.RHELSubtitle) - - + t(curiosity-view.RHELSubtitle, [object Object], [object Object])

diff --git a/src/components/pageLayout/pageHeader.js b/src/components/pageLayout/pageHeader.js index be02b78d3..9da324ccb 100644 --- a/src/components/pageLayout/pageHeader.js +++ b/src/components/pageLayout/pageHeader.js @@ -6,32 +6,30 @@ import { PageHeaderTitle } from '@redhat-cloud-services/frontend-components/components/cjs/PageHeader'; import { Button } from '@patternfly/react-core'; -import { helpers } from '../../common'; +import { translate } from '../i18n/i18n'; /** * Render a platform page header. * * @param {object} props * @param {Node} props.children - * @param {Function} props.t * @param {string} props.viewId * @returns {Node} */ -const PageHeader = ({ children, t, viewId }) => ( +const PageHeader = ({ children, viewId }) => ( {viewId && (

- {t(`curiosity-view.${viewId}Subtitle`)}{' '} - + {translate(`curiosity-view.${viewId}Subtitle`, {}, [ +