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

[Release] Stage to Main #2043

Merged
merged 26 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d9de74
MWPW-143648 - [Action Item] Fix float icon position (#1957)
Sartxi Mar 14, 2024
27f8507
MWPW-142798 + MWPW-142872: Made the height-fit-content class to be se…
mirafedas Mar 14, 2024
0e512db
MWPW-144575: Fix for commerce modal height (#2014)
Axelcureno Mar 15, 2024
1786b5a
[MWPW-144516] Handle cross cloud menu block error (#2006)
overmyheadandbody Mar 15, 2024
56bbeb1
fix(MWPW-142248): Accessibility for carousels containing focusable el…
sharath-kannan Mar 15, 2024
52bb962
MWPW-144575: Modal-Iframe for apps-whats-included is broken for Deskt…
mirafedas Mar 15, 2024
d2f377e
Sync stage with main (#2025)
vhargrave Mar 18, 2024
79455a6
Merge remote-tracking branch 'upstream/main' into main-to-stage
yesil Mar 18, 2024
9754674
remove extra line
yesil Mar 18, 2024
7af20af
Main to stage (#2027)
vhargrave Mar 18, 2024
9b3dad1
MWPW-144575: fix for the modal duplication (#2021)
mirafedas Mar 18, 2024
32959b6
[MWPW-137148] [PERFORMANCE] Load IMS from the same domain (#1996)
mokimo Mar 18, 2024
944ae19
MWPW-142003: Mini Compare Chart Mobile styling (#1989)
Axelcureno Mar 18, 2024
f5a436c
MWPW-143202 firefox gnav not appearing bug (#1969)
vhargrave Mar 18, 2024
dc2f291
Merge branch 'main' into stage
Blainegunn Mar 18, 2024
e909bc6
Excluding modals from Active link check (#1942)
bandana147 Mar 19, 2024
1d0d5a3
[MWPW-144602] Ensure DNT functionality in top nav (#2020)
overmyheadandbody Mar 19, 2024
d95029e
Revert "MWPW-142003: Mini Compare Chart Mobile styling" (#2041)
Blainegunn Mar 19, 2024
248f71c
MWPW-144026 Update Twitter Icon to X (#2030)
meganthecoder Mar 19, 2024
d9f9dd1
Add support for bold as header if no header (#1997)
vgoodric Mar 19, 2024
a690836
[MWPW-144112] send-to-caas: point to prod end-point (#1995)
jedjedjedM Mar 19, 2024
7b115d2
[MILO] Allow svg or media files to be located in a fragments folder (…
vgoodric Mar 19, 2024
dc687a1
Consolidate MEP PR's for stage (#1975)
vgoodric Mar 19, 2024
6c08840
UAR integration - Quiz Sync for state in local storage and accessibil…
colloyd Mar 19, 2024
cffe9f8
Merge branch 'main' into sync-stage-with-main
vhargrave Mar 20, 2024
fa5f12a
Sync stage with main (#2047)
overmyheadandbody Mar 20, 2024
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
8 changes: 4 additions & 4 deletions libs/blocks/fragment/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function replaceDotMedia(path, doc) {
}

export default async function init(a) {
const { expFragments, decorateArea } = getConfig();
const { expFragments, decorateArea, mep } = getConfig();
let relHref = localizeLink(a.href);
let inline = false;

Expand All @@ -78,9 +78,9 @@ export default async function init(a) {
}

const path = new URL(a.href).pathname;
if (expFragments?.[path]) {
a.href = expFragments[path];
relHref = expFragments[path];
if (expFragments?.[path] && mep) {
relHref = mep.handleFragmentCommand(expFragments[path], a);
if (!relHref) return;
}

if (isCircularRef(relHref)) {
Expand Down
22 changes: 20 additions & 2 deletions libs/blocks/quiz/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function loadFragments(fragmentURL) {
const App = ({
initialIsDataLoaded = false,
preQuestions = {}, initialStrings = {}, shortQuiz: isShortQuiz = false,
preselections = [], nextQuizViewsExist: preNextQuizViewsExist = true,
preselections = [], nextQuizViewsExist: preNextQuizViewsExist = true, storedQuizState = true,
}) => {
const [btnAnalytics, setBtnAnalytics] = useState(null);
const [countSelectedCards, setCountOfSelectedCards] = useState(0);
Expand Down Expand Up @@ -56,7 +56,14 @@ const App = ({
strMap[question.q] = question;
});

setUserFlow([questions.questions.data[0].questions]);
if (!!Object.keys(storedQuizState).length
&& !!storedQuizState?.userFlow.length
&& !!storedQuizState?.userSelection.length) {
setUserFlow(storedQuizState.userFlow);
updateUserSelection(storedQuizState.userSelection);
} else {
setUserFlow([questions.questions.data[0].questions]);
}

setStringData(dataStrings);
setQuestionData(questions);
Expand Down Expand Up @@ -195,6 +202,8 @@ const App = ({
const nextQuizViewsLen = nextQuizViews.length;
const [firstQuizView] = nextQuizViews;

localStorage.removeItem('stored-quiz-state');

if (nextQuizViewsLen === 1 && isValidUrl(firstQuizView)) {
window.location.href = firstQuizView;
return;
Expand Down Expand Up @@ -332,6 +341,14 @@ export default async function init(
) {
const configData = initConfigPathGlob(el);
const updatedShortQuiz = shortQuiz || configData.shortQuiz;
let storedQuizState = localStorage.getItem('stored-quiz-state') || {};

try {
storedQuizState = JSON.parse(storedQuizState);
} catch (e) {
storedQuizState = {};
}

el.replaceChildren();
render(html`<${App}
initialIsDataLoaded=${initialIsDataLoaded}
Expand All @@ -340,5 +357,6 @@ export default async function init(
shortQuiz=${updatedShortQuiz}
preselections=${preselections}
nextQuizViewsExist=${nextQuizViewsExist}
storedQuizState=${storedQuizState}
/>`, el);
}
2 changes: 1 addition & 1 deletion libs/blocks/quiz/quizcontainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { html } from '../../deps/htm-preact.js';
export const DecorateBlockBackgroundCmp = ({ background = '' }) => html`<img loading="eager" alt="" src=${background} height="1020" width="1920" />`;

export const DecorateBlockForeground = ({ heading, subhead }) => html`<div class="quiz-foreground">
<h1 class="quiz-question-title" daa-lh="${heading}">${heading}</h1>
<h1 id="question" class="quiz-question-title" daa-lh="${heading}">${heading}</h1>
<p class="quiz-question-text">${subhead}</p>
</div>`;

Expand Down
4 changes: 2 additions & 2 deletions libs/blocks/quiz/quizoption.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const OptionCard = ({
`;

return html`<button class="quiz-option ${getOptionClass()}" data-option-name="${options}"
aria-pressed="${!!selected}" tabindex="${disabled ? '-1' : '0'}">
role="checkbox" aria-checked="${!!selected}" disabled="${disabled}">
${(icon || iconTablet || iconDesktop) && getIconHtml()}
${image && imageHtml}
<div class="quiz-option-text-container">
Expand Down Expand Up @@ -78,7 +78,7 @@ export const GetQuizOption = ({
btnAnalyticsData, background,
}) => html`
<div class="quiz-question">
<div class="quiz-options-container">
<div class="quiz-options-container" role="group" aria-labelledby="question">
<${CreateOptions}
options=${options}
selectedCards=${selectedCards}
Expand Down
Loading
Loading