From 9b7c81d8ad97260ed15171a28084f841626eb2b7 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Tue, 11 Jun 2024 11:51:20 +0200 Subject: [PATCH 1/2] back to use master api branch in e2e --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3094e921..acf3c9e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@v4 with: repository: wri/fti_api - ref: feature/newsletter-history + ref: master path: otp_api - name: Save OTP API Commit SHA From f938dde176fe1ed7875f45865cffa1d52060c15f Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 12 Jun 2024 14:38:58 +0200 Subject: [PATCH 2/2] better quality newsletter image, fix date translation --- pages/newsletter.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/newsletter.js b/pages/newsletter.js index 039289eb..095da138 100644 --- a/pages/newsletter.js +++ b/pages/newsletter.js @@ -14,7 +14,7 @@ import API from 'services/api'; const JSONA = new Jsona(); -const Newsletter = ({ url, newsletters }) => { +const Newsletter = ({ url, newsletters, language }) => { const intl = useIntl(); return ( @@ -47,7 +47,7 @@ const Newsletter = ({ url, newsletters }) => { // genereate newsletter card with image on top and title and description below
-
+

@@ -56,7 +56,7 @@ const Newsletter = ({ url, newsletters }) => {

- {new Date(newsletter.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', timeZone: 'UTC' })} + {new Date(newsletter.date).toLocaleDateString(language, { year: 'numeric', month: 'long', timeZone: 'UTC' })}

{newsletter["short-description"]}

@@ -77,7 +77,8 @@ const Newsletter = ({ url, newsletters }) => { Newsletter.propTypes = { url: PropTypes.shape({}).isRequired, - newsletters: PropTypes.array.isRequired + newsletters: PropTypes.array.isRequired, + language: PropTypes.string.isRequired }; Newsletter.getInitialProps = async ({ url, store }) => { const { language } = store.getState(); @@ -85,7 +86,7 @@ Newsletter.getInitialProps = async ({ url, store }) => { .get('newsletters', { locale: language }) .then((response) => JSONA.deserialize(response)); - return { url, newsletters }; + return { url, newsletters, language }; }