Skip to content

Commit

Permalink
Merge branch 'stage' of github.com:adobecom/milo into MWPW-165302
Browse files Browse the repository at this point in the history
  • Loading branch information
yesil committed Jan 23, 2025
2 parents 603a868 + 7d4a28d commit 7af0f95
Show file tree
Hide file tree
Showing 82 changed files with 2,679 additions and 858 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ let body = `
const isHighPrio = (labels) => labels.includes(LABELS.highPriority);
const isZeroImpact = (labels) => labels.includes(LABELS.zeroImpact);

const hasFailingChecks = (checks) => checks.some(({ conclusion, name }) => name !== 'merge-to-stage' && conclusion === 'failure');
const hasFailingChecks = (checks) =>
checks.some(
({ conclusion, name }) =>
name !== 'merge-to-stage' &&
(conclusion === 'in_progress' || conclusion === 'failure')
);

const commentOnPR = async (comment, prNumber) => {
console.log(comment); // Logs for debugging the action.
Expand Down Expand Up @@ -90,7 +95,7 @@ const getPRs = async () => {

prs = prs.filter(({ checks, reviews, number, title }) => {
if (hasFailingChecks(checks)) {
commentOnPR(`Skipped merging ${number}: ${title} due to failing checks`, number);
commentOnPR(`Skipped merging ${number}: ${title} due to failing or running checks`, number);
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions libs/blocks/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ function toggleMedia(con, trig, status) {
trig.setAttribute('hidden', '');
trig.setAttribute('aria-expanded', 'false');
con.setAttribute('hidden', '');
con.setAttribute('aria-expanded', 'false');
} else {
trig.setAttribute('aria-expanded', 'true');
trig.removeAttribute('hidden');
con.setAttribute('aria-expanded', 'true');
con.removeAttribute('hidden');
}
}
Expand Down
3 changes: 1 addition & 2 deletions libs/blocks/global-footer/global-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ class Footer {
<a
href="${regionSelector.href}"
class="${regionPickerClass}"
aria-expanded="false"
aria-haspopup="true"
role="button">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="feds-regionPicker-globe" focusable="false">
<use href="#footer-icon-globe" />
Expand Down Expand Up @@ -284,6 +282,7 @@ class Footer {
});
} else {
// No hash -> region selector expands a dropdown
regionPickerElem.setAttribute('aria-haspopup', 'true');
regionPickerElem.href = '#'; // reset href value to not get treated as a fragment
regionSelector.href = localizeLink(regionSelector.href);
decorateAutoBlock(regionSelector); // add fragment-specific class(es)
Expand Down
3 changes: 3 additions & 0 deletions libs/blocks/global-navigation/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
--feds-backgroundColor-tabs-v2: #f8f8f8;
--feds-backgroundColor-tabContent-v2: #f3f3f3;
--feds-borderColor-localnav-v2: #eee;

/* App banner */
--app-banner-height: 76px;
}

/* Nav Link styles */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ const createBreadcrumbs = (element) => {
if (hiddenEntries.includes(li.innerText?.toLowerCase().trim())) li.remove();
});

const noTransform = element.classList.contains('no-transform') ? ' no-transform' : '';

const breadcrumbs = toFragment`
<div class="feds-breadcrumbs-wrapper">
<nav class="feds-breadcrumbs" aria-label="Breadcrumb">${ul}</nav>
<nav class="feds-breadcrumbs${noTransform}" aria-label="Breadcrumb">${ul}</nav>
</div>
`;
ul.querySelector('li:last-of-type')?.setAttribute('aria-current', 'page');
Expand Down
5 changes: 3 additions & 2 deletions libs/blocks/global-navigation/features/profile/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class ProfileDropdown {
// the email had some special logic as well;
// for MVP, we took a simpler approach ("Some very long name, very l...")
this.avatarElem = toFragment`<img
data-cs-mask
class="feds-profile-img"
src="${this.avatar}"
tabindex="0"
Expand All @@ -117,8 +118,8 @@ class ProfileDropdown {
>
${this.avatarElem}
<div class="feds-profile-details">
<p class="feds-profile-name">${this.profileData.displayName}</p>
<p class="feds-profile-email">${this.decorateEmail(this.profileData.email)}</p>
<p data-cs-mask class="feds-profile-name">${this.profileData.displayName}</p>
<p data-cs-mask class="feds-profile-email">${this.decorateEmail(this.profileData.email)}</p>
<p class="feds-profile-account">${this.placeholders.viewAccount}</p>
</div>
</a>
Expand Down
10 changes: 10 additions & 0 deletions libs/blocks/global-navigation/global-navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ header.global-navigation {
text-transform: capitalize;
}

.feds-breadcrumbs.no-transform a,
.feds-breadcrumbs.no-transform [aria-current] {
text-transform: none;
}

.feds-breadcrumbs a {
display: block;
color: var(--feds-color-link-breadcrumbs);
Expand Down Expand Up @@ -1322,3 +1327,8 @@ html:has(body.disable-ios-scroll) { /* this class is only added on iOS */
height: 100dvh;
position: fixed;
}

/* GNAV popup height fix in case of app banner */
.branch-banner-is-active header.new-nav .feds-nav > section.feds-navItem > .feds-popup {
height: calc(100dvh - var(--app-banner-height));
}
11 changes: 6 additions & 5 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ const decorateProfileTrigger = async ({ avatar }) => {

const buttonElem = toFragment`
<button
data-cs-mask
class="feds-profile-button"
aria-expanded="false"
aria-controls="feds-profile-menu"
aria-label="${label}"
daa-ll="Account"
aria-haspopup="true"
>
<img class="feds-profile-img" src="${avatar}" alt="${profileAvatar}"></img>
<img data-cs-mask class="feds-profile-img" src="${avatar}" alt="${profileAvatar}"></img>
</button>
`;

Expand Down Expand Up @@ -301,7 +302,7 @@ class Gnav {
this.blocks = {
profile: {
rawElem: this.content.querySelector('.profile'),
decoratedElem: toFragment`<div class="feds-profile"></div>`,
decoratedElem: toFragment`<div data-cs-mask class="feds-profile"></div>`,
},
search: { config: { icon: CONFIG.icons.search } },
breadcrumbs: { wrapper: '' },
Expand Down Expand Up @@ -351,7 +352,7 @@ class Gnav {
this.addChangeEventListeners,
];
const fetchKeyboardNav = () => {
setupKeyboardNav(this.newMobileNav && this.isLocalNav());
setupKeyboardNav(this.isLocalNav());
};
this.block.addEventListener('click', this.loadDelayed);
this.block.addEventListener('keydown', fetchKeyboardNav);
Expand Down Expand Up @@ -793,7 +794,7 @@ class Gnav {

isToggleExpanded = () => this.elements.mobileToggle?.getAttribute('aria-expanded') === 'true';

isLocalNav = () => this
isLocalNav = () => this.newMobileNav && this
.elements
.navWrapper
?.querySelectorAll('.feds-nav > section.feds-navItem')
Expand All @@ -816,7 +817,7 @@ class Gnav {
const section = sections[0];
queueMicrotask(() => section.click());
}
} else if (isExpanded && this.newMobileNav && this.isLocalNav()) {
} else if (isExpanded && this.isLocalNav()) {
enableMobileScroll();
}
toggle?.setAttribute('aria-expanded', !isExpanded);
Expand Down
3 changes: 2 additions & 1 deletion libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ export function trigger({ element, event, type } = {}) {
closeAllDropdowns({ type });
if (isOpen) return false;
element.setAttribute('aria-expanded', 'true');
if (!isDesktop.matches && type === 'dropdown') disableMobileScroll();
if (!isDesktop.matches && type === 'dropdown'
&& !!document.querySelector('header.new-nav')) disableMobileScroll();
return true;
}

Expand Down
7 changes: 6 additions & 1 deletion libs/blocks/mmm/mmm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fetchData, DATA_TYPE } from '../../features/personalization/personaliza
import { getMepPopup, API_URLS } from '../../features/personalization/preview.js';

const SEARCH_CRITERIA_CHANGE_EVENT = 'mmm-search-change';
let cachedSearchCriteria = '';
export const DEBOUNCE_TIME = 800;

async function toggleDrawer(target, dd, pageId) {
Expand Down Expand Up @@ -319,7 +320,11 @@ async function createPageList(el, search) {

function subscribeToSearchCriteriaChanges() {
document.addEventListener(SEARCH_CRITERIA_CHANGE_EVENT, (el) => {
createPageList(document.querySelector('.mmm').parentNode, el.detail);
const searchCriteria = JSON.stringify(el?.detail || {});
if (cachedSearchCriteria !== searchCriteria) {
createPageList(document.querySelector('.mmm').parentNode, el.detail);
cachedSearchCriteria = searchCriteria;
}
});
}

Expand Down
138 changes: 138 additions & 0 deletions libs/blocks/rollout/rollout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/* Rollout Modal styling */
.modal {
padding: 20px;
max-width: 500px;
margin: 40px auto;
text-align: center;
font-family: Arial, sans-serif;
}

.modal.warning {
display: flex;
align-items: center;
justify-content: center;
gap: 15px;
background-color: #fff3e0;
border: 1px solid #ffb74d;
border-radius: 8px;
padding: 15px 20px;
text-align: left;
}

.warning-icon {
width: 24px;
height: 24px;
background-color: #f57c00;
border-radius: 50%;
position: relative;
}

.warning-icon:before {
content: "!";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-weight: bold;
font-size: 16px;
}

.warning-text {
color: #e65100;
font-size: 20px;
font-weight: 800;
}

.warning-text-sub {
font-size: 14px;
font-weight: 500;
}

.env-label {
font-weight: 600;
margin-bottom: 10px;
color: #333;
font-size: 16px;
}

.radio-group {
display: flex;
flex-direction: column;
gap: 10px;
margin: 10px 0;
}

.radio-group label {
display: flex;
align-items: center;
font-size: 14px;
font-weight: 500;
padding: 8px 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #fff;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
}

.radio-group label:hover {
border-color: #0078d4;
background-color: #f0f8ff;
box-shadow: 0 3px 6px rgb(0 0 0 / 10%);
}

.radio-group input[type="radio"] {
margin-right: 8px;
accent-color: #0078d4;
width: 16px;
height: 16px;
}

.button-group {
display: flex;
justify-content: center;
margin-top: 15px;
}

.rollout-btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 8px 16px;
font-size: 14px;
font-weight: bold;
color: #fff;
background: linear-gradient(135deg, #0078d4, #005a9e);
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 3px 6px rgb(0 0 0 / 10%);
}

.rollout-btn:hover {
background: linear-gradient(135deg, #005a9e, #003e6b);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgb(0 0 0 / 15%);
}

.rollout-btn:active {
background: linear-gradient(135deg, #004080, #002a57);
transform: translateY(1px);
box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

.rollout-btn:disabled {
background-color: #ccc;
color: #666;
cursor: not-allowed;
box-shadow: none;
}

.rollout-btn-text {
font-size: 14px;
font-weight: normal;
color: inherit;
}
Loading

0 comments on commit 7af0f95

Please sign in to comment.