From 9bf8b4576a60cea9c5a486791fd01a1e5cbf3c62 Mon Sep 17 00:00:00 2001
From: Marte Fossum <marte.fossum@usit.uio.no>
Date: Tue, 2 May 2023 10:21:18 +0200
Subject: [PATCH] Try to make the sponsor verify the guest correctly - Add link
 to clearify why it's important - Change name of button and header in pop-up

---
 frontend/.env                                  |  2 ++
 frontend/public/locales/en/common.json         |  6 +++---
 frontend/public/locales/nb/common.json         |  6 +++---
 frontend/public/locales/nn/common.json         |  6 +++---
 frontend/src/appConfig.ts                      |  3 +++
 frontend/src/components/identityLine/index.tsx | 15 +++++++++++++--
 6 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/frontend/.env b/frontend/.env
index 6033d809..eb242d6c 100644
--- a/frontend/.env
+++ b/frontend/.env
@@ -12,4 +12,6 @@ REACT_APP_RESPONSIBLE_ORGANIZATION='Seksjon for integrasjon og elektroniske iden
 REACT_APP_RESPONSIBLE_ORGANIZATION_EN='Department for System Integration and Identity Management (INT)'
 REACT_APP_RESPONSIBLE_ORGANIZATION_LINK='https://www.usit.uio.no/om/organisasjon/bnt/usitint/'
 
+REACT_APP_VERIFY_GUEST_EXPLANATION_LINK='https://www.uio.no/tjenester/it/brukernavn-passord/gjestetjenesten/hjelp/verifisering.html'
+
 REACT_APP_DISABLE_NIN_VERIFICATION='false'
diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json
index 40684e8e..64314f16 100644
--- a/frontend/public/locales/en/common.json
+++ b/frontend/public/locales/en/common.json
@@ -156,7 +156,7 @@
     "next": "Next",
     "save": "Save",
     "cancel": "Cancel",
-    "verify": "Verify",
+    "verify": "Verify identification",
     "backToFrontPage": "Go to front page",
     "cancelInvitation": "Cancel",
     "resendInvitation": "Resend invitation",
@@ -195,11 +195,11 @@
   "guestSubmitSuccessDescription": "Your registration is now completed. You will receive an e-mail or SMS when your account has been created.",
   "confirmationDialog": {
     "text": {
-      "uio": "Before verifying this identity, please make sure that you have seen ID-papers with a picture matching the supplied value. Approved papers are passport, Norwegian driver's license, and Norwegian national ID card.",
+      "uio": "Before verifying this identity, please make sure that you have seen ID-papers with a picture matching the supplied value. Approved papers are passport, Norwegian driver's license, and Norwegian national ID card. <br/> <br/>Read about why it is important to verify the guest <0>here</0>.",
       "uib": "Are you sure you want to verify this identity?",
       "default": "Are you sure you want to verify this identity?"
     },
-    "confirmIdentityTitle": "Confirm?",
+    "confirmIdentityTitle": "Are you sure you want to verify?",
     "cancelInvitation": "Cancel invitation?",
     "cancelInvitationDescription": "Do you want to cancel the invitation?"
   },
diff --git a/frontend/public/locales/nb/common.json b/frontend/public/locales/nb/common.json
index 38363b4a..5e19b3c1 100644
--- a/frontend/public/locales/nb/common.json
+++ b/frontend/public/locales/nb/common.json
@@ -156,7 +156,7 @@
     "next": "Neste",
     "save": "Lagre",
     "cancel": "Avbryt",
-    "verify": "Bekreft",
+    "verify": "Godkjenn identifikasjon",
     "backToFrontPage": "Tilbake til forsiden",
     "resendInvitation": "Send ny invitasjon",
     "cancelInvitation": "Kanseller",
@@ -195,11 +195,11 @@
   "guestSubmitSuccessDescription": "Din registrering er nå fullført. Du vil få en e-post eller SMS når kontoen er opprettet.",
   "confirmationDialog": {
     "text": {
-      "uio": "Vennligst sammenlign verdien du godkjenner mot ID-papirer med bilde, før du godkjenner. Godkjente papirer er pass, norsk førerkort og norsk nasjonalt ID-kort.",
+      "uio": "Vennligst sammenlign verdien du godkjenner mot ID-papirer med bilde, før du godkjenner. Godkjente papirer er pass, norsk førerkort og norsk nasjonalt ID-kort.<br/> <br/> Les mer om hvorfor det er viktig å verifisere gjesten rett <0>her</0>.",
       "uib": "Er du sikker på at du vil bekrefte denne identiteten?",
       "default": "Er du sikker på at du vil bekrefte denne identiteten?"
     },
-    "confirmIdentityTitle": "Bekrefte?",
+    "confirmIdentityTitle": "Er du sikker du vil godkjenne?",
     "cancelInvitation": "Kanseller invitasjon?",
     "cancelInvitationDescription": "Vil du kansellere invitasjonen?"
   },
