Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…ocks into fix/product-query-global-query
  • Loading branch information
gigitux committed Nov 24, 2022
2 parents 780e5c0 + 78228fb commit 6905099
Show file tree
Hide file tree
Showing 145 changed files with 2,946 additions and 1,471 deletions.
7 changes: 5 additions & 2 deletions .github/monitor-typescript-errors/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ inputs:
repo-token:
description: 'GitHub token'
required: true
compare:
description: 'Path checkstyle.xml file'
checkstyle:
description: 'Path checkstyle.xml file of current PR/branch'
required: true
checkstyle-trunk:
description: 'Path checkstyle.xml file of trunk'
required: true

runs:
Expand Down
23 changes: 7 additions & 16 deletions .github/monitor-typescript-errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,26 @@ const { setFailed, getInput } = require( '@actions/core' );
const { parseXml, getFilesWithNewErrors } = require( './utils/xml' );
const { generateMarkdownMessage } = require( './utils/markdown' );
const { addRecord } = require( './utils/airtable' );
const { getFileContent, addComment } = require( './utils/github' );
const { addComment } = require( './utils/github' );

const runner = async () => {
const token = getInput( 'repo-token', { required: true } );
const octokit = getOctokit( token );
const payload = context.payload;
const repo = payload.repository.name;
const owner = payload.repository.owner.login;
const fileName = getInput( 'compare', {
const fileName = getInput( 'checkstyle', {
required: true,
} );
const trunkFileName = getInput( 'checkstyle-trunk', {
required: true,
} );

const newCheckStyleFile = fs.readFileSync( fileName );
const newCheckStyleFileParsed = parseXml( newCheckStyleFile );
const currentCheckStyleFile = await getFileContent( {
octokit,
owner,
repo,
fileName,
onFail: setFailed,
} );

if ( ! currentCheckStyleFile.data ) {
setFailed( 'No Content Available' );
return;
}

const currentCheckStyleFile = fs.readFileSync( trunkFileName );
const currentCheckStyleFileContentParsed = parseXml(
currentCheckStyleFile.data
currentCheckStyleFile
);

const { header } = generateMarkdownMessage( newCheckStyleFileParsed );
Expand Down
25 changes: 0 additions & 25 deletions .github/monitor-typescript-errors/utils/github.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
exports.getFileContent = async ( {
octokit,
owner,
repo,
fileName,
onFail,
} ) => {
try {
return await octokit.rest.repos.getContent( {
owner,
repo,
path: fileName,
mediaType: {
format: 'raw',
},
} );
} catch ( err ) {
if ( err.status === '404' ) {
return;
}

onFail( err.message );
}
};

const getReportCommentId = async ( { octokit, owner, repo, payload } ) => {
const currentComments = await octokit.rest.issues.listComments( {
owner,
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/php-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ jobs:

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT


- name: Set up Composer caching
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/php-js-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -124,8 +125,8 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
34 changes: 15 additions & 19 deletions .github/workflows/typescript-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
check-typescript-errors-with-trunk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
ref: 'trunk'

- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -30,10 +30,19 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

- name: npm install
- name: Generate checkstyle for trunk
run: |
npm ci
npm run ts:log-errors
mv checkstyle.xml $HOME/checkstyle-trunk.xml
- uses: actions/checkout@v3

- name: Generate checkstyle for current PR
run: |
npm ci
npm run ts:log-errors
mv $HOME/checkstyle-trunk.xml checkstyle-trunk.xml
- name: Get branch name
id: branch-name
Expand All @@ -43,21 +52,8 @@ jobs:
uses: ./.github/monitor-typescript-errors
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
compare: checkstyle.xml
checkstyle: checkstyle.xml
checkstyle-trunk: checkstyle-trunk.xml
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
CURRENT_BRANCH: ${{ steps.branch-name.outputs.current_branch }}

- name: Check if the checklist.xml file is changed
id: verify_diff
run: |
git diff --quiet checkstyle.xml || echo "::set-output name=is_different_checkstyle::true"
- name: Commit the new checklist.xml file
if: steps.verify_diff.outputs.is_different_checkstyle == 'true'
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add checkstyle.xml
git commit -m "bot: update checkstyle.xml"
git push
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Set up Composer caching
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
Expand Down
7 changes: 4 additions & 3 deletions assets/css/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ $fontSizes: (
@mixin placeholder($include-border-radius: true) {
outline: 0 !important;
border: 0 !important;
background-color: #ebebeb !important;
color: transparent !important;
background-color: currentColor !important;
color: currentColor !important;
width: 100%;
@if $include-border-radius == true {
border-radius: 0.25rem;
Expand All @@ -46,6 +46,7 @@ $fontSizes: (
pointer-events: none;
box-shadow: none;
z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */
opacity: 0.15;

// Forces direct descendants to keep layout but lose visibility.
> * {
Expand All @@ -61,7 +62,7 @@ $fontSizes: (
top: 0;
height: 100%;
background-repeat: no-repeat;
background-image: linear-gradient(90deg, #ebebeb, #f5f5f5, #ebebeb);
background-image: linear-gradient(90deg, currentColor, #f5f5f54d, currentColor);
transform: translateX(-100%);
animation: loading__animation 1.5s ease-in-out infinite;
}
Expand Down
30 changes: 29 additions & 1 deletion assets/js/atomic/blocks/product-elements/image/attributes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
export const attributes = {
interface BlockAttributes {
productId: {
type: string;
default: number;
};
showProductLink: {
type: string;
default: boolean;
};
showSaleBadge: {
type: string;
default: boolean;
};
saleBadgeAlign: {
type: string;
default: string;
};
imageSizing: {
type: string;
default: string;
};
isDescendentOfQueryLoop: {
type: string;
default: boolean;
};
}
export const blockAttributes: BlockAttributes = {
showProductLink: {
type: 'boolean',
default: true,
Expand All @@ -24,3 +50,5 @@ export const attributes = {
default: false,
},
};

export default blockAttributes;
Loading

0 comments on commit 6905099

Please sign in to comment.