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 #2571

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 0 additions & 1 deletion .github/workflows/merge-to-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}
MILO_STAGE_SLACK_WH: ${{secrets.MILO_STAGE_SLACK_WH}}

jobs:
merge-to-main:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {

Check warning on line 1 in .github/workflows/merge-to-stage.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
slackNotification,
getLocalConfigs,
isWithinRCP,
Expand Down Expand Up @@ -132,7 +132,7 @@
try {
if (files.some((file) => SEEN[file])) {
commentOnPR(
`Skipped ${number}: ${title} due to file overlap. Merging will be attempted in the next batch`,
`Skipped ${number}: ${title} due to file "${file}" overlap. Merging will be attempted in the next batch`,
number
);
continue;
Expand All @@ -157,10 +157,11 @@
number,
title,
prefix,
})
}).catch(console.error)
);
await new Promise((resolve) => setTimeout(resolve, 5000));
} catch (error) {
files.forEach((file) => (SEEN[file] = false));
commentOnPR(`Error merging ${number}: ${title} ` + error.message, number);
}
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/merge-to-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}
REQUIRED_APPROVALS: ${{ secrets.REQUIRED_APPROVALS }}
SLACK_HIGH_IMPACT_PR_WEBHOOK: ${{ secrets.SLACK_HIGH_IMPACT_PR_WEBHOOK }}
MILO_STAGE_SLACK_WH: ${{secrets.MILO_STAGE_SLACK_WH}}

jobs:
merge-to-stage:
Expand Down
5 changes: 5 additions & 0 deletions libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ const parseTwpContent = async (el, merchCard) => {
const content = group.filter((e) => e.tagName.toLowerCase() === 'p' || e.tagName.toLowerCase() === 'ul');
const bodySlot = createTag('div', { slot: 'body-xs' }, content);
merchCard.append(bodySlot);

const whatsIncludedLink = bodySlot.querySelector('a[href*="merch-whats-included"]');
if (whatsIncludedLink) {
whatsIncludedLink.classList.add('merch-whats-included');
}
} else if (index === 2) { // Footer section
const footerContent = group.filter((e) => ['h5', 'p'].includes(e.tagName.toLowerCase()));
const footer = createTag('div', { slot: 'footer' }, footerContent);
Expand Down
6 changes: 6 additions & 0 deletions libs/blocks/merch-mnemonic-list/merch-mnemonic-list.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.merch-mnemonic-list {
display: flex;
height: 380px;
flex-flow: column;
flex-wrap: wrap;
}
21 changes: 21 additions & 0 deletions libs/blocks/merch-mnemonic-list/merch-mnemonic-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import '../../deps/merch-mnemonic-list.js';
import '../../deps/merch-card.js';
import { createTag } from '../../utils/utils.js';

const init = async (el) => {
const rows = el.querySelectorAll(':scope p:not([class])');
if (rows.length < 1) return;
[...rows].forEach((paragraph) => {
const merchMnemonicList = createTag('merch-mnemonic-list');
paragraph.setAttribute('slot', 'description');
const picture = paragraph.querySelector('picture');
const img = picture.querySelector('img');
const icon = createTag('merch-icon', { slot: 'icon', size: 's', src: img.src });
picture.remove();
if (icon) merchMnemonicList.appendChild(icon);
if (paragraph) merchMnemonicList.appendChild(paragraph);
el.appendChild(merchMnemonicList);
});
};

export default init;
13 changes: 13 additions & 0 deletions libs/blocks/merch-twp/merch-twp.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ export default async function init(el) {
content.querySelector('h4').setAttribute('slot', 'detail-xl');
twp.append(...[...content.querySelectorAll(':scope > h4, merch-card')]);

const whatsIncludedFragment = el.querySelector('.fragment[data-path*="merch-whats-included"]');
if (whatsIncludedFragment) {
const whatsIncludedSlot = createTag(
'div',
{
slot: 'merch-whats-included',
class: 'hidden merch-whats-included-container',
},
whatsIncludedFragment,
);
twp.append(whatsIncludedSlot);
}

const cciFooter = createTag('div', { slot: 'cci-footer' });
cciFooter.append(...[...content.querySelectorAll('p:not(hr ~ p)')]);
const cctFooter = createTag('div', { slot: 'cct-footer' });
Expand Down
37 changes: 37 additions & 0 deletions libs/blocks/merch-whats-included/merch-whats-included.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.merch-whats-included-container > .fragment {
width: inherit;
height: inherit;
max-height: 100%;
display: block;
}

.merch-whats-included-container .content h3 {
margin: 0;
}

.merch-whats-included-container .fragment .container {
display: contents;
}

.merch-whats-included-container .fragment .content {
float: right;
}

.merch-whats-included-container .fragment .content a[is="checkout-link"] {
margin-inline-start: var(--spacing-xxs);
}

@media screen and (max-width: 767px) {
.merch-whats-included-container {
position: fixed;
overflow: hidden scroll;
}

.merch-mnemonic-list {
height: auto;
}

.merch-whats-included-container .fragment .container {
grid-auto-flow: row;
}
}
30 changes: 30 additions & 0 deletions libs/blocks/merch-whats-included/merch-whats-included.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import '../../deps/merch-whats-included.js';
import { createTag } from '../../utils/utils.js';

const init = async (el) => {
const styles = Array.from(el.classList);
const mobileRows = styles.find((style) => /\d/.test(style));
const heading = el.querySelector('h3, h4');
const content = el.querySelector('.section');

const contentSlot = createTag(
'div',
{ slot: 'content' },
content.innerHTML,
);
const whatsIncluded = createTag(
'merch-whats-included',
{ mobileRows: mobileRows || 1 },
);
if (heading) {
heading.setAttribute('slot', 'heading');
whatsIncluded.appendChild(heading);
}

whatsIncluded.appendChild(contentSlot);
const divsWithoutClass = contentSlot.querySelectorAll('div:not([class])');
divsWithoutClass.forEach((div) => div.remove());
el.replaceWith(whatsIncluded);
};

export default init;
Loading
Loading