From 879602f3847d261a249c7e66039e00780d63d23d Mon Sep 17 00:00:00 2001 From: Joe Armani <93854858+JoeArmani@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:06:56 -0500 Subject: [PATCH 1/6] update Bootstrap v5.3.3 --- .eslintrc.json | 1 + .gitignore | 6 +- app.js | 32 +-- css/style.css | 52 +++-- i18n/en.js | 8 +- i18n/es.js | 8 +- index.html | 53 +++-- js/components/form.js | 10 +- js/components/navbar.js | 45 ++-- js/event.js | 233 ++++++++----------- js/fieldToConceptIdMapping.js | 23 +- js/pages/agreements.js | 101 +++++---- js/pages/consent.js | 169 +++++++------- js/pages/footer.js | 10 +- js/pages/healthCareProvider.js | 44 ++-- js/pages/homePage.js | 6 +- js/pages/myToDoList.js | 76 +++---- js/pages/notifications.js | 2 +- js/pages/payment.js | 9 - js/pages/questionnaire.js | 400 +++++++++++++++++++++++++-------- js/pages/settings.js | 99 ++++---- js/pages/support.js | 145 ++---------- js/shared.js | 182 +++++++++------ lib/bootstrap.min.css | 11 +- lib/bootstrap.min.js | 8 +- 25 files changed, 940 insertions(+), 793 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 67b3c68b..13f6c1a0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,7 @@ "eslint:recommended" ], "globals": { + "bootstrap": "readonly", "firebase": "readonly", "firebaseui": "readonly", "google":"readonly", diff --git a/.gitignore b/.gitignore index 4af0c34a..26dba509 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ temp .DS_Store .hintrc .eslintrc.js +eslint.config.js connectApp-translation node_modules/ -local-dev/ \ No newline at end of file +local-dev/ +npm-debug.log* +package.json +package-lock.json \ No newline at end of file diff --git a/app.js b/app.js index e3d38340..2a945954 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,5 @@ -import { getParameters, validateToken, userLoggedIn, getMyData, hasUserData, getMyCollections, showAnimation, hideAnimation, storeResponse, isBrowserCompatible, inactivityTime, urls, appState, processAuthWithFirebaseAdmin, successResponse, logDDRumError, translateHTML, translateText, languageAcronyms } from "./js/shared.js"; -import { userNavBar, homeNavBar, languageSelector } from "./js/components/navbar.js"; +import { getParameters, validateToken, userLoggedIn, getMyData, hasUserData, getMyCollections, showAnimation, hideAnimation, storeResponse, isBrowserCompatible, inactivityTime, urls, appState, processAuthWithFirebaseAdmin, successResponse, logDDRumError, translateHTML, translateText, languageAcronyms, toggleNavbarMobileView } from "./js/shared.js"; +import { userNavBar, homeNavBar, languageSelector, signOutNavBarTemplate } from "./js/components/navbar.js"; import { homePage, joinNowBtn, whereAmIInDashboard, renderHomeAboutPage, renderHomeExpectationsPage, renderHomePrivacyPage } from "./js/pages/homePage.js"; import { addEventPinAutoUpperCase, addEventRequestPINForm, addEventRetrieveNotifications, toggleCurrentPage, toggleCurrentPageNoUser, addEventToggleSubmit, addEventLanguageSelection } from "./js/event.js"; import { requestPINTemplate, duplicateAccountReminderRender } from "./js/pages/healthCareProvider.js"; @@ -18,7 +18,8 @@ import { firebaseConfig as prodFirebaseConfig } from "./prod/config.js"; // When doing local development, uncomment this. // Get the API key file from Box or the DevOps team // Do not accept PRs with the localDevFirebaseConfig import uncommented -// import { firebaseConfig as localDevFirebaseConfig} from "./local-dev/config.js"; +import { firebaseConfig as localDevFirebaseConfig} from "./local-dev/config.js"; + import conceptIdMap from "./js/fieldToConceptIdMapping.js"; if ("serviceWorker" in navigator) { @@ -97,6 +98,10 @@ window.onload = async () => { return; } !firebase.apps.length ? firebase.initializeApp(localDevFirebaseConfig) : firebase.app(); + + // TODO: Remove this + if (location.host.startsWith('localhost')) firebase.functions().useFunctionsEmulator('http://localhost:5001'); + window.DD_RUM && window.DD_RUM.init({ ...datadogConfig, env: 'dev' }); } else { script.src = `https://maps.googleapis.com/maps/api/js?key=${devFirebaseConfig.apiKey}&libraries=places&callback=Function.prototype` !firebase.apps.length ? firebase.initializeApp(devFirebaseConfig) : firebase.app(); @@ -125,16 +130,10 @@ window.onload = async () => { const footer = document.getElementById('footer'); footer.innerHTML = footerTemplate(); - // googleTranslateElementInit(); router(); } -// TODO: 'google is not defined' datadog error - inspect loading sequence/timing. -// const googleTranslateElementInit = () => { -// if(google) new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element'); -// } - const handleVerifyEmail = (auth, actionCode) => { auth.applyActionCode(actionCode).then(function(resp) { window.location.hash = '#verified'; @@ -288,8 +287,8 @@ const renderLanguageSelector = () => { //Add the language Selector Container languageSelectorContainer = document.createElement('div'); languageSelectorContainer.id = 'languageSelectorContainer'; - let navBarAlt = document.getElementById('navbarNavAltMarkup') - navBarAlt.parentNode.insertBefore(languageSelectorContainer, navBarAlt); + let userNavBar = document.getElementById('userNavBarContainer'); + userNavBar.parentNode.insertBefore(languageSelectorContainer, userNavBar); } languageSelectorContainer.innerHTML = languageSelector(); @@ -430,22 +429,23 @@ const toggleNavBar = (route, data) => { auth.onAuthStateChanged(async user => { if (user && !user.isAnonymous){ showAnimation(); - document.getElementById('navbarNavAltMarkup').innerHTML = userNavBar(data); + document.getElementById('userNavBarContainer').innerHTML = userNavBar(data); + document.getElementById('signOutContainer').innerHTML = signOutNavBarTemplate(); document.getElementById('joinNow') ? document.getElementById('joinNow').innerHTML = joinNowBtn(false) : ``; document.getElementById('signInWrapperDiv') ? document.getElementById('signInWrapperDiv').style.display = "none" :''; document.getElementById('nextStepWarning') ? document.getElementById('nextStepWarning').innerHTML = await whereAmIInDashboard() : ''; document.getElementById('nextStepWarning') ? document.getElementById('nextStepWarning').style.display="block": ''; addEventRetrieveNotifications(); - toggleCurrentPage(route); + await toggleCurrentPage(route); hideAnimation(); - } else{ showAnimation(); - document.getElementById('navbarNavAltMarkup').innerHTML = homeNavBar(); + document.getElementById('userNavBarContainer').innerHTML = homeNavBar(); + document.getElementById('signOutContainer').innerHTML = ''; document.getElementById('joinNow') ? document.getElementById('joinNow').innerHTML = joinNowBtn(true) : ``; document.getElementById('nextStepWarning') ? document.getElementById('nextStepWarning').style.display="none": ''; - toggleCurrentPageNoUser(route); + await toggleCurrentPageNoUser(route); hideAnimation(); } }); diff --git a/css/style.css b/css/style.css index a58b871b..0c34ed82 100644 --- a/css/style.css +++ b/css/style.css @@ -1471,33 +1471,55 @@ button.connect-secondary { cursor: pointer; } -.screen-reader-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0,0,0,0); - border: 0; -} - #languageSelectorContainer { float: right; - line-height: .9rem; + line-height: 0.9rem; font-weight: bold; + display: flex; + flex-direction: column; } #languageSelectorTitle { - margin: 2px 0; - font-weight: bold; + padding-bottom: 0.25rem; + text-align: center; } #languageSelector { - margin-bottom: 2px; + margin-bottom: .25rem; +} + +@media (max-width: 991.98px) { + .navbar-collapse { + padding-top: .75rem; + } + + .navbar-toggler { + margin: 0.5rem ; + } + + /* Prevent language selector from moving when navbar expands */ + .navbar-collapse.show~#languageSelectorContainer, + .navbar-collapse.collapsing~#languageSelectorContainer { + position: absolute; + right: .75rem; + top: .8rem; + } } #appVersion { color: #fff; font-size: 0.8rem; +} + +.survey-main-body { + border: 1px solid #dee2e6; + padding: 20px; + border-radius: 0 10px 10px 10px; +} + +@media (max-width: 768px) { + .survey-main-body { + padding: 10px; + border-width: 0.5px; + } } \ No newline at end of file diff --git a/i18n/en.js b/i18n/en.js index fe2beeef..086d91e7 100644 --- a/i18n/en.js +++ b/i18n/en.js @@ -308,7 +308,7 @@ const en = { "firstName": "First name *", "middleName": "Middle name", "lastName": "Last name*", - "navButtons": "
" + "navButtons": "" }, "consent": { "list0": "Welcome", @@ -603,7 +603,7 @@ const en = { }, "footer": { "Questions": "HAVE QUESTIONS?", - "nci-dceg": "", + "nci-dceg": "", "contactLink": "Contact the Connect Support Center", "emailUs": "Email Us", "policies": "POLICIES", @@ -1365,7 +1365,7 @@ const en = { "fixesList": "
  • Check if the email was marked as spam or filtered.
  • Check your internet connection.
  • Check that you did not misspell your email.
  • Check that your inbox space is not running out or other inbox settings related issues.
  • ", "resendEmail": "If the steps above didn't work, you can resend the email. Note that this will deactivate the link in the older email.", "resendText": "Resend", - "savingSpin": "
    Loading...
    Saving", + "savingSpin": "
    Loading...
    Saving", "stateAlabama": "Alabama", "stateAlaska": "Alaska", "stateArizona": "Arizona", @@ -1695,7 +1695,7 @@ const en = { "modQualityofLifeSurvey": "Quality of Life Survey", "mod2024ConnectExperienceSurvey": "2024 Connect Experience Survey", "sessionInactiveTitle": "Inactive", - "sessionInactive": "You were inactive for 20 minutes, would you like to extend your session?
    ", + "sessionInactive": "You were inactive for 20 minutes, would you like to extend your session?
    ", "homeTitle": "My Connect - Home", "dashboardTitle": "My Connect - Dashboard", "signInPhone": "Sign in with phone number" diff --git a/i18n/es.js b/i18n/es.js index 99f658f0..2196805a 100644 --- a/i18n/es.js +++ b/i18n/es.js @@ -309,7 +309,7 @@ "firstName": "Nombre de pila *", "middleName": "Segundo nombre", "lastName": "Apellido*", - "navButtons": "
    " + "navButtons": "" }, "consent": { "list0": "Le damos la bienvenida", @@ -608,7 +608,7 @@ }, "footer": { "Questions": "¿TIENE ALGUNA PREGUNTA?", - "nci-dceg": "", + "nci-dceg": "", "contactLink": "Comuníquese con el Centro de Asistencia de Connect", "emailUs": "Escríbanos", "policies": "POLÍTICAS", @@ -1370,7 +1370,7 @@ "fixesList": "
  • Revise si el mensaje se marcó como correo no deseado o se lo filtró.
  • Revise su conexión a Internet.
  • Revise que no haya escrito mal su dirección de correo electrónico.
  • Verifique que la bandeja de entrada no se esté quedando sin espacio y que haya otros problemas relacionados con la configuración de la bandeja de entrada.
  • ", "resendEmail": "Si los pasos anteriores no funcionan, puede volver a enviar el mensaje. Tenga en cuenta que eso desactivará el enlace del mensaje anterior.", "resendText": "Reenviar", - "savingSpin": "
    Cargando…
    Guardando", + "savingSpin": "
    Cargando…
    Guardando", "stateAlabama": "Alabama", "stateAlaska": "Alaska", "stateArizona": "Arizona", @@ -1700,7 +1700,7 @@ "modQualityofLifeSurvey": "Encuesta sobre calidad de vida", "mod2024ConnectExperienceSurvey": "2024 Encuesta Sobre Experiencia de Connect", "sessionInactiveTitle": "Inactivo", - "sessionInactive": "Ha estado inactivo durante 20 minutos, ¿desea extender la sesión?
    ", + "sessionInactive": "Ha estado inactivo durante 20 minutos, ¿desea extender la sesión?
    ", "homeTitle": "My Connect - Inicio", "dashboardTitle": "My Connect - Panel", "signInPhone": "Iniciar sesión con el número de teléfono" diff --git a/index.html b/index.html index 25fd8323..1e658bc2 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,9 @@ + + + - - - + + + diff --git a/js/components/form.js b/js/components/form.js index 7b41821e..2b400a60 100644 --- a/js/components/form.js +++ b/js/components/form.js @@ -344,7 +344,7 @@ export const renderUserProfile = async () => {

    -
    +
    @@ -464,7 +464,7 @@ export const renderMailingAddress = (type, id, required, showCountry) => { State ${required ? '*': ''}
    - ${renderStates()} @@ -473,12 +473,10 @@ export const renderMailingAddress = (type, id, required, showCountry) => { - +
    -
    - -
    + ${showCountry ? `