Skip to content

Commit

Permalink
Revert "[Release] Stage to Main (#2043)"
Browse files Browse the repository at this point in the history
This reverts commit b19efef.
  • Loading branch information
Blainegunn authored Mar 20, 2024
1 parent b19efef commit b44ecf0
Show file tree
Hide file tree
Showing 71 changed files with 444 additions and 2,473 deletions.
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, mep } = getConfig();
const { expFragments, decorateArea } = 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] && mep) {
relHref = mep.handleFragmentCommand(expFragments[path], a);
if (!relHref) return;
if (expFragments?.[path]) {
a.href = expFragments[path];
relHref = expFragments[path];
}

if (isCircularRef(relHref)) {
Expand Down
22 changes: 2 additions & 20 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, storedQuizState = true,
preselections = [], nextQuizViewsExist: preNextQuizViewsExist = true,
}) => {
const [btnAnalytics, setBtnAnalytics] = useState(null);
const [countSelectedCards, setCountOfSelectedCards] = useState(0);
Expand Down Expand Up @@ -56,14 +56,7 @@ const App = ({
strMap[question.q] = question;
});

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

setStringData(dataStrings);
setQuestionData(questions);
Expand Down Expand Up @@ -202,8 +195,6 @@ 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 @@ -341,14 +332,6 @@ 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 @@ -357,6 +340,5 @@ 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 id="question" class="quiz-question-title" daa-lh="${heading}">${heading}</h1>
<h1 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}"
role="checkbox" aria-checked="${!!selected}" disabled="${disabled}">
aria-pressed="${!!selected}" tabindex="${disabled ? '-1' : '0'}">
${(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" role="group" aria-labelledby="question">
<div class="quiz-options-container">
<${CreateOptions}
options=${options}
selectedCards=${selectedCards}
Expand Down
Loading

0 comments on commit b44ecf0

Please sign in to comment.