Skip to content

Commit

Permalink
Merge branch 'stage' into MWPW-157555
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchoi-dev committed Sep 18, 2024
2 parents 91d447d + 54c3cc0 commit f640209
Show file tree
Hide file tree
Showing 291 changed files with 18,760 additions and 5,232 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ module.exports = {
files: ['test/**/*.js'],
rules: { 'no-console': 0 },
},
{
// Override for nala test
files: ['nala/**/*.js', 'nala/**/*.test.js'],
rules: {
'no-console': 0,
'import/no-extraneous-dependencies': 0,
'max-len': 0,
'chai-friendly/no-unused-expressions': 0,
'no-plusplus': 0,
},
},
],
ignorePatterns: [
'/libs/deps/*',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const RCPDates = [
end: new Date('2024-09-12T14:00:00-07:00'),
},
{
start: new Date('2024-10-14T00:00:00-07:00'),
end: new Date('2024-11-18T17:00:00-08:00'),
start: new Date('2024-10-07T00:00:00-07:00'),
end: new Date('2024-10-18T17:00:00-07:00'),
},
{
start: new Date('2024-11-17T00:00:00-08:00'),
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/run-mas-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: MAS Unit Tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
run-tests:
name: Running tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install npm dependencies
run: npm install
working-directory: libs/features/mas

- name: Run npm test
run: npm test
working-directory: libs/features/mas

- name: Upload commerce coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: mas-commerce
token: ${{ secrets.CODECOV_TOKEN }}
files: libs/features/mas/commerce/coverage/lcov.info

- name: Upload web-components coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: mas-web-components
token: ${{ secrets.CODECOV_TOKEN }}
files: libs/features/mas/web-components/coverage/lcov.info
48 changes: 48 additions & 0 deletions .github/workflows/run-nala-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Nala Tests

on:
push:
branches:
- stage
- main
pull_request:
branches:
- stage
- main
types: [opened, synchronize, reopened]

jobs:
run-nala-tests:
name: Running Nala E2E UI Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Set execute permission for nalarun.sh
run: chmod +x ./nala/utils/pr.run.sh

- name: Run Nala Tests via pr.run.sh
run: ./nala/utils/pr.run.sh
env:
labels: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
branch: ${{ github.event.pull_request.head.ref }}
repoName: ${{ github.repository }}
prUrl: ${{ github.event.pull_request.head.repo.html_url }}
prOrg: ${{ github.event.pull_request.head.repo.owner.login }}
prRepo: ${{ github.event.pull_request.head.repo.name }}
prBranch: ${{ github.event.pull_request.head.ref }}
prBaseBranch: ${{ github.event.pull_request.base.ref }}
GITHUB_ACTION_PATH: ${{ github.workspace }}
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
6 changes: 3 additions & 3 deletions .github/workflows/run-nala.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nala Tests
name: Nala Tests (Consuming Apps)

on:
pull_request:
Expand All @@ -7,13 +7,13 @@ on:
jobs:
action:
name: Running E2E & IT
if: contains(github.event.pull_request.labels.*.name, 'run-nala')
runs-on: ubuntu-latest
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'run-nala-on-')

steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Run Nala
- name: Run Nala Tests (Consuming Apps)
uses: adobecom/nala@main # Change if doing dev work
env:
labels: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
Expand Down
1 change: 1 addition & 0 deletions .hlxignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.*
*.md
test/*
nala
build/*
LICENSE
web-test-runner.config.mjs
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/article-feed/article-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export async function loadTaxonomy() {
a.href = tax.link;
} else {
// eslint-disable-next-line no-console
window.lana.log(`Trying to get a link for an unknown topic: ${topic} (current page)`, { tags: 'errorType=warn,module=article-feed' });
window.lana.log(`Trying to get a link for an unknown topic: ${topic} (current page)`, { tags: 'article-feed' });
a.href = '#';
}
delete a.dataset.topicLink;
Expand Down
9 changes: 5 additions & 4 deletions libs/blocks/article-header/article-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ function openPopup(e) {
}

async function buildAuthorInfo(authorEl, bylineContainer) {
const { href, textContent } = authorEl;
const { textContent } = authorEl;
const link = authorEl.href || authorEl.dataset.authorPage;
const config = getConfig();
const base = config.miloLibs || config.codeRoot;
const authorImg = createTag('div', { class: 'article-author-image' });
authorImg.style.backgroundImage = `url(${base}/blocks/article-header/adobe-logo.svg)`;
bylineContainer.prepend(authorImg);

const doc = await validateAuthorUrl(href);
const doc = await validateAuthorUrl(link);
if (!doc) {
const p = createTag('p', null, textContent);
authorEl.replaceWith(p);
Expand All @@ -48,7 +49,7 @@ async function buildAuthorInfo(authorEl, bylineContainer) {

const img = doc.querySelector('img');
if (img) {
img.setAttribute('alt', authorEl.textContent);
img.setAttribute('alt', textContent);
authorImg.append(img);
if (!img.complete) {
img.addEventListener('load', () => {
Expand Down Expand Up @@ -197,7 +198,7 @@ export default async function init(blockEl) {
bylineContainer.firstElementChild.classList.add('article-byline-info');

const authorContainer = bylineContainer.firstElementChild.firstElementChild;
const authorEl = authorContainer.querySelector('a');
const authorEl = authorContainer.firstElementChild;
authorContainer.classList.add('article-author');

buildAuthorInfo(authorEl, bylineContainer);
Expand Down
1 change: 1 addition & 0 deletions libs/blocks/aside/aside.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function addCloseButton(el) {
el.querySelector('.foreground').appendChild(closeBtn);
closeBtn.addEventListener('click', (e) => {
e.target.closest('.section').classList.add('close-sticky-section');
document.dispatchEvent(new CustomEvent('milo:sticky:closed'));
});
}

Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ const PaginationPanel = () => {
options=${defaultOptions.paginationType}
/>
<${Select}
label="Animation Style"
label="Carousel Animation Style"
prop="paginationAnimationStyle"
options=${defaultOptions.paginationAnimationStyle}
/>
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,10 @@ export const getConfig = async (originalState, strs = {}) => {
lastViewedSession: state.lastViewedSession || '',
},
customCard: ['card', `return \`${state.customCard}\``],
linkTransformer: pageConfig.caasLinkTransformer || {},
headers: caasRequestHeaders,
};

return config;
};

Expand Down
38 changes: 37 additions & 1 deletion libs/blocks/editorial-card/editorial-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
margin-top: auto;
}

.editorial-card .vp-media .tablet-only,
.editorial-card .vp-media .desktop-only {
display: none;
}

.editorial-card .card-footer > div {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -142,11 +147,22 @@
height: 100%;
}

.editorial-card .background .milo-video,
.editorial-card .background .milo-iframe {
height: 100%;
padding-bottom: 0;
}

.editorial-card .lockup-area,
.editorial-card .device {
margin: 0;
}

.editorial-card .device {
font-size: var(--type-body-xxs-size);
line-height: var(--type-body-xxs-lh);
}

.editorial-card .lockup-area {
row-gap: var(--spacing-xxs);
}
Expand All @@ -173,7 +189,6 @@
justify-content: center;
}


.editorial-card hr {
background-color: currentcolor;
border: none;
Expand Down Expand Up @@ -248,3 +263,24 @@

.editorial-card.footer-align-left .action-area { justify-content: start; }
.editorial-card.footer-align-center .action-area { justify-content: center; }


/* Tablet up */
@media screen and (min-width: 600px) {
.editorial-card .vp-media .mobile-only,
.editorial-card .vp-media .desktop-only {
display: none;
}

.editorial-card .vp-media .tablet-only { display: block; }
}

/* desktop up */
@media screen and (min-width: 1200px) {
.editorial-card .vp-media .mobile-only,
.editorial-card .vp-media .tablet-only {
display: none;
}

.editorial-card .vp-media .desktop-only { display: block; }
}
Loading

0 comments on commit f640209

Please sign in to comment.