From 1e85ae9d036ac5d1f70704593c3453a1d9dc244d Mon Sep 17 00:00:00 2001 From: veronikaslc Date: Fri, 16 Sep 2022 18:02:34 -0400 Subject: [PATCH 1/9] CARDS-1741: Add a PageStart extension point to the patient UI --- modules/demo-banner/pom.xml | 1 + .../SurveyPageStart/WarningBanner.json | 6 +++++ modules/downtime-warning-banner/pom.xml | 1 + .../DowntimeWarningBanner.json | 6 +++++ .../frontend/src/patient-portal/index.jsx | 26 ++++++++++++------- .../ExtensionPoints/SurveyPageStart.json | 5 ++++ 6 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 modules/demo-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/WarningBanner.json create mode 100644 modules/downtime-warning-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/DowntimeWarningBanner.json create mode 100644 modules/patient-portal/src/main/resources/SLING-INF/content/apps/cards/ExtensionPoints/SurveyPageStart.json diff --git a/modules/demo-banner/pom.xml b/modules/demo-banner/pom.xml index ffffa37d11..89ef2e76e2 100644 --- a/modules/demo-banner/pom.xml +++ b/modules/demo-banner/pom.xml @@ -45,6 +45,7 @@ SLING-INF/content/Extensions/PageStart/;path:=/Extensions/PageStart/;overwriteProperties:=true;uninstall:=true, SLING-INF/content/Extensions/LoginPageStart/;path:=/Extensions/LoginPageStart/;overwriteProperties:=true;uninstall:=true, + SLING-INF/content/Extensions/SurveyPageStart/;path:=/Extensions/SurveyPageStart/;overwriteProperties:=true;uninstall:=true diff --git a/modules/demo-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/WarningBanner.json b/modules/demo-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/WarningBanner.json new file mode 100644 index 0000000000..78cfb2c562 --- /dev/null +++ b/modules/demo-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/WarningBanner.json @@ -0,0 +1,6 @@ +{ + "jcr:primaryType": "cards:Extension", + "cards:extensionPointId": "patient-portal/surveyPageStart", + "cards:extensionName": "Demo Warning Banner", + "cards:extensionRenderURL": "asset:cards-demo-banner.demoBanner.js" +} diff --git a/modules/downtime-warning-banner/pom.xml b/modules/downtime-warning-banner/pom.xml index 0cd2f2e8a5..af8f301e1c 100644 --- a/modules/downtime-warning-banner/pom.xml +++ b/modules/downtime-warning-banner/pom.xml @@ -43,6 +43,7 @@ SLING-INF/content/apps/cards/config/;path:=/apps/cards/config/;overwrite:=false, SLING-INF/content/Extensions/PageStart/;path:=/Extensions/PageStart/;overwriteProperties:=true;uninstall:=true, SLING-INF/content/Extensions/LoginPageStart/;path:=/Extensions/LoginPageStart/;overwriteProperties:=true;uninstall:=true, + SLING-INF/content/Extensions/SurveyPageStart/;path:=/Extensions/SurveyPageStart/;overwriteProperties:=true;uninstall:=true, SLING-INF/content/Extensions/AdminDashboard/;path:=/Extensions/AdminDashboard/;overwriteProperties:=true;uninstall:=true, SLING-INF/content/Extensions/Views/;path:=/Extensions/Views/;overwriteProperties:=true;uninstall:=true, diff --git a/modules/downtime-warning-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/DowntimeWarningBanner.json b/modules/downtime-warning-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/DowntimeWarningBanner.json new file mode 100644 index 0000000000..7bab47f214 --- /dev/null +++ b/modules/downtime-warning-banner/src/main/resources/SLING-INF/content/Extensions/SurveyPageStart/DowntimeWarningBanner.json @@ -0,0 +1,6 @@ +{ + "jcr:primaryType": "cards:Extension", + "cards:extensionPointId": "patient-portal/surveyPageStart", + "cards:extensionName": "Downtime Warning Banner", + "cards:extensionRenderURL": "asset:cards-downtime-warning-banner.downtimeBanner.js" +} diff --git a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx index ff79ad8828..208ad71ec1 100644 --- a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx +++ b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx @@ -26,6 +26,7 @@ import QuestionnaireSet from "./QuestionnaireSet.jsx"; import PatientIdentification from "./PatientIdentification.jsx"; import Footer from "./Footer.jsx"; import ErrorPage from "../components/ErrorPage.jsx"; +import PageStart from '../PageStart'; import { DEFAULT_INSTRUCTIONS, SURVEY_INSTRUCTIONS_PATH } from "./SurveyInstructionsConfiguration.jsx" @@ -113,16 +114,21 @@ function PatientPortalHomepage (props) { const hist = createBrowserHistory(); hist.listen(({action, location}) => window.dispatchEvent(new Event("beforeunload"))); ReactDOM.render( - - - - - - - - - - , + + + + + + + + + + + + + , document.querySelector('#patient-portal-container') ); diff --git a/modules/patient-portal/src/main/resources/SLING-INF/content/apps/cards/ExtensionPoints/SurveyPageStart.json b/modules/patient-portal/src/main/resources/SLING-INF/content/apps/cards/ExtensionPoints/SurveyPageStart.json new file mode 100644 index 0000000000..67605a3c82 --- /dev/null +++ b/modules/patient-portal/src/main/resources/SLING-INF/content/apps/cards/ExtensionPoints/SurveyPageStart.json @@ -0,0 +1,5 @@ +{ + "jcr:primaryType": "cards:ExtensionPoint", + "cards:extensionPointId": "patient-portal/surveyPageStart", + "cards:extensionPointName": "Content to be displayed on the top of the Patient Portal" +} From 180af7ab6dab51eb673017a6cd2e876ada15d586 Mon Sep 17 00:00:00 2001 From: veronikaslc Date: Mon, 19 Sep 2022 22:46:00 -0400 Subject: [PATCH 2/9] CARDS-1741: Add a PageStart extension point to the patient UI Better codestyle --- .../frontend/src/patient-portal/index.jsx | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx index 208ad71ec1..ac5fec5a38 100644 --- a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx +++ b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx @@ -114,21 +114,17 @@ function PatientPortalHomepage (props) { const hist = createBrowserHistory(); hist.listen(({action, location}) => window.dispatchEvent(new Event("beforeunload"))); ReactDOM.render( - - - - - - - - - - - - - , + + + + + + + + + + + , document.querySelector('#patient-portal-container') ); From ebaaceb202df0993779416d4d29c8b8e24bb875f Mon Sep 17 00:00:00 2001 From: veronikaslc Date: Wed, 21 Sep 2022 14:08:50 -0400 Subject: [PATCH 3/9] CARDS-1741: Add a PageStart extension point to the patient UI Fixed the banner alignment --- .../frontend/src/patient-portal/index.jsx | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx index ac5fec5a38..f565915fcd 100644 --- a/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx +++ b/modules/patient-portal/src/main/frontend/src/patient-portal/index.jsx @@ -42,6 +42,7 @@ function PatientPortalHomepage (props) { const [ surveyInstructions, setSurveyInstructions ] = useState(); const [ accessConfig, setAccessConfig ] = useState({}); const [ unableToProceed, setUnableToProceed ] = useState(); + const [ contentOffset, setContentOffset ] = useState(0); // Fetch saved settings for Patient Portal Survey Instructions useEffect(() => { @@ -100,13 +101,35 @@ function PatientPortalHomepage (props) { if (!subject) { return (<> - + { + if (contentOffset != th) { + setContentOffset(th); + } + } + } + /> +
+ +