Skip to content

Commit ec98013

Browse files
authored
release: v3.14.1
- Improve error handling on connection - Fixes sub-API keys displaying the site selector in Cloud Library settings
2 parents 9b87ba2 + da83113 commit ec98013

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+639
-40721
lines changed

.distignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ composer.lock
2424
npm-debug.log
2525
bin
2626
key.enc
27-
cypress
28-
cypress.json
2927
node_modules
3028
logs
3129
grunt
@@ -36,9 +34,10 @@ assets/src
3634
.wporg
3735
.nvmrc
3836
.github
39-
cypress.config.js
4037
.eslintrc
4138
postcss.config.js
4239
tailwind.config.js
4340
phpstan.neon
4441
development.php
42+
playwright.config.ts
43+
test-results

.github/workflows/test-e2e.yml

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,23 @@ on:
66
concurrency:
77
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
88
cancel-in-progress: true
9-
env:
10-
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
119

1210
jobs:
1311
e2e:
1412
if: ( github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name ) && ( github.actor != 'dependabot[bot]' )
1513
runs-on: ubuntu-latest
1614
steps:
17-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1816
- name: Setup Node
19-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v4
2018
with:
2119
node-version: 16
22-
- name: Get Composer Cache Directory
23-
id: composer-cache
24-
run: |
25-
echo "::set-output name=dir::$(composer config cache-files-dir)"
26-
- name: Configure Composer cache
27-
uses: actions/cache@v1
28-
with:
29-
path: ${{ steps.composer-cache.outputs.dir }}
30-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-composer-
20+
cache: 'npm'
3321
- name: Install dependencies
3422
run: |
3523
npm ci
3624
composer install --no-dev --prefer-dist --no-progress --no-suggest
25+
npx playwright install
3726
- name: Make build
3827
run: |
3928
npm run build
@@ -48,23 +37,11 @@ jobs:
4837
SSH_HOST: ${{ secrets.SSH_HOST }}
4938
SSH_PATH: ${{ secrets.SSH_PATH }}
5039
run: ./bin/run-e2e-tests.sh
51-
- name: E2E tests chrome
52-
uses: cypress-io/github-action@v6
53-
with:
54-
env: host=testing.optimole.com
55-
config-file: cypress.config.js
56-
browser: chrome
57-
e2eFirefox:
58-
needs: e2e
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v2
62-
- name: Setup Node
63-
uses: actions/setup-node@v1
64-
with:
65-
node-version: 16
66-
- uses: cypress-io/github-action@v6
67-
with:
68-
env: host=testing.optimole.com
69-
config-file: cypress.config.js
70-
browser: firefox
40+
- name: Run E2E tests
41+
id: run_tests
42+
run: |
43+
npm run e2e:run
44+
continue-on-error: false
45+
- name: Check test results
46+
if: steps.run_tests.outcome != 'success'
47+
run: exit 1

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ node_modules
44
logs
55
dist
66
artifact
7-
cypress/videos
8-
cypress/fixtures
97
vendor
108
code_quality
119
build
1210
.DS_Store
1311
cc-test-reporter
14-
assets/build
12+
assets/build
13+
test-results

assets/src/dashboard/parts/connected/settings/CloudLibrary.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ export default function CloudLibrary( props ) {
1717
} = props;
1818

1919
const storeData = useSelect( select => {
20-
const { isLoading } = select( 'optimole' );
20+
const { isLoading, isSubApiKey } = select( 'optimole' );
2121
return {
22-
isLoading: isLoading()
22+
isLoading: isLoading(),
23+
isSubApiKey: isSubApiKey()
2324
};
2425
}, []);
2526

26-
const { isLoading } = storeData;
27+
const { isLoading, isSubApiKey } = storeData;
2728

2829

2930
const isCloudLibraryEnabled = 'disabled' !== settings[ 'cloud_images' ];
31+
const showSiteSelector = ! isSubApiKey && isCloudLibraryEnabled;
3032
const whitelistedDomains = user_data.whitelist || [];
3133

3234

@@ -81,7 +83,7 @@ export default function CloudLibrary( props ) {
8183

8284
<hr className="my-8 border-grayish-blue"/>
8385

84-
{isCloudLibraryEnabled && (
86+
{showSiteSelector && (
8587
<BaseControl
8688
label={options_strings.cloud_site_title}
8789
help={options_strings.cloud_site_desc}

assets/src/dashboard/store/selectors.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ const selectors = {
9393
}
9494

9595
return state.logs;
96+
},
97+
isSubApiKey( state ) {
98+
return state.apiKey && state.apiKey.startsWith( 'optml-s' );
9699
}
97100
};
98101

cypress.config.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

cypress/.eslintrc.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

cypress/.prettierrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

cypress/e2e/test_amp.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

cypress/e2e/test_beaver_builder_background_lazyload.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)