diff --git a/frontend/public/locales/nn/common.json b/frontend/public/locales/nn/common.json
index e1669b95..b0961baa 100644
--- a/frontend/public/locales/nn/common.json
+++ b/frontend/public/locales/nn/common.json
@@ -156,7 +156,7 @@
     "next": "Neste",
     "save": "Lagre",
     "cancel": "Avbryt",
-    "verify": "Bekreft",
+    "verify": "Godkjenn identifikasjon",
     "backToFrontPage": "Tilbake til framsida",
     "resendInvitation": "Send ny invitasjon",
     "cancelInvitation": "Kanseller",
@@ -195,11 +195,11 @@
   "guestSubmitSuccessDescription": "Di registrering er no fullførd. Du vil få ein e-post eller SMS når kontoen er oppretta.",
   "confirmationDialog": {
     "text": {
-      "uio": "Vennligst samanlikn verdien mot ID-papirer med bilde, før du godkjenner. Godkjende papirer er pass, norsk førerkort og norsk nasjonalt ID-kort.",
+      "uio": "Vennligst samanlikn verdien mot ID-papirer med bilde, før du godkjenner. Godkjende papirer er pass, norsk førerkort og norsk nasjonalt ID-kort. <br/> <br/>Les mer om kvifor det er viktig å verifisere gjesten rett <0>her</0>.",
       "uib": "Er du sikker på at du vil bekrefte denne identiteten?",
       "default": "Er du sikker på at du vil bekrefte denne identiteten?"
     },
-    "confirmIdentityTitle": "Bekrefte?",
+    "confirmIdentityTitle": "Er du sikker du vil godkjenne?",
     "cancelInvitation": "Kanseller invitasjon?",
     "cancelInvitationDescription": "Vil du kansellere invitasjonen?"
   },
diff --git a/frontend/src/appConfig.ts b/frontend/src/appConfig.ts
index 32047507..9b1e952a 100644
--- a/frontend/src/appConfig.ts
+++ b/frontend/src/appConfig.ts
@@ -27,6 +27,9 @@ export const appStagingWarning: boolean =
 export const guestConsentStepEnabled: boolean =
   env.REACT_APP_GUEST_CONSENT_STEP_ENABLED === 'true'
 
+/* Link to read more about the importance of verifying a guest */
+export const verifyGuestExplanationLink: string = env.REACT_APP_VERIFY_GUEST_EXPLANATION_LINK as string
+
 /* Should the 'available in search' field on roles be available for use? */
 export const availableInSearchEnabled: boolean =
   env.REACT_APP_AVAILABLE_IN_SEARCH_ENABLED === 'true'
diff --git a/frontend/src/components/identityLine/index.tsx b/frontend/src/components/identityLine/index.tsx
index 4b8cf3de..ddf9d53a 100644
--- a/frontend/src/components/identityLine/index.tsx
+++ b/frontend/src/components/identityLine/index.tsx
@@ -7,7 +7,12 @@ import { fetchJsonOpts, submitJsonOpts } from 'utils'
 import CheckIcon from '@mui/icons-material/Check'
 import { Trans, useTranslation } from 'react-i18next'
 import { TableCell } from 'components/table'
-import { appInst, disableNinVerification, enableIgaCheck } from 'appConfig'
+import {
+  appInst,
+  disableNinVerification,
+  enableIgaCheck,
+  verifyGuestExplanationLink,
+} from 'appConfig'
 
 interface IdentityLineProps {
   text: string
@@ -85,7 +90,13 @@ const IdentityLine = ({
   const getDialogText = () => {
     switch (appInst) {
       case 'uio':
-        return t('confirmationDialog.text.uio')
+        return (
+          <Trans
+            t={t}
+            i18nKey="confirmationDialog.text.uio"
+            components={[<a href={verifyGuestExplanationLink || '#'}> </a>]}
+          />
+        )
       case 'uib':
         return t('confirmationDialog.text.uib')
       default:
-- 
GitLab