Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade bootstrap 5 3 3 #859

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"eslint:recommended"
],
"globals": {
"bootstrap": "readonly",
"firebase": "readonly",
"firebaseui": "readonly",
"google":"readonly",
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ temp
.DS_Store
.hintrc
.eslintrc.js
eslint.config.js
JoeArmani marked this conversation as resolved.
Show resolved Hide resolved
connectApp-translation
node_modules/
local-dev/
local-dev/
npm-debug.log*
package.json
package-lock.json
27 changes: 12 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -19,6 +19,7 @@ import { firebaseConfig as prodFirebaseConfig } from "./prod/config.js";
// 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 conceptIdMap from "./js/fieldToConceptIdMapping.js";

if ("serviceWorker" in navigator) {
Expand Down Expand Up @@ -97,6 +98,7 @@ window.onload = async () => {
return;
}
!firebase.apps.length ? firebase.initializeApp(localDevFirebaseConfig) : firebase.app();
window.DD_RUM && window.DD_RUM.init({ ...datadogConfig, env: 'dev' });
JoeArmani marked this conversation as resolved.
Show resolved Hide resolved
} 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();
Expand Down Expand Up @@ -125,16 +127,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';
Expand Down Expand Up @@ -288,8 +284,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();
Expand Down Expand Up @@ -430,22 +426,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();
}
});
Expand Down
52 changes: 37 additions & 15 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
JoeArmani marked this conversation as resolved.
Show resolved Hide resolved
}

@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;
JoeArmani marked this conversation as resolved.
Show resolved Hide resolved
}
}

#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;
}
}
36 changes: 36 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.browser,
bootstrap: "readonly",
firebase: "readonly",
firebaseui: "readonly",
google: "readonly",
workbox: "readonly",
importScripts: "readonly",
localforage: "readonly",
pdfjsLib: "readonly",
PDFLib: "readonly",
download: "readonly",
},

ecmaVersion: 2020,
sourceType: "module",
},

rules: {},
}];
8 changes: 4 additions & 4 deletions i18n/en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions i18n/es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading