From 1d2b5299f214f0b3cb5d920002438d34b1d4f87a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 13 Nov 2023 17:10:28 -0500 Subject: [PATCH 01/55] update notifications module --- composer.json | 2 +- composer.lock | 14 +++++++------- src/app/index.js | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index cc52c1539..35cf7e268 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", "newfold-labs/wp-module-marketplace": "^2.1.0", - "newfold-labs/wp-module-notifications": "^1.1.6", + "newfold-labs/wp-module-notifications": "^1.2.0", "newfold-labs/wp-module-onboarding": "^1.11.8", "newfold-labs/wp-module-patterns": "^0.1.8", "newfold-labs/wp-module-performance": "^1.2.2", diff --git a/composer.lock b/composer.lock index fc844ca8b..6b473775f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "41ae75c15a31eef7955bac64cb2cacf3", + "content-hash": "60e5b25186bb036570b6b4d863acb50a", "packages": [ { "name": "doctrine/inflector", @@ -828,16 +828,16 @@ }, { "name": "newfold-labs/wp-module-notifications", - "version": "1.1.6", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-notifications.git", - "reference": "040c63553978974bdebc066febb0ba3842875095" + "reference": "5b686576c074526c75e338250fa057a0e19afafc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-notifications/zipball/040c63553978974bdebc066febb0ba3842875095", - "reference": "040c63553978974bdebc066febb0ba3842875095", + "url": "https://api.github.com/repos/newfold-labs/wp-module-notifications/zipball/5b686576c074526c75e338250fa057a0e19afafc", + "reference": "5b686576c074526c75e338250fa057a0e19afafc", "shasum": "" }, "require": { @@ -866,10 +866,10 @@ ], "description": "A module for managing Newfold in-site notifications.", "support": { - "source": "https://github.com/newfold-labs/wp-module-notifications/tree/1.1.6", + "source": "https://github.com/newfold-labs/wp-module-notifications/tree/1.2.0", "issues": "https://github.com/newfold-labs/wp-module-notifications/issues" }, - "time": "2023-10-18T16:10:26+00:00" + "time": "2023-11-13T21:50:58+00:00" }, { "name": "newfold-labs/wp-module-onboarding", diff --git a/src/app/index.js b/src/app/index.js index 5a76e57b3..4f87f6226 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -24,6 +24,7 @@ import { NotificationFeed } from './components/notifications/feed'; import { default as NewfoldNotifications } from '../../vendor/newfold-labs/wp-module-notifications/assets/js/components/notifications/'; // to pass to notifications module import apiFetch from '@wordpress/api-fetch'; +import { addQueryArgs } from '@wordpress/url'; import { useState } from '@wordpress/element'; const Notices = () => { @@ -82,10 +83,10 @@ const AppBody = ( props ) => { constants={{ context: 'bluehost-plugin', page: hashedPath, - resturl: NewfoldRuntime.createApiUrl("") }} methods={{ apiFetch, + addQueryArgs, classnames, filter, useState, From 769f9ff1700ce8d6f86c2f7e2309fd5ee40f548b Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 13 Nov 2023 18:01:58 -0500 Subject: [PATCH 02/55] update notifications module with fixed test --- .wp-env.json | 2 +- composer.json | 2 +- composer.lock | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index 3dd3b3244..a77cb04fd 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#tags/6.3.2", + "core": "WordPress/WordPress#tags/6.4.1", "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true, diff --git a/composer.json b/composer.json index 35cf7e268..878b2f70d 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", "newfold-labs/wp-module-marketplace": "^2.1.0", - "newfold-labs/wp-module-notifications": "^1.2.0", + "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.8", "newfold-labs/wp-module-patterns": "^0.1.8", "newfold-labs/wp-module-performance": "^1.2.2", diff --git a/composer.lock b/composer.lock index 6b473775f..acd3a26c2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "60e5b25186bb036570b6b4d863acb50a", + "content-hash": "f15566237f8c435286952bd6ac7dd2f8", "packages": [ { "name": "doctrine/inflector", @@ -828,16 +828,16 @@ }, { "name": "newfold-labs/wp-module-notifications", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-notifications.git", - "reference": "5b686576c074526c75e338250fa057a0e19afafc" + "reference": "802de89e0a94f59f93b5637fdcce62d80a30af1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-notifications/zipball/5b686576c074526c75e338250fa057a0e19afafc", - "reference": "5b686576c074526c75e338250fa057a0e19afafc", + "url": "https://api.github.com/repos/newfold-labs/wp-module-notifications/zipball/802de89e0a94f59f93b5637fdcce62d80a30af1c", + "reference": "802de89e0a94f59f93b5637fdcce62d80a30af1c", "shasum": "" }, "require": { @@ -866,10 +866,10 @@ ], "description": "A module for managing Newfold in-site notifications.", "support": { - "source": "https://github.com/newfold-labs/wp-module-notifications/tree/1.2.0", + "source": "https://github.com/newfold-labs/wp-module-notifications/tree/1.2.1", "issues": "https://github.com/newfold-labs/wp-module-notifications/issues" }, - "time": "2023-11-13T21:50:58+00:00" + "time": "2023-11-13T22:55:16+00:00" }, { "name": "newfold-labs/wp-module-onboarding", From eb23ad7d440ab505006ef38bb9b555e85472b1d2 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Fri, 17 Nov 2023 12:41:38 -0500 Subject: [PATCH 03/55] remove commented legacy code --- src/app/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/index.js b/src/app/index.js index 4f87f6226..68aa1b633 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -78,7 +78,7 @@ const AppBody = ( props ) => { 'nfd-w-full nfd-p-4 min-[783px]:nfd-p-0' ) } > - {/*
*/} + Date: Sat, 25 Nov 2023 21:59:12 -0700 Subject: [PATCH 04/55] Add `eslint` and lint js files --- .eslintrc.js | 30 ++ package-lock.json | 111 +++--- package.json | 3 + postcss.config.js | 14 +- set-latest-wp-version.js | 46 +-- src/app/components/accordion/index.js | 14 - src/app/components/accordion/stylesheet.scss | 33 -- src/app/components/app-nav/index.js | 380 ++++++++++--------- src/app/components/app-nav/logo.js | 8 +- src/app/components/errorCard/index.js | 6 +- src/app/components/header/index.js | 28 -- src/app/components/header/logo.js | 38 -- src/app/components/header/nav-large.js | 25 -- src/app/components/header/nav-mobile.js | 42 -- src/app/components/header/nav-utility.js | 35 -- src/app/components/header/stylesheet.scss | 150 -------- src/app/components/heading/index.js | 11 - src/app/components/icons/BluehostIcon.js | 25 +- src/app/components/icons/WordPressIcon.js | 64 +++- src/app/components/index.js | 3 - src/app/components/notifications/feed.js | 82 ---- src/app/components/notifications/index.js | 62 +++ src/app/components/page/index.js | 28 +- src/app/components/section/index.js | 271 +++++++------ src/app/components/site-info/index.js | 128 ++++--- src/app/components/webinars-banner/index.js | 142 ++++--- src/app/data/help.js | 23 +- src/app/data/routes.js | 53 +-- src/app/data/store.js | 3 +- src/app/index.js | 38 +- src/app/pages/ecommerce/page.js | 82 ++-- src/app/pages/example/index.js | 118 ++++-- src/app/pages/help/index.js | 82 ++-- src/app/pages/home/accountCard.js | 198 +++++----- src/app/pages/home/freeAddonsSection.js | 12 +- src/app/pages/home/helpCard.js | 53 +-- src/app/pages/home/index.js | 2 +- src/app/pages/home/welcomeSection.js | 41 +- src/app/pages/marketplace/index.js | 86 +++-- src/app/pages/performance/index.js | 91 +++-- src/app/pages/settings/automaticUpdates.js | 317 +++++++++------- src/app/pages/settings/comingSoon.js | 124 +++--- src/app/pages/settings/commentSettings.js | 237 ++++++------ src/app/pages/settings/contentSettings.js | 206 +++++----- src/app/pages/settings/index.js | 62 +-- src/app/pages/staging/index.js | 71 ++-- src/app/util/helpers.js | 149 +++----- src/index.js | 29 +- src/webpack-public-path.js | 6 +- tailwind.config.js | 72 ++-- webpack.config.js | 61 +-- 51 files changed, 1969 insertions(+), 2026 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 src/app/components/accordion/index.js delete mode 100644 src/app/components/accordion/stylesheet.scss delete mode 100644 src/app/components/header/index.js delete mode 100644 src/app/components/header/logo.js delete mode 100644 src/app/components/header/nav-large.js delete mode 100644 src/app/components/header/nav-mobile.js delete mode 100644 src/app/components/header/nav-utility.js delete mode 100644 src/app/components/header/stylesheet.scss delete mode 100644 src/app/components/heading/index.js delete mode 100644 src/app/components/notifications/feed.js create mode 100644 src/app/components/notifications/index.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..bfe0dce4a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ], + settings: { + 'import/resolver': { + alias: { + map: [ + [ 'App', './src/app' ], + [ 'Assets', './aseets' ], + ], + extensions: [ '.js', '.jsx', '.json' ], + }, + }, + }, + globals: { + __: true, + _camelCase: true, + _filter: true, + _n: true, + classNames: true, + useContext: true, + useEffect: true, + useState: true, + }, + rules: { + 'import/no-unresolved': [ + 'error', + { ignore: [ '^App/', '^Assets/' ] }, + ], + }, +}; diff --git a/package-lock.json b/package-lock.json index 1bd0a17a5..e6a7c8443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@wordpress/i18n": "^4.45.0", "@wordpress/icons": "^9.36.0", "classnames": "^2.3.2", + "eslint-import-resolver-alias": "^1.1.2", "jquery": "^3.7.1", "lodash": "^4.17.21", "react": "^18.2.0", @@ -32,9 +33,11 @@ "@tailwindcss/forms": "^0.5.6", "@testing-library/cypress": "^10.0.1", "@wordpress/env": "^8.11.0", + "@wordpress/eslint-plugin": "^17.3.0", "@wordpress/scripts": "^26.16.0", "cypress": "^13.4.0", "cypress-axe": "^1.5.0", + "eslint-plugin-import": "^2.29.0", "tailwindcss": "^3.3.5" }, "engines": { @@ -5200,9 +5203,9 @@ } }, "node_modules/@wordpress/babel-plugin-import-jsx-pragma": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.28.0.tgz", - "integrity": "sha512-rLZgUIku7r0tI0Qxm8hLZq/0ecymtTSEL6MXesztqOMc155ZWpsTOBjOJgfiL3vaO3Hj1eZrgNKTkJbqhZNDvQ==", + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.29.0.tgz", + "integrity": "sha512-VPAn1iVZae1sQ6QaiMKbp3AzFPbhBl6YQeDr3AKpj24GTiUmsho6WgxijzyhBEBX5xPHVCahhQ8mjiZ5Ql6FwA==", "dev": true, "engines": { "node": ">=14" @@ -5212,9 +5215,9 @@ } }, "node_modules/@wordpress/babel-preset-default": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.29.0.tgz", - "integrity": "sha512-MOhijDBuG+iKZaxp8k6nvq/C4XujyHCwkYEs1WZ5+vCzsdBXg3Axa7wqURyuMjJ+e7hzejyj0w6bm19woMcIiQ==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.30.0.tgz", + "integrity": "sha512-O/IA8Jvh6MzlTyeo0As2chhZ2w6WdvMYSjjTDDC66SkbnUxUf4jWqehncHGrtQLoQJfwsCUnyWSH4ePb/j+kIw==", "dev": true, "dependencies": { "@babel/core": "^7.16.0", @@ -5223,9 +5226,9 @@ "@babel/preset-env": "^7.16.0", "@babel/preset-typescript": "^7.16.0", "@babel/runtime": "^7.16.0", - "@wordpress/babel-plugin-import-jsx-pragma": "^4.28.0", - "@wordpress/browserslist-config": "^5.28.0", - "@wordpress/warning": "^2.45.0", + "@wordpress/babel-plugin-import-jsx-pragma": "^4.29.0", + "@wordpress/browserslist-config": "^5.29.0", + "@wordpress/warning": "^2.46.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.2.0" @@ -5241,9 +5244,9 @@ "dev": true }, "node_modules/@wordpress/browserslist-config": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.28.0.tgz", - "integrity": "sha512-6O4mgi4mZAizyPpcKjXoXwcF7onL+BJckH3M1JnnXoa0aBb42TB3wQMTYDcGc1Kg1sRD4HWaDl53inWdmiyk7g==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.29.0.tgz", + "integrity": "sha512-sVDgPWcI3wdKd3cIvgf/NLO7HtEkwyV4bWuSztzoemNMGQW17BhH2Blx46HnJFXm9ooYw4SpAOyioHTkuT+JFg==", "dev": true, "engines": { "node": ">=14" @@ -5784,16 +5787,16 @@ } }, "node_modules/@wordpress/eslint-plugin": { - "version": "17.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.2.0.tgz", - "integrity": "sha512-i2Gpu+hmGyqzprwyfFutHaJ1ZQRv8tYfkgC3ROdzc1yAKw4AHWSRSPWk79d6Ua87y3EIYVEffRV5cQf4nnEQAQ==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.3.0.tgz", + "integrity": "sha512-u6ZMf8sL4act3bNuX0CTuu9quCBw68BItpb5gpyo7LGmV4+/cic14GVWPBTroA9oz6z5UHjIfjKMqib7NGecWQ==", "dev": true, "dependencies": { "@babel/eslint-parser": "^7.16.0", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "@wordpress/babel-preset-default": "^7.29.0", - "@wordpress/prettier-config": "^3.2.0", + "@wordpress/babel-preset-default": "^7.30.0", + "@wordpress/prettier-config": "^3.3.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", @@ -6031,9 +6034,9 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.2.0.tgz", - "integrity": "sha512-/iNBuGgUm9ul/76PrUKHzg+KVdXvsAvThz9Ui4z0HQIEBzkvNxrZnofIdH0PJ7tEVPMomkvbWmV/IR0410yfog==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.3.0.tgz", + "integrity": "sha512-G0HoubSikorLtXs0CZ0TNGbhKImCr+Ztg0HQUKv683r+yiZBOQV1igk7TaHOmIaf6702Bt4E3++IoAQN8Nr5ew==", "dev": true, "engines": { "node": ">=14" @@ -6393,9 +6396,9 @@ } }, "node_modules/@wordpress/warning": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.45.0.tgz", - "integrity": "sha512-cutow0USHkFWYQn4ah46gjoE9NAeq3q5fFCIXQoAK8MLuD7EVCcBmO7WvYVK0GeelHd1g7/Y7fM3GtqFFkLegg==", + "version": "2.46.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.46.0.tgz", + "integrity": "sha512-oyUNmDz64nF8vnS9LaobXMIx6K5w+XhAtvo3Cjv3kCVIuWFwpxoeMus3pUo1A7v2H9zcW+E87zwEuqsLPYjNfQ==", "dev": true, "engines": { "node": ">=12" @@ -10602,6 +10605,17 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-import-resolver-alias": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", + "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==", + "engines": { + "node": ">= 4" + }, + "peerDependencies": { + "eslint-plugin-import": ">=1.4.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -27130,15 +27144,15 @@ } }, "@wordpress/babel-plugin-import-jsx-pragma": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.28.0.tgz", - "integrity": "sha512-rLZgUIku7r0tI0Qxm8hLZq/0ecymtTSEL6MXesztqOMc155ZWpsTOBjOJgfiL3vaO3Hj1eZrgNKTkJbqhZNDvQ==", + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.29.0.tgz", + "integrity": "sha512-VPAn1iVZae1sQ6QaiMKbp3AzFPbhBl6YQeDr3AKpj24GTiUmsho6WgxijzyhBEBX5xPHVCahhQ8mjiZ5Ql6FwA==", "dev": true }, "@wordpress/babel-preset-default": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.29.0.tgz", - "integrity": "sha512-MOhijDBuG+iKZaxp8k6nvq/C4XujyHCwkYEs1WZ5+vCzsdBXg3Axa7wqURyuMjJ+e7hzejyj0w6bm19woMcIiQ==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.30.0.tgz", + "integrity": "sha512-O/IA8Jvh6MzlTyeo0As2chhZ2w6WdvMYSjjTDDC66SkbnUxUf4jWqehncHGrtQLoQJfwsCUnyWSH4ePb/j+kIw==", "dev": true, "requires": { "@babel/core": "^7.16.0", @@ -27147,9 +27161,9 @@ "@babel/preset-env": "^7.16.0", "@babel/preset-typescript": "^7.16.0", "@babel/runtime": "^7.16.0", - "@wordpress/babel-plugin-import-jsx-pragma": "^4.28.0", - "@wordpress/browserslist-config": "^5.28.0", - "@wordpress/warning": "^2.45.0", + "@wordpress/babel-plugin-import-jsx-pragma": "^4.29.0", + "@wordpress/browserslist-config": "^5.29.0", + "@wordpress/warning": "^2.46.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.2.0" @@ -27162,9 +27176,9 @@ "dev": true }, "@wordpress/browserslist-config": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.28.0.tgz", - "integrity": "sha512-6O4mgi4mZAizyPpcKjXoXwcF7onL+BJckH3M1JnnXoa0aBb42TB3wQMTYDcGc1Kg1sRD4HWaDl53inWdmiyk7g==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.29.0.tgz", + "integrity": "sha512-sVDgPWcI3wdKd3cIvgf/NLO7HtEkwyV4bWuSztzoemNMGQW17BhH2Blx46HnJFXm9ooYw4SpAOyioHTkuT+JFg==", "dev": true }, "@wordpress/components": { @@ -27623,16 +27637,16 @@ } }, "@wordpress/eslint-plugin": { - "version": "17.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.2.0.tgz", - "integrity": "sha512-i2Gpu+hmGyqzprwyfFutHaJ1ZQRv8tYfkgC3ROdzc1yAKw4AHWSRSPWk79d6Ua87y3EIYVEffRV5cQf4nnEQAQ==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.3.0.tgz", + "integrity": "sha512-u6ZMf8sL4act3bNuX0CTuu9quCBw68BItpb5gpyo7LGmV4+/cic14GVWPBTroA9oz6z5UHjIfjKMqib7NGecWQ==", "dev": true, "requires": { "@babel/eslint-parser": "^7.16.0", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "@wordpress/babel-preset-default": "^7.29.0", - "@wordpress/prettier-config": "^3.2.0", + "@wordpress/babel-preset-default": "^7.30.0", + "@wordpress/prettier-config": "^3.3.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", @@ -27800,9 +27814,9 @@ } }, "@wordpress/prettier-config": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.2.0.tgz", - "integrity": "sha512-/iNBuGgUm9ul/76PrUKHzg+KVdXvsAvThz9Ui4z0HQIEBzkvNxrZnofIdH0PJ7tEVPMomkvbWmV/IR0410yfog==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.3.0.tgz", + "integrity": "sha512-G0HoubSikorLtXs0CZ0TNGbhKImCr+Ztg0HQUKv683r+yiZBOQV1igk7TaHOmIaf6702Bt4E3++IoAQN8Nr5ew==", "dev": true }, "@wordpress/primitives": { @@ -28112,9 +28126,9 @@ } }, "@wordpress/warning": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.45.0.tgz", - "integrity": "sha512-cutow0USHkFWYQn4ah46gjoE9NAeq3q5fFCIXQoAK8MLuD7EVCcBmO7WvYVK0GeelHd1g7/Y7fM3GtqFFkLegg==", + "version": "2.46.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.46.0.tgz", + "integrity": "sha512-oyUNmDz64nF8vnS9LaobXMIx6K5w+XhAtvo3Cjv3kCVIuWFwpxoeMus3pUo1A7v2H9zcW+E87zwEuqsLPYjNfQ==", "dev": true }, "@xobotyi/scrollbar-width": { @@ -31354,6 +31368,11 @@ "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true }, + "eslint-import-resolver-alias": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", + "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==" + }, "eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", diff --git a/package.json b/package.json index e4e54baf0..8afe157e1 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@wordpress/i18n": "^4.45.0", "@wordpress/icons": "^9.36.0", "classnames": "^2.3.2", + "eslint-import-resolver-alias": "^1.1.2", "jquery": "^3.7.1", "lodash": "^4.17.21", "react": "^18.2.0", @@ -47,9 +48,11 @@ "@tailwindcss/forms": "^0.5.6", "@testing-library/cypress": "^10.0.1", "@wordpress/env": "^8.11.0", + "@wordpress/eslint-plugin": "^17.3.0", "@wordpress/scripts": "^26.16.0", "cypress": "^13.4.0", "cypress-axe": "^1.5.0", + "eslint-plugin-import": "^2.29.0", "tailwindcss": "^3.3.5" }, "scripts": { diff --git a/postcss.config.js b/postcss.config.js index 4d8ae98c3..90a2477ed 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,8 +1,8 @@ module.exports = { - plugins: [ - require("postcss-import"), - require("tailwindcss/nesting"), - require("tailwindcss"), - ...require("@wordpress/postcss-plugins-preset"), - ], - }; \ No newline at end of file + plugins: [ + require( 'postcss-import' ), + require( 'tailwindcss/nesting' ), + require( 'tailwindcss' ), + ...require( '@wordpress/postcss-plugins-preset' ), + ], +}; diff --git a/set-latest-wp-version.js b/set-latest-wp-version.js index 05d4074a3..0502410df 100644 --- a/set-latest-wp-version.js +++ b/set-latest-wp-version.js @@ -1,24 +1,26 @@ -const fs = require('fs') -const fetch = require('node-fetch') -const wpEnv = require('./.wp-env.json') +const fs = require( 'fs' ); +const fetch = require( 'node-fetch' ); +const wpEnv = require( './.wp-env.json' ); -fetch('https://api.wordpress.org/core/stable-check/1.0/') - .then(res => res.json()) - .then( - json => { - const wpVersion = Object.keys(json)[Object.keys(json).length - 1] - wpEnv.core = `WordPress/WordPress#tags/${ wpVersion }` - fs.writeFile( - './.wp-env.json', - JSON.stringify(wpEnv, null, 2), - 'utf8', - (err) => { - if (err) { - console.log('An error occurred while writing latest WordPress version to .wp-env.json file.') - return console.log(err) - } - console.log(`The .wp-env.json file was updated with the latest WordPress version (${wpVersion}).`) +fetch( 'https://api.wordpress.org/core/stable-check/1.0/' ) + .then( ( res ) => res.json() ) + .then( ( json ) => { + const wpVersion = Object.keys( json )[ Object.keys( json ).length - 1 ]; + wpEnv.core = `WordPress/WordPress#tags/${ wpVersion }`; + fs.writeFile( + './.wp-env.json', + JSON.stringify( wpEnv, null, 2 ), + 'utf8', + ( err ) => { + if ( err ) { + console.log( + 'An error occurred while writing latest WordPress version to .wp-env.json file.' + ); + return console.log( err ); } - ); - } - ) \ No newline at end of file + console.log( + `The .wp-env.json file was updated with the latest WordPress version (${ wpVersion }).` + ); + } + ); + } ); diff --git a/src/app/components/accordion/index.js b/src/app/components/accordion/index.js deleted file mode 100644 index 851732604..000000000 --- a/src/app/components/accordion/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import './stylesheet.scss'; - -const Accordion = ( { summary, className, children } ) => { - return ( -
- -

{ summary }

-
-
{ children }
-
- ); -}; - -export default Accordion; diff --git a/src/app/components/accordion/stylesheet.scss b/src/app/components/accordion/stylesheet.scss deleted file mode 100644 index 21269fda6..000000000 --- a/src/app/components/accordion/stylesheet.scss +++ /dev/null @@ -1,33 +0,0 @@ -.wppbh .accordion { - border: 1px solid var(--color-border); - margin-bottom: .6em; - margin-top: .6em; - opacity: .8; - padding: 1px; - transition: opacity .2s ease; - - &:hover, - &[open] { - opacity: 1; - } - - .accordion-summary { - background: var(--color-off-white); - cursor: pointer; - font-weight: 700; - padding: 10px 15px; - - p { - display: inline; - } - } - - .accordion-content { - padding: 0 15px; - margin: 10px 0; - } - - + .accordion { - margin-top: -.6em; - } -} diff --git a/src/app/components/app-nav/index.js b/src/app/components/app-nav/index.js index 636c4a176..fd0af78d0 100644 --- a/src/app/components/app-nav/index.js +++ b/src/app/components/app-nav/index.js @@ -1,199 +1,205 @@ -import { Modal, SidebarNavigation } from "@newfold/ui-component-library" -import { NavLink, useLocation } from 'react-router-dom'; +import { useEffect, useState } from '@wordpress/element'; import { useViewportMatch } from '@wordpress/compose'; -import Logo from "./logo"; -import { topRoutes, utilityRoutes } from "../../data/routes"; -import { Bars3Icon } from "@heroicons/react/24/outline"; -import { useEffect } from 'react'; -import { handleHelpLinksClick } from "../../util/helpers"; +import { Modal, SidebarNavigation } from '@newfold/ui-component-library'; +import { NavLink, useLocation } from 'react-router-dom'; +import { Bars3Icon } from '@heroicons/react/24/outline'; +import { topRoutes, utilityRoutes } from 'App/data/routes'; +import { handleHelpLinksClick } from '../../util/helpers'; +import Logo from './logo'; export const SideNavHeader = () => { - return ( -
- -
- ); -} + return ( +
+ +
+ ); +}; export const SideNavMenu = () => { - let location = useLocation(); - - const primaryMenu = () => { - return ( -
    - {topRoutes.map((page) => ( - - - - ))} -
- ); - } - - const secondaryMenu = () => { - return ( -
    - {utilityRoutes.map((page) => ( - - - - ))} -
- ); - } - - const SubMenusManager = () => { - // close any open submenus - const subMenus = document.querySelectorAll('.wppbh-app-navitem-submenu'); - subMenus.forEach((subMenu) => { - subMenu.classList.add('nfd-hidden'); - }); - - // open active's submenu if it exists - const activeMenu = document.querySelector('.wppbh-app-sidenav .active'); - if (activeMenu && null !== activeMenu.nextSibling && activeMenu.nextSibling.classList.contains('wppbh-app-navitem-submenu')) { - activeMenu.nextSibling.classList.remove('nfd-hidden'); - } - } - - useEffect(() => { - SubMenusManager(); - document.onclick = SubMenusManager; - }, [location]); - - return ( -
- {primaryMenu()} - {secondaryMenu()} -
- ); -} - -export const SideNavMenuItem = ({ label, name, icon: Icon = null, path, action, subItems }) => { - return ( -
  • - - {Icon && - - } - {label} - - - {subItems && subItems.length > 0 && -
      - {subItems.map((subItem) => ( - - ))} -
    - } -
  • - ); -} - -export const SideNavMenuSubItem = ({ label, name, path, action }) => { - return ( -
  • - - {label} - -
  • - ); -} + const location = useLocation(); + + const primaryMenu = () => { + return ( +
      + { topRoutes.map( ( page ) => ( + + ) ) } +
    + ); + }; + + const secondaryMenu = () => { + return ( +
      + { utilityRoutes.map( ( page ) => ( + + ) ) } +
    + ); + }; + + const SubMenusManager = () => { + // close any open submenus + const subMenus = document.querySelectorAll( + '.wppbh-app-navitem-submenu' + ); + subMenus.forEach( ( subMenu ) => { + subMenu.classList.add( 'nfd-hidden' ); + } ); + + // open active's submenu if it exists + const activeMenu = document.querySelector( + '.wppbh-app-sidenav .active' + ); + if ( + activeMenu && + null !== activeMenu.nextSibling && + activeMenu.nextSibling.classList.contains( + 'wppbh-app-navitem-submenu' + ) + ) { + activeMenu.nextSibling.classList.remove( 'nfd-hidden' ); + } + }; + + useEffect( () => { + SubMenusManager(); + document.onclick = SubMenusManager; + }, [ location ] ); + + return ( +
    + { primaryMenu() } + { secondaryMenu() } +
    + ); +}; + +export const SideNavMenuItem = ( { + label, + icon: Icon = null, + path, + action, + subItems, +} ) => { + return ( +
  • + + { Icon && ( + + ) } + { label } + + + { subItems && subItems.length > 0 && ( +
      + { subItems.map( ( subItem ) => ( + + ) ) } +
    + ) } +
  • + ); +}; + +export const SideNavMenuSubItem = ( { label, path, action } ) => { + return ( +
  • + + { label } + +
  • + ); +}; export const SideNav = () => { - return ( - - ); -} + return ( + + ); +}; export const MobileNav = () => { - const [isOpen, setIsOpen] = useState(false); - - let location = useLocation(); - // Close mobile nav when location changes - useEffect(() => { - setIsOpen(false); - }, [location]); - - return ( -
    -
    - -
    - -
    - - - setIsOpen(false)} - className="wppbh-app-sidenav-mobile nfd-z-40" - initialFocus - > - -
    - -
    -
    -
    - -
    -
    - ); -} + const [ isOpen, setIsOpen ] = useState( false ); + + const location = useLocation(); + // Close mobile nav when location changes + useEffect( () => { + setIsOpen( false ); + }, [ location ] ); + + return ( +
    +
    +
    + +
    + + + setIsOpen( false ) } + className="wppbh-app-sidenav-mobile nfd-z-40" + initialFocus + > + +
    + +
    +
    +
    +
    +
    + ); +}; export const AppNav = () => { - const isLargeViewport = useViewportMatch('medium'); - handleHelpLinksClick(); - - return ( - <> - {(isLargeViewport && ) || } - + const isLargeViewport = useViewportMatch( 'medium' ); + handleHelpLinksClick(); - ); -} \ No newline at end of file + return <>{ ( isLargeViewport && ) || }; +}; diff --git a/src/app/components/app-nav/logo.js b/src/app/components/app-nav/logo.js index a29bc2ca2..ccc7e3895 100644 --- a/src/app/components/app-nav/logo.js +++ b/src/app/components/app-nav/logo.js @@ -1,6 +1,6 @@ import { Button } from '@wordpress/components'; -import { Heading } from '..'; -import { ReactComponent as Brand } from '../../../../assets/svg/bluehost-logo.svg'; +import { Title } from '@newfold/ui-component-library'; +import { ReactComponent as Brand } from 'Assets/svg/bluehost-logo.svg'; import { delay } from 'lodash'; const Mark = () => { @@ -27,9 +27,9 @@ const Logo = () => { return (
    - + { __( 'Bluehost WordPress Plugin', 'wp-plugin-bluehost' ) } - </Heading> +
    ); }; diff --git a/src/app/components/errorCard/index.js b/src/app/components/errorCard/index.js index 0a2b437a4..abba3619e 100644 --- a/src/app/components/errorCard/index.js +++ b/src/app/components/errorCard/index.js @@ -1,3 +1,4 @@ +import { Title } from '@newfold/ui-component-library'; import './stylesheet.scss'; import { Card, @@ -6,7 +7,6 @@ import { CardFooter, Dashicon, } from '@wordpress/components'; -import { Heading } from '../../components'; import { dispatchUpdateSnackbar } from '../../util/helpers'; const ErrorCard = ( { error, className, notice = 'Error!' } ) => { @@ -15,7 +15,7 @@ const ErrorCard = ( { error, className, notice = 'Error!' } ) => { return ( - + <Dashicon icon="warning" style={ { @@ -25,7 +25,7 @@ const ErrorCard = ( { error, className, notice = 'Error!' } ) => { } } />{ ' ' } { __( 'Oh No, An Error!', 'wp-plugin-bluehost' ) } - </Heading> +

    diff --git a/src/app/components/header/index.js b/src/app/components/header/index.js deleted file mode 100644 index 5b0a697cc..000000000 --- a/src/app/components/header/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import './stylesheet.scss'; - -import Logo from './logo'; -import NavLarge from './nav-large'; -import NavMobile from './nav-mobile'; -import NavUtility from './nav-utility'; -import { useViewportMatch } from '@wordpress/compose'; - -const Header = () => { - const isLargeViewport = useViewportMatch( 'medium' ); - return ( - -

    -
    - - { ( isLargeViewport && ) || } -
    -
    - { isLargeViewport && ( - - ) } - - ); -}; - -export default Header; diff --git a/src/app/components/header/logo.js b/src/app/components/header/logo.js deleted file mode 100644 index 8b6e8f846..000000000 --- a/src/app/components/header/logo.js +++ /dev/null @@ -1,38 +0,0 @@ -import { Button } from '@wordpress/components'; -import { Heading } from '../../components'; -import { ReactComponent as Brand } from '../../../../assets/svg/bluehost-logo.svg'; -import { delay } from 'lodash'; - -const Mark = () => { - const defocus = () => { - const button = document.querySelector( '.logo-mark' ); - delay( () => { - if ( null !== button ) { - button.blur(); - } - }, 500 ); - }; - return ( - - } - {secondaryAction.title && - - } - - } +export const SectionHeader = ( { + title, + subTitle, + className, + primaryAction = { title: false, className: false, onClick: false }, + secondaryAction = { title: false, className: false, onClick: false }, +} ) => { + return ( +
    +
    + { title && ( +

    + { title } +

    + ) } + { subTitle &&

    { subTitle }

    } +
    + { ( primaryAction.title || secondaryAction.title ) && ( +
    + { primaryAction.title && ( + + ) } + { secondaryAction.title && ( + + ) } +
    + ) } +
    + ); +}; - - ); -} +export const SectionContent = ( { + separator = false, + id, + className, + children, +} ) => { + const [ isTarget, setIsTarget ] = useState( false ); + const searchParams = new URLSearchParams( window.location.search ); -export const SectionContent = ({ - separator = false, - id, - className, - children -}) => { - const [isTarget, setIsTarget] = useState(false); - const searchParams = new URLSearchParams(window.location.search); + useEffect( () => { + if ( + searchParams.has( 'nfd-target' ) && + searchParams.get( 'nfd-target' ) === id + ) { + setIsTarget( true ); - useEffect(() => { - if (searchParams.has('nfd-target') && searchParams.get('nfd-target') === id) { - setIsTarget(true); - - setTimeout(() => { - setIsTarget(false); - removeTargetQueryParam(); - }, 9500); - } - }, [searchParams]); + setTimeout( () => { + setIsTarget( false ); + removeTargetQueryParam(); + }, 9500 ); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ searchParams ] ); - /* - * Remove the 'nfd-target={id}' query param from the URL - */ - const removeTargetQueryParam = () => { - searchParams.delete('nfd-target'); - const currentURL = window.location.href; - const updatedURL = currentURL.replace(`&nfd-target=${id}`, ''); - window.history.replaceState(null, null, updatedURL); - } - - return ( -
    -
    - {children} -
    -
    - ); -} + /* + * Remove the 'nfd-target={id}' query param from the URL + */ + const removeTargetQueryParam = () => { + searchParams.delete( 'nfd-target' ); + const currentURL = window.location.href; + const updatedURL = currentURL.replace( `&nfd-target=${ id }`, '' ); + window.history.replaceState( null, null, updatedURL ); + }; -export const SectionSettings = ({ className, children, title, description }) => { - return ( -
    -
    -
    - - {title} - - {description &&
    {description}
    } -
    -
    + return ( +
    +
    + { children } +
    +
    + ); +}; -
    - {title} -
    - {children} -
    -
    -
    - ); -} \ No newline at end of file +export const SectionSettings = ( { + className, + children, + title, + description, +} ) => { + return ( +
    +
    +
    + + { title } + + { description && ( +
    { description }
    + ) } +
    +
    + +
    + { title } +
    { children }
    +
    +
    + ); +}; diff --git a/src/app/components/site-info/index.js b/src/app/components/site-info/index.js index bb627c11a..682f89fa5 100644 --- a/src/app/components/site-info/index.js +++ b/src/app/components/site-info/index.js @@ -1,62 +1,78 @@ -import { LockClosedIcon, LockOpenIcon } from "@heroicons/react/24/outline"; -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; -import { Button } from "@newfold/ui-component-library"; -import { BluehostIcon, WordPressIcon } from "../icons"; -import { getPlatformPathUrl, addUtmParams } from "../../util/helpers"; +import { LockClosedIcon, LockOpenIcon } from '@heroicons/react/24/outline'; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; +import { Button } from '@newfold/ui-component-library'; +import { BluehostIcon, WordPressIcon } from '../icons'; +import { getPlatformPathUrl, addUtmParams } from '../../util/helpers'; export const SiteInfoBar = () => { - const { url, title } = NewfoldRuntime.siteDetails; - const parsedUrl = new URL(url); - const siteDomain = parsedUrl.hostname; - const hasSSL = parsedUrl.protocol.includes("https"); - const isWooCommerce = NewfoldRuntime.hasCapability('isEcommerce'); - const isStore = window.location.href.includes('store'); + const { url, title } = NewfoldRuntime.siteDetails; + const parsedUrl = new URL( url ); + const siteDomain = parsedUrl.hostname; + const hasSSL = parsedUrl.protocol.includes( 'https' ); + const isWooCommerce = NewfoldRuntime.hasCapability( 'isEcommerce' ); + const isStore = window.location.href.includes( 'store' ); - const renderPadLock = () => { - if (hasSSL) { - return - } + const renderPadLock = () => { + if ( hasSSL ) { + return ( + + ); + } - return - } + return ( + + ); + }; - return ( -
    -
    + return ( +
    +
    +
    +

    + { title } +

    +
    +
    + { renderPadLock() } + + { siteDomain } + +
    +
    +
    -
    -

    {title}

    -
    -
    - {renderPadLock()} - {siteDomain} -
    -
    -
    - -
    - - -
    - -
    -
    - ); -} \ No newline at end of file +
    + + +
    +
    +
    + ); +}; diff --git a/src/app/components/webinars-banner/index.js b/src/app/components/webinars-banner/index.js index 7bb7c8bb4..e5a68ced3 100644 --- a/src/app/components/webinars-banner/index.js +++ b/src/app/components/webinars-banner/index.js @@ -1,87 +1,108 @@ -import { useState, useEffect } from "@wordpress/element"; -import { Button, Title } from "@newfold/ui-component-library"; -import { ArrowRightIcon, CalendarIcon, ClockIcon } from "@heroicons/react/24/outline"; +import { useState, useEffect } from '@wordpress/element'; +import { Button, Title } from '@newfold/ui-component-library'; +import { + ArrowRightIcon, + CalendarIcon, + ClockIcon, +} from '@heroicons/react/24/outline'; import { ReactComponent as WebinarsVector } from 'App/images/webinars-vector.svg'; import { SectionContainer, SectionContent } from 'App/components/section'; /** * A component that displays the next monthly webinar. - * + * * The component will attempt to fetch the webinars data from the Hiive CDN. * If the file is fetched successfully, the component will verify the required shape of the data. * When the data is valid, the component will filter the webinars to only include next webinar. * The component will then render the next webinar. - * + * * If any of the above fails the component will not render. - * - * @returns JSX.Element + * + * @return { JSX.Element } The webinars banner component. */ const WebinarsBanner = () => { - const [webinars, setWebinars] = useState([]); - const [nextWebinar, setNextWebinar] = useState(null); + const [ webinars, setWebinars ] = useState( [] ); + const [ nextWebinar, setNextWebinar ] = useState( null ); - useEffect(() => { + useEffect( () => { fetchWebinars(); - }, []); + }, [] ); const fetchWebinars = async () => { - const webinarsEndpoint = 'https://cdn.hiive.space/resources/bluehost-webinars.json'; + const webinarsEndpoint = + 'https://cdn.hiive.space/resources/bluehost-webinars.json'; - const response = await fetch(webinarsEndpoint); - if (!response.ok) { - console.warn('Could not fetch webinars data.'); + const response = await fetch( webinarsEndpoint ); + if ( ! response.ok ) { + // eslint-disable-next-line no-console + console.warn( 'Could not fetch webinars data.' ); return; } const data = await response.json(); if ( - data.hasOwnProperty('isActive') && + data.hasOwnProperty( 'isActive' ) && data.isActive && - data.hasOwnProperty('items') && - Array.isArray(data.items) && + data.hasOwnProperty( 'items' ) && + Array.isArray( data.items ) && data.items.length > 0 ) { - setWebinars(data.items); + setWebinars( data.items ); } - } + }; - useEffect(() => { - setNextWebinar(getNextWebinar()); - }, [webinars]); + useEffect( () => { + setNextWebinar( getNextWebinar() ); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ webinars ] ); const getNextWebinar = () => { const currentDate = new Date(); - const futureWebinars = webinars.filter(webinar => new Date(webinar.date) > currentDate); - if (futureWebinars.length === 0) { + const futureWebinars = webinars.filter( + ( webinar ) => new Date( webinar.date ) > currentDate + ); + if ( futureWebinars.length === 0 ) { return null; } - futureWebinars.sort((a, b) => new Date(a.date) - new Date(b.date)); + futureWebinars.sort( + ( a, b ) => new Date( a.date ) - new Date( b.date ) + ); - const nextWebinar = futureWebinars[0]; - if (nextWebinar.hasOwnProperty('title') && nextWebinar.title.length > 0) { + // eslint-disable-next-line no-shadow + const nextWebinar = futureWebinars[ 0 ]; + if ( + nextWebinar.hasOwnProperty( 'title' ) && + nextWebinar.title.length > 0 + ) { nextWebinar.hasDescription = nextWebinar.description ? true : false; - nextWebinar.hasTopics = (nextWebinar.hasOwnProperty('topics') && Array.isArray(nextWebinar.topics) && nextWebinar.topics.length > 0) ? true : false; + nextWebinar.hasTopics = + nextWebinar.hasOwnProperty( 'topics' ) && + Array.isArray( nextWebinar.topics ) && + nextWebinar.topics.length > 0 + ? true + : false; nextWebinar.hasTime = nextWebinar.time ? true : false; - nextWebinar.link = nextWebinar.link ?? 'https://www.bluehost.com/blog/events/'; + nextWebinar.link = + nextWebinar.link ?? 'https://www.bluehost.com/blog/events/'; nextWebinar.ctaText = nextWebinar.ctaText ?? 'Register Now'; return nextWebinar; } return null; - } + }; - const WebinarListItem = ({ children }) => { + const WebinarListItem = ( { children } ) => { return (
  • • - {children} + { children }
  • ); - } + }; - if (!nextWebinar) { + if ( ! nextWebinar ) { return null; } @@ -94,53 +115,68 @@ const WebinarsBanner = () => {
    - FREE Monthly Webinar: {nextWebinar.title} + + FREE Monthly Webinar: { nextWebinar.title } + - {(nextWebinar.hasDescription || nextWebinar.hasTopics) && + { ( nextWebinar.hasDescription || + nextWebinar.hasTopics ) && (
    - {nextWebinar.description &&

    {nextWebinar.description}

    } - {nextWebinar.topics && + { nextWebinar.description && ( +

    + { nextWebinar.description } +

    + ) } + { nextWebinar.topics && ( <> - Topics: + + Topics: +
      - {nextWebinar.topics.map((topic, index) => {topic})} + { nextWebinar.topics.map( + ( topic, index ) => ( + + { topic } + + ) + ) }
    - } + ) }
    - } - + ) }
    - {nextWebinar.date} + { nextWebinar.date }
    - {nextWebinar.hasTime && + { nextWebinar.hasTime && (
    - {nextWebinar.time} + { nextWebinar.time }
    - } + ) }
    -
    ); -} +}; -export default WebinarsBanner; \ No newline at end of file +export default WebinarsBanner; diff --git a/src/app/data/help.js b/src/app/data/help.js index a3b045214..0184667e9 100644 --- a/src/app/data/help.js +++ b/src/app/data/help.js @@ -1,5 +1,5 @@ -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; -import { getPlatformBaseUrl } from "../util/helpers"; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; +import { getPlatformBaseUrl } from '../util/helpers'; const getSupportPhoneNumber = () => { const brand = NewfoldRuntime.plugin.brand; @@ -9,13 +9,14 @@ const getSupportPhoneNumber = () => { } return '888-401-4678'; -} +}; const help = [ { name: 'phone', title: __( 'Phone', 'wp-plugin-bluehost' ), + // eslint-disable-next-line @wordpress/i18n-no-variables description: __( - "Contact one of our friendly Customer Care Specialists, as we are waiting to help at " + getSupportPhoneNumber() + ". Open 24 hours - 7 days.", + `Contact one of our friendly Customer Care Specialists, as we are waiting to help at ${ getSupportPhoneNumber() }. Open 24 hours - 7 days.`, 'wp-plugin-bluehost' ), icon: false, @@ -31,7 +32,9 @@ const help = [ ), icon: false, cta: __( 'Live Chat', 'wp-plugin-bluehost' ), - url: getPlatformBaseUrl() + '/contact/?utm_campaign=&utm_content=help_chat_link&utm_term=live_chat&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', + url: + getPlatformBaseUrl() + + '/contact/?utm_campaign=&utm_content=help_chat_link&utm_term=live_chat&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', }, { name: 'twitter', @@ -48,7 +51,7 @@ const help = [ name: 'youtube', title: __( 'YouTube', 'wp-plugin-bluehost' ), description: __( - "Find tutorials, answers, interviews and guides on our YouTube channel.", + 'Find tutorials, answers, interviews and guides on our YouTube channel.', 'wp-plugin-bluehost' ), icon: false, @@ -64,7 +67,9 @@ const help = [ ), icon: false, cta: __( 'Visit Knowledge Base', 'wp-plugin-bluehost' ), - url: getPlatformBaseUrl() + '/help/?utm_campaign=&utm_content=help_help_link&utm_term=we_can_help&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', + url: + getPlatformBaseUrl() + + '/help/?utm_campaign=&utm_content=help_help_link&utm_term=we_can_help&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', }, { name: 'resources', @@ -75,7 +80,9 @@ const help = [ ), icon: false, cta: __( 'Explore Resources', 'wp-plugin-bluehost' ), - url: getPlatformBaseUrl() + '/blog/?utm_campaign=&utm_content=help_kb_link&utm_term=find_answers&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', + url: + getPlatformBaseUrl() + + '/blog/?utm_campaign=&utm_content=help_kb_link&utm_term=find_answers&utm_medium=brand_plugin&utm_source=wp-admin/admin.php?page=bluehost#/help', }, { name: 'events', diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 10667cd00..3654e1c00 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -1,12 +1,11 @@ -import { +import { HomeIcon, ShoppingBagIcon, WrenchScrewdriverIcon, - BoltIcon, + BoltIcon, AdjustmentsHorizontalIcon, BuildingStorefrontIcon, - QuestionMarkCircleIcon } -from '@heroicons/react/24/outline'; +} from '@heroicons/react/24/outline'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; import { Route, Routes } from 'react-router-dom'; import { __ } from '@wordpress/i18n'; @@ -18,15 +17,15 @@ import Settings from '../pages/settings'; import Staging from '../pages/staging'; import Help from '../pages/help'; import { getMarketplaceSubnavRoutes } from '../../../vendor/newfold-labs/wp-module-marketplace/components/marketplaceSubnav'; -import { ReactComponent as HelpIcon } from "../components/icons/HelpIcon.svg"; +import { ReactComponent as HelpIcon } from '../components/icons/HelpIcon.svg'; -const addPartialMatch = (prefix, path) => - prefix === path ? `${prefix}/*` : path; +const addPartialMatch = ( prefix, path ) => + prefix === path ? `${ prefix }/*` : path; -const HelpCenterAI = (e) => { +const HelpCenterAI = ( e ) => { e.preventDefault(); window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp(); -} +}; export const AppRoutes = () => { return ( @@ -38,7 +37,7 @@ export const AppRoutes = () => { path={ addPartialMatch( '/marketplace', addPartialMatch( '/store', page.name ) - )} + ) } element={ } /> ) ) } @@ -48,7 +47,10 @@ export const AppRoutes = () => { element={

    - { __( "There's nothing here!", 'wp-plugin-bluehost' ) } + { __( + "There's nothing here!", + 'wp-plugin-bluehost' + ) }

    } @@ -84,23 +86,24 @@ export const routes = [ name: '/store/products', title: __( 'Products & Services', 'wp-plugin-bluehost' ), }, - NewfoldRuntime.hasCapability( 'hasYithExtended' ) || NewfoldRuntime.hasCapability('canAccessGlobalCTB') - ? { - name: "/store/sales_discounts", - title: __("Sales & Discounts", "wp-plugin-bluehost"), - } - : null, + NewfoldRuntime.hasCapability( 'hasYithExtended' ) || + NewfoldRuntime.hasCapability( 'canAccessGlobalCTB' ) + ? { + name: '/store/sales_discounts', + title: __( 'Sales & Discounts', 'wp-plugin-bluehost' ), + } + : null, NewfoldRuntime.isWoo - ? { - name: '/store/payments', - title: __( 'Payments', 'wp-plugin-bluehost' ), - } - : null, + ? { + name: '/store/payments', + title: __( 'Payments', 'wp-plugin-bluehost' ), + } + : null, { name: '/store/details', title: __( 'Store Details', 'wp-plugin-bluehost' ), }, - ].filter(Boolean), + ].filter( Boolean ), }, { name: '/marketplace', @@ -132,7 +135,9 @@ export const routes = [ title: __( 'Help', 'wp-plugin-bluehost' ), Component: Help, Icon: HelpIcon, - action: NewfoldRuntime.hasCapability( 'canAccessHelpCenter' ) ? HelpCenterAI : false, + action: NewfoldRuntime.hasCapability( 'canAccessHelpCenter' ) + ? HelpCenterAI + : false, }, ]; diff --git a/src/app/data/store.js b/src/app/data/store.js index f57ad7e03..64def0fe8 100644 --- a/src/app/data/store.js +++ b/src/app/data/store.js @@ -11,7 +11,7 @@ const AppStore = createContext( DEFAULT ); export const bluehostApiFetchSettings = async ( options = {} ) => { return await apiFetch( { - url: NewfoldRuntime.createApiUrl('/bluehost/v1/settings'), + url: NewfoldRuntime.createApiUrl( '/bluehost/v1/settings' ), ...options, } ); }; @@ -44,6 +44,7 @@ export const AppStoreProvider = ( { children } ) => { setError( error ); } ); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [] ); return ( diff --git a/src/app/index.js b/src/app/index.js index 68aa1b633..3d9c3622f 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -4,7 +4,6 @@ import './tailwind.pcss'; import AppStore, { AppStoreProvider } from './data/store'; import { useLocation, HashRouter as Router } from 'react-router-dom'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; -import { __ } from '@wordpress/i18n'; import { SnackbarList, Spinner } from '@wordpress/components'; import classnames from 'classnames'; import AppRoutes from './data/routes'; @@ -12,13 +11,13 @@ import ErrorCard from './components/errorCard'; import { useDispatch, useSelect } from '@wordpress/data'; import { useEffect } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; +// eslint-disable-next-line import/no-unresolved import { store as noticesStore } from '@wordpress/notices'; -import { setActiveSubnav } from './util/helpers'; import { kebabCase, filter } from 'lodash'; -import { Root } from "@newfold/ui-component-library"; +import { Root } from '@newfold/ui-component-library'; import { AppNav } from './components/app-nav'; import { SiteInfoBar } from './components/site-info'; -import { NotificationFeed } from './components/notifications/feed'; +import { NotificationFeed } from './components/notifications'; // component sourced from module import { default as NewfoldNotifications } from '../../vendor/newfold-labs/wp-module-notifications/assets/js/components/notifications/'; @@ -28,9 +27,6 @@ import { addQueryArgs } from '@wordpress/url'; import { useState } from '@wordpress/element'; const Notices = () => { - if ( 'undefined' === typeof noticesStore ) { - return null; - } const notices = useSelect( ( select ) => select( noticesStore ) @@ -39,6 +35,7 @@ const Notices = () => { [] ); const { removeNotice } = useDispatch( noticesStore ); + return ( { ); }; -const handlePageLoad = () => { - const location = useLocation(); - const routeContents = document.querySelector( '.wppbh-app-body-inner' ); - useEffect( () => { - setActiveSubnav( location.pathname ); - window.scrollTo( 0, 0 ); - if ( routeContents ) { - routeContents.focus( { preventScroll: true } ); - } - }, [ location.pathname ] ); -}; - const AppBody = ( props ) => { const location = useLocation(); const hashedPath = '#' + location.pathname; const { booted, hasError } = useContext( AppStore ); - handlePageLoad(); - return (
    { 'nfd-w-full nfd-p-4 min-[783px]:nfd-p-0' ) } > -
    @@ -105,7 +87,7 @@ const AppBody = ( props ) => {
    - + { 'undefined' !== typeof noticesStore && }
    ); diff --git a/src/app/pages/ecommerce/page.js b/src/app/pages/ecommerce/page.js index f64d14fe0..21e319c14 100644 --- a/src/app/pages/ecommerce/page.js +++ b/src/app/pages/ecommerce/page.js @@ -1,45 +1,51 @@ -import { NewfoldECommerce } from "@newfold-labs/wp-module-ecommerce"; -import { useContext } from "@wordpress/element"; -import { useLocation, useNavigate, useSearchParams } from "react-router-dom"; -import { useNotification } from "../../components/notifications/feed"; -import { Page } from "../../components/page"; -import AppStore from "../../data/store"; -import { bluehostSettingsApiFetch } from "../../util/helpers"; -import "./styles.scss"; -import "@newfold-labs/wp-module-ecommerce/bluehost.css"; +import './styles.scss'; +import { useContext } from '@wordpress/element'; +import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; +import { NewfoldECommerce } from '@newfold-labs/wp-module-ecommerce'; +import '@newfold-labs/wp-module-ecommerce/bluehost.css'; +import AppStore from 'App/data/store'; +import { bluehostSettingsApiFetch } from 'App/util/helpers'; +import { Page } from 'App/components/page'; +import { useNotification } from 'App/components/notifications'; const ECommerce = () => { - const { store, setStore } = useContext(AppStore); - let [params] = useSearchParams(); - let location = useLocation(); - let navigate = useNavigate(); - let notify = useNotification(); - let state = { - wp: { comingSoon: store?.comingSoon }, - params, - location: location.pathname, - }; - let wpModules = { navigate, notify }; + const { store, setStore } = useContext( AppStore ); + const [ params ] = useSearchParams(); + const location = useLocation(); + const navigate = useNavigate(); + const notify = useNotification(); + const state = { + wp: { comingSoon: store?.comingSoon }, + params, + location: location.pathname, + }; + const wpModules = { navigate, notify }; - let actions = { - toggleComingSoon: () => - bluehostSettingsApiFetch( - { comingSoon: !store.comingSoon }, - console.error, - (response) => { - setStore({ - ...store, - comingSoon: !store.comingSoon, - }); - } - ), - }; + const actions = { + toggleComingSoon: () => + bluehostSettingsApiFetch( + { comingSoon: ! store.comingSoon }, + // eslint-disable-next-line no-console + console.error, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setStore( { + ...store, + comingSoon: ! store.comingSoon, + } ); + } + ), + }; - return ( - - - - ); + return ( + + + + ); }; export default ECommerce; diff --git a/src/app/pages/example/index.js b/src/app/pages/example/index.js index 12e2ae61b..d64495801 100644 --- a/src/app/pages/example/index.js +++ b/src/app/pages/example/index.js @@ -1,44 +1,86 @@ -import { Button } from "@newfold/ui-component-library"; -import { SectionContainer, SectionHeader, SectionContent } from "../../components/section"; -import { RocketLaunchIcon } from "@heroicons/react/24/outline"; -import { Page } from "../../components/page"; +import { Button } from '@newfold/ui-component-library'; +import { + SectionContainer, + SectionHeader, + SectionContent, +} from '../../components/section'; +import { RocketLaunchIcon } from '@heroicons/react/24/outline'; +import { Page } from '../../components/page'; const Example = () => { - return ( - - - { console.log('Primary Action Clicked') } }} - secondaryAction={{ title: 'Secondary Action', onClick: () => { console.log('Secondary Action Clicked') } }} - /> + return ( + + + { + // eslint-disable-next-line no-console + console.log( 'Primary Action Clicked' ); + }, + } } + secondaryAction={ { + title: 'Secondary Action', + onClick: () => { + // eslint-disable-next-line no-console + console.log( 'Secondary Action Clicked' ); + }, + } } + /> - -
    - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. -
    -
    + +
    + Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the industrys + standard dummy text ever since the 1500s, when an + unknown printer took a galley of type and scrambled it + to make a type specimen book. It has survived not only + five centuries, but also the leap into electronic + typesetting, remaining essentially unchanged. +
    +
    - -
    - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. -
    -
    + +
    + Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the industrys + standard dummy text ever since the 1500s, when an + unknown printer took a galley of type and scrambled it + to make a type specimen book. It has survived not only + five centuries, but also the leap into electronic + typesetting, remaining essentially unchanged. +
    +
    - -
    -

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

    - -
    -
    -
    -
    - ); -} + +
    +

    + Lorem Ipsum is simply dummy text of the printing and + typesetting industry. Lorem Ipsum has been the + industrys standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and + scrambled it to make a type specimen book. +

    + +
    +
    +
    +
    + ); +}; -export default Example; \ No newline at end of file +export default Example; diff --git a/src/app/pages/help/index.js b/src/app/pages/help/index.js index c5df84caf..fd0961d18 100644 --- a/src/app/pages/help/index.js +++ b/src/app/pages/help/index.js @@ -1,34 +1,36 @@ -import { Page } from '../../components/page'; -import { SectionContainer, SectionContent, SectionHeader } from '../../components/section'; -import help from '../../data/help'; -import { Button, Card, Title } from "@newfold/ui-component-library"; +import { Button, Card, Title } from '@newfold/ui-component-library'; +import { Page } from 'App/components/page'; +import { + SectionContainer, + SectionContent, + SectionHeader, +} from 'App/components/section'; +import help from 'App/data/help'; -const HelpCard = ({ item }) => { - return ( - - - {item.title} -

    {item.description}

    -
    +const HelpCard = ( { item } ) => { + return ( + + + + { item.title } + +

    { item.description }

    +
    - - - -
    - ); -} + + + +
    + ); +}; const Help = () => { const renderHelpCards = () => { @@ -36,24 +38,24 @@ const Help = () => { return (
    - {helpItems.map((item) => ( - - ))} + { helpItems.map( ( item ) => ( + + ) ) }
    ); }; return ( - - + + - - {renderHelpCards()} - + { renderHelpCards() } ); diff --git a/src/app/pages/home/accountCard.js b/src/app/pages/home/accountCard.js index f862cdeec..061249211 100644 --- a/src/app/pages/home/accountCard.js +++ b/src/app/pages/home/accountCard.js @@ -1,99 +1,109 @@ import { - CpuChipIcon, - CreditCardIcon, - EnvelopeIcon, - GiftIcon, - IdentificationIcon, - ShieldCheckIcon, -} from "@heroicons/react/24/outline"; -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; -import { Card, Title } from "@newfold/ui-component-library"; -import { addUtmParams, getPlatformPathUrl, getPlatformBaseUrl, isJarvis } from "../../util/helpers"; -import classNames from "classnames"; + CpuChipIcon, + CreditCardIcon, + EnvelopeIcon, + GiftIcon, + IdentificationIcon, + ShieldCheckIcon, +} from '@heroicons/react/24/outline'; +import { Card, Title } from '@newfold/ui-component-library'; +import { + addUtmParams, + getPlatformPathUrl, + getPlatformBaseUrl, + isJarvis, +} from '../../util/helpers'; +import classNames from 'classnames'; const base = [ - { - icon: CpuChipIcon, - id: "account_link", - href: addUtmParams( getPlatformPathUrl("hosting/list", "app") ), - label: isJarvis() - ? __("Hosting", "bluehost-wordpress-plugin") - : __("Control Panel", "bluehost-wordpress-plugin"), - color: "nfd-fill-gray", - }, - { - icon: GiftIcon, - id: "products_link", - href: addUtmParams( getPlatformPathUrl("renewal-center", "account_center#products") ), - label: isJarvis() - ? __("Renewal Center", "bluehost-wordpress-plugin") - : __("Products", "bluehost-wordpress-plugin"), - color: "nfd-fill-primary-dark", - }, - { - icon: CreditCardIcon, - id: "billing_link", - href: addUtmParams( getPlatformPathUrl("billing-center", "account_center#billing") ), - label: isJarvis() - ? __("Payment Methods", "bluehost-wordpress-plugin") - : __("Billing", "bluehost-wordpress-plugin"), - color: "nfd-fill-primary", - }, - { - icon: EnvelopeIcon, - id: "mail_link", - href: addUtmParams( getPlatformPathUrl("home", "app#/email-office") ), - label: isJarvis() - ? __("Mail", "bluehost-wordpress-plugin") - : __("Mail & Office", "bluehost-wordpress-plugin"), - color: "nfd-fill-[#5b5b5b]", - }, - { - icon: ShieldCheckIcon, - id: "security_link", - href: addUtmParams( getPlatformPathUrl("account-center", "account_center#security") ), - label: __("Security", "bluehost-wordpress-plugin"), - color: "nfd-fill-[#17b212]", - }, - { - icon: IdentificationIcon, - id: "validation_token_link", - href: isJarvis() - ? addUtmParams( getPlatformPathUrl("account-center") ) - : addUtmParams( getPlatformBaseUrl("/cgi/token") ), - label: isJarvis() - ? __("Profile", "bluehost-wordpress-plugin") - : __("Validation Token", "bluehost-wordpress-plugin"), - color: "nfd-fill-[#f89c24]", - }, + { + icon: CpuChipIcon, + id: 'account_link', + href: addUtmParams( getPlatformPathUrl( 'hosting/list', 'app' ) ), + label: isJarvis() + ? __( 'Hosting', 'bluehost-wordpress-plugin' ) + : __( 'Control Panel', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-gray', + }, + { + icon: GiftIcon, + id: 'products_link', + href: addUtmParams( + getPlatformPathUrl( 'renewal-center', 'account_center#products' ) + ), + label: isJarvis() + ? __( 'Renewal Center', 'bluehost-wordpress-plugin' ) + : __( 'Products', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-primary-dark', + }, + { + icon: CreditCardIcon, + id: 'billing_link', + href: addUtmParams( + getPlatformPathUrl( 'billing-center', 'account_center#billing' ) + ), + label: isJarvis() + ? __( 'Payment Methods', 'bluehost-wordpress-plugin' ) + : __( 'Billing', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-primary', + }, + { + icon: EnvelopeIcon, + id: 'mail_link', + href: addUtmParams( getPlatformPathUrl( 'home', 'app#/email-office' ) ), + label: isJarvis() + ? __( 'Mail', 'bluehost-wordpress-plugin' ) + : __( 'Mail & Office', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-[#5b5b5b]', + }, + { + icon: ShieldCheckIcon, + id: 'security_link', + href: addUtmParams( + getPlatformPathUrl( 'account-center', 'account_center#security' ) + ), + label: __( 'Security', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-[#17b212]', + }, + { + icon: IdentificationIcon, + id: 'validation_token_link', + href: isJarvis() + ? addUtmParams( getPlatformPathUrl( 'account-center' ) ) + : addUtmParams( getPlatformBaseUrl( '/cgi/token' ) ), + label: isJarvis() + ? __( 'Profile', 'bluehost-wordpress-plugin' ) + : __( 'Validation Token', 'bluehost-wordpress-plugin' ), + color: 'nfd-fill-[#f89c24]', + }, ]; -export function AccountCard(props) { - return ( - - - Bluehost Account - - - - ); -} +export const AccountCard = ( { props } ) => { + return ( + + + Bluehost Account + + + + ); +}; diff --git a/src/app/pages/home/freeAddonsSection.js b/src/app/pages/home/freeAddonsSection.js index 2518f6f5f..2aa9f50be 100644 --- a/src/app/pages/home/freeAddonsSection.js +++ b/src/app/pages/home/freeAddonsSection.js @@ -1,7 +1,7 @@ -import { FreePlugins } from "@newfold-labs/wp-module-ecommerce"; -import { useNotification } from "../../components/notifications/feed"; +import { FreePlugins } from '@newfold-labs/wp-module-ecommerce'; +import { useNotification } from 'App/components/notifications'; -export function FreeAddonsSection() { - let notify = useNotification(); - return ; -} +export const FreeAddonsSection = ( { props } ) => { + const notify = useNotification(); + return ; +}; diff --git a/src/app/pages/home/helpCard.js b/src/app/pages/home/helpCard.js index a3ee28006..c7829c2db 100644 --- a/src/app/pages/home/helpCard.js +++ b/src/app/pages/home/helpCard.js @@ -1,26 +1,31 @@ -import { Button, Card, Title } from "@newfold/ui-component-library"; -import SupportIllustration from "../../images/section-home-help-me.svg"; +import { Button, Card, Title } from '@newfold/ui-component-library'; +import SupportIllustration from '../../images/section-home-help-me.svg'; export function HelpCard() { - return ( - - - Need some help? -
    - Help Agent Illustration -

    From DIY to full-service help.

    -

    - Call or chat 24/7 for support or let our experts build your site for - you. -

    - -
    -
    -
    - ); + return ( + + + Need some help? +
    + Help Agent Illustration +

    From DIY to full-service help.

    +

    + Call or chat 24/7 for support or let our experts build + your site for you. +

    + +
    +
    +
    + ); } diff --git a/src/app/pages/home/index.js b/src/app/pages/home/index.js index 7df5f3d50..6b7efae6c 100644 --- a/src/app/pages/home/index.js +++ b/src/app/pages/home/index.js @@ -12,7 +12,7 @@ const Home = () => { - +
    diff --git a/src/app/pages/home/welcomeSection.js b/src/app/pages/home/welcomeSection.js index 002dce3eb..d5540304c 100644 --- a/src/app/pages/home/welcomeSection.js +++ b/src/app/pages/home/welcomeSection.js @@ -1,23 +1,24 @@ -import { OnboardingScreen } from "@newfold-labs/wp-module-ecommerce"; -import { useContext } from "@wordpress/element"; -import { useNotification } from "../../components/notifications/feed"; -import AppStore from "../../data/store"; -import { bluehostSettingsApiFetch } from "../../util/helpers"; +import { useContext } from '@wordpress/element'; +import { OnboardingScreen } from '@newfold-labs/wp-module-ecommerce'; +import AppStore from 'App/data/store'; +import { bluehostSettingsApiFetch } from 'App/util/helpers'; +import { useNotification } from 'App/components/notifications'; export function WelcomeSection() { - let { store, setStore } = useContext(AppStore); - let notify = useNotification(); - const toggleComingSoon = () => - bluehostSettingsApiFetch( - { comingSoon: !store.comingSoon }, - console.error, - () => setStore({ ...store, comingSoon: !store.comingSoon }) - ); - return ( - - ); + const { store, setStore } = useContext( AppStore ); + const notify = useNotification(); + const toggleComingSoon = () => + bluehostSettingsApiFetch( + { comingSoon: ! store.comingSoon }, + // eslint-disable-next-line no-console + console.error, + () => setStore( { ...store, comingSoon: ! store.comingSoon } ) + ); + return ( + + ); } diff --git a/src/app/pages/marketplace/index.js b/src/app/pages/marketplace/index.js index 97d5fc920..40e929ff1 100644 --- a/src/app/pages/marketplace/index.js +++ b/src/app/pages/marketplace/index.js @@ -2,54 +2,64 @@ import apiFetch from '@wordpress/api-fetch'; import { useState, useEffect } from '@wordpress/element'; import { useLocation } from 'react-router-dom'; import classnames from 'classnames'; -import { Page } from "../../components/page"; -import { SectionContainer, SectionHeader, SectionContent } from "../../components/section"; -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; +import { Page } from 'App/components/page'; +import { + SectionContainer, + SectionHeader, + SectionContent, +} from 'App/components/section'; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; // component sourced from marketplace module import { default as NewfoldMarketplace } from '../../../../vendor/newfold-labs/wp-module-marketplace/components/marketplace/'; const MarketplacePage = () => { - - // constants to pass to module - const moduleConstants = { - 'supportsCTB': true, - 'text': { - 'title': __('Marketplace', 'bluehost-wordpress-plugin'), - 'subTitle': __('Explore our featured collection of tools and services.', 'bluehost-wordpress-plugin'), - 'error': __('Oops, there was an error loading the marketplace, please try again later.', 'bluehost-wordpress-plugin'), - 'noProducts': __('Sorry, no marketplace items. Please, try again later.', 'bluehost-wordpress-plugin'), - 'loadMore': __('Load More', 'bluehost-wordpress-plugin'), - } + // constants to pass to module + const moduleConstants = { + supportsCTB: true, + text: { + title: __( 'Marketplace', 'bluehost-wordpress-plugin' ), + subTitle: __( + 'Explore our featured collection of tools and services.', + 'bluehost-wordpress-plugin' + ), + error: __( + 'Oops, there was an error loading the marketplace, please try again later.', + 'bluehost-wordpress-plugin' + ), + noProducts: __( + 'Sorry, no marketplace items. Please, try again later.', + 'bluehost-wordpress-plugin' + ), + loadMore: __( 'Load More', 'bluehost-wordpress-plugin' ), + }, }; - // methods to pass to module - const moduleMethods = { - apiFetch, - classnames, - useState, - useEffect, - useLocation, - NewfoldRuntime, - }; + // methods to pass to module + const moduleMethods = { + apiFetch, + classnames, + useState, + useEffect, + useLocation, + NewfoldRuntime, + }; const moduleComponents = { SectionHeader, SectionContent, - } - - return ( - - - - + }; - - - ); + return ( + + + + + + ); }; -export default MarketplacePage; \ No newline at end of file +export default MarketplacePage; diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index 3a4f7ec34..33dfc9d97 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -4,59 +4,66 @@ import { useState, useEffect, useContext, Fragment } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; import classnames from 'classnames'; import { useUpdateEffect } from 'react-use'; -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; -import { SectionContainer, SectionHeader, SectionContent, SectionSettings } from '../../components/section'; -import { useNotification } from '../../components/notifications/feed'; -import { - bluehostSettingsApiFetch as newfoldSettingsApiFetch, - bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch -} from '../../util/helpers'; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; +import { + SectionContainer, + SectionHeader, + SectionContent, + SectionSettings, +} from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; +import { + bluehostSettingsApiFetch as newfoldSettingsApiFetch, + bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch, +} from 'App/util/helpers'; import { default as NewfoldPerformance } from '../../../../vendor/newfold-labs/wp-module-performance/components/performance/'; const PerformancePage = () => { + // constants to pass to module + const moduleConstants = {}; - // constants to pass to module - const moduleConstants = {}; - - // methods to pass to module - const moduleMethods = { - apiFetch, - classnames, - useState, - useEffect, - useContext, - NewfoldRuntime, - useNotification, - newfoldSettingsApiFetch, - newfoldPurgeCacheApiFetch, - useUpdateEffect, - AppStore, - }; + // methods to pass to module + const moduleMethods = { + apiFetch, + classnames, + useState, + useEffect, + useContext, + NewfoldRuntime, + useNotification, + newfoldSettingsApiFetch, + newfoldPurgeCacheApiFetch, + useUpdateEffect, + AppStore, + }; const moduleComponents = { Page, - SectionHeader, + SectionHeader, SectionContent, - SectionSettings, - SectionContainer, - Fragment, - } + SectionSettings, + SectionContainer, + Fragment, + }; return ( - - - - - + + + + + ); }; diff --git a/src/app/pages/settings/automaticUpdates.js b/src/app/pages/settings/automaticUpdates.js index 6ef9a85f2..0758c2fa2 100644 --- a/src/app/pages/settings/automaticUpdates.js +++ b/src/app/pages/settings/automaticUpdates.js @@ -1,284 +1,323 @@ +import { useState } from '@wordpress/element'; +import { useUpdateEffect } from 'react-use'; +import { Alert, ToggleField } from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch } from '../../util/helpers'; -import { useUpdateEffect } from 'react-use'; -import { useState } from '@wordpress/element'; -import { Alert, ToggleField } from "@newfold/ui-component-library"; -import { SectionSettings } from "../../components/section"; -import { useNotification } from '../../components/notifications/feed'; +import { SectionSettings } from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; -const AutomaticUpdatesAll = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [autoUpdatesAll, setAutoUpdatesAll] = useState( +const AutomaticUpdatesAll = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ autoUpdatesAll, setAutoUpdatesAll ] = useState( store.autoUpdatesMajorCore && - store.autoUpdatesPlugins && - store.autoUpdatesThemes - ? true - : false + store.autoUpdatesPlugins && + store.autoUpdatesThemes + ? true + : false ); const getAllNoticeTitle = () => { return autoUpdatesAll - ? __('Enabled All auto-updates', 'wp-plugin-bluehost') - : __('Disabled All auto-updates', 'wp-plugin-bluehost'); + ? __( 'Enabled All auto-updates', 'wp-plugin-bluehost' ) + : __( 'Disabled All auto-updates', 'wp-plugin-bluehost' ); }; const getAllNoticeText = () => { return autoUpdatesAll - ? __('Everything will automatically update.', 'wp-plugin-bluehost') - : __('Custom auto-update settings.', 'wp-plugin-bluehost'); + ? __( + 'Everything will automatically update.', + 'wp-plugin-bluehost' + ) + : __( 'Custom auto-update settings.', 'wp-plugin-bluehost' ); }; const toggleAutoUpdatesAll = () => { - if ( autoUpdatesAll ) { // is unchecking + if ( autoUpdatesAll ) { + // is unchecking // just uncheck this one - setAutoUpdatesAll(!autoUpdatesAll); - } else { // is checking + setAutoUpdatesAll( ! autoUpdatesAll ); + } else { + // is checking bluehostSettingsApiFetch( - { + { autoUpdatesMajorCore: true, autoUpdatesPlugins: true, - autoUpdatesThemes: true - }, - setError, - (response) => { - setAutoUpdatesAll(!autoUpdatesAll); + autoUpdatesThemes: true, + }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setAutoUpdatesAll( ! autoUpdatesAll ); } ); } }; const notifySuccess = () => { - notify.push("everything-autoupdate-notice", { + notify.push( 'everything-autoupdate-notice', { title: getAllNoticeTitle(), - description: ( - - {getAllNoticeText()} - - ), - variant: "success", + description: { getAllNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; useEffect( () => { - if ( store.autoUpdatesMajorCore && store.autoUpdatesPlugins && store.autoUpdatesThemes ) { + if ( + store.autoUpdatesMajorCore && + store.autoUpdatesPlugins && + store.autoUpdatesThemes + ) { setAutoUpdatesAll( true ); } else { setAutoUpdatesAll( false ); } - }, [ store.autoUpdatesMajorCore, store.autoUpdatesPlugins, store.autoUpdatesThemes ] ); - - useUpdateEffect(() => { - - setStore({ + }, [ + store.autoUpdatesMajorCore, + store.autoUpdatesPlugins, + store.autoUpdatesThemes, + ] ); + + useUpdateEffect( () => { + setStore( { ...store, autoUpdatesAll, - }); + } ); notifySuccess(); - }, [autoUpdatesAll]); + }, [ autoUpdatesAll ] ); return ( ); -} +}; -const AutomaticUpdatesMajorCore = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [autoUpdatesMajorCore, setAutoUpdatesCore] = useState( +const AutomaticUpdatesMajorCore = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ autoUpdatesMajorCore, setAutoUpdatesCore ] = useState( store.autoUpdatesMajorCore ); const getCoreNoticeTitle = () => { return autoUpdatesMajorCore - ? __('Enabled Core auto-updates', 'wp-plugin-bluehost') - : __('Disabled Core auto-updates', 'wp-plugin-bluehost'); + ? __( 'Enabled Core auto-updates', 'wp-plugin-bluehost' ) + : __( 'Disabled Core auto-updates', 'wp-plugin-bluehost' ); }; const getCoreNoticeText = () => { return autoUpdatesMajorCore - ? __('WordPress will automatically update.', 'wp-plugin-bluehost') - : __('WordPress must be manually updated.', 'wp-plugin-bluehost'); + ? __( 'WordPress will automatically update.', 'wp-plugin-bluehost' ) + : __( 'WordPress must be manually updated.', 'wp-plugin-bluehost' ); }; const toggleAutoUpdatesMajorCore = () => { - bluehostSettingsApiFetch({ autoUpdatesMajorCore: !autoUpdatesMajorCore }, setError, (response) => { - setAutoUpdatesCore(!autoUpdatesMajorCore); - }); + bluehostSettingsApiFetch( + { autoUpdatesMajorCore: ! autoUpdatesMajorCore }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setAutoUpdatesCore( ! autoUpdatesMajorCore ); + } + ); }; const notifySuccess = () => { - notify.push("major-core-autoupdate-notice", { + notify.push( 'major-core-autoupdate-notice', { title: getCoreNoticeTitle(), - description: ( - - {getCoreNoticeText()} - - ), - variant: "success", + description: { getCoreNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, autoUpdatesMajorCore, - }); + } ); notifySuccess(); - }, [autoUpdatesMajorCore]); + }, [ autoUpdatesMajorCore ] ); return ( ); -} +}; -const AutomaticUpdatesPlugins = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [autoUpdatesPlugins, setAutoUpdatesPlugins] = useState( +const AutomaticUpdatesPlugins = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ autoUpdatesPlugins, setAutoUpdatesPlugins ] = useState( store.autoUpdatesPlugins ); const getPluginsNoticeTitle = () => { return autoUpdatesPlugins - ? __('Enabled Plugins auto-update', 'wp-plugin-bluehost') - : __('Disabled Plugins auto-update', 'wp-plugin-bluehost'); + ? __( 'Enabled Plugins auto-update', 'wp-plugin-bluehost' ) + : __( 'Disabled Plugins auto-update', 'wp-plugin-bluehost' ); }; const getPluginsNoticeText = () => { return autoUpdatesPlugins - ? __('All plugins will automatically update.', 'wp-plugin-bluehost') - : __('Each plugin must be manually updated.', 'wp-plugin-bluehost'); + ? __( + 'All plugins will automatically update.', + 'wp-plugin-bluehost' + ) + : __( + 'Each plugin must be manually updated.', + 'wp-plugin-bluehost' + ); }; const toggleAutoUpdatesPlugins = () => { - bluehostSettingsApiFetch({ autoUpdatesPlugins: !autoUpdatesPlugins }, setError, (response) => { - setAutoUpdatesPlugins(!autoUpdatesPlugins); - }); + bluehostSettingsApiFetch( + { autoUpdatesPlugins: ! autoUpdatesPlugins }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setAutoUpdatesPlugins( ! autoUpdatesPlugins ); + } + ); }; const notifySuccess = () => { - notify.push("plugins-autoupdate-notice", { + notify.push( 'plugins-autoupdate-notice', { title: getPluginsNoticeTitle(), - description: ( - - {getPluginsNoticeText()} - - ), - variant: "success", + description: { getPluginsNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, autoUpdatesPlugins, - }); + } ); notifySuccess(); - }, [autoUpdatesPlugins]); + }, [ autoUpdatesPlugins ] ); return ( ); -} +}; -const AutomaticUpdatesThemes = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [autoUpdatesThemes, setAutoUpdatesThemes] = useState( +const AutomaticUpdatesThemes = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ autoUpdatesThemes, setAutoUpdatesThemes ] = useState( store.autoUpdatesThemes ); const getThemesNoticeTitle = () => { return autoUpdatesThemes - ? __('Enabled Themes auto-update', 'wp-plugin-bluehost') - : __('Disabled Themes auto-update', 'wp-plugin-bluehost'); + ? __( 'Enabled Themes auto-update', 'wp-plugin-bluehost' ) + : __( 'Disabled Themes auto-update', 'wp-plugin-bluehost' ); }; const getThemesNoticeText = () => { return autoUpdatesThemes - ? __('All themes will automatically update.', 'wp-plugin-bluehost') - : __('Each theme must be manually updated.', 'wp-plugin-bluehost'); + ? __( + 'All themes will automatically update.', + 'wp-plugin-bluehost' + ) + : __( + 'Each theme must be manually updated.', + 'wp-plugin-bluehost' + ); }; const toggleAutoUpdatesThemes = () => { - bluehostSettingsApiFetch({ autoUpdatesThemes: !autoUpdatesThemes }, setError, (response) => { - setAutoUpdatesThemes(!autoUpdatesThemes); - }); + bluehostSettingsApiFetch( + { autoUpdatesThemes: ! autoUpdatesThemes }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setAutoUpdatesThemes( ! autoUpdatesThemes ); + } + ); }; const notifySuccess = () => { - notify.push("themes-autoupdate-notice", { + notify.push( 'themes-autoupdate-notice', { title: getThemesNoticeTitle(), - description: ( - - {getThemesNoticeText()} - - ), - variant: "success", + description: { getThemesNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, autoUpdatesThemes, - }); + } ); notifySuccess(); - }, [autoUpdatesThemes]); + }, [ autoUpdatesThemes ] ); return ( ); -} +}; const AutomaticUpdates = () => { - const [isError, setError] = useState(false); + const [ isError, setError ] = useState( false ); - let notify = useNotification(); + const notify = useNotification(); return (
    - - - - - {isError && + + + + + { isError && ( - {__('Oops! Something went wrong. Please try again.', 'wp-plugin-bluehost')} + { __( + 'Oops! Something went wrong. Please try again.', + 'wp-plugin-bluehost' + ) } - } + ) }
    ); -} +}; -export default AutomaticUpdates; \ No newline at end of file +export default AutomaticUpdates; diff --git a/src/app/pages/settings/comingSoon.js b/src/app/pages/settings/comingSoon.js index e77a57ba2..de0d710cd 100644 --- a/src/app/pages/settings/comingSoon.js +++ b/src/app/pages/settings/comingSoon.js @@ -1,115 +1,131 @@ +import { useState } from '@wordpress/element'; +import { useUpdateEffect } from 'react-use'; +import { Alert, ToggleField } from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch, comingSoonAdminbarToggle, } from '../../util/helpers'; -import { useState } from '@wordpress/element'; -import { useUpdateEffect } from 'react-use'; -import { Alert, ToggleField } from "@newfold/ui-component-library"; -import { SectionSettings } from "../../components/section"; -import { useNotification } from '../../components/notifications/feed'; +import { SectionSettings } from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; const ComingSoon = () => { - const { store, setStore } = useContext(AppStore); - const [comingSoon, setComingSoon] = useState(store.comingSoon); - const [isError, setError] = useState(false); + const { store, setStore } = useContext( AppStore ); + const [ comingSoon, setComingSoon ] = useState( store.comingSoon ); + const [ isError, setError ] = useState( false ); - let notify = useNotification(); + const notify = useNotification(); const getComingSoonNoticeTitle = () => { return comingSoon - ? __('Coming soon activated', 'wp-plugin-bluehost') - : __('Coming soon deactivated', 'wp-plugin-bluehost'); + ? __( 'Coming soon activated', 'wp-plugin-bluehost' ) + : __( 'Coming soon deactivated', 'wp-plugin-bluehost' ); }; const getComingSoonNoticeText = () => { return comingSoon ? __( - 'Coming soon page is active. Site requires login.', - 'wp-plugin-bluehost' - ) + 'Coming soon page is active. Site requires login.', + 'wp-plugin-bluehost' + ) : __( - 'Coming soon page is not active. Site is live to visitors.', - 'wp-plugin-bluehost' - ); + 'Coming soon page is not active. Site is live to visitors.', + 'wp-plugin-bluehost' + ); }; const toggleComingSoon = () => { - bluehostSettingsApiFetch({ comingSoon: !comingSoon }, setError, (response) => { - setComingSoon(!comingSoon); - }); + bluehostSettingsApiFetch( + { comingSoon: ! comingSoon }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setComingSoon( ! comingSoon ); + } + ); }; const notifySuccess = () => { - notify.push("coming-soon-toggle-notice", { + notify.push( 'coming-soon-toggle-notice', { title: getComingSoonNoticeTitle(), - description: ( - - {getComingSoonNoticeText()} - - ), - variant: "success", + description: { getComingSoonNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, comingSoon, - }); + } ); notifySuccess(); - comingSoonAdminbarToggle(comingSoon); - }, [comingSoon]); + comingSoonAdminbarToggle( comingSoon ); + }, [ comingSoon ] ); const getComingSoonSectionTitle = () => { const getStatus = () => { - return ( - comingSoon - ? {__('Coming Soon', 'wp-plugin-bluehost')} - : {__('Live', 'wp-plugin-bluehost')} + return comingSoon ? ( + + { __( 'Coming Soon', 'wp-plugin-bluehost' ) } + + ) : ( + + { __( 'Live', 'wp-plugin-bluehost' ) } + ); }; return ( - {__('Site Status', 'wp-plugin-bluehost')}: {getStatus()} - ) + + { __( 'Site Status', 'wp-plugin-bluehost' ) }: { getStatus() } + + ); }; return (
    { + ) } + checked={ comingSoon } + onChange={ () => { toggleComingSoon(); - }} + } } /> - {comingSoon && + { comingSoon && ( - {__('Your website is currently displaying a "Coming Soon" page.', 'wp-plugin-bluehost')} + { __( + 'Your website is currently displaying a "Coming Soon" page.', + 'wp-plugin-bluehost' + ) } - } + ) } - {isError && + { isError && ( - {__('Oops! Something went wrong. Please try again.', 'wp-plugin-bluehost')} + { __( + 'Oops! Something went wrong. Please try again.', + 'wp-plugin-bluehost' + ) } - } + ) }
    ); -} +}; -export default ComingSoon; \ No newline at end of file +export default ComingSoon; diff --git a/src/app/pages/settings/commentSettings.js b/src/app/pages/settings/commentSettings.js index 27f6475f4..fdd66e3a5 100644 --- a/src/app/pages/settings/commentSettings.js +++ b/src/app/pages/settings/commentSettings.js @@ -1,137 +1,150 @@ +import { useState } from '@wordpress/element'; +import { useUpdateEffect } from 'react-use'; +import { Alert, SelectField, ToggleField } from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch } from '../../util/helpers'; -import { useUpdateEffect } from 'react-use'; -import { useState } from '@wordpress/element'; -import { Alert, SelectField, ToggleField } from "@newfold/ui-component-library"; -import { SectionSettings } from "../../components/section"; -import { useNotification } from '../../components/notifications/feed'; +import { SectionSettings } from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; -const OldPostsComments = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [disableCommentsOldPosts, setDisableCommentsOldPosts] = useState( +const OldPostsComments = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ disableCommentsOldPosts, setDisableCommentsOldPosts ] = useState( store.disableCommentsOldPosts ); const disableCommentsNoticeTitle = () => { return disableCommentsOldPosts - ? __('Disabled old post comments', 'wp-plugin-bluehost') - : __('Enabled old post comments', 'wp-plugin-bluehost'); + ? __( 'Disabled old post comments', 'wp-plugin-bluehost' ) + : __( 'Enabled old post comments', 'wp-plugin-bluehost' ); }; const disableCommentsNoticeText = () => { return disableCommentsOldPosts - ? __('Comments on old posts are disabled.', 'wp-plugin-bluehost') - : __('Comments are allowed on old posts.', 'wp-plugin-bluehost'); + ? __( 'Comments on old posts are disabled.', 'wp-plugin-bluehost' ) + : __( 'Comments are allowed on old posts.', 'wp-plugin-bluehost' ); }; const toggleDisableCommentsOldPosts = () => { - bluehostSettingsApiFetch({ disableCommentsOldPosts: !disableCommentsOldPosts }, setError, (response) => { - setDisableCommentsOldPosts(!disableCommentsOldPosts); - }); + bluehostSettingsApiFetch( + { disableCommentsOldPosts: ! disableCommentsOldPosts }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setDisableCommentsOldPosts( ! disableCommentsOldPosts ); + } + ); }; const notifySuccess = () => { - notify.push("disable-old-posts-comments-notice", { + notify.push( 'disable-old-posts-comments-notice', { title: disableCommentsNoticeTitle(), - description: ( - - {disableCommentsNoticeText()} - - ), - variant: "success", + description: { disableCommentsNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, disableCommentsOldPosts, - }); + } ); notifySuccess(); - }, [disableCommentsOldPosts]); + }, [ disableCommentsOldPosts ] ); return ( ); -} +}; -const CloseCommentsDays = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [closeCommentsDays, setNumCloseCommentsDays] = useState( +const CloseCommentsDays = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ closeCommentsDays, setNumCloseCommentsDays ] = useState( store.closeCommentsDays ); const closeCommentsDaysNoticeTitle = () => { - return ( - __('Comments setting saved ', 'wp-plugin-bluehost') - ); + return __( 'Comments setting saved ', 'wp-plugin-bluehost' ); }; const closeCommentsDaysNoticeText = () => { //`Comments on posts are disabled after ${closeCommentsDays} days.` return ( - __('Comments on posts are disabled after ', 'wp-plugin-bluehost') + + __( + 'Comments on posts are disabled after ', + 'wp-plugin-bluehost' + ) + closeCommentsDays + - _n(' day.', ' days.', parseInt(closeCommentsDays), 'wp-plugin-bluehost') + _n( + ' day.', + ' days.', + parseInt( closeCommentsDays ), + 'wp-plugin-bluehost' + ) ); }; const closeCommentsDaysLabelText = () => { //`Close comments after ${closeCommentsDays} days.` return ( - __('Close comments after ', 'wp-plugin-bluehost') + + __( 'Close comments after ', 'wp-plugin-bluehost' ) + closeCommentsDays + - _n(' day.', ' days.', parseInt(closeCommentsDays), 'wp-plugin-bluehost') + _n( + ' day.', + ' days.', + parseInt( closeCommentsDays ), + 'wp-plugin-bluehost' + ) ); }; - const handleCloseCommentsDaysChange = (value) => { - bluehostSettingsApiFetch({ closeCommentsDays: value }, setError, (response) => { - setNumCloseCommentsDays(value); - }); + const handleCloseCommentsDaysChange = ( value ) => { + bluehostSettingsApiFetch( + { closeCommentsDays: value }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setNumCloseCommentsDays( value ); + } + ); }; const notifySuccess = () => { - notify.push("close-comments-days-notice", { + notify.push( 'close-comments-days-notice', { title: closeCommentsDaysNoticeTitle(), - description: ( - - {closeCommentsDaysNoticeText()} - - ), - variant: "success", + description: { closeCommentsDaysNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, closeCommentsDays, - }); + } ); notifySuccess(); - }, [closeCommentsDays]); + }, [ closeCommentsDays ] ); return ( { { label: '30', value: '30' }, { label: '50', value: '50' }, { label: '100', value: '100' }, - ]} - onChange={handleCloseCommentsDaysChange} + ] } + onChange={ handleCloseCommentsDaysChange } className="nfd-select-field__spaced" /> ); -} +}; -const CommentsPerPage = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [commentsPerPage, setNumCommentsPerPage] = useState( +const CommentsPerPage = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); + const [ commentsPerPage, setNumCommentsPerPage ] = useState( store.commentsPerPage ); const commentsPerPageNoticeTitle = () => { - return __('Comments setting saved.', 'wp-plugin-bluehost'); + return __( 'Comments setting saved.', 'wp-plugin-bluehost' ); }; const commentsPerPageNoticeText = () => { //`Posts will display ${commentsPerPage} comments at a time.` return ( - __('Posts will display ', 'wp-plugin-bluehost') + + __( 'Posts will display ', 'wp-plugin-bluehost' ) + commentsPerPage + _n( ' comment at a time.', ' comments at a time.', - parseInt(commentsPerPage), + parseInt( commentsPerPage ), 'wp-plugin-bluehost' ) ); }; - const handleCommentsPerPageChange = (value) => { - bluehostSettingsApiFetch({ commentsPerPage: value }, setError, (response) => { - setNumCommentsPerPage(value); - }); + const handleCommentsPerPageChange = ( value ) => { + bluehostSettingsApiFetch( + { commentsPerPage: value }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setNumCommentsPerPage( value ); + } + ); }; const notifySuccess = () => { - notify.push("comments-per-page-notice", { + notify.push( 'comments-per-page-notice', { title: commentsPerPageNoticeTitle(), - description: ( - - {commentsPerPageNoticeText()} - - ), - variant: "success", + description: { commentsPerPageNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, commentsPerPage, - }); + } ); notifySuccess(); - }, [commentsPerPage]); + }, [ commentsPerPage ] ); return ( ); -} +}; const CommentSettings = () => { - const [isError, setError] = useState(false); + const [ isError, setError ] = useState( false ); - let notify = useNotification(); + const notify = useNotification(); return (
    - - - - {isError && + + + + { isError && ( - {__('Oops! Something went wrong. Please try again.', 'wp-plugin-bluehost')} + { __( + 'Oops! Something went wrong. Please try again.', + 'wp-plugin-bluehost' + ) } - } + ) }
    -
    + ); }; diff --git a/src/app/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 067ea6c8e..7beb8548a 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -1,181 +1,217 @@ -import AppStore from '../../data/store'; -import { bluehostSettingsApiFetch } from '../../util/helpers'; -import { useUpdateEffect } from 'react-use'; import { useState } from '@wordpress/element'; -import { Alert, SelectField } from "@newfold/ui-component-library"; -import { SectionSettings } from "../../components/section"; -import { useNotification } from '../../components/notifications/feed'; - -const ContentRevisions = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); +import { useUpdateEffect } from 'react-use'; +import { Alert, SelectField } from '@newfold/ui-component-library'; +import AppStore from 'App/data/store'; +import { bluehostSettingsApiFetch } from 'App/util/helpers'; +import { SectionSettings } from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; + +const ContentRevisions = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); const [ contentRevisions, setNumContentRevisions ] = useState( store.contentRevisions ); const contentRevisionsNoticeTitle = () => { - return ( - __('Post revision setting saved ', 'wp-plugin-bluehost') - ); + return __( 'Post revision setting saved ', 'wp-plugin-bluehost' ); }; const contentRevisionsNoticeText = () => { return ( - __('Posts will save ', 'wp-plugin-bluehost') + + __( 'Posts will save ', 'wp-plugin-bluehost' ) + contentRevisions + - _n(' revision.', ' revisions.', parseInt(contentRevisions), 'wp-plugin-bluehost') + _n( + ' revision.', + ' revisions.', + parseInt( contentRevisions ), + 'wp-plugin-bluehost' + ) ); }; const contentRevisionsDescriptionText = () => { return ( - __('Saving drafts and updating published content creates revisions. Make changes with confidence, knowing you can take ', 'wp-plugin-bluehost') + + __( + 'Saving drafts and updating published content creates revisions. Make changes with confidence, knowing you can take ', + 'wp-plugin-bluehost' + ) + contentRevisions + - _n(' step back.', ' steps back.', parseInt(contentRevisions), 'wp-plugin-bluehost') + _n( + ' step back.', + ' steps back.', + parseInt( contentRevisions ), + 'wp-plugin-bluehost' + ) ); }; - const handleContentRevisionsChange = (value) => { - bluehostSettingsApiFetch({ contentRevisions: value }, setError, (response) => { - setNumContentRevisions(value); - }); + const handleContentRevisionsChange = ( value ) => { + bluehostSettingsApiFetch( + { contentRevisions: value }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setNumContentRevisions( value ); + } + ); }; const notifySuccess = () => { - notify.push("content-revision-notice", { + notify.push( 'content-revision-notice', { title: contentRevisionsNoticeTitle(), - description: ( - - {contentRevisionsNoticeText()} - - ), - variant: "success", + description: { contentRevisionsNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, contentRevisions, - }); + } ); notifySuccess(); - }, [contentRevisions]); + }, [ contentRevisions ] ); return ( ); -} +}; -const EmptyTrash = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); +const EmptyTrash = ( { setError, notify } ) => { + const { store, setStore } = useContext( AppStore ); const [ emptyTrashDays, setNumEmptyTrashDays ] = useState( store.emptyTrashDays ); let numTrashWeeks = Math.floor( emptyTrashDays / 7 ); const emptyTrashNoticeTitle = () => { - return ( - __('Trash setting saved ', 'wp-plugin-bluehost') - ); + return __( 'Trash setting saved ', 'wp-plugin-bluehost' ); }; const emptyTrashNoticeText = () => { return ( - __('The trash will automatically empty every ', 'wp-plugin-bluehost') + + __( + 'The trash will automatically empty every ', + 'wp-plugin-bluehost' + ) + numTrashWeeks + - _n( ' week.', ' weeks.', parseInt(numTrashWeeks), 'wp-plugin-bluehost' ) + _n( + ' week.', + ' weeks.', + parseInt( numTrashWeeks ), + 'wp-plugin-bluehost' + ) ); }; - const handleEmptyTrashDaysChange = (value) => { - bluehostSettingsApiFetch({ emptyTrashDays: value }, setError, (response) => { - setNumEmptyTrashDays(value); - }); + const handleEmptyTrashDaysChange = ( value ) => { + bluehostSettingsApiFetch( + { emptyTrashDays: value }, + setError, + // eslint-disable-next-line no-unused-vars + ( response ) => { + setNumEmptyTrashDays( value ); + } + ); }; const notifySuccess = () => { - notify.push("empty-trash-notice", { + notify.push( 'empty-trash-notice', { title: emptyTrashNoticeTitle(), - description: ( - - {emptyTrashNoticeText()} - - ), - variant: "success", + description: { emptyTrashNoticeText() }, + variant: 'success', autoDismiss: 5000, - }); + } ); }; - useUpdateEffect(() => { - setStore({ + useUpdateEffect( () => { + setStore( { ...store, emptyTrashDays, - }); + } ); numTrashWeeks = Math.floor( emptyTrashDays / 7 ); notifySuccess(); - }, [emptyTrashDays]); + }, [ emptyTrashDays ] ); return ( ); -} +}; const ContentSettings = () => { - const [isError, setError] = useState(false); + const [ isError, setError ] = useState( false ); - let notify = useNotification(); + const notify = useNotification(); return (
    - - - - {isError && + + + + { isError && ( - {__('Oops! Something went wrong. Please try again.', 'wp-plugin-bluehost')} + { __( + 'Oops! Something went wrong. Please try again.', + 'wp-plugin-bluehost' + ) } - } + ) }
    -
    + ); -} +}; export default ContentSettings; diff --git a/src/app/pages/settings/index.js b/src/app/pages/settings/index.js index 0d35ba176..2316d1e86 100644 --- a/src/app/pages/settings/index.js +++ b/src/app/pages/settings/index.js @@ -2,36 +2,52 @@ import AutomaticUpdates from './automaticUpdates'; import ComingSoon from './comingSoon'; import CommentSettings from './commentSettings'; import ContentSettings from './contentSettings'; -import { Page } from '../../components/page'; -import { SectionContainer, SectionHeader, SectionContent } from '../../components/section'; +import { Page } from 'App/components/page'; +import { + SectionContainer, + SectionHeader, + SectionContent, +} from 'App/components/section'; const Settings = () => { return ( - - - + + + - - - + + + - - - + + + - - - + + + - - - - - + + + + ); }; diff --git a/src/app/pages/staging/index.js b/src/app/pages/staging/index.js index c6106311a..94d5dcf7d 100644 --- a/src/app/pages/staging/index.js +++ b/src/app/pages/staging/index.js @@ -1,51 +1,52 @@ import './stylesheet.scss'; - import { useState, useEffect } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; import classnames from 'classnames'; -import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; -import { Page } from '../../components/page'; -import { SectionContainer, SectionHeader, SectionContent, SectionSettings } from '../../components/section'; -import { useNotification } from '../../components/notifications/feed'; +import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; +import { Page } from 'App/components/page'; +import { + SectionContainer, + SectionHeader, + SectionContent, + SectionSettings, +} from 'App/components/section'; +import { useNotification } from 'App/components/notifications'; // component sourced from staging module import { default as NewfoldStaging } from '../../../../vendor/newfold-labs/wp-module-staging/components/staging/'; const Staging = () => { - - // constants to pass to module - const moduleConstants = { - 'text': { - 'title': __('Staging', 'bluehost-wordpress-plugin'), - } + // constants to pass to module + const moduleConstants = { + text: { + title: __( 'Staging', 'bluehost-wordpress-plugin' ), + }, }; - // methods to pass to module - const moduleMethods = { - apiFetch, - classnames, - useState, - useEffect, - NewfoldRuntime, - useNotification, - }; + // methods to pass to module + const moduleMethods = { + apiFetch, + classnames, + useState, + useEffect, + NewfoldRuntime, + useNotification, + }; const moduleComponents = { Page, - SectionHeader, + SectionHeader, SectionContent, - SectionSettings, - SectionContainer, - } - - return ( - - + SectionSettings, + SectionContainer, + }; - ); -} + return ( + + ); +}; -export default Staging; \ No newline at end of file +export default Staging; diff --git a/src/app/util/helpers.js b/src/app/util/helpers.js index 6e907e6a9..566ffebee 100644 --- a/src/app/util/helpers.js +++ b/src/app/util/helpers.js @@ -4,63 +4,11 @@ import apiFetch from '@wordpress/api-fetch'; import { addQueryArgs } from '@wordpress/url'; let lastNoticeId; -const W_NAV = document.querySelector( '#toplevel_page_bluehost .wp-submenu' ); -/** - * Set active nav in wp admin sub pages. - * - * @param path - */ -export const setActiveSubnav = ( path ) => { - if ( W_NAV ) { - const W_NAV_LIS = W_NAV.children; - if ( W_NAV_LIS ) { - for ( let i = 0; i < W_NAV_LIS.length; i++ ) { - // get all children li elements - const link = W_NAV_LIS[ i ].children[ 0 ]; - if ( link ) { - const href = link.getAttribute( 'href' ); - // check each child a href for match with path - if ( - href.endsWith( path ) || // match - ( path.includes( '/marketplace/' ) && - href.endsWith( 'marketplace' ) ) || - ( path === '/' && href.endsWith( 'home' ) ) - ) { - // highlight home subnav for root page - // update li class when match - W_NAV_LIS[ i ].classList.add( 'current' ); - } else { - W_NAV_LIS[ i ].classList.remove( 'current' ); - } - // highlight our home nav for root level access - const W_HOME_NAV = document.querySelector( - '.wppbh-nav a[href="#/home"]' - ); - if ( W_HOME_NAV ) { - if ( path === '/' || path === '/home' ) { - W_HOME_NAV.classList.add( 'active' ); - } else { - W_HOME_NAV.classList.remove( 'active' ); - } - } - // handle help - if ( path === '/help' ) { - if ( NewfoldRuntime.hasCapability( 'canAccessHelpCenter' ) && !window.newfoldEmbeddedHelp.isDefaultOpen ) { - window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp(); - window.newfoldEmbeddedHelp.isDefaultOpen = true; // since this fires multiple times on load - } - } - } - } - } - } -}; /** * Wrapper method to dispatch snackbar notice * - * @param string text text for notice - * @param text + * @param {string} text text for notice */ export const dispatchUpdateSnackbar = ( text = 'Settings Saved' ) => { //clear previous notice so they don't stack up when quickly saving multiple settings @@ -81,10 +29,9 @@ export const dispatchUpdateSnackbar = ( text = 'Settings Saved' ) => { /** * Wrapper method to post setting to bluehost endpoint * - * @param {*} data object of data - * @param passError setter for the error in component - * @param thenCallback method to call in promise then - * @return apiFetch promise + * @param {Object} data object of data + * @param {Function} passError setter for the error in component + * @param {Function} thenCallback method to call in promise then */ export const bluehostSettingsApiFetch = ( data, passError, thenCallback ) => { return apiFetch( { @@ -104,10 +51,9 @@ export const bluehostSettingsApiFetch = ( data, passError, thenCallback ) => { /** * Wrapper method to post request to bluehost cache endpoint * - * @param {*} data object of data - * @param passError setter for the error in component - * @param thenCallback method to call in promise then - * @return apiFetch promise + * @param {Object} data object of data + * @param {Function} passError setter for the error in component + * @param {Function} thenCallback method to call in promise then */ export const bluehostPurgeCacheApiFetch = ( data, passError, thenCallback ) => { return apiFetch( { @@ -125,6 +71,7 @@ export const bluehostPurgeCacheApiFetch = ( data, passError, thenCallback ) => { /** * Coming soon admin bar + * @param {boolean} comingSoon Whether or not the site is coming soon. */ export const comingSoonAdminbarToggle = ( comingSoon ) => { const comingsoonadminbar = document.getElementById( @@ -134,11 +81,11 @@ export const comingSoonAdminbarToggle = ( comingSoon ) => { return; } if ( ! comingSoon ) { - comingsoonadminbar.style.color = "#048200"; - comingsoonadminbar.textContent = "Live"; + comingsoonadminbar.style.color = '#048200'; + comingsoonadminbar.textContent = 'Live'; } else { - comingsoonadminbar.style.color = "#E01C1C"; - comingsoonadminbar.textContent = "Coming Soon"; + comingsoonadminbar.style.color = '#E01C1C'; + comingsoonadminbar.textContent = 'Coming Soon'; } }; @@ -149,92 +96,94 @@ export const comingSoonAdminbarToggle = ( comingSoon ) => { * The utm_content should be the unique identifier for the link. * The utm_campaign is optional and reserved for special occasions. * - * @param {string} url The original URL. + * @param {string} url The original URL. * @param {Object} params The URL parameters to add. * * @return {string} The new URL. */ -export const addUtmParams = (url, params = {}) => { - params.utm_source = `wp-admin/admin.php?page=bluehost${window.location.hash}`; +export const addUtmParams = ( url, params = {} ) => { + params.utm_source = `wp-admin/admin.php?page=bluehost${ window.location.hash }`; params.utm_medium = 'bluehost_plugin'; - return addQueryArgs(url, params); -} + return addQueryArgs( url, params ); +}; /** * Get's Base Platform URL * @param {string} path The path to a resource within the platform, leave blank for root. - * - * @return {string} + * + * @return {string} The base URL for the platform. */ export const getPlatformBaseUrl = ( path = '' ) => { const brand = NewfoldRuntime.plugin.brand; const baseUrl = () => { - if (brand === 'Bluehost_India') { + if ( brand === 'Bluehost_India' ) { return 'https://my.bluehost.in'; } - if (isJarvis()) { + if ( isJarvis() ) { return 'https://www.bluehost.com'; } return 'https://my.bluehost.com'; - } + }; return baseUrl() + path; }; /** * Gets Platform URL - * + * * @param {string} jarvisPath The path to the hosting resource for Jarvis accounts, leave blank for the main page. * @param {string} legacyPath The path to the hosting resource for Legacy accounts, leave blank for the main page. - * - * @return {string} - * + * + * @return {string} The URL for the platform. + * * @example * getPlatformPathUrl('home', 'app#home') * // returns https://www.bluehost.com/my-account/home if Jarvis or https://my.bluehost.com/hosting/app#home if legacy */ export const getPlatformPathUrl = ( jarvisPath = '', legacyPath = '' ) => { - - if (isJarvis()) { - return getPlatformBaseUrl('/my-account/') + jarvisPath; + if ( isJarvis() ) { + return getPlatformBaseUrl( '/my-account/' ) + jarvisPath; } - return getPlatformBaseUrl('/hosting/') + legacyPath; + return getPlatformBaseUrl( '/hosting/' ) + legacyPath; }; /** * Handles help center links click, will open help center slide if user has access * or navigate to help page if user doesn't have access - * - * @return void */ export const handleHelpLinksClick = () => { - if (NewfoldRuntime.hasCapability( 'canAccessHelpCenter' ) && window.newfoldEmbeddedHelp && !window.newfoldEmbeddedHelp.hasListeners) { - const helpLinks = document.querySelectorAll('[href*="#/help"]'); - if (helpLinks) { - helpLinks.forEach(el => el.addEventListener('click', (e) => { - e.preventDefault(); - window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp(); - })); + if ( + NewfoldRuntime.hasCapability( 'canAccessHelpCenter' ) && + window.newfoldEmbeddedHelp && + ! window.newfoldEmbeddedHelp.hasListeners + ) { + const helpLinks = document.querySelectorAll( '[href*="#/help"]' ); + if ( helpLinks ) { + helpLinks.forEach( ( el ) => + el.addEventListener( 'click', ( e ) => { + e.preventDefault(); + window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp(); + } ) + ); window.newfoldEmbeddedHelp.hasListeners = true; } } -}; +}; /** - * Check if this is a jarvis site or not. - * Defaults to true in cases where the capabilites are not set such as + * Check if this is a jarvis site or not. + * Defaults to true in cases where the capabilites are not set such as * in local and test environments that do not receive capabilities. - * - * @return boolean + * + * @return {boolean} Whether or not this is a jarvis site. */ export const isJarvis = () => { if ( NewfoldRuntime.hasCapability( 'isJarvis' ) ) { return window.NewfoldRuntime.capabilities.isJarvis; - } else { - return true; } -}; \ No newline at end of file + return true; +}; diff --git a/src/index.js b/src/index.js index 47dda59f5..728ede72c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,13 +1,13 @@ /* Use PHP-provided URL to current version's build directory instead of root */ import './webpack-public-path'; -import App from './app'; import domReady from '@wordpress/dom-ready'; -import {createRoot, render} from '@wordpress/element'; +import { createRoot, render } from '@wordpress/element'; +import App from './app'; const WP_ADM_PAGE_ROOT_ELEMENT = 'wppbh-app'; const W_ASCI = ` - Welcome to Bluehost! + Welcome to Bluehost! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@(((((((((@@((((((((((@@(((((((((@@@ @@@(((((((((@@((((((((((@@(((((((((@@@ @@ -25,18 +25,19 @@ const W_ASCI = ` @@@(((((((((@@((((((((((@@(((((((((@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `; -console.log(W_ASCI); +// eslint-disable-next-line no-console +console.log( W_ASCI ); const WPPBHRender = () => { - const DOM_ELEMENT = document.getElementById(WP_ADM_PAGE_ROOT_ELEMENT); - if (null !== DOM_ELEMENT) { - if ('undefined' !== typeof createRoot) { - // WP 6.2+ only - createRoot(DOM_ELEMENT).render(); - } else if ('undefined' !== typeof render) { - render(, DOM_ELEMENT); - } - } + const DOM_ELEMENT = document.getElementById( WP_ADM_PAGE_ROOT_ELEMENT ); + if ( null !== DOM_ELEMENT ) { + if ( 'undefined' !== typeof createRoot ) { + // WP 6.2+ only + createRoot( DOM_ELEMENT ).render( ); + } else if ( 'undefined' !== typeof render ) { + render( , DOM_ELEMENT ); + } + } }; -domReady(WPPBHRender); +domReady( WPPBHRender ); diff --git a/src/webpack-public-path.js b/src/webpack-public-path.js index 122ff2e66..a6298b178 100644 --- a/src/webpack-public-path.js +++ b/src/webpack-public-path.js @@ -3,7 +3,11 @@ * so that lazy-loading works correctly. This value is set in /includes/Data.php in runtime(). */ export default () => { - if ( 'undefined' !== typeof window.NewfoldRuntime && 'plugin' in window.NewfoldRuntime ) { + if ( + 'undefined' !== typeof window.NewfoldRuntime && + 'plugin' in window.NewfoldRuntime + ) { + // eslint-disable-next-line camelcase, no-undef __webpack_public_path__ = window.NewfoldRuntime.plugin.url; } }; diff --git a/tailwind.config.js b/tailwind.config.js index 18ca2dc39..e48d1958b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,39 +1,39 @@ -import { TAILWINDCSS_PRESET } from "@newfold/ui-component-library"; +import { TAILWINDCSS_PRESET } from '@newfold/ui-component-library'; module.exports = { - presets: [ TAILWINDCSS_PRESET ], - content: [ - // Include all JS files inside the UI library in your content. - ...TAILWINDCSS_PRESET.content, - "./src/**/*.js", // all source files - "./node_modules/@newfold-labs/wp-module-*/build/index.js", // all npm sourced module builds - "./vendor/newfold-labs/wp-module-*/components/**/*.js", // all composer sourced module components - ], - theme: { - extend: { - colors: { - primary: { - DEFAULT: "#196BDE", - dark: "#1A4884", - light: "#CCDCF4", - lighter: "#949FB1", - }, - secondary: { - DEFAULT: "#FCD34D", - dark: "#E9B404", - light: "#FEF6D9", - lighter: "#FEF6D9", - }, - title: "#0F172A", - body: "#4A5567", - link: "#2271B1", - line: "#E2E8F0", - white: "#FFFFFF", - offWhite: "#F0F0F5", - black: "#000000", - canvas: "#F1F5F9", - }, - }, - }, - plugins: [], + presets: [ TAILWINDCSS_PRESET ], + content: [ + // Include all JS files inside the UI library in your content. + ...TAILWINDCSS_PRESET.content, + './src/**/*.js', // all source files + './node_modules/@newfold-labs/wp-module-*/build/index.js', // all npm sourced module builds + './vendor/newfold-labs/wp-module-*/components/**/*.js', // all composer sourced module components + ], + theme: { + extend: { + colors: { + primary: { + DEFAULT: '#196BDE', + dark: '#1A4884', + light: '#CCDCF4', + lighter: '#949FB1', + }, + secondary: { + DEFAULT: '#FCD34D', + dark: '#E9B404', + light: '#FEF6D9', + lighter: '#FEF6D9', + }, + title: '#0F172A', + body: '#4A5567', + link: '#2271B1', + line: '#E2E8F0', + white: '#FFFFFF', + offWhite: '#F0F0F5', + black: '#000000', + canvas: '#F1F5F9', + }, + }, + }, + plugins: [], }; diff --git a/webpack.config.js b/webpack.config.js index c48777fd0..c3313b229 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,35 +1,36 @@ -const path = require('path'); -const { merge } = require('webpack-merge'); -const wpScriptsConfig = require('@wordpress/scripts/config/webpack.config'); -const version = require('./package.json').version; -const { ProvidePlugin } = require('webpack'); +const path = require( 'path' ); +const { merge } = require( 'webpack-merge' ); +const wpScriptsConfig = require( '@wordpress/scripts/config/webpack.config' ); +const version = require( './package.json' ).version; +const { ProvidePlugin } = require( 'webpack' ); /** * Aliases for resolving Brand imports */ const alias = { - App: path.resolve(__dirname, '/src/app/'), - Store: path.resolve(__dirname, '/src/app/data/store.js'), - Routes: path.resolve(__dirname, '/src/app/data/routes.js'), + App: path.resolve( __dirname, '/src/app/' ), + Assets: path.resolve( __dirname, '/assets/' ), + Store: path.resolve( __dirname, '/src/app/data/store.js' ), + Routes: path.resolve( __dirname, '/src/app/data/routes.js' ), }; /** * Make most-common imports available globally to ease import debt. * (Instead of import { useEffect } from '@wordpress/element' in every file) */ const mostCommonImports = { - Fragment: ['@wordpress/element', 'Fragment'], - useState: ['@wordpress/element', 'useState'], - useEffect: ['@wordpress/element', 'useEffect'], - useContext: ['@wordpress/element', 'useContext'], - useLocation: ['react-router-dom', 'useLocation'], - useNavigate: ['react-router-dom', 'useNavigate'], - _filter: ['lodash', 'filter'], - _map: ['lodash', 'map'], - _isEmpty: ['lodash', 'isEmpty'], - _camelCase: ['lodash', 'camelCase'], - __: ['@wordpress/i18n', '__'], - _n: ['@wordpress/i18n', '_n'], - sprintf: ['@wordpress/i18n', 'sprintf'], - classNames: ['classnames'], + Fragment: [ '@wordpress/element', 'Fragment' ], + useState: [ '@wordpress/element', 'useState' ], + useEffect: [ '@wordpress/element', 'useEffect' ], + useContext: [ '@wordpress/element', 'useContext' ], + useLocation: [ 'react-router-dom', 'useLocation' ], + useNavigate: [ 'react-router-dom', 'useNavigate' ], + _filter: [ 'lodash', 'filter' ], + _map: [ 'lodash', 'map' ], + _isEmpty: [ 'lodash', 'isEmpty' ], + _camelCase: [ 'lodash', 'camelCase' ], + __: [ '@wordpress/i18n', '__' ], + _n: [ '@wordpress/i18n', '_n' ], + sprintf: [ '@wordpress/i18n', 'sprintf' ], + classNames: [ 'classnames' ], }; /** * Extend @wordpress/scripts default webpack config with: @@ -38,12 +39,12 @@ const mostCommonImports = { * - Use webpack's ProvidePlugin to ease repetitive imports. */ const webConfig = { - mode: 'production', - output: { - // versioned output directory i.e. /build/1.0.0, /build/1.1.0, etc. - path: path.resolve(process.cwd(), 'build/' + version), - }, - resolve: { alias }, - plugins: [new ProvidePlugin(mostCommonImports)], + mode: 'production', + output: { + // versioned output directory i.e. /build/1.0.0, /build/1.1.0, etc. + path: path.resolve( process.cwd(), 'build/' + version ), + }, + resolve: { alias }, + plugins: [ new ProvidePlugin( mostCommonImports ) ], }; -module.exports = merge(wpScriptsConfig, webConfig); \ No newline at end of file +module.exports = merge( wpScriptsConfig, webConfig ); From a44aae1d6df9da46a5aaac02808e2bb583312eae Mon Sep 17 00:00:00 2001 From: wpalani Date: Sat, 25 Nov 2023 22:05:24 -0700 Subject: [PATCH 05/55] Other lint fixes --- src/app/pages/home/accountCard.js | 4 +++- src/app/pages/home/helpCard.js | 9 ++++++--- src/app/pages/home/index.js | 12 ++++++------ src/app/pages/home/welcomeSection.js | 8 ++++++-- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/app/pages/home/accountCard.js b/src/app/pages/home/accountCard.js index 061249211..801a4ace1 100644 --- a/src/app/pages/home/accountCard.js +++ b/src/app/pages/home/accountCard.js @@ -78,7 +78,7 @@ const base = [ }, ]; -export const AccountCard = ( { props } ) => { +const AccountCard = ( { props } ) => { return ( @@ -107,3 +107,5 @@ export const AccountCard = ( { props } ) => { ); }; + +export default AccountCard; diff --git a/src/app/pages/home/helpCard.js b/src/app/pages/home/helpCard.js index c7829c2db..2b48b8c3f 100644 --- a/src/app/pages/home/helpCard.js +++ b/src/app/pages/home/helpCard.js @@ -1,6 +1,7 @@ import { Button, Card, Title } from '@newfold/ui-component-library'; -import SupportIllustration from '../../images/section-home-help-me.svg'; -export function HelpCard() { +import SupportIllustration from 'App/images/section-home-help-me.svg'; + +const HelpCard = ( {} ) => { return ( @@ -28,4 +29,6 @@ export function HelpCard() { ); -} +}; + +export default HelpCard; diff --git a/src/app/pages/home/index.js b/src/app/pages/home/index.js index 6b7efae6c..22232a333 100644 --- a/src/app/pages/home/index.js +++ b/src/app/pages/home/index.js @@ -1,10 +1,10 @@ -import { Page } from '../../components/page'; -import { SectionContainer, SectionContent } from '../../components/section'; -import WebinarsBanner from 'App/components/webinars-banner'; -import { AccountCard } from './accountCard'; -import { HelpCard } from './helpCard'; import './stylesheet.scss'; -import { WelcomeSection } from './welcomeSection'; +import { Page } from 'App/components/page'; +import { SectionContainer, SectionContent } from 'App/components/section'; +import WebinarsBanner from 'App/components/webinars-banner'; +import AccountCard from './accountCard'; +import HelpCard from './helpCard'; +import WelcomeSection from './welcomeSection'; const Home = () => { return ( diff --git a/src/app/pages/home/welcomeSection.js b/src/app/pages/home/welcomeSection.js index d5540304c..ad0e1ef74 100644 --- a/src/app/pages/home/welcomeSection.js +++ b/src/app/pages/home/welcomeSection.js @@ -4,9 +4,10 @@ import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; import { useNotification } from 'App/components/notifications'; -export function WelcomeSection() { +const WelcomeSection = ( {} ) => { const { store, setStore } = useContext( AppStore ); const notify = useNotification(); + const toggleComingSoon = () => bluehostSettingsApiFetch( { comingSoon: ! store.comingSoon }, @@ -14,6 +15,7 @@ export function WelcomeSection() { console.error, () => setStore( { ...store, comingSoon: ! store.comingSoon } ) ); + return ( ); -} +}; + +export default WelcomeSection; From 13575d4ba18489c0bf06d85c03e2dc18fc71823d Mon Sep 17 00:00:00 2001 From: wpalani Date: Sat, 25 Nov 2023 22:15:31 -0700 Subject: [PATCH 06/55] Fix webinar banner component lint issue --- src/app/components/webinars-banner/index.js | 31 ++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/app/components/webinars-banner/index.js b/src/app/components/webinars-banner/index.js index e5a68ced3..0a42a4b3e 100644 --- a/src/app/components/webinars-banner/index.js +++ b/src/app/components/webinars-banner/index.js @@ -22,7 +22,7 @@ import { SectionContainer, SectionContent } from 'App/components/section'; */ const WebinarsBanner = () => { const [ webinars, setWebinars ] = useState( [] ); - const [ nextWebinar, setNextWebinar ] = useState( null ); + const [ upcomingWebinar, setUpcomingWebinar ] = useState( null ); useEffect( () => { fetchWebinars(); @@ -52,7 +52,7 @@ const WebinarsBanner = () => { }; useEffect( () => { - setNextWebinar( getNextWebinar() ); + setUpcomingWebinar( getNextWebinar() ); // eslint-disable-next-line react-hooks/exhaustive-deps }, [ webinars ] ); @@ -69,7 +69,6 @@ const WebinarsBanner = () => { ( a, b ) => new Date( a.date ) - new Date( b.date ) ); - // eslint-disable-next-line no-shadow const nextWebinar = futureWebinars[ 0 ]; if ( nextWebinar.hasOwnProperty( 'title' ) && @@ -102,7 +101,7 @@ const WebinarsBanner = () => { ); }; - if ( ! nextWebinar ) { + if ( ! upcomingWebinar ) { return null; } @@ -116,24 +115,24 @@ const WebinarsBanner = () => {
    - FREE Monthly Webinar: { nextWebinar.title } + FREE Monthly Webinar: { upcomingWebinar.title } - { ( nextWebinar.hasDescription || - nextWebinar.hasTopics ) && ( + { ( upcomingWebinar.hasDescription || + upcomingWebinar.hasTopics ) && (
    - { nextWebinar.description && ( + { upcomingWebinar.description && (

    - { nextWebinar.description } + { upcomingWebinar.description }

    ) } - { nextWebinar.topics && ( + { upcomingWebinar.topics && ( <> Topics:
      - { nextWebinar.topics.map( + { upcomingWebinar.topics.map( ( topic, index ) => ( {
      - { nextWebinar.date } + { upcomingWebinar.date }
      - { nextWebinar.hasTime && ( + { upcomingWebinar.hasTime && (
      - { nextWebinar.time } + { upcomingWebinar.time }
      ) }
      @@ -165,12 +164,12 @@ const WebinarsBanner = () => {
    From 0d19e1904d4f1e67e165010af3f33e69e2c2aaf0 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 27 Nov 2023 13:29:00 -0700 Subject: [PATCH 07/55] ESLint action --- .github/workflows/eslint.yml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 000000000..66a147fd6 --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,49 @@ +name: ESLint + +on: + push: + branches: + - main + - master + - trunk + - develop + - release/* + - feature/* + - add/* + - update/* + - fix/* + - try/*' + paths: + - 'src/**/*.js' + pull_request: + types: [ opened, edited, reopened, ready_for_review ] + paths: + - 'src/**/*.js' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + eslint: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js 16.x + uses: actions/setup-node@v4 + with: + node-version: 16.x + cache: 'npm' + + - name: Setup Registry + run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc + + - name: NPM Install + run: npm ci --legacy-peer-deps + + - name: ESLint + run: npm run lint:js From 4325287ddc7d31e257173e82bfc089bdc254954b Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 27 Nov 2023 13:50:44 -0700 Subject: [PATCH 08/55] Move handlePageLoad function to react hook --- src/app/index.js | 3 +++ src/app/util/hooks/index.js | 1 + src/app/util/hooks/useHandlePageLoad.js | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 src/app/util/hooks/index.js create mode 100644 src/app/util/hooks/useHandlePageLoad.js diff --git a/src/app/index.js b/src/app/index.js index 3d9c3622f..e913f06dc 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -14,6 +14,7 @@ import { ErrorBoundary } from 'react-error-boundary'; // eslint-disable-next-line import/no-unresolved import { store as noticesStore } from '@wordpress/notices'; import { kebabCase, filter } from 'lodash'; +import { useHandlePageLoad } from './util/hooks'; import { Root } from '@newfold/ui-component-library'; import { AppNav } from './components/app-nav'; import { SiteInfoBar } from './components/site-info'; @@ -50,6 +51,8 @@ const AppBody = ( props ) => { const hashedPath = '#' + location.pathname; const { booted, hasError } = useContext( AppStore ); + useHandlePageLoad(); + return (
    { + const location = useLocation(); + const routeContents = document.querySelector( '.wppbh-app-body-inner' ); + + useEffect( () => { + window.scrollTo( 0, 0 ); + if ( routeContents ) { + routeContents.focus( { preventScroll: true } ); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ location.pathname ] ); + + return true; +}; + +export default useHandlePageLoad; From 82fe8c77fa2011b746ccf2ca4de03450d11580f7 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 27 Nov 2023 17:35:09 -0700 Subject: [PATCH 09/55] Add php dependencies to eslint action --- .github/workflows/eslint.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 66a147fd6..e3bc4197d 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -33,12 +33,54 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer, cs2pr + + - name: Setup workflow context + id: workflow + working-directory: ${{ runner.temp }} + env: + REPO: ${{ github.repository }} + run: | + mkdir dist + echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT + echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT + - name: Use Node.js 16.x uses: actions/setup-node@v4 with: node-version: 16.x cache: 'npm' + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache Composer vendor directory + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Show versions + run: | + php --version + composer --version + node --version + npm --version + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install PHP Dependencies + run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist + - name: Setup Registry run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc From 72e7233887d70f6311bf59ac4b5a62fcc84cfd19 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 27 Nov 2023 17:35:30 -0700 Subject: [PATCH 10/55] Remove example page --- src/app/pages/example/index.js | 86 ---------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 src/app/pages/example/index.js diff --git a/src/app/pages/example/index.js b/src/app/pages/example/index.js deleted file mode 100644 index d64495801..000000000 --- a/src/app/pages/example/index.js +++ /dev/null @@ -1,86 +0,0 @@ -import { Button } from '@newfold/ui-component-library'; -import { - SectionContainer, - SectionHeader, - SectionContent, -} from '../../components/section'; -import { RocketLaunchIcon } from '@heroicons/react/24/outline'; -import { Page } from '../../components/page'; - -const Example = () => { - return ( - - - { - // eslint-disable-next-line no-console - console.log( 'Primary Action Clicked' ); - }, - } } - secondaryAction={ { - title: 'Secondary Action', - onClick: () => { - // eslint-disable-next-line no-console - console.log( 'Secondary Action Clicked' ); - }, - } } - /> - - -
    - Lorem Ipsum is simply dummy text of the printing and - typesetting industry. Lorem Ipsum has been the industrys - standard dummy text ever since the 1500s, when an - unknown printer took a galley of type and scrambled it - to make a type specimen book. It has survived not only - five centuries, but also the leap into electronic - typesetting, remaining essentially unchanged. -
    -
    - - -
    - Lorem Ipsum is simply dummy text of the printing and - typesetting industry. Lorem Ipsum has been the industrys - standard dummy text ever since the 1500s, when an - unknown printer took a galley of type and scrambled it - to make a type specimen book. It has survived not only - five centuries, but also the leap into electronic - typesetting, remaining essentially unchanged. -
    -
    - - -
    -

    - Lorem Ipsum is simply dummy text of the printing and - typesetting industry. Lorem Ipsum has been the - industrys standard dummy text ever since the 1500s, - when an unknown printer took a galley of type and - scrambled it to make a type specimen book. -

    - -
    -
    -
    -
    - ); -}; - -export default Example; From 254de76d56fd682defa24bbcbd7e5f3e9603e466 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 27 Nov 2023 17:37:55 -0700 Subject: [PATCH 11/55] Update eslint.yml --- .github/workflows/eslint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index e3bc4197d..53f170c38 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -26,7 +26,7 @@ concurrency: cancel-in-progress: true jobs: - eslint: + ESLint: runs-on: ubuntu-latest steps: From cfd6d82fa8a7cba38ba465e2ee653c9cc0cd7d27 Mon Sep 17 00:00:00 2001 From: Brad Parbs Date: Tue, 28 Nov 2023 10:35:10 -0600 Subject: [PATCH 12/55] Update console ascii art --- src/index.js | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/index.js b/src/index.js index 728ede72c..df7577997 100644 --- a/src/index.js +++ b/src/index.js @@ -6,27 +6,33 @@ import { createRoot, render } from '@wordpress/element'; import App from './app'; const WP_ADM_PAGE_ROOT_ELEMENT = 'wppbh-app'; -const W_ASCI = ` - Welcome to Bluehost! -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@(((((((((@@((((((((((@@(((((((((@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -`; + // eslint-disable-next-line no-console -console.log( W_ASCI ); +console.log(` +%cWelcome to Bluehost! + +%c +██████████████████████████████████████ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +██████████████████████████████████████ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +██████████████████████████████████████ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +███ ██ ██ ███ +██████████████████████████████████████ +`, + 'color: #196bde; font-size: 2em; font-weight: 900;', + 'background: #fff; color: #196bde; font-weight: 400;' +); + const WPPBHRender = () => { const DOM_ELEMENT = document.getElementById( WP_ADM_PAGE_ROOT_ELEMENT ); From 944cb60aee106a3d47419bb879316ff0581fad52 Mon Sep 17 00:00:00 2001 From: Brad Parbs Date: Tue, 28 Nov 2023 10:45:10 -0600 Subject: [PATCH 13/55] Fix linting --- src/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index df7577997..41eee7b34 100644 --- a/src/index.js +++ b/src/index.js @@ -8,8 +8,7 @@ import App from './app'; const WP_ADM_PAGE_ROOT_ELEMENT = 'wppbh-app'; // eslint-disable-next-line no-console -console.log(` -%cWelcome to Bluehost! +console.log(`%cWelcome to Bluehost! %c ██████████████████████████████████████ @@ -28,10 +27,7 @@ console.log(` ███ ██ ██ ███ ███ ██ ██ ███ ██████████████████████████████████████ -`, - 'color: #196bde; font-size: 2em; font-weight: 900;', - 'background: #fff; color: #196bde; font-weight: 400;' -); +`, 'color: #196bde; font-size: 2em; font-weight: 900;', 'background: #fff; color: #196bde; font-weight: 400;'); const WPPBHRender = () => { From f2189f1882d8bc9b38edf951a32c2bcc2d63133f Mon Sep 17 00:00:00 2001 From: wpalani Date: Tue, 28 Nov 2023 16:16:12 -0700 Subject: [PATCH 14/55] Translate strings --- src/app/components/site-info/index.js | 6 +++--- src/app/pages/home/helpCard.js | 15 +++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/app/components/site-info/index.js b/src/app/components/site-info/index.js index 682f89fa5..99a7639e5 100644 --- a/src/app/components/site-info/index.js +++ b/src/app/components/site-info/index.js @@ -55,7 +55,7 @@ export const SiteInfoBar = () => { className="nfd-bg-[#383F4A] nfd-text-tiny nfd-w-full min-[400px]:nfd-w-auto" > - Bluehost Account + { __( 'Bluehost Account', 'wp-plugin-bluehost' ) }
    diff --git a/src/app/pages/home/helpCard.js b/src/app/pages/home/helpCard.js index 2b48b8c3f..6666620ec 100644 --- a/src/app/pages/home/helpCard.js +++ b/src/app/pages/home/helpCard.js @@ -12,10 +12,17 @@ const HelpCard = ( {} ) => { src={ SupportIllustration } alt="Help Agent Illustration" /> -

    From DIY to full-service help.

    - Call or chat 24/7 for support or let our experts build - your site for you. + { __( + 'From DIY to full-service help.', + 'wp-plugin-bluehost' + ) } +

    +

    + { __( + 'Call or chat 24/7 for support or let our experts build your site for you.', + 'wp-plugin-bluehost' + ) }

    From 0cb99541471ebaecc17c6f523da5c047369b6957 Mon Sep 17 00:00:00 2001 From: wpalani Date: Tue, 28 Nov 2023 17:09:12 -0700 Subject: [PATCH 15/55] Fix minor ESLint issue after PR merge --- src/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 41eee7b34..40d3a8136 100644 --- a/src/index.js +++ b/src/index.js @@ -8,8 +8,8 @@ import App from './app'; const WP_ADM_PAGE_ROOT_ELEMENT = 'wppbh-app'; // eslint-disable-next-line no-console -console.log(`%cWelcome to Bluehost! - +console.log( + `%cWelcome to Bluehost! %c ██████████████████████████████████████ ███ ██ ██ ███ @@ -27,8 +27,10 @@ console.log(`%cWelcome to Bluehost! ███ ██ ██ ███ ███ ██ ██ ███ ██████████████████████████████████████ -`, 'color: #196bde; font-size: 2em; font-weight: 900;', 'background: #fff; color: #196bde; font-weight: 400;'); - +`, + 'color: #196bde; font-size: 2em; font-weight: 900;', + 'background: #fff; color: #196bde; font-weight: 400;' +); const WPPBHRender = () => { const DOM_ELEMENT = document.getElementById( WP_ADM_PAGE_ROOT_ELEMENT ); From 34cfbdc227b635549ec06c3f01c6e6344aed8778 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 29 Nov 2023 09:42:56 -0500 Subject: [PATCH 16/55] add module alias for cleaner imports --- src/app/data/routes.js | 2 +- src/app/index.js | 2 +- src/app/pages/marketplace/index.js | 2 +- src/app/pages/performance/index.js | 2 +- src/app/pages/staging/index.js | 2 +- webpack.config.js | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 10667cd00..81cca0082 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -17,7 +17,7 @@ import Performance from '../pages/performance'; import Settings from '../pages/settings'; import Staging from '../pages/staging'; import Help from '../pages/help'; -import { getMarketplaceSubnavRoutes } from '../../../vendor/newfold-labs/wp-module-marketplace/components/marketplaceSubnav'; +import { getMarketplaceSubnavRoutes } from 'Modules/wp-module-marketplace/components/marketplaceSubnav'; import { ReactComponent as HelpIcon } from "../components/icons/HelpIcon.svg"; const addPartialMatch = (prefix, path) => diff --git a/src/app/index.js b/src/app/index.js index 68aa1b633..24698ed91 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -21,7 +21,7 @@ import { SiteInfoBar } from './components/site-info'; import { NotificationFeed } from './components/notifications/feed'; // component sourced from module -import { default as NewfoldNotifications } from '../../vendor/newfold-labs/wp-module-notifications/assets/js/components/notifications/'; +import { default as NewfoldNotifications } from 'Modules/wp-module-notifications/assets/js/components/notifications/'; // to pass to notifications module import apiFetch from '@wordpress/api-fetch'; import { addQueryArgs } from '@wordpress/url'; diff --git a/src/app/pages/marketplace/index.js b/src/app/pages/marketplace/index.js index 97d5fc920..3b56875a0 100644 --- a/src/app/pages/marketplace/index.js +++ b/src/app/pages/marketplace/index.js @@ -6,7 +6,7 @@ import { Page } from "../../components/page"; import { SectionContainer, SectionHeader, SectionContent } from "../../components/section"; import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; // component sourced from marketplace module -import { default as NewfoldMarketplace } from '../../../../vendor/newfold-labs/wp-module-marketplace/components/marketplace/'; +import { default as NewfoldMarketplace } from 'Modules/wp-module-marketplace/components/marketplace/'; const MarketplacePage = () => { diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index 3a4f7ec34..659ba2129 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -12,7 +12,7 @@ import { bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch } from '../../util/helpers'; -import { default as NewfoldPerformance } from '../../../../vendor/newfold-labs/wp-module-performance/components/performance/'; +import { default as NewfoldPerformance } from 'Modules/wp-module-performance/components/performance/'; const PerformancePage = () => { diff --git a/src/app/pages/staging/index.js b/src/app/pages/staging/index.js index c6106311a..4c9b63a7f 100644 --- a/src/app/pages/staging/index.js +++ b/src/app/pages/staging/index.js @@ -8,7 +8,7 @@ import { Page } from '../../components/page'; import { SectionContainer, SectionHeader, SectionContent, SectionSettings } from '../../components/section'; import { useNotification } from '../../components/notifications/feed'; // component sourced from staging module -import { default as NewfoldStaging } from '../../../../vendor/newfold-labs/wp-module-staging/components/staging/'; +import { default as NewfoldStaging } from 'Modules/wp-module-staging/components/staging/'; const Staging = () => { diff --git a/webpack.config.js b/webpack.config.js index c48777fd0..6445227b4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,6 +10,7 @@ const alias = { App: path.resolve(__dirname, '/src/app/'), Store: path.resolve(__dirname, '/src/app/data/store.js'), Routes: path.resolve(__dirname, '/src/app/data/routes.js'), + Modules: path.resolve(__dirname, '/vendor/newfold-labs/'), }; /** * Make most-common imports available globally to ease import debt. From eabffb4d1593a619f948bf2b61a98fefd328123a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:48:27 +0000 Subject: [PATCH 17/55] Composer(deps): Bump newfold-labs/wp-module-data from 2.4.9 to 2.4.13 Bumps [newfold-labs/wp-module-data](https://github.com/newfold-labs/wp-module-data) from 2.4.9 to 2.4.13. - [Release notes](https://github.com/newfold-labs/wp-module-data/releases) - [Commits](https://github.com/newfold-labs/wp-module-data/compare/2.4.9...2.4.13) --- updated-dependencies: - dependency-name: newfold-labs/wp-module-data dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 878b2f70d..ebd841f7f 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "newfold-labs/wp-module-coming-soon": "^1.1.12", "newfold-labs/wp-module-ctb": "^1.1.2", "newfold-labs/wp-module-customer-bluehost": "^1.6.0", - "newfold-labs/wp-module-data": "^2.4.9", + "newfold-labs/wp-module-data": "^2.4.13", "newfold-labs/wp-module-deactivation": "^1.0.2", "newfold-labs/wp-module-ecommerce": "^1.3.9", "newfold-labs/wp-module-global-ctb": "^1.0.9", diff --git a/composer.lock b/composer.lock index acd3a26c2..ffa0d25fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f15566237f8c435286952bd6ac7dd2f8", + "content-hash": "a8d29013c70eb24544e8a626a97a7b91", "packages": [ { "name": "doctrine/inflector", @@ -418,16 +418,16 @@ }, { "name": "newfold-labs/wp-module-data", - "version": "2.4.9", + "version": "2.4.13", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-data.git", - "reference": "672ba89b7f3fa7721e8be4cd79653f21d9a3a503" + "reference": "a21d4579037add8bb921426f8d41e15d13b81af3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/672ba89b7f3fa7721e8be4cd79653f21d9a3a503", - "reference": "672ba89b7f3fa7721e8be4cd79653f21d9a3a503", + "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/a21d4579037add8bb921426f8d41e15d13b81af3", + "reference": "a21d4579037add8bb921426f8d41e15d13b81af3", "shasum": "" }, "require": { @@ -460,10 +460,10 @@ ], "description": "Newfold Data Module", "support": { - "source": "https://github.com/newfold-labs/wp-module-data/tree/2.4.9", + "source": "https://github.com/newfold-labs/wp-module-data/tree/2.4.13", "issues": "https://github.com/newfold-labs/wp-module-data/issues" }, - "time": "2023-10-23T14:39:19+00:00" + "time": "2023-11-29T18:53:24+00:00" }, { "name": "newfold-labs/wp-module-deactivation", @@ -3536,5 +3536,5 @@ "platform-overrides": { "php": "7.1.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 28a360511137bfaba29a62ba6f058fcb4efb87ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:01:43 +0000 Subject: [PATCH 18/55] NPM(deps): Bump @wordpress/icons from 9.36.0 to 9.38.0 Bumps [@wordpress/icons](https://github.com/WordPress/gutenberg/tree/HEAD/packages/icons) from 9.36.0 to 9.38.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/icons@9.38.0/packages/icons) --- updated-dependencies: - dependency-name: "@wordpress/icons" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 66 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1bd0a17a5..e759e198a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@wordpress/dom-ready": "^3.45.0", "@wordpress/element": "^5.22.0", "@wordpress/i18n": "^4.45.0", - "@wordpress/icons": "^9.36.0", + "@wordpress/icons": "^9.38.0", "classnames": "^2.3.2", "jquery": "^3.7.1", "lodash": "^4.17.21", @@ -5732,14 +5732,14 @@ "dev": true }, "node_modules/@wordpress/element": { - "version": "5.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.22.0.tgz", - "integrity": "sha512-36pNl+2B/By5/9s0puDqWrjRsplJe817ltrAdm/kn7k4SGJBmgSE1TwDiR/hQmoM+/XFzDXaQkCi0mNDMKsacg==", + "version": "5.24.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.24.0.tgz", + "integrity": "sha512-El1E5jlZitrDouvde0dUF2yVRiPsxPnjxB9TU43EhahQ9eT8pwfUaH3I4NT8kUj2LD76WwU8fN7CEmBNBW+ofA==", "dependencies": { "@babel/runtime": "^7.16.0", "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", - "@wordpress/escape-html": "^2.45.0", + "@wordpress/escape-html": "^2.47.0", "change-case": "^4.1.2", "is-plain-object": "^5.0.0", "react": "^18.2.0", @@ -5773,9 +5773,9 @@ } }, "node_modules/@wordpress/escape-html": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.45.0.tgz", - "integrity": "sha512-Io+t/OVHxGNeaHNzwi4hVbE2mR53rVwomNz/veCMQfaswDO84LlN4PPghOQNTQVXOgQr7ruLZ5bAM/zUAMZjAw==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.47.0.tgz", + "integrity": "sha512-bBGcTE5chneQJ3yETJyT2suyVtEJNfOiMVBV5qm606TyEzIDm18Sw2mPfOagiB1nOwDkAVfpSVD2NeGpit2alA==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -5922,13 +5922,13 @@ "integrity": "sha512-yywVJy8ctVlN5lNPxsep5urnZ6TTclwPEyigM9M3Bi8vseJBOfqNrGWN/r8NzuIt3PovM323W04blJfGQfQSVg==" }, "node_modules/@wordpress/icons": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.36.0.tgz", - "integrity": "sha512-QkJRDNgSJzfU3OCVr5X9P3Au3MIag2yT4dzM3Ej6VfrF0SPfFgMwroXKSdNEHmCCG7AwtzGOjaqjpQ3y9vRMkA==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.38.0.tgz", + "integrity": "sha512-K+rSZM1eKuWh+rXeMWNLj4dT0a3RJSzoUUh9UDQZCSdnThyAyZECGEKfHSCfd28/yabxLKaziXrb5/MVBrPjZw==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.22.0", - "@wordpress/primitives": "^3.43.0" + "@wordpress/element": "^5.24.0", + "@wordpress/primitives": "^3.45.0" }, "engines": { "node": ">=12" @@ -6043,12 +6043,12 @@ } }, "node_modules/@wordpress/primitives": { - "version": "3.43.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.43.0.tgz", - "integrity": "sha512-o6HwUM8XQmwJeCTfaaTpXhiiofymfKec34fSpACQbZNLA9ud2t5p1aWTRArnkm3cYOJAHVtiiFEJywTnnyOoPg==", + "version": "3.45.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.45.0.tgz", + "integrity": "sha512-8nSRklcrUFIOD/A8gpDrNmf2GTa3x0kuc8EHpra0FBVAwUaacp+HeeP7281tSSIt/yKg3BYhzFnYTB2OQIguGQ==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.22.0", + "@wordpress/element": "^5.24.0", "classnames": "^2.3.1" }, "engines": { @@ -27580,14 +27580,14 @@ } }, "@wordpress/element": { - "version": "5.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.22.0.tgz", - "integrity": "sha512-36pNl+2B/By5/9s0puDqWrjRsplJe817ltrAdm/kn7k4SGJBmgSE1TwDiR/hQmoM+/XFzDXaQkCi0mNDMKsacg==", + "version": "5.24.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.24.0.tgz", + "integrity": "sha512-El1E5jlZitrDouvde0dUF2yVRiPsxPnjxB9TU43EhahQ9eT8pwfUaH3I4NT8kUj2LD76WwU8fN7CEmBNBW+ofA==", "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", - "@wordpress/escape-html": "^2.45.0", + "@wordpress/escape-html": "^2.47.0", "change-case": "^4.1.2", "is-plain-object": "^5.0.0", "react": "^18.2.0", @@ -27615,9 +27615,9 @@ } }, "@wordpress/escape-html": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.45.0.tgz", - "integrity": "sha512-Io+t/OVHxGNeaHNzwi4hVbE2mR53rVwomNz/veCMQfaswDO84LlN4PPghOQNTQVXOgQr7ruLZ5bAM/zUAMZjAw==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.47.0.tgz", + "integrity": "sha512-bBGcTE5chneQJ3yETJyT2suyVtEJNfOiMVBV5qm606TyEzIDm18Sw2mPfOagiB1nOwDkAVfpSVD2NeGpit2alA==", "requires": { "@babel/runtime": "^7.16.0" } @@ -27720,13 +27720,13 @@ } }, "@wordpress/icons": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.36.0.tgz", - "integrity": "sha512-QkJRDNgSJzfU3OCVr5X9P3Au3MIag2yT4dzM3Ej6VfrF0SPfFgMwroXKSdNEHmCCG7AwtzGOjaqjpQ3y9vRMkA==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.38.0.tgz", + "integrity": "sha512-K+rSZM1eKuWh+rXeMWNLj4dT0a3RJSzoUUh9UDQZCSdnThyAyZECGEKfHSCfd28/yabxLKaziXrb5/MVBrPjZw==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.22.0", - "@wordpress/primitives": "^3.43.0" + "@wordpress/element": "^5.24.0", + "@wordpress/primitives": "^3.45.0" } }, "@wordpress/is-shallow-equal": { @@ -27806,12 +27806,12 @@ "dev": true }, "@wordpress/primitives": { - "version": "3.43.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.43.0.tgz", - "integrity": "sha512-o6HwUM8XQmwJeCTfaaTpXhiiofymfKec34fSpACQbZNLA9ud2t5p1aWTRArnkm3cYOJAHVtiiFEJywTnnyOoPg==", + "version": "3.45.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.45.0.tgz", + "integrity": "sha512-8nSRklcrUFIOD/A8gpDrNmf2GTa3x0kuc8EHpra0FBVAwUaacp+HeeP7281tSSIt/yKg3BYhzFnYTB2OQIguGQ==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.22.0", + "@wordpress/element": "^5.24.0", "classnames": "^2.3.1" } }, diff --git a/package.json b/package.json index e4e54baf0..8940e8a8a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@wordpress/dom-ready": "^3.45.0", "@wordpress/element": "^5.22.0", "@wordpress/i18n": "^4.45.0", - "@wordpress/icons": "^9.36.0", + "@wordpress/icons": "^9.38.0", "classnames": "^2.3.2", "jquery": "^3.7.1", "lodash": "^4.17.21", From 028d368108a98644d23cbaaf210e2ff1adb15099 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 30 Nov 2023 15:34:17 -0500 Subject: [PATCH 19/55] use '@module' as alias --- src/app/data/routes.js | 2 +- src/app/index.js | 2 +- src/app/pages/marketplace/index.js | 2 +- src/app/pages/performance/index.js | 2 +- src/app/pages/staging/index.js | 2 +- webpack.config.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 81cca0082..b2c1e9dab 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -17,7 +17,7 @@ import Performance from '../pages/performance'; import Settings from '../pages/settings'; import Staging from '../pages/staging'; import Help from '../pages/help'; -import { getMarketplaceSubnavRoutes } from 'Modules/wp-module-marketplace/components/marketplaceSubnav'; +import { getMarketplaceSubnavRoutes } from '@modules/wp-module-marketplace/components/marketplaceSubnav'; import { ReactComponent as HelpIcon } from "../components/icons/HelpIcon.svg"; const addPartialMatch = (prefix, path) => diff --git a/src/app/index.js b/src/app/index.js index 24698ed91..edcb4bb38 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -21,7 +21,7 @@ import { SiteInfoBar } from './components/site-info'; import { NotificationFeed } from './components/notifications/feed'; // component sourced from module -import { default as NewfoldNotifications } from 'Modules/wp-module-notifications/assets/js/components/notifications/'; +import { default as NewfoldNotifications } from '@modules/wp-module-notifications/assets/js/components/notifications/'; // to pass to notifications module import apiFetch from '@wordpress/api-fetch'; import { addQueryArgs } from '@wordpress/url'; diff --git a/src/app/pages/marketplace/index.js b/src/app/pages/marketplace/index.js index 3b56875a0..aed6c0b16 100644 --- a/src/app/pages/marketplace/index.js +++ b/src/app/pages/marketplace/index.js @@ -6,7 +6,7 @@ import { Page } from "../../components/page"; import { SectionContainer, SectionHeader, SectionContent } from "../../components/section"; import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; // component sourced from marketplace module -import { default as NewfoldMarketplace } from 'Modules/wp-module-marketplace/components/marketplace/'; +import { default as NewfoldMarketplace } from '@modules/wp-module-marketplace/components/marketplace/'; const MarketplacePage = () => { diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index 659ba2129..7b4056e91 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -12,7 +12,7 @@ import { bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch } from '../../util/helpers'; -import { default as NewfoldPerformance } from 'Modules/wp-module-performance/components/performance/'; +import { default as NewfoldPerformance } from '@modules/wp-module-performance/components/performance/'; const PerformancePage = () => { diff --git a/src/app/pages/staging/index.js b/src/app/pages/staging/index.js index 4c9b63a7f..f1d75ee38 100644 --- a/src/app/pages/staging/index.js +++ b/src/app/pages/staging/index.js @@ -8,7 +8,7 @@ import { Page } from '../../components/page'; import { SectionContainer, SectionHeader, SectionContent, SectionSettings } from '../../components/section'; import { useNotification } from '../../components/notifications/feed'; // component sourced from staging module -import { default as NewfoldStaging } from 'Modules/wp-module-staging/components/staging/'; +import { default as NewfoldStaging } from '@modules/wp-module-staging/components/staging/'; const Staging = () => { diff --git a/webpack.config.js b/webpack.config.js index 6445227b4..30a80e694 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,7 +10,7 @@ const alias = { App: path.resolve(__dirname, '/src/app/'), Store: path.resolve(__dirname, '/src/app/data/store.js'), Routes: path.resolve(__dirname, '/src/app/data/routes.js'), - Modules: path.resolve(__dirname, '/vendor/newfold-labs/'), + '@modules': path.resolve(__dirname, '/vendor/newfold-labs/'), }; /** * Make most-common imports available globally to ease import debt. From 9ec77a5fcb8d83b6b3509a0cbb6f23a010b42cf0 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 30 Nov 2023 15:56:34 -0500 Subject: [PATCH 20/55] lint update and add map for @modules alias --- .eslintrc.js | 1 + webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index bfe0dce4a..bcf47e946 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { map: [ [ 'App', './src/app' ], [ 'Assets', './aseets' ], + [ '@modules', './vendor/newfold-labs' ], ], extensions: [ '.js', '.jsx', '.json' ], }, diff --git a/webpack.config.js b/webpack.config.js index e1ad2b303..5c173b6cb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ const alias = { Assets: path.resolve( __dirname, '/assets/' ), Store: path.resolve( __dirname, '/src/app/data/store.js' ), Routes: path.resolve( __dirname, '/src/app/data/routes.js' ), - '@modules': path.resolve(__dirname, '/vendor/newfold-labs/'), + '@modules': path.resolve( __dirname, '/vendor/newfold-labs/' ), }; /** * Make most-common imports available globally to ease import debt. From 5b07791e1ec50634da6dd937414f07667c751a07 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 30 Nov 2023 17:34:20 -0500 Subject: [PATCH 21/55] remove all assignees and reviewers from dependabot PRs --- .github/dependabot.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 57e7872de..8e23bdd04 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,12 +9,6 @@ updates: - dependency-type: direct schedule: interval: "daily" - assignees: - - "wpscholar" - reviewers: - - "aalani95" - - "circlecube" - - "wpscholar" commit-message: prefix: "GitHub Actions" include: "scope" @@ -30,12 +24,6 @@ updates: schedule: interval: "daily" versioning-strategy: increase - assignees: - - "wpscholar" - reviewers: - - "aalani95" - - "circlecube" - - "wpscholar" commit-message: prefix: "NPM" prefix-development: "NPM Dev" @@ -59,12 +47,6 @@ updates: allow: - dependency-type: direct versioning-strategy: increase - assignees: - - "wpscholar" - reviewers: - - "aalani95" - - "circlecube" - - "wpscholar" commit-message: prefix: "Composer" prefix-development: "Composer Dev" From 624adb99db7bf65ae10ef4cd3678a819890feb57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:15:10 +0000 Subject: [PATCH 22/55] Composer(deps): Bump newfold-labs/wp-module-deactivation Bumps [newfold-labs/wp-module-deactivation](https://github.com/newfold-labs/wp-module-deactivation) from 1.0.2 to 1.0.3. - [Release notes](https://github.com/newfold-labs/wp-module-deactivation/releases) - [Commits](https://github.com/newfold-labs/wp-module-deactivation/compare/1.0.2...1.0.3) --- updated-dependencies: - dependency-name: newfold-labs/wp-module-deactivation dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ebd841f7f..b55d2311d 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ "newfold-labs/wp-module-ctb": "^1.1.2", "newfold-labs/wp-module-customer-bluehost": "^1.6.0", "newfold-labs/wp-module-data": "^2.4.13", - "newfold-labs/wp-module-deactivation": "^1.0.2", + "newfold-labs/wp-module-deactivation": "^1.0.3", "newfold-labs/wp-module-ecommerce": "^1.3.9", "newfold-labs/wp-module-global-ctb": "^1.0.9", "newfold-labs/wp-module-help-center": "1.0.21", diff --git a/composer.lock b/composer.lock index ffa0d25fd..ba4d996d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a8d29013c70eb24544e8a626a97a7b91", + "content-hash": "2730ca21dbfbe1f3b9893a10d832d31f", "packages": [ { "name": "doctrine/inflector", @@ -467,16 +467,16 @@ }, { "name": "newfold-labs/wp-module-deactivation", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-deactivation.git", - "reference": "dd8bf1820a0bd136e1a673d3a4b916b4c581179a" + "reference": "5668c206ea868c0baaca201042ca7c24404c7be1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-deactivation/zipball/dd8bf1820a0bd136e1a673d3a4b916b4c581179a", - "reference": "dd8bf1820a0bd136e1a673d3a4b916b4c581179a", + "url": "https://api.github.com/repos/newfold-labs/wp-module-deactivation/zipball/5668c206ea868c0baaca201042ca7c24404c7be1", + "reference": "5668c206ea868c0baaca201042ca7c24404c7be1", "shasum": "" }, "require": { @@ -521,10 +521,10 @@ ], "description": "A Module for handling WordPress brand plugins and modules deactivations", "support": { - "source": "https://github.com/newfold-labs/wp-module-deactivation/tree/1.0.2", + "source": "https://github.com/newfold-labs/wp-module-deactivation/tree/1.0.3", "issues": "https://github.com/newfold-labs/wp-module-deactivation/issues" }, - "time": "2023-10-17T22:48:37+00:00" + "time": "2023-11-29T19:20:56+00:00" }, { "name": "newfold-labs/wp-module-ecommerce", From 0d32215c3b5702e0df7ffdaf8b8391bc1215ef4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 18:09:34 +0000 Subject: [PATCH 23/55] Composer(deps): Bump newfold-labs/wp-module-patterns Bumps [newfold-labs/wp-module-patterns](https://github.com/newfold-labs/wp-module-patterns) from 0.1.8 to 0.1.10. - [Release notes](https://github.com/newfold-labs/wp-module-patterns/releases) - [Commits](https://github.com/newfold-labs/wp-module-patterns/compare/0.1.8...0.1.10) --- updated-dependencies: - dependency-name: newfold-labs/wp-module-patterns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b55d2311d..d3eb3db3a 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,7 @@ "newfold-labs/wp-module-marketplace": "^2.1.0", "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.8", - "newfold-labs/wp-module-patterns": "^0.1.8", + "newfold-labs/wp-module-patterns": "^0.1.10", "newfold-labs/wp-module-performance": "^1.2.2", "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", diff --git a/composer.lock b/composer.lock index ba4d996d5..d153bc38c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2730ca21dbfbe1f3b9893a10d832d31f", + "content-hash": "2b4dc0f0725e0a8a3bbe5e0232804f67", "packages": [ { "name": "doctrine/inflector", @@ -973,16 +973,16 @@ }, { "name": "newfold-labs/wp-module-patterns", - "version": "0.1.8", + "version": "0.1.10", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-patterns.git", - "reference": "8e582216003d1e881b851efa76230ce0237d7fd4" + "reference": "0f459d2df5a44eec4dd39bc216187e36e9931cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/8e582216003d1e881b851efa76230ce0237d7fd4", - "reference": "8e582216003d1e881b851efa76230ce0237d7fd4", + "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/0f459d2df5a44eec4dd39bc216187e36e9931cba", + "reference": "0f459d2df5a44eec4dd39bc216187e36e9931cba", "shasum": "" }, "require-dev": { @@ -1016,10 +1016,10 @@ ], "description": "WordPress Cloud Patterns", "support": { - "source": "https://github.com/newfold-labs/wp-module-patterns/tree/0.1.8", + "source": "https://github.com/newfold-labs/wp-module-patterns/tree/0.1.10", "issues": "https://github.com/newfold-labs/wp-module-patterns/issues" }, - "time": "2023-10-24T20:40:31+00:00" + "time": "2023-11-29T19:06:10+00:00" }, { "name": "newfold-labs/wp-module-performance", From 2e1df828291c64e3b38ad762a069acbd12d53f33 Mon Sep 17 00:00:00 2001 From: wpalani Date: Sun, 3 Dec 2023 17:08:51 -0700 Subject: [PATCH 24/55] Move `eslint-import-resolver-alias` package to dev --- package-lock.json | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6a7c8443..a11d77035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "@wordpress/i18n": "^4.45.0", "@wordpress/icons": "^9.36.0", "classnames": "^2.3.2", - "eslint-import-resolver-alias": "^1.1.2", "jquery": "^3.7.1", "lodash": "^4.17.21", "react": "^18.2.0", @@ -37,6 +36,7 @@ "@wordpress/scripts": "^26.16.0", "cypress": "^13.4.0", "cypress-axe": "^1.5.0", + "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", "tailwindcss": "^3.3.5" }, @@ -10609,6 +10609,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==", + "dev": true, "engines": { "node": ">= 4" }, @@ -31371,7 +31372,8 @@ "eslint-import-resolver-alias": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", - "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==" + "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==", + "dev": true }, "eslint-import-resolver-node": { "version": "0.3.9", diff --git a/package.json b/package.json index 8afe157e1..8c0431ec7 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "@wordpress/i18n": "^4.45.0", "@wordpress/icons": "^9.36.0", "classnames": "^2.3.2", - "eslint-import-resolver-alias": "^1.1.2", "jquery": "^3.7.1", "lodash": "^4.17.21", "react": "^18.2.0", @@ -52,6 +51,7 @@ "@wordpress/scripts": "^26.16.0", "cypress": "^13.4.0", "cypress-axe": "^1.5.0", + "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", "tailwindcss": "^3.3.5" }, From 2c4b4ba6fa2830d3dd4d382519eab89fc950f8ee Mon Sep 17 00:00:00 2001 From: wpalani Date: Sun, 3 Dec 2023 18:14:10 -0700 Subject: [PATCH 25/55] Update package-lock.json --- package-lock.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 431b20b89..d901c298c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "bluehost-wordpress-plugin", "version": "3.6.0", "license": "GPL-2.0-or-later", "dependencies": { @@ -32,9 +31,12 @@ "@tailwindcss/forms": "^0.5.6", "@testing-library/cypress": "^10.0.1", "@wordpress/env": "^8.11.0", + "@wordpress/eslint-plugin": "^17.3.0", "@wordpress/scripts": "^26.16.0", "cypress": "^13.4.0", "cypress-axe": "^1.5.0", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-plugin-import": "^2.29.0", "tailwindcss": "^3.3.5" }, "engines": { @@ -10517,6 +10519,18 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-import-resolver-alias": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", + "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==", + "dev": true, + "engines": { + "node": ">= 4" + }, + "peerDependencies": { + "eslint-plugin-import": ">=1.4.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -31111,6 +31125,12 @@ "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true }, + "eslint-import-resolver-alias": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz", + "integrity": "sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==", + "dev": true + }, "eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", From 0a36f7856e8d8613a343d22cc882ec518a16c89d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 01:33:43 +0000 Subject: [PATCH 26/55] NPM Dev(deps-dev): Bump @tailwindcss/forms from 0.5.6 to 0.5.7 Bumps [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) from 0.5.6 to 0.5.7. - [Release notes](https://github.com/tailwindlabs/tailwindcss-forms/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss-forms/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.6...v0.5.7) --- updated-dependencies: - dependency-name: "@tailwindcss/forms" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d901c298c..24e84678e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "semver": "^7.5.4" }, "devDependencies": { - "@tailwindcss/forms": "^0.5.6", + "@tailwindcss/forms": "^0.5.7", "@testing-library/cypress": "^10.0.1", "@wordpress/env": "^8.11.0", "@wordpress/eslint-plugin": "^17.3.0", @@ -4031,9 +4031,9 @@ } }, "node_modules/@tailwindcss/forms": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.6.tgz", - "integrity": "sha512-Fw+2BJ0tmAwK/w01tEFL5TiaJBX1NLT1/YbWgvm7ws3Qcn11kiXxzNTEQDMs5V3mQemhB56l3u0i9dwdzSQldA==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", + "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", "dev": true, "dependencies": { "mini-svg-data-uri": "^1.2.3" @@ -25953,9 +25953,9 @@ } }, "@tailwindcss/forms": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.6.tgz", - "integrity": "sha512-Fw+2BJ0tmAwK/w01tEFL5TiaJBX1NLT1/YbWgvm7ws3Qcn11kiXxzNTEQDMs5V3mQemhB56l3u0i9dwdzSQldA==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", + "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", "dev": true, "requires": { "mini-svg-data-uri": "^1.2.3" diff --git a/package.json b/package.json index 740a4643a..eea8f4a67 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "semver": "^7.5.4" }, "devDependencies": { - "@tailwindcss/forms": "^0.5.6", + "@tailwindcss/forms": "^0.5.7", "@testing-library/cypress": "^10.0.1", "@wordpress/env": "^8.11.0", "@wordpress/eslint-plugin": "^17.3.0", From 8cf02a0ff58960b7e2cd375e95160c13783a97de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 01:34:32 +0000 Subject: [PATCH 27/55] NPM Dev(deps-dev): Bump cypress from 13.4.0 to 13.6.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 13.4.0 to 13.6.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.4.0...v13.6.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d901c298c..2ed25bcd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@wordpress/env": "^8.11.0", "@wordpress/eslint-plugin": "^17.3.0", "@wordpress/scripts": "^26.16.0", - "cypress": "^13.4.0", + "cypress": "^13.6.0", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", @@ -9061,9 +9061,9 @@ } }, "node_modules/cypress": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", - "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", + "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -29948,9 +29948,9 @@ } }, "cypress": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", - "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", + "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/package.json b/package.json index 740a4643a..7095ca7bf 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@wordpress/env": "^8.11.0", "@wordpress/eslint-plugin": "^17.3.0", "@wordpress/scripts": "^26.16.0", - "cypress": "^13.4.0", + "cypress": "^13.6.0", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", From 8e2ad7c01807f900984d3164a64bd133f835bdb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:30:32 +0000 Subject: [PATCH 28/55] NPM(deps): Bump react-router-dom from 6.18.0 to 6.20.1 Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.18.0 to 6.20.1. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.20.1/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 50 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index d901c298c..1bcf17c71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "lodash": "^4.17.21", "react": "^18.2.0", "react-error-boundary": "^4.0.11", - "react-router-dom": "^6.18.0", + "react-router-dom": "^6.20.1", "react-use": "^17.4.0", "semver": "^7.5.4" }, @@ -3582,9 +3582,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.11.0.tgz", - "integrity": "sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz", + "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==", "engines": { "node": ">=14.0.0" } @@ -18738,11 +18738,11 @@ } }, "node_modules/react-router": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.18.0.tgz", - "integrity": "sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz", + "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==", "dependencies": { - "@remix-run/router": "1.11.0" + "@remix-run/router": "1.13.1" }, "engines": { "node": ">=14.0.0" @@ -18752,12 +18752,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.18.0.tgz", - "integrity": "sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz", + "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==", "dependencies": { - "@remix-run/router": "1.11.0", - "react-router": "6.18.0" + "@remix-run/router": "1.13.1", + "react-router": "6.20.1" }, "engines": { "node": ">=14.0.0" @@ -25655,9 +25655,9 @@ } }, "@remix-run/router": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.11.0.tgz", - "integrity": "sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz", + "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==" }, "@sentry/core": { "version": "6.19.7", @@ -37048,20 +37048,20 @@ "integrity": "sha512-sBtMIEy/9oI+Xf2o7IdWdkTokpZSPo9TWn60gqWKPG3BXg44Rg3FCIMiIjmgvRUF4eQptw6pqYTUhYwkeVSxXA==" }, "react-router": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.18.0.tgz", - "integrity": "sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz", + "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==", "requires": { - "@remix-run/router": "1.11.0" + "@remix-run/router": "1.13.1" } }, "react-router-dom": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.18.0.tgz", - "integrity": "sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz", + "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==", "requires": { - "@remix-run/router": "1.11.0", - "react-router": "6.18.0" + "@remix-run/router": "1.13.1", + "react-router": "6.20.1" } }, "react-spring": { diff --git a/package.json b/package.json index 740a4643a..73cfdab8f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "lodash": "^4.17.21", "react": "^18.2.0", "react-error-boundary": "^4.0.11", - "react-router-dom": "^6.18.0", + "react-router-dom": "^6.20.1", "react-use": "^17.4.0", "semver": "^7.5.4" }, From 46a3b34d0e55593d4e637798bf5224019bb4368e Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 12:41:19 -0500 Subject: [PATCH 29/55] place dependabot registries per updates --- .github/dependabot.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 085856c5e..a37c420fb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,10 @@ version: 2 -registries: "*" updates: # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directory: "/" + registries: "*" target-branch: "develop" allow: - dependency-type: direct @@ -19,6 +19,7 @@ updates: # Maintain dependencies for npm - package-ecosystem: "npm" directory: "/" + registries: "*" target-branch: "develop" allow: - dependency-type: direct @@ -42,6 +43,7 @@ updates: # Maintain dependencies for Composer - package-ecosystem: "composer" directory: "/" + registries: "*" target-branch: "develop" schedule: interval: "daily" From 7fcff78e7e62eaf5644a23f530d93c7032b66193 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 12:43:23 -0500 Subject: [PATCH 30/55] remove registries from dependabot --- .github/dependabot.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a37c420fb..8e23bdd04 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,6 @@ updates: # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directory: "/" - registries: "*" target-branch: "develop" allow: - dependency-type: direct @@ -19,7 +18,6 @@ updates: # Maintain dependencies for npm - package-ecosystem: "npm" directory: "/" - registries: "*" target-branch: "develop" allow: - dependency-type: direct @@ -43,7 +41,6 @@ updates: # Maintain dependencies for Composer - package-ecosystem: "composer" directory: "/" - registries: "*" target-branch: "develop" schedule: interval: "daily" From f77794f226ea028151d2bbeca902ae100a765a99 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 13:22:52 -0500 Subject: [PATCH 31/55] update plugin version to 3.7.0 --- bluehost-wordpress-plugin.php | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bluehost-wordpress-plugin.php b/bluehost-wordpress-plugin.php index 0b9dcd24c..a3bb86081 100644 --- a/bluehost-wordpress-plugin.php +++ b/bluehost-wordpress-plugin.php @@ -12,7 +12,7 @@ * Plugin URI: https://bluehost.com * Update URI: https://github.com/bluehost/bluehost-wordpress-plugin * Description: WordPress plugin that integrates a WordPress site with the Bluehost control panel, including performance, security, and update features. - * Version: 3.6.0 + * Version: 3.7.0 * Requires at least: 6.0 * Requires PHP: 7.1 * Tested up to: 6.4.0 @@ -32,7 +32,7 @@ } // Define constants -define( 'BLUEHOST_PLUGIN_VERSION', '3.6.0' ); +define( 'BLUEHOST_PLUGIN_VERSION', '3.7.0' ); define( 'BLUEHOST_PLUGIN_FILE', __FILE__ ); define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); diff --git a/package-lock.json b/package-lock.json index 2596cca1c..cd48f10e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "bluehost-wordpress-plugin", - "version": "3.6.0", + "version": "3.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.6.0", + "version": "3.7.0", "license": "GPL-2.0-or-later", "dependencies": { "@heroicons/react": "^2.0.18", diff --git a/package.json b/package.json index 26a534f7c..837c0a25b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "WordPress plugin that integrates your WordPress site with the Bluehost control panel, including performance, security, and update features.", "license": "GPL-2.0-or-later", - "version": "3.6.0", + "version": "3.7.0", "private": true, "repository": { "type": "git", From c7e80175e65b65261914ad0463bcc2901ea01284 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 13:32:07 -0500 Subject: [PATCH 32/55] update modules - Upgrading newfold-labs/wp-module-ecommerce (v1.3.9 => v1.3.13) - Upgrading newfold-labs/wp-module-onboarding (1.11.8 => 1.11.10) - Upgrading newfold-labs/wp-module-onboarding-data (0.0.6 => 0.0.8) --- composer.json | 4 +-- composer.lock | 84 ++++++++++++++++++++++++++++++++++------------- package-lock.json | 14 ++++---- package.json | 2 +- 4 files changed, 72 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index d3eb3db3a..c339516aa 100644 --- a/composer.json +++ b/composer.json @@ -61,13 +61,13 @@ "newfold-labs/wp-module-customer-bluehost": "^1.6.0", "newfold-labs/wp-module-data": "^2.4.13", "newfold-labs/wp-module-deactivation": "^1.0.3", - "newfold-labs/wp-module-ecommerce": "^1.3.9", + "newfold-labs/wp-module-ecommerce": "^1.3.13", "newfold-labs/wp-module-global-ctb": "^1.0.9", "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", "newfold-labs/wp-module-marketplace": "^2.1.0", "newfold-labs/wp-module-notifications": "^1.2.1", - "newfold-labs/wp-module-onboarding": "^1.11.8", + "newfold-labs/wp-module-onboarding": "^1.11.10", "newfold-labs/wp-module-patterns": "^0.1.10", "newfold-labs/wp-module-performance": "^1.2.2", "newfold-labs/wp-module-runtime": "^1.0.7", diff --git a/composer.lock b/composer.lock index d153bc38c..a55fc538e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2b4dc0f0725e0a8a3bbe5e0232804f67", + "content-hash": "8ff524ab696116013383b39bcea2f924", "packages": [ { "name": "doctrine/inflector", @@ -528,16 +528,16 @@ }, { "name": "newfold-labs/wp-module-ecommerce", - "version": "v1.3.9", + "version": "v1.3.13", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-ecommerce.git", - "reference": "dc87a1feae60dc0b5df0795ded184a5bc859131b" + "reference": "81be77c59780688861190096947525d1c3bc074a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/dc87a1feae60dc0b5df0795ded184a5bc859131b", - "reference": "dc87a1feae60dc0b5df0795ded184a5bc859131b", + "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/81be77c59780688861190096947525d1c3bc074a", + "reference": "81be77c59780688861190096947525d1c3bc074a", "shasum": "" }, "require": { @@ -580,10 +580,10 @@ ], "description": "Brand Agnostic eCommerce Experience", "support": { - "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.3.9", + "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.3.13", "issues": "https://github.com/newfold-labs/wp-module-ecommerce/issues" }, - "time": "2023-11-06T11:21:13+00:00" + "time": "2023-12-01T10:50:14+00:00" }, { "name": "newfold-labs/wp-module-global-ctb", @@ -681,6 +681,45 @@ }, "time": "2023-10-24T15:24:33+00:00" }, + { + "name": "newfold-labs/wp-module-install-checker", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/newfold-labs/wp-module-install-checker.git", + "reference": "7d6574b297fb7a8a459ec9e53706bd956ef35490" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/newfold-labs/wp-module-install-checker/zipball/7d6574b297fb7a8a459ec9e53706bd956ef35490", + "reference": "7d6574b297fb7a8a459ec9e53706bd956ef35490", + "shasum": "" + }, + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "NewfoldLabs\\WP\\Module\\InstallChecker\\": "includes/" + } + }, + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Micah Wood", + "homepage": "https://wpscholar.com" + } + ], + "description": "A module that handles checking a WordPress installation to see if it is a fresh install and to fetch the estimated installation date.", + "support": { + "source": "https://github.com/newfold-labs/wp-module-install-checker/tree/1.0.2", + "issues": "https://github.com/newfold-labs/wp-module-install-checker/issues" + }, + "time": "2023-11-29T20:35:54+00:00" + }, { "name": "newfold-labs/wp-module-installer", "version": "1.1.2", @@ -873,22 +912,23 @@ }, { "name": "newfold-labs/wp-module-onboarding", - "version": "1.11.8", + "version": "1.11.10", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-onboarding.git", - "reference": "196e62b8d741e825b11b52648cb23cd505597ca7" + "reference": "f1cc93205e8304c92eaa931ea6d71eda756c91a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding/zipball/196e62b8d741e825b11b52648cb23cd505597ca7", - "reference": "196e62b8d741e825b11b52648cb23cd505597ca7", + "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding/zipball/f1cc93205e8304c92eaa931ea6d71eda756c91a6", + "reference": "f1cc93205e8304c92eaa931ea6d71eda756c91a6", "shasum": "" }, "require": { "mustache/mustache": "^2.14", - "newfold-labs/wp-module-onboarding-data": "^0.0.6", - "newfold-labs/wp-module-patterns": "^0.1.8", + "newfold-labs/wp-module-install-checker": "^1.0", + "newfold-labs/wp-module-onboarding-data": "^0.0.8", + "newfold-labs/wp-module-patterns": "^0.1.9", "wp-cli/wp-config-transformer": "^1.3" }, "require-dev": { @@ -925,23 +965,23 @@ ], "description": "Next-generation WordPress Onboarding for WordPress sites at Newfold Digital.", "support": { - "source": "https://github.com/newfold-labs/wp-module-onboarding/tree/1.11.8", + "source": "https://github.com/newfold-labs/wp-module-onboarding/tree/1.11.10", "issues": "https://github.com/newfold-labs/wp-module-onboarding/issues" }, - "time": "2023-11-07T11:23:21+00:00" + "time": "2023-11-29T09:55:24+00:00" }, { "name": "newfold-labs/wp-module-onboarding-data", - "version": "0.0.6", + "version": "0.0.8", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-onboarding-data.git", - "reference": "4735ce96add2e17253e434c38a1b613bd36b2cf4" + "reference": "3d9265b2c2e75978f9a4b6d430518817b2244301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding-data/zipball/4735ce96add2e17253e434c38a1b613bd36b2cf4", - "reference": "4735ce96add2e17253e434c38a1b613bd36b2cf4", + "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding-data/zipball/3d9265b2c2e75978f9a4b6d430518817b2244301", + "reference": "3d9265b2c2e75978f9a4b6d430518817b2244301", "shasum": "" }, "require": { @@ -966,10 +1006,10 @@ ], "description": "A non-toggleable module containing a standardized interface for interacting with Onboarding data.", "support": { - "source": "https://github.com/newfold-labs/wp-module-onboarding-data/tree/0.0.6", + "source": "https://github.com/newfold-labs/wp-module-onboarding-data/tree/0.0.8", "issues": "https://github.com/newfold-labs/wp-module-onboarding-data/issues" }, - "time": "2023-11-01T10:30:53+00:00" + "time": "2023-11-29T09:37:19+00:00" }, { "name": "newfold-labs/wp-module-patterns", @@ -3536,5 +3576,5 @@ "platform-overrides": { "php": "7.1.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/package-lock.json b/package-lock.json index d8e6701aa..1d04e940f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "license": "GPL-2.0-or-later", "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.3.9", + "@newfold-labs/wp-module-ecommerce": "^1.3.13", "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", @@ -3084,9 +3084,9 @@ "integrity": "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==" }, "node_modules/@newfold-labs/wp-module-ecommerce": { - "version": "1.3.9", - "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.9/7c4145981aacfc93b51fb1933c92754b64b063dd", - "integrity": "sha512-fwb6QqQ0K95dxN4TEhqGmaRdM5VpWGYT42ehGCtku8qIj6KxL5eCyMEDEYocoLCcgdNCNIcvYjfX8WXqGPT0jg==", + "version": "1.3.13", + "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.13/f16ea4c40782dbbe16856be5eb9f53b1570a2433", + "integrity": "sha512-2kv2bYaswni/CLhUt6o5+Mqn+o2aCZqaQs1tR1azRgEp3SIoGssHAYrGcP8zGERN14G6uTbrJ/KP/1h1gkHH+Q==", "license": "GPL-2.0-or-later", "dependencies": { "@faizaanceg/pandora": "^1.1.1", @@ -25298,9 +25298,9 @@ } }, "@newfold-labs/wp-module-ecommerce": { - "version": "1.3.9", - "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.9/7c4145981aacfc93b51fb1933c92754b64b063dd", - "integrity": "sha512-fwb6QqQ0K95dxN4TEhqGmaRdM5VpWGYT42ehGCtku8qIj6KxL5eCyMEDEYocoLCcgdNCNIcvYjfX8WXqGPT0jg==", + "version": "1.3.13", + "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.13/f16ea4c40782dbbe16856be5eb9f53b1570a2433", + "integrity": "sha512-2kv2bYaswni/CLhUt6o5+Mqn+o2aCZqaQs1tR1azRgEp3SIoGssHAYrGcP8zGERN14G6uTbrJ/KP/1h1gkHH+Q==", "requires": { "@faizaanceg/pandora": "^1.1.1", "@heroicons/react": "2.0.18", diff --git a/package.json b/package.json index 49ddc1030..6648321fa 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.3.9", + "@newfold-labs/wp-module-ecommerce": "^1.3.13", "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", From 9177db7ff3d2cde5d0284c88e8e16cbc3d026c0c Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 14:14:28 -0500 Subject: [PATCH 33/55] update wp packages --- package-lock.json | 204 +++++++++++++++++++++++----------------------- package.json | 16 ++-- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d04e940f..4787356fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,10 @@ "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", - "@wordpress/compose": "^6.22.0", - "@wordpress/dom-ready": "^3.45.0", - "@wordpress/element": "^5.22.0", - "@wordpress/i18n": "^4.45.0", + "@wordpress/compose": "^6.24.0", + "@wordpress/dom-ready": "^3.47.0", + "@wordpress/element": "^5.24.0", + "@wordpress/i18n": "^4.47.0", "@wordpress/icons": "^9.38.0", "classnames": "^2.3.2", "jquery": "^3.7.1", @@ -30,14 +30,14 @@ "devDependencies": { "@tailwindcss/forms": "^0.5.7", "@testing-library/cypress": "^10.0.1", - "@wordpress/env": "^8.11.0", - "@wordpress/eslint-plugin": "^17.3.0", - "@wordpress/scripts": "^26.16.0", + "@wordpress/env": "^8.13.0", + "@wordpress/eslint-plugin": "^17.4.0", + "@wordpress/scripts": "^26.18.0", "cypress": "^13.6.0", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", - "tailwindcss": "^3.3.5" + "tailwindcss": "^3.3.6" }, "engines": { "node": ">=16", @@ -5337,19 +5337,19 @@ } }, "node_modules/@wordpress/compose": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.22.0.tgz", - "integrity": "sha512-ZHJzNE4XzBD/8tPaYaCAiLBzLmxNfAjv5TQCARq+D1GDCcP+EEzfO3crNJIA6YeIXlGE7R9mWoW+L1eIsKJRjQ==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.24.0.tgz", + "integrity": "sha512-aO0HWi12Y7Do5hyGEOXcRtRTIn7P/t4RrHYMTsHvufCrt6ZCLKvY2vBEaDA8XnWFQZ/Tzo4fBAnxAAxDt1DtEw==", "dependencies": { "@babel/runtime": "^7.16.0", "@types/mousetrap": "^1.6.8", - "@wordpress/deprecated": "^3.45.0", - "@wordpress/dom": "^3.45.0", - "@wordpress/element": "^5.22.0", - "@wordpress/is-shallow-equal": "^4.45.0", - "@wordpress/keycodes": "^3.45.0", - "@wordpress/priority-queue": "^2.45.0", - "@wordpress/undo-manager": "^0.5.0", + "@wordpress/deprecated": "^3.47.0", + "@wordpress/dom": "^3.47.0", + "@wordpress/element": "^5.24.0", + "@wordpress/is-shallow-equal": "^4.47.0", + "@wordpress/keycodes": "^3.47.0", + "@wordpress/priority-queue": "^2.47.0", + "@wordpress/undo-manager": "^0.7.0", "change-case": "^4.1.2", "clipboard": "^2.0.8", "mousetrap": "^1.6.5", @@ -5363,33 +5363,33 @@ } }, "node_modules/@wordpress/compose/node_modules/@wordpress/deprecated": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.45.0.tgz", - "integrity": "sha512-1dMPEc9INXwE4fzG+nMzuLj+f76EjyWg3lsp9g0RTRby44Gtze5+zLJDEz3JbCCIPxiwlxNRxX0NCvSdcFrRyw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.47.0.tgz", + "integrity": "sha512-Vq4h6LHGPUc/pqmLOANcPpiMrOVoTeZRDvKxE+ioR9ldEFo+uquMKrEmJZxXVXl0GZdMKQ4jGKx34z8S8VRwQw==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.45.0" + "@wordpress/hooks": "^3.47.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/compose/node_modules/@wordpress/dom": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.45.0.tgz", - "integrity": "sha512-IX4F+x7tIzj7IbU00oaMcS1lbNzuWb1OtPdWKz14P4XPy9GmqHZvfX0+UJNvryYmy89uOWFYwe5OBvQtVLC8LA==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.47.0.tgz", + "integrity": "sha512-SY6wfAc4yrXYil8fm/uyeKQnPjGuc0G9Q1/5pUKO6dssst8fClsrxy+hXNl0FYFGWnAZBqg5ccrwYydrFt5k/g==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.45.0" + "@wordpress/deprecated": "^3.47.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/compose/node_modules/@wordpress/hooks": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.45.0.tgz", - "integrity": "sha512-cqd5Dv4lp4S5UAip2/bMm2TZiFxs7/sKNq9/73BlKFSmc9hgqgkmcctfER+nVxiYafUNGATyQmDRpJU6R3NaDw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.47.0.tgz", + "integrity": "sha512-a0mZ+lSUBrmacJGXDnFTaz1O47sQgTCZi3LrY445WNc7cmiSlscTfeBxrUXaTF0ninzHJnE7evCIeKLbQC3dLQ==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -5398,9 +5398,9 @@ } }, "node_modules/@wordpress/compose/node_modules/@wordpress/is-shallow-equal": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.45.0.tgz", - "integrity": "sha512-fEhQ/tlTsyb0Fu87PQ/ryFKO0CNo8WP5NXCML6YrIVByvJf2M7XDTwSkTSRNt0A7VlyUPQkih4xlzxmzkg0yvQ==", + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.47.0.tgz", + "integrity": "sha512-mfrw/GXtCzm5jciuXumabfJhJLzGU0EpGgXU9tDHw6CwDrtUMcM05qrvrXFk4IlE2hYFwuTkWryValMt3FFdoQ==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -5409,12 +5409,12 @@ } }, "node_modules/@wordpress/compose/node_modules/@wordpress/keycodes": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.45.0.tgz", - "integrity": "sha512-jIlOV/lDLIr3WHfK+XYs6V6Fy6eySFjYfNCR1aTQGx2gNPZeAySUfiG+r/ZOUgND2I2v/khwalpU/eg8N7OARw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.47.0.tgz", + "integrity": "sha512-dmYpqCWUoCM290YA5ApES9nqz/0D1JngIlZtel+BvELf8fj/jctdsT5wDB7dVdvZCuyr5SF+1Od00DYbMbb5oA==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.45.0", + "@wordpress/i18n": "^4.47.0", "change-case": "^4.1.2" }, "engines": { @@ -5560,9 +5560,9 @@ } }, "node_modules/@wordpress/dom-ready": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.45.0.tgz", - "integrity": "sha512-4e6b+YhOMy+Fe9gNs/8bpS+KzRl952y1UEm8WwWmfkcrxPGB2T1czKe0z0Hf3SZQV/ZPGd7+KwvAy6rdlJTVFQ==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.47.0.tgz", + "integrity": "sha512-VsqaTQJ5Z7Qa3Doi5qk4LMnW0K78JEKLYRcg3ohapgBrQ2tKTS67oWgJx2VgWz8ky6j9UosecSISP3zJHXfEeA==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -5659,9 +5659,9 @@ } }, "node_modules/@wordpress/env": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.11.0.tgz", - "integrity": "sha512-9zE7HJNW1UenqfME/ao2+1kNrtFbj+jpAipgHwDOnJ+Xkg37mzQ3cb75QQzT/zM7WJ1r1ET4J2b7zbwOImTvAw==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.13.0.tgz", + "integrity": "sha512-rtrrBO22DnbLsdBlsGqlMQrjz1dZfbwGnxyKev+gFd1rSfmLs+1F8L89RHOx9vsGPixl5uRwoU/qgYo7Hf1NVQ==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -5965,9 +5965,9 @@ } }, "node_modules/@wordpress/priority-queue": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.45.0.tgz", - "integrity": "sha512-5Xf5HVtOYahXFUM/5SoB45cgm+zbzB0J1HNggAZ45Ef8jGxu2aSBlCUkdUnGFdW9+S89fAEUcdLBFm/B5jsdfw==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.47.0.tgz", + "integrity": "sha512-ZA6BDYkEC3mY1UrEXYnihdb0GoJooxZ9ADPEDEnqY88EuUT8/eeIDOge7OzgatDa9ivzV8TP3Fs4C/mHg/s6dQ==", "dependencies": { "@babel/runtime": "^7.16.0", "requestidlecallback": "^0.3.0" @@ -6267,21 +6267,21 @@ } }, "node_modules/@wordpress/undo-manager": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.5.0.tgz", - "integrity": "sha512-qQsQZDdduh3sajncyCCa8v+ROOnyxPTTe1VhyDtTJ3JdJSeqIeCum7NMKspf2E2AurZD8ZTEEXYdZQyhp+mYOg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.7.0.tgz", + "integrity": "sha512-WhMKX/ETGUJr2GkaPgGwFF8gTU/PgikfvE2b2ZDjUglxIPYnujBa9S6w+kQPzwGniGJutHL1DFK+TmAaxoci9A==", "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.45.0" + "@wordpress/is-shallow-equal": "^4.47.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/undo-manager/node_modules/@wordpress/is-shallow-equal": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.45.0.tgz", - "integrity": "sha512-fEhQ/tlTsyb0Fu87PQ/ryFKO0CNo8WP5NXCML6YrIVByvJf2M7XDTwSkTSRNt0A7VlyUPQkih4xlzxmzkg0yvQ==", + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.47.0.tgz", + "integrity": "sha512-mfrw/GXtCzm5jciuXumabfJhJLzGU0EpGgXU9tDHw6CwDrtUMcM05qrvrXFk4IlE2hYFwuTkWryValMt3FFdoQ==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -21194,9 +21194,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", - "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.6.tgz", + "integrity": "sha512-AKjF7qbbLvLaPieoKeTjG1+FyNZT6KaJMJPFeQyLfIp7l82ggH1fbHJSsYIvnbTFQOlkh+gBYpyby5GT1LIdLw==", "dev": true, "dependencies": { "@alloc/quick-lru": "^5.2.0", @@ -27098,19 +27098,19 @@ } }, "@wordpress/compose": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.22.0.tgz", - "integrity": "sha512-ZHJzNE4XzBD/8tPaYaCAiLBzLmxNfAjv5TQCARq+D1GDCcP+EEzfO3crNJIA6YeIXlGE7R9mWoW+L1eIsKJRjQ==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.24.0.tgz", + "integrity": "sha512-aO0HWi12Y7Do5hyGEOXcRtRTIn7P/t4RrHYMTsHvufCrt6ZCLKvY2vBEaDA8XnWFQZ/Tzo4fBAnxAAxDt1DtEw==", "requires": { "@babel/runtime": "^7.16.0", "@types/mousetrap": "^1.6.8", - "@wordpress/deprecated": "^3.45.0", - "@wordpress/dom": "^3.45.0", - "@wordpress/element": "^5.22.0", - "@wordpress/is-shallow-equal": "^4.45.0", - "@wordpress/keycodes": "^3.45.0", - "@wordpress/priority-queue": "^2.45.0", - "@wordpress/undo-manager": "^0.5.0", + "@wordpress/deprecated": "^3.47.0", + "@wordpress/dom": "^3.47.0", + "@wordpress/element": "^5.24.0", + "@wordpress/is-shallow-equal": "^4.47.0", + "@wordpress/keycodes": "^3.47.0", + "@wordpress/priority-queue": "^2.47.0", + "@wordpress/undo-manager": "^0.7.0", "change-case": "^4.1.2", "clipboard": "^2.0.8", "mousetrap": "^1.6.5", @@ -27118,46 +27118,46 @@ }, "dependencies": { "@wordpress/deprecated": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.45.0.tgz", - "integrity": "sha512-1dMPEc9INXwE4fzG+nMzuLj+f76EjyWg3lsp9g0RTRby44Gtze5+zLJDEz3JbCCIPxiwlxNRxX0NCvSdcFrRyw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.47.0.tgz", + "integrity": "sha512-Vq4h6LHGPUc/pqmLOANcPpiMrOVoTeZRDvKxE+ioR9ldEFo+uquMKrEmJZxXVXl0GZdMKQ4jGKx34z8S8VRwQw==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.45.0" + "@wordpress/hooks": "^3.47.0" } }, "@wordpress/dom": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.45.0.tgz", - "integrity": "sha512-IX4F+x7tIzj7IbU00oaMcS1lbNzuWb1OtPdWKz14P4XPy9GmqHZvfX0+UJNvryYmy89uOWFYwe5OBvQtVLC8LA==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.47.0.tgz", + "integrity": "sha512-SY6wfAc4yrXYil8fm/uyeKQnPjGuc0G9Q1/5pUKO6dssst8fClsrxy+hXNl0FYFGWnAZBqg5ccrwYydrFt5k/g==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.45.0" + "@wordpress/deprecated": "^3.47.0" } }, "@wordpress/hooks": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.45.0.tgz", - "integrity": "sha512-cqd5Dv4lp4S5UAip2/bMm2TZiFxs7/sKNq9/73BlKFSmc9hgqgkmcctfER+nVxiYafUNGATyQmDRpJU6R3NaDw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.47.0.tgz", + "integrity": "sha512-a0mZ+lSUBrmacJGXDnFTaz1O47sQgTCZi3LrY445WNc7cmiSlscTfeBxrUXaTF0ninzHJnE7evCIeKLbQC3dLQ==", "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/is-shallow-equal": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.45.0.tgz", - "integrity": "sha512-fEhQ/tlTsyb0Fu87PQ/ryFKO0CNo8WP5NXCML6YrIVByvJf2M7XDTwSkTSRNt0A7VlyUPQkih4xlzxmzkg0yvQ==", + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.47.0.tgz", + "integrity": "sha512-mfrw/GXtCzm5jciuXumabfJhJLzGU0EpGgXU9tDHw6CwDrtUMcM05qrvrXFk4IlE2hYFwuTkWryValMt3FFdoQ==", "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/keycodes": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.45.0.tgz", - "integrity": "sha512-jIlOV/lDLIr3WHfK+XYs6V6Fy6eySFjYfNCR1aTQGx2gNPZeAySUfiG+r/ZOUgND2I2v/khwalpU/eg8N7OARw==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.47.0.tgz", + "integrity": "sha512-dmYpqCWUoCM290YA5ApES9nqz/0D1JngIlZtel+BvELf8fj/jctdsT5wDB7dVdvZCuyr5SF+1Od00DYbMbb5oA==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.45.0", + "@wordpress/i18n": "^4.47.0", "change-case": "^4.1.2" } } @@ -27276,9 +27276,9 @@ } }, "@wordpress/dom-ready": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.45.0.tgz", - "integrity": "sha512-4e6b+YhOMy+Fe9gNs/8bpS+KzRl952y1UEm8WwWmfkcrxPGB2T1czKe0z0Hf3SZQV/ZPGd7+KwvAy6rdlJTVFQ==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.47.0.tgz", + "integrity": "sha512-VsqaTQJ5Z7Qa3Doi5qk4LMnW0K78JEKLYRcg3ohapgBrQ2tKTS67oWgJx2VgWz8ky6j9UosecSISP3zJHXfEeA==", "requires": { "@babel/runtime": "^7.16.0" } @@ -27356,9 +27356,9 @@ } }, "@wordpress/env": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.11.0.tgz", - "integrity": "sha512-9zE7HJNW1UenqfME/ao2+1kNrtFbj+jpAipgHwDOnJ+Xkg37mzQ3cb75QQzT/zM7WJ1r1ET4J2b7zbwOImTvAw==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.13.0.tgz", + "integrity": "sha512-rtrrBO22DnbLsdBlsGqlMQrjz1dZfbwGnxyKev+gFd1rSfmLs+1F8L89RHOx9vsGPixl5uRwoU/qgYo7Hf1NVQ==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -27577,9 +27577,9 @@ } }, "@wordpress/priority-queue": { - "version": "2.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.45.0.tgz", - "integrity": "sha512-5Xf5HVtOYahXFUM/5SoB45cgm+zbzB0J1HNggAZ45Ef8jGxu2aSBlCUkdUnGFdW9+S89fAEUcdLBFm/B5jsdfw==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.47.0.tgz", + "integrity": "sha512-ZA6BDYkEC3mY1UrEXYnihdb0GoJooxZ9ADPEDEnqY88EuUT8/eeIDOge7OzgatDa9ivzV8TP3Fs4C/mHg/s6dQ==", "requires": { "@babel/runtime": "^7.16.0", "requestidlecallback": "^0.3.0" @@ -27845,18 +27845,18 @@ } }, "@wordpress/undo-manager": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.5.0.tgz", - "integrity": "sha512-qQsQZDdduh3sajncyCCa8v+ROOnyxPTTe1VhyDtTJ3JdJSeqIeCum7NMKspf2E2AurZD8ZTEEXYdZQyhp+mYOg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.7.0.tgz", + "integrity": "sha512-WhMKX/ETGUJr2GkaPgGwFF8gTU/PgikfvE2b2ZDjUglxIPYnujBa9S6w+kQPzwGniGJutHL1DFK+TmAaxoci9A==", "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.45.0" + "@wordpress/is-shallow-equal": "^4.47.0" }, "dependencies": { "@wordpress/is-shallow-equal": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.45.0.tgz", - "integrity": "sha512-fEhQ/tlTsyb0Fu87PQ/ryFKO0CNo8WP5NXCML6YrIVByvJf2M7XDTwSkTSRNt0A7VlyUPQkih4xlzxmzkg0yvQ==", + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.47.0.tgz", + "integrity": "sha512-mfrw/GXtCzm5jciuXumabfJhJLzGU0EpGgXU9tDHw6CwDrtUMcM05qrvrXFk4IlE2hYFwuTkWryValMt3FFdoQ==", "requires": { "@babel/runtime": "^7.16.0" } @@ -38948,9 +38948,9 @@ } }, "tailwindcss": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", - "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.6.tgz", + "integrity": "sha512-AKjF7qbbLvLaPieoKeTjG1+FyNZT6KaJMJPFeQyLfIp7l82ggH1fbHJSsYIvnbTFQOlkh+gBYpyby5GT1LIdLw==", "dev": true, "requires": { "@alloc/quick-lru": "^5.2.0", diff --git a/package.json b/package.json index 6648321fa..3ec431cc3 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,10 @@ "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", - "@wordpress/compose": "^6.22.0", - "@wordpress/dom-ready": "^3.45.0", - "@wordpress/element": "^5.22.0", - "@wordpress/i18n": "^4.45.0", + "@wordpress/compose": "^6.24.0", + "@wordpress/dom-ready": "^3.47.0", + "@wordpress/element": "^5.24.0", + "@wordpress/i18n": "^4.47.0", "@wordpress/icons": "^9.38.0", "classnames": "^2.3.2", "jquery": "^3.7.1", @@ -45,14 +45,14 @@ "devDependencies": { "@tailwindcss/forms": "^0.5.7", "@testing-library/cypress": "^10.0.1", - "@wordpress/env": "^8.11.0", - "@wordpress/eslint-plugin": "^17.3.0", - "@wordpress/scripts": "^26.16.0", + "@wordpress/env": "^8.13.0", + "@wordpress/eslint-plugin": "^17.4.0", + "@wordpress/scripts": "^26.18.0", "cypress": "^13.6.0", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", - "tailwindcss": "^3.3.5" + "tailwindcss": "^3.3.6" }, "scripts": { "build": "NODE_ENV=production wp-scripts build", From 9ab12e1d49d4c48a8e061e59164c62ad3674be59 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 14:52:53 -0500 Subject: [PATCH 34/55] Upgrading newfold-labs/wp-module-data (2.4.13 => 2.4.14) --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index c339516aa..e1883bd30 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "newfold-labs/wp-module-coming-soon": "^1.1.12", "newfold-labs/wp-module-ctb": "^1.1.2", "newfold-labs/wp-module-customer-bluehost": "^1.6.0", - "newfold-labs/wp-module-data": "^2.4.13", + "newfold-labs/wp-module-data": "^2.4.14", "newfold-labs/wp-module-deactivation": "^1.0.3", "newfold-labs/wp-module-ecommerce": "^1.3.13", "newfold-labs/wp-module-global-ctb": "^1.0.9", diff --git a/composer.lock b/composer.lock index a55fc538e..149fc4842 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ff524ab696116013383b39bcea2f924", + "content-hash": "f1a701ef3556edd11be109f1d3dfde0b", "packages": [ { "name": "doctrine/inflector", @@ -418,16 +418,16 @@ }, { "name": "newfold-labs/wp-module-data", - "version": "2.4.13", + "version": "2.4.14", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-data.git", - "reference": "a21d4579037add8bb921426f8d41e15d13b81af3" + "reference": "3bdc70e9f0784832c2955bd2f887215cd38c4425" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/a21d4579037add8bb921426f8d41e15d13b81af3", - "reference": "a21d4579037add8bb921426f8d41e15d13b81af3", + "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/3bdc70e9f0784832c2955bd2f887215cd38c4425", + "reference": "3bdc70e9f0784832c2955bd2f887215cd38c4425", "shasum": "" }, "require": { @@ -460,10 +460,10 @@ ], "description": "Newfold Data Module", "support": { - "source": "https://github.com/newfold-labs/wp-module-data/tree/2.4.13", + "source": "https://github.com/newfold-labs/wp-module-data/tree/2.4.14", "issues": "https://github.com/newfold-labs/wp-module-data/issues" }, - "time": "2023-11-29T18:53:24+00:00" + "time": "2023-12-04T19:34:50+00:00" }, { "name": "newfold-labs/wp-module-deactivation", From 1d91af289d367e1c95b46f18b1c587ea194c2b29 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 14:54:01 -0500 Subject: [PATCH 35/55] Upgrading wp-phpunit/wp-phpunit (6.3.1 => 6.4.1) --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index e1883bd30..2f1cd7e4c 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "roave/security-advisories": "dev-latest", "newfold-labs/wp-php-standards": "^1.2", "wp-cli/i18n-command": "^2.4.4", - "wp-phpunit/wp-phpunit": "^6.3.1" + "wp-phpunit/wp-phpunit": "^6.4.1" }, "require": { "newfold-labs/wp-module-business-reviews": "^1.1.1", diff --git a/composer.lock b/composer.lock index 149fc4842..14cc68920 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f1a701ef3556edd11be109f1d3dfde0b", + "content-hash": "7851837f2e884247ce1f8e369b093848", "packages": [ { "name": "doctrine/inflector", @@ -3517,16 +3517,16 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.3.1", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "4797791a311c41d213027333e4fcc48073f77df0" + "reference": "7b0f58b0c33ba2569a4de74761c10c629298e7ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/4797791a311c41d213027333e4fcc48073f77df0", - "reference": "4797791a311c41d213027333e4fcc48073f77df0", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/7b0f58b0c33ba2569a4de74761c10c629298e7ce", + "reference": "7b0f58b0c33ba2569a4de74761c10c629298e7ce", "shasum": "" }, "type": "library", @@ -3561,7 +3561,7 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2023-08-09T01:26:57+00:00" + "time": "2023-11-28T00:32:39+00:00" } ], "aliases": [], From 219b40e6171fff0d0b7e61aae5b604b5418bcf0e Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 4 Dec 2023 17:13:13 -0500 Subject: [PATCH 36/55] Update ecommerce module to 1.3.14 and lint fix cypress files --- composer.json | 2 +- composer.lock | 14 +- cypress.config.js | 114 ++-- package-lock.json | 14 +- package.json | 2 +- tests/cypress/integration/help.cy.js | 94 ++-- tests/cypress/integration/home.cy.js | 175 +++--- tests/cypress/integration/navigation.cy.js | 323 ++++++----- tests/cypress/integration/settings.cy.js | 508 ++++++++++-------- tests/cypress/integration/version-check.cy.js | 46 +- tests/cypress/support/commands.js | 102 ++-- tests/cypress/support/index.js | 16 +- 12 files changed, 746 insertions(+), 664 deletions(-) diff --git a/composer.json b/composer.json index 2f1cd7e4c..589d6e423 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "newfold-labs/wp-module-customer-bluehost": "^1.6.0", "newfold-labs/wp-module-data": "^2.4.14", "newfold-labs/wp-module-deactivation": "^1.0.3", - "newfold-labs/wp-module-ecommerce": "^1.3.13", + "newfold-labs/wp-module-ecommerce": "^1.3.14", "newfold-labs/wp-module-global-ctb": "^1.0.9", "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", diff --git a/composer.lock b/composer.lock index 14cc68920..7fc03cb06 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7851837f2e884247ce1f8e369b093848", + "content-hash": "91de4cbb8c627ca7ac8cbcc4f5586ca7", "packages": [ { "name": "doctrine/inflector", @@ -528,16 +528,16 @@ }, { "name": "newfold-labs/wp-module-ecommerce", - "version": "v1.3.13", + "version": "v1.3.14", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-ecommerce.git", - "reference": "81be77c59780688861190096947525d1c3bc074a" + "reference": "769ac1baa102829e4a90f9aa2fcc120a08fcfc7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/81be77c59780688861190096947525d1c3bc074a", - "reference": "81be77c59780688861190096947525d1c3bc074a", + "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/769ac1baa102829e4a90f9aa2fcc120a08fcfc7e", + "reference": "769ac1baa102829e4a90f9aa2fcc120a08fcfc7e", "shasum": "" }, "require": { @@ -580,10 +580,10 @@ ], "description": "Brand Agnostic eCommerce Experience", "support": { - "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.3.13", + "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.3.14", "issues": "https://github.com/newfold-labs/wp-module-ecommerce/issues" }, - "time": "2023-12-01T10:50:14+00:00" + "time": "2023-12-04T21:59:52+00:00" }, { "name": "newfold-labs/wp-module-global-ctb", diff --git a/cypress.config.js b/cypress.config.js index e772d6512..d63ccccaf 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,88 +1,84 @@ -const { defineConfig } = require('cypress') -const { phpVersion, core } = require('./.wp-env.json') -const wpVersion = /[^/]*$/.exec(core)[0] +const { defineConfig } = require( 'cypress' ); +const { phpVersion, core } = require( './.wp-env.json' ); +const wpVersion = /[^/]*$/.exec( core )[ 0 ]; -module.exports = defineConfig({ - projectId: "h78f39", - env: { - wpUsername: 'admin', - wpPassword: 'password', - wpVersion, - phpVersion, - pluginId: 'bluehost', - appId: 'wppbh', - }, - downloadsFolder: 'tests/cypress/downloads', - fixturesFolder: 'tests/cypress/fixtures', - screenshotsFolder: 'tests/cypress/screenshots', - video: true, - videosFolder: 'tests/cypress/videos', - chromeWebSecurity: false, - viewportWidth: 1024, - viewportHeight: 768, - blockHosts: [ - '*doubleclick.net', - '*jnn-pa.googleapis.com', - '*youtube.com', - ], - e2e: { - setupNodeEvents(on, config) { - const semver = require('semver'); +module.exports = defineConfig( { + projectId: 'h78f39', + env: { + wpUsername: 'admin', + wpPassword: 'password', + wpVersion, + phpVersion, + pluginId: 'bluehost', + appId: 'wppbh', + }, + downloadsFolder: 'tests/cypress/downloads', + fixturesFolder: 'tests/cypress/fixtures', + screenshotsFolder: 'tests/cypress/screenshots', + video: true, + videosFolder: 'tests/cypress/videos', + chromeWebSecurity: false, + viewportWidth: 1024, + viewportHeight: 768, + blockHosts: [ + '*doubleclick.net', + '*jnn-pa.googleapis.com', + '*youtube.com', + ], + e2e: { + setupNodeEvents( on, config ) { + const semver = require( 'semver' ); // Ensure that the base URL is always properly set. - if (config.env && config.env.baseUrl) { + if ( config.env && config.env.baseUrl ) { config.baseUrl = config.env.baseUrl; } // Ensure that we have a semantically correct WordPress version number for comparisons. - if (config.env.wpVersion) { - if (config.env.wpVersion.split('.').length !== 3) { - config.env.wpSemverVersion = `${config.env.wpVersion}.0`; + if ( config.env.wpVersion ) { + if ( config.env.wpVersion.split( '.' ).length !== 3 ) { + config.env.wpSemverVersion = `${ config.env.wpVersion }.0`; } else { config.env.wpSemverVersion = config.env.wpVersion; } } // Exclude onboarding tests for WordPress lower than WordPress 6.2.0 - if (semver.satisfies(config.env.wpSemverVersion, '<6.2.0')) { - config.excludeSpecPattern = config.excludeSpecPattern.concat( - [ - "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/**" - ] - ); + if ( semver.satisfies( config.env.wpSemverVersion, '<6.2.0' ) ) { + config.excludeSpecPattern = config.excludeSpecPattern.concat( [ + 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/**', + ] ); } // Ensure that we have a semantically correct PHP version number for comparisons. - if (config.env.phpVersion) { - if (config.env.phpVersion.split('.').length !== 3) { - config.env.phpSemverVersion = `${config.env.phpVersion}.0`; + if ( config.env.phpVersion ) { + if ( config.env.phpVersion.split( '.' ).length !== 3 ) { + config.env.phpSemverVersion = `${ config.env.phpVersion }.0`; } else { config.env.phpSemverVersion = config.env.phpVersion; } } // Exclude onboarding/ecommerce tests for PHP lower than 7.3 (7.1 and 7.2) - if (semver.satisfies(config.env.phpSemverVersion, '<7.3.0')) { - config.excludeSpecPattern = config.excludeSpecPattern.concat( - [ - "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/3-ecommerce-onboarding-flow/**", - "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js" - ] - ); + if ( semver.satisfies( config.env.phpSemverVersion, '<7.3.0' ) ) { + config.excludeSpecPattern = config.excludeSpecPattern.concat( [ + 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/3-ecommerce-onboarding-flow/**', + 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js', + ] ); } return config; }, - baseUrl: 'http://localhost:8882', + baseUrl: 'http://localhost:8882', specPattern: [ - "tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}", - "vendor/newfold-labs/**/tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}", + 'tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}', + 'vendor/newfold-labs/**/tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}', ], supportFile: 'tests/cypress/support/index.js', testIsolation: false, excludeSpecPattern: [ - "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/4-design-steps/**", - "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/wp-module-support/" - ] - }, - retries: 1, - experimentalMemoryManagement: true, -}) + 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/4-design-steps/**', + 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/wp-module-support/', + ], + }, + retries: 1, + experimentalMemoryManagement: true, +} ); diff --git a/package-lock.json b/package-lock.json index 4787356fd..fdea0166b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "license": "GPL-2.0-or-later", "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.3.13", + "@newfold-labs/wp-module-ecommerce": "^1.3.14", "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", @@ -3084,9 +3084,9 @@ "integrity": "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==" }, "node_modules/@newfold-labs/wp-module-ecommerce": { - "version": "1.3.13", - "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.13/f16ea4c40782dbbe16856be5eb9f53b1570a2433", - "integrity": "sha512-2kv2bYaswni/CLhUt6o5+Mqn+o2aCZqaQs1tR1azRgEp3SIoGssHAYrGcP8zGERN14G6uTbrJ/KP/1h1gkHH+Q==", + "version": "1.3.14", + "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.14/51f691897a2d4141bcb9ddfd0ba6f3a3d378b3d4", + "integrity": "sha512-cueUmU7UpLfcni9PCoN/87fvQDpZvJh0TsSkGYxSSV7BZYo2qwMdstxdyWGFKegr+7kF8S1au8dZ+DNY16S8hQ==", "license": "GPL-2.0-or-later", "dependencies": { "@faizaanceg/pandora": "^1.1.1", @@ -25298,9 +25298,9 @@ } }, "@newfold-labs/wp-module-ecommerce": { - "version": "1.3.13", - "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.13/f16ea4c40782dbbe16856be5eb9f53b1570a2433", - "integrity": "sha512-2kv2bYaswni/CLhUt6o5+Mqn+o2aCZqaQs1tR1azRgEp3SIoGssHAYrGcP8zGERN14G6uTbrJ/KP/1h1gkHH+Q==", + "version": "1.3.14", + "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.3.14/51f691897a2d4141bcb9ddfd0ba6f3a3d378b3d4", + "integrity": "sha512-cueUmU7UpLfcni9PCoN/87fvQDpZvJh0TsSkGYxSSV7BZYo2qwMdstxdyWGFKegr+7kF8S1au8dZ+DNY16S8hQ==", "requires": { "@faizaanceg/pandora": "^1.1.1", "@heroicons/react": "2.0.18", diff --git a/package.json b/package.json index 3ec431cc3..010c5a17c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.3.13", + "@newfold-labs/wp-module-ecommerce": "^1.3.14", "@newfold-labs/wp-module-runtime": "^1.0.7", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.6", diff --git a/tests/cypress/integration/help.cy.js b/tests/cypress/integration/help.cy.js index aecfab265..4fbc82024 100644 --- a/tests/cypress/integration/help.cy.js +++ b/tests/cypress/integration/help.cy.js @@ -1,63 +1,71 @@ // -describe('Help Page', function () { +describe( 'Help Page', function () { + before( () => { + cy.visit( + '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/help' + ); + } ); - before(() => { - cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/help'); - }); - - it('Is Accessible', () => { + it( 'Is Accessible', () => { cy.injectAxe(); - cy.wait(500); - cy.checkA11y('.wppbh-app-body'); - }); + cy.wait( 500 ); + cy.checkA11y( '.wppbh-app-body' ); + } ); - it('Phone Card Exists', () => { - cy.get('.card-help-phone').contains('h3', 'Phone') + it( 'Phone Card Exists', () => { + cy.get( '.card-help-phone' ) + .contains( 'h3', 'Phone' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Chat Card Exists', () => { - cy.get('.card-help-chat').contains('h3', 'Chat') + it( 'Chat Card Exists', () => { + cy.get( '.card-help-chat' ) + .contains( 'h3', 'Chat' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Tweet Card Exists', () => { - cy.get('.card-help-twitter').contains('h3', 'Tweet') + it( 'Tweet Card Exists', () => { + cy.get( '.card-help-twitter' ) + .contains( 'h3', 'Tweet' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Youtube Card Exists', () => { - cy.get('.card-help-youtube').contains('h3', 'YouTube') + it( 'Youtube Card Exists', () => { + cy.get( '.card-help-youtube' ) + .contains( 'h3', 'YouTube' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Online Support Card Exists', () => { - cy.get('.card-help-kb').contains('h3', 'Knowledge Base') + it( 'Online Support Card Exists', () => { + cy.get( '.card-help-kb' ) + .contains( 'h3', 'Knowledge Base' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Resources Card Exists', () => { - cy.get('.card-help-resources').contains('h3', 'Resources') + it( 'Resources Card Exists', () => { + cy.get( '.card-help-resources' ) + .contains( 'h3', 'Resources' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Events Card Exists', () => { - cy.get('.card-help-events').contains('h3', 'Events and Webinars') + it( 'Events Card Exists', () => { + cy.get( '.card-help-events' ) + .contains( 'h3', 'Events and Webinars' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Website Card Exists', () => { - cy.get('.card-help-website').contains('h3', 'Bluehost Website') + it( 'Website Card Exists', () => { + cy.get( '.card-help-website' ) + .contains( 'h3', 'Bluehost Website' ) .scrollIntoView() - .should('be.visible'); - }); - -}); + .should( 'be.visible' ); + } ); +} ); diff --git a/tests/cypress/integration/home.cy.js b/tests/cypress/integration/home.cy.js index 429dee3d7..a1a924c9f 100644 --- a/tests/cypress/integration/home.cy.js +++ b/tests/cypress/integration/home.cy.js @@ -1,133 +1,138 @@ // -describe('Home Page', function () { +describe( 'Home Page', function () { let NewfoldRuntime; - before(() => { - cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home'); - cy.window().its('NewfoldRuntime').then(data => { - NewfoldRuntime = data; - }); + before( () => { + cy.visit( + '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/home' + ); + cy.window() + .its( 'NewfoldRuntime' ) + .then( ( data ) => { + NewfoldRuntime = data; + } ); cy.injectAxe(); - }); + } ); - it('Site Info Exists', () => { - cy - .get('.wppbh-app-site-info').contains('h3', NewfoldRuntime.site.title) + it( 'Site Info Exists', () => { + cy.get( '.wppbh-app-site-info' ) + .contains( 'h3', NewfoldRuntime.site.title ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Is Accessible', () => { - cy.wait(500); - cy.checkA11y('.wppbh-app-body'); - }); + it( 'Is Accessible', () => { + cy.wait( 500 ); + cy.checkA11y( '.wppbh-app-body' ); + } ); - it('Welcome Section Exists', () => { - cy - .get('.nfd-app-section-container').contains('h2', 'Home') + it( 'Welcome Section Exists', () => { + cy.get( '.nfd-app-section-container' ) + .contains( 'h2', 'Home' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it.skip('Additional Features Section Exists', () => { - cy - .get('.nfd-app-section-container').contains('h2', 'Additional Features') + it.skip( 'Additional Features Section Exists', () => { + cy.get( '.nfd-app-section-container' ) + .contains( 'h2', 'Additional Features' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Account Section Exists', () => { - cy - .get('.wppbh-account-help-section').contains('h1', 'Bluehost Account') + it( 'Account Section Exists', () => { + cy.get( '.wppbh-account-help-section' ) + .contains( 'h1', 'Bluehost Account' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Help Section Exists', () => { - cy - .get('.wppbh-account-help-section').contains('h1', 'Need some help?') + it( 'Help Section Exists', () => { + cy.get( '.wppbh-account-help-section' ) + .contains( 'h1', 'Need some help?' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Webinars Section Exists', () => { + it( 'Webinars Section Exists', () => { cy.intercept( - 'https://cdn.hiive.space/resources/bluehost-webinars.json', + 'https://cdn.hiive.space/resources/bluehost-webinars.json', { fixture: 'webinars.json' } ); cy.reload(); - cy - .get('.wppbh-webinars-banner-section').contains('h2', 'FREE Monthly Webinar: Build your brand with WordPress') + cy.get( '.wppbh-webinars-banner-section' ) + .contains( + 'h2', + 'FREE Monthly Webinar: Build your brand with WordPress' + ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Webinars Section Renders Correctly', () => { + it( 'Webinars Section Renders Correctly', () => { // Title - cy - .get('.wppbh-webinars-banner-section') - .contains('h2', 'FREE Monthly Webinar: Build your brand with WordPress') + cy.get( '.wppbh-webinars-banner-section' ) + .contains( + 'h2', + 'FREE Monthly Webinar: Build your brand with WordPress' + ) .scrollIntoView() - .should('be.visible'); - + .should( 'be.visible' ); + // Description - cy - .get('.wppbh-webinars-banner-section p:first-of-type') - .contains('Join us for a free webinar on how to build your brand with WordPress.') + cy.get( '.wppbh-webinars-banner-section p:first-of-type' ) + .contains( + 'Join us for a free webinar on how to build your brand with WordPress.' + ) .scrollIntoView() - .should('be.visible'); + .should( 'be.visible' ); // Topics - cy - .get('.wppbh-webinars-banner-section h3') - .contains('Topics:') + cy.get( '.wppbh-webinars-banner-section h3' ) + .contains( 'Topics:' ) .scrollIntoView() - .should('be.visible'); + .should( 'be.visible' ); // Date - cy - .get('.wppbh-webinars-banner-section') - .contains('August 31, 2040') + cy.get( '.wppbh-webinars-banner-section' ) + .contains( 'August 31, 2040' ) .scrollIntoView() - .should('be.visible'); + .should( 'be.visible' ); // Time - cy - .get('.wppbh-webinars-banner-section') - .contains('1pm - 2pm EST') + cy.get( '.wppbh-webinars-banner-section' ) + .contains( '1pm - 2pm EST' ) .scrollIntoView() - .should('be.visible'); + .should( 'be.visible' ); // CTA - cy - .get('.wppbh-webinars-banner-section a:first-of-type') - .contains('Register Now') + cy.get( '.wppbh-webinars-banner-section a:first-of-type' ) + .contains( 'Register Now' ) .scrollIntoView() - .should('be.visible') - .should('have.attr', 'href') - .and('include', 'https://www.bluehost.com/blog/events/next-event-post'); - }); - - it('Webinars Section Doesn\'t Render When Active Propety is False', () => { + .should( 'be.visible' ) + .should( 'have.attr', 'href' ) + .and( + 'include', + 'https://www.bluehost.com/blog/events/next-event-post' + ); + } ); + + it( "Webinars Section Doesn't Render When Active Propety is False", () => { cy.intercept( - 'https://cdn.hiive.space/resources/bluehost-webinars.json', + 'https://cdn.hiive.space/resources/bluehost-webinars.json', { fixture: 'webinars-inactive.json' } ); cy.reload(); - cy - .get('.wppbh-webinars-banner-section') - .should('not.exist'); - }); + cy.get( '.wppbh-webinars-banner-section' ).should( 'not.exist' ); + } ); - it('Webinars Section Doesn\'t Render Items Are in the Past', () => { + it( "Webinars Section Doesn't Render Items Are in the Past", () => { cy.intercept( - 'https://cdn.hiive.space/resources/bluehost-webinars.json', + 'https://cdn.hiive.space/resources/bluehost-webinars.json', { fixture: 'webinars-past.json' } ); cy.reload(); - cy - .get('.wppbh-webinars-banner-section') - .should('not.exist'); - }); -}); + cy.get( '.wppbh-webinars-banner-section' ).should( 'not.exist' ); + } ); +} ); diff --git a/tests/cypress/integration/navigation.cy.js b/tests/cypress/integration/navigation.cy.js index c34e1c580..5a689f456 100644 --- a/tests/cypress/integration/navigation.cy.js +++ b/tests/cypress/integration/navigation.cy.js @@ -1,175 +1,166 @@ // -describe('Navigation', function () { - - before(() => { - cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') ); - cy.injectAxe(); - - }); - - it('Admin submenu shouldn\'t exist inside app', () => { - cy - .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu') - .should('not.exist'); - }); - - it('Logo Links to home', () => { - cy.get('.wppbh-logo-wrap').click(); - cy.wait(500); - cy.hash().should('eq', '#/home'); - }); +describe( 'Navigation', function () { + before( () => { + cy.visit( '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) ); + } ); + + it( "Admin submenu shouldn't exist inside app", () => { + cy.get( '#adminmenu #toplevel_page_bluehost ul.wp-submenu' ).should( + 'not.exist' + ); + } ); + + it( 'Logo Links to home', () => { + cy.get( '.wppbh-logo-wrap' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/home' ); + } ); // test main nav - it('Main nav links properly navigates', () => { - cy - .get('.wppbh-app-navitem-Marketplace'). - should('not.have.class', 'active'); - cy.get('.wppbh-app-navitem-Marketplace').click(); - cy.wait(500); - cy.hash().should('eq', '#/marketplace'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('have.class', 'active'); - - cy.get('.wppbh-app-navitem-Performance').click(); - cy.wait(500); - cy.hash().should('eq', '#/performance'); - cy - .get('.wppbh-app-navitem-Performance') - .should('have.class', 'active'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('not.have.class', 'active'); - - cy.get('.wppbh-app-navitem-Settings').click(); - cy.wait(500); - cy.hash().should('eq', '#/settings'); - }); - - it('Subnav links properly navigates', () => { - - cy - .get('.wppbh-app-navitem-Marketplace') + it( 'Main nav links properly navigates', () => { + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'not.have.class', + 'active' + ); + cy.get( '.wppbh-app-navitem-Marketplace' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/marketplace' ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'have.class', + 'active' + ); + + cy.get( '.wppbh-app-navitem-Performance' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/performance' ); + cy.get( '.wppbh-app-navitem-Performance' ).should( + 'have.class', + 'active' + ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'not.have.class', + 'active' + ); + + cy.get( '.wppbh-app-navitem-Settings' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/settings' ); + } ); + + it( 'Subnav links properly navigates', () => { + cy.get( '.wppbh-app-navitem-Marketplace' ) .scrollIntoView() - .should('not.have.class', 'active'); - cy.get('.wppbh-app-navitem-Marketplace').click(); - - cy.wait(500); - cy.hash().should('eq', '#/marketplace'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('have.class', 'active'); - - cy.get('.wppbh-app-subnavitem-Services').click(); - cy.wait(500); - cy.hash().should('eq', '#/marketplace/services'); - cy - .get('.wppbh-app-subnavitem-Services') - .should('have.class', 'active'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('have.class', 'active'); - - - cy.get('.wppbh-app-subnavitem-SEO').click(); - cy.wait(500); - cy.hash().should('eq', '#/marketplace/seo'); - cy - .get('.wppbh-app-subnavitem-SEO') - .should('have.class', 'active'); - cy - .get('.wppbh-app-subnavitem-Services') - .should('not.have.class', 'active'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('have.class', 'active'); - - cy.get('.wppbh-app-navitem-Performance').click(); - cy.wait(500); - cy - .get('.wppbh-app-subnavitem-Services') - .should('not.have.class', 'active'); - cy - .get('.wppbh-app-subnavitem-SEO') - .should('not.have.class', 'active'); - cy - .get('.wppbh-app-navitem-Marketplace') - .should('not.have.class', 'active'); - }); - - it('Admin submenu exist outside the app', () => { - cy.visit('/wp-admin/index.php'); - cy - .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu') - .should('exist'); - cy - .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/home"]') - .should('exist'); - cy - .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/marketplace"]') - .should('exist'); - cy - .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/settings"]') - .should('exist'); - }); + .should( 'not.have.class', 'active' ); + cy.get( '.wppbh-app-navitem-Marketplace' ).click(); + + cy.wait( 500 ); + cy.hash().should( 'eq', '#/marketplace' ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'have.class', + 'active' + ); + + cy.get( '.wppbh-app-subnavitem-Services' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/marketplace/services' ); + cy.get( '.wppbh-app-subnavitem-Services' ).should( + 'have.class', + 'active' + ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'have.class', + 'active' + ); + + cy.get( '.wppbh-app-subnavitem-SEO' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/marketplace/seo' ); + cy.get( '.wppbh-app-subnavitem-SEO' ).should( 'have.class', 'active' ); + cy.get( '.wppbh-app-subnavitem-Services' ).should( + 'not.have.class', + 'active' + ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'have.class', + 'active' + ); + + cy.get( '.wppbh-app-navitem-Performance' ).click(); + cy.wait( 500 ); + cy.get( '.wppbh-app-subnavitem-Services' ).should( + 'not.have.class', + 'active' + ); + cy.get( '.wppbh-app-subnavitem-SEO' ).should( + 'not.have.class', + 'active' + ); + cy.get( '.wppbh-app-navitem-Marketplace' ).should( + 'not.have.class', + 'active' + ); + } ); + + it( 'Admin submenu exist outside the app', () => { + cy.visit( '/wp-admin/index.php' ); + cy.get( '#adminmenu #toplevel_page_bluehost ul.wp-submenu' ).should( + 'exist' + ); + cy.get( + '#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/home"]' + ).should( 'exist' ); + cy.get( + '#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/marketplace"]' + ).should( 'exist' ); + cy.get( + '#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/settings"]' + ).should( 'exist' ); + } ); // utility nav is no more, leaving this in place un case we bring it back anytime soon. - it.skip('Utility nav links properly navigates', () => { - cy - .get('.utility-link-Performance') - .should('not.have.class', 'active'); - cy - .get('.utility-link-Performance').click(); - cy.wait(500); - cy.hash().should('eq', '#/performance'); - cy - .get('.utility-link-Performance') - .should('have.class', 'active'); - - cy - .get('.utility-link-Settings').click(); - cy.wait(500); - cy.hash().should('eq', '#/settings'); - cy - .get('.utility-link-Settings') - .should('have.class', 'active'); - cy - .get('.utility-link-Performance') - .should('not.have.class', 'active'); - - cy - .get('.utility-link-Help').click(); - cy.wait(500); - cy.hash().should('eq', '#/help'); - cy - .get('.utility-link-Help') - .should('have.class', 'active'); - cy - .get('.utility-link-Settings') - .should('not.have.class', 'active'); - }); + it.skip( 'Utility nav links properly navigates', () => { + cy.get( '.utility-link-Performance' ).should( + 'not.have.class', + 'active' + ); + cy.get( '.utility-link-Performance' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/performance' ); + cy.get( '.utility-link-Performance' ).should( 'have.class', 'active' ); + + cy.get( '.utility-link-Settings' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/settings' ); + cy.get( '.utility-link-Settings' ).should( 'have.class', 'active' ); + cy.get( '.utility-link-Performance' ).should( + 'not.have.class', + 'active' + ); + + cy.get( '.utility-link-Help' ).click(); + cy.wait( 500 ); + cy.hash().should( 'eq', '#/help' ); + cy.get( '.utility-link-Help' ).should( 'have.class', 'active' ); + cy.get( '.utility-link-Settings' ).should( 'not.have.class', 'active' ); + } ); // no mobile nav, but should probably add - it.skip('Mobile nav links dispaly for mobile', () => { - cy - .get('.mobile-toggle') - .should('not.exist'); - - cy.viewport('iphone-x'); - cy - .get('.mobile-toggle') - .should('be.visible'); - }); - - it.skip('Mobile nav links properly navigates', () => { - cy.get('.mobile-link-Home').should('not.exist'); - cy.viewport('iphone-x'); - cy.get('.mobile-toggle').click(); - cy.wait(500); - cy.get('.mobile-link-Home').should('be.visible'); - cy.get('button[aria-label="Close"]').should('be.visible') - cy.get('button[aria-label="Close"]').click(); - cy.get('.mobile-link-Home').should('not.exist'); - }); -}); + it.skip( 'Mobile nav links dispaly for mobile', () => { + cy.get( '.mobile-toggle' ).should( 'not.exist' ); + + cy.viewport( 'iphone-x' ); + cy.get( '.mobile-toggle' ).should( 'be.visible' ); + } ); + + it.skip( 'Mobile nav links properly navigates', () => { + cy.get( '.mobile-link-Home' ).should( 'not.exist' ); + cy.viewport( 'iphone-x' ); + cy.get( '.mobile-toggle' ).click(); + cy.wait( 500 ); + cy.get( '.mobile-link-Home' ).should( 'be.visible' ); + cy.get( 'button[aria-label="Close"]' ).should( 'be.visible' ); + cy.get( 'button[aria-label="Close"]' ).click(); + cy.get( '.mobile-link-Home' ).should( 'not.exist' ); + } ); +} ); diff --git a/tests/cypress/integration/settings.cy.js b/tests/cypress/integration/settings.cy.js index 65ac8f85a..8bb3c12be 100644 --- a/tests/cypress/integration/settings.cy.js +++ b/tests/cypress/integration/settings.cy.js @@ -1,243 +1,327 @@ // -describe('Settings Page', function () { +describe( 'Settings Page', function () { + before( () => { + cy.visit( + '/wp-admin/admin.php?page=' + + Cypress.env( 'pluginId' ) + + '#/settings' + ); + } ); - before(() => { - cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/settings'); - - }); - - it('Is Accessible', () => { + it( 'Is Accessible', () => { cy.injectAxe(); - cy.wait(500); - cy.checkA11y('.wppbh-app-body'); - }); + cy.wait( 500 ); + cy.checkA11y( '.wppbh-app-body' ); + } ); - it('Has Coming Soon', () => { - cy - .get('.wppbh-app-settings-coming-soon') + it( 'Has Coming Soon', () => { + cy.get( '.wppbh-app-settings-coming-soon' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Has Auto Updates Settings', () => { - cy - .get('.wppbh-app-settings-update') + it( 'Has Auto Updates Settings', () => { + cy.get( '.wppbh-app-settings-update' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Has Content Settings', () => { - cy - .get('.wppbh-app-settings-content') + it( 'Has Content Settings', () => { + cy.get( '.wppbh-app-settings-content' ) .scrollIntoView() - .should('be.visible'); - }); + .should( 'be.visible' ); + } ); - it('Has Comments Settings', () => { - cy - .get('.wppbh-app-settings-comments') + it( 'Has Comments Settings', () => { + cy.get( '.wppbh-app-settings-comments' ) .scrollIntoView() - .should('be.visible'); - }); - - it('On load update all is checked, which forces other updates to check and disabled state', () => { - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-core-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-themes-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - }); - - it('Disable ALL toggle, leaves everything checked, but enables them', () => { - cy.get('[data-id="autoupdate-all-toggle"]').click(); - cy.wait(100); - cy.get('.nfd-notifications') - .contains('p', 'Disabled All auto-updates') - .should('be.visible'); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="autoupdate-core-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-themes-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - }); - - it('Core toggle works', () => { - cy.get('[data-id="autoupdate-core-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-core-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="autoupdate-core-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('.nfd-notifications') - .contains('p', 'Disabled Core auto-updates') - .should('be.visible'); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - }); - - it('Plugins toggle works', () => { - cy.get('[data-id="autoupdate-plugins-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-plugins-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('.nfd-notifications') - .contains('p', 'Disabled Plugins auto-update') - .should('be.visible'); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - }); - - it('Themes toggle works', () => { - cy.get('[data-id="autoupdate-themes-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-themes-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="autoupdate-themes-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('.nfd-notifications') - .contains('p', 'Disabled Themes auto-update') - .should('be.visible'); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - }); - - it('All toggle activates all', () => { - cy.get('[data-id="autoupdate-all-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-core-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-themes-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - }); - - it('Disabling All toggle returns to previous state', () => { - cy.get('[data-id="autoupdate-all-toggle"]').click(); - cy.wait(100); - cy.get('.nfd-notifications') - .contains('p', 'Disabled All auto-updates') - .should('be.visible'); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="autoupdate-core-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="autoupdate-themes-toggle"]').should('not.be.disabled').should('have.attr', 'aria-checked').and('include', 'false'); - }); - - it('All Toggle takes over again when all are enabled', () => { - cy.get('[data-id="autoupdate-core-toggle"]').click(); - cy.get('[data-id="autoupdate-plugins-toggle"]').click(); - cy.get('[data-id="autoupdate-themes-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="autoupdate-all-toggle"]').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-core-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-plugins-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="autoupdate-themes-toggle"]').should('be.disabled').should('have.attr', 'aria-checked').and('include', 'true'); - }); - - it('Content Settings Work', () => { - cy.get('[data-id="content-revisions-select"]').click(); - cy.wait(100); - cy.get('[data-id="content-revisions-select"]') + .should( 'be.visible' ); + } ); + + it( 'On load update all is checked, which forces other updates to check and disabled state', () => { + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + } ); + + it( 'Disable ALL toggle, leaves everything checked, but enables them', () => { + cy.get( '[data-id="autoupdate-all-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '.nfd-notifications' ) + .contains( 'p', 'Disabled All auto-updates' ) + .should( 'be.visible' ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + } ); + + it( 'Core toggle works', () => { + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '.nfd-notifications' ) + .contains( 'p', 'Disabled Core auto-updates' ) + .should( 'be.visible' ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + } ); + + it( 'Plugins toggle works', () => { + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '.nfd-notifications' ) + .contains( 'p', 'Disabled Plugins auto-update' ) + .should( 'be.visible' ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + } ); + + it( 'Themes toggle works', () => { + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '.nfd-notifications' ) + .contains( 'p', 'Disabled Themes auto-update' ) + .should( 'be.visible' ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + } ); + + it( 'All toggle activates all', () => { + cy.get( '[data-id="autoupdate-all-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + } ); + + it( 'Disabling All toggle returns to previous state', () => { + cy.get( '[data-id="autoupdate-all-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '.nfd-notifications' ) + .contains( 'p', 'Disabled All auto-updates' ) + .should( 'be.visible' ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'not.be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + } ); + + it( 'All Toggle takes over again when all are enabled', () => { + cy.get( '[data-id="autoupdate-core-toggle"]' ).click(); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ).click(); + cy.get( '[data-id="autoupdate-themes-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="autoupdate-all-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-core-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-plugins-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="autoupdate-themes-toggle"]' ) + .should( 'be.disabled' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + } ); + + it( 'Content Settings Work', () => { + cy.get( '[data-id="content-revisions-select"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="content-revisions-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:first') + .next( 'ul.nfd-select__options' ) + .find( 'li:first' ) .click(); // 1 - cy.wait(100); - cy.get('#content-revisions-select__description') - .contains('you can take 1 step back.') - .should('be.visible'); - - cy.get('[data-id="content-revisions-select"]').click(); - cy.wait(1000); - cy.get('[data-id="content-revisions-select"]') + cy.wait( 100 ); + cy.get( '#content-revisions-select__description' ) + .contains( 'you can take 1 step back.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="content-revisions-select"]' ).click(); + cy.wait( 1000 ); + cy.get( '[data-id="content-revisions-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:last') + .next( 'ul.nfd-select__options' ) + .find( 'li:last' ) .click(); // 40 - cy.wait(100); - cy.get('#content-revisions-select__description') - .contains('you can take 40 steps back.') - .should('be.visible'); - - cy.get('[data-id="content-revisions-select"]').click(); - cy.wait(500); - cy.get('[data-id="content-revisions-select"]') + cy.wait( 100 ); + cy.get( '#content-revisions-select__description' ) + .contains( 'you can take 40 steps back.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="content-revisions-select"]' ).click(); + cy.wait( 500 ); + cy.get( '[data-id="content-revisions-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:nth-child(2)') + .next( 'ul.nfd-select__options' ) + .find( 'li:nth-child(2)' ) .click(); // 5 - cy.get('#content-revisions-select__description') - .contains('you can take 5 steps back.') - .should('be.visible'); - + cy.get( '#content-revisions-select__description' ) + .contains( 'you can take 5 steps back.' ) + .should( 'be.visible' ); + // Empty Trash Setting - cy.get('[data-id="empty-trash-select"]').click(); - cy.wait(500); - cy.get('[data-id="empty-trash-select"]') + cy.get( '[data-id="empty-trash-select"]' ).click(); + cy.wait( 500 ); + cy.get( '[data-id="empty-trash-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:nth-child(2)') + .next( 'ul.nfd-select__options' ) + .find( 'li:nth-child(2)' ) .click(); // 2 - cy.wait(100); - cy.get('#empty-trash-select__description') - .contains('The trash will automatically empty every 2 weeks.') - .should('be.visible'); - - cy.get('[data-id="empty-trash-select"]').click(); - cy.wait(500); - cy.get('[data-id="empty-trash-select"]') + cy.wait( 100 ); + cy.get( '#empty-trash-select__description' ) + .contains( 'The trash will automatically empty every 2 weeks.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="empty-trash-select"]' ).click(); + cy.wait( 500 ); + cy.get( '[data-id="empty-trash-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:last') + .next( 'ul.nfd-select__options' ) + .find( 'li:last' ) .click(); // 4 - cy.wait(100); - cy.get('#empty-trash-select__description') - .contains('The trash will automatically empty every 4 weeks.') - .should('be.visible'); - }); - - it('Comment Settings Work', () => { - cy.get('[data-id="comments-per-page-select"]').click(); - cy.wait(500); - cy.get('[data-id="comments-per-page-select"]') + cy.wait( 100 ); + cy.get( '#empty-trash-select__description' ) + .contains( 'The trash will automatically empty every 4 weeks.' ) + .should( 'be.visible' ); + } ); + + it( 'Comment Settings Work', () => { + cy.get( '[data-id="comments-per-page-select"]' ).click(); + cy.wait( 500 ); + cy.get( '[data-id="comments-per-page-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:first') + .next( 'ul.nfd-select__options' ) + .find( 'li:first' ) .click(); // 10 - cy.wait(100); - cy.get('.wppbh-app-settings-comments') - .contains('label', 'Display 10 comments per page.') - .should('be.visible'); - - cy.get('[data-id="disable-comments-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="close-comments-days-select"]').should('be.disabled'); - cy.get('[data-id="disable-comments-toggle"]').click(); - cy.wait(100); - - cy.get('[data-id="disable-comments-toggle"]').should('have.attr', 'aria-checked').and('include', 'true'); - cy.get('[data-id="close-comments-days-select"]').should('not.be.disabled'); + cy.wait( 100 ); + cy.get( '.wppbh-app-settings-comments' ) + .contains( 'label', 'Display 10 comments per page.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="disable-comments-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="close-comments-days-select"]' ).should( + 'be.disabled' + ); + cy.get( '[data-id="disable-comments-toggle"]' ).click(); + cy.wait( 100 ); + + cy.get( '[data-id="disable-comments-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'true' ); + cy.get( '[data-id="close-comments-days-select"]' ).should( + 'not.be.disabled' + ); // Close comments after days - cy.get('[data-id="close-comments-days-select"]').click(); - cy.wait(100); - cy.get('[data-id="close-comments-days-select"]') + cy.get( '[data-id="close-comments-days-select"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="close-comments-days-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:last') + .next( 'ul.nfd-select__options' ) + .find( 'li:last' ) .click(); // 100 - cy.wait(100); - cy.get('.wppbh-app-settings-comments') - .contains('label', 'Close comments after 100 days.') - .should('be.visible'); - - cy.get('[data-id="close-comments-days-select"]').click(); - cy.wait(100); - cy.get('[data-id="close-comments-days-select"]') + cy.wait( 100 ); + cy.get( '.wppbh-app-settings-comments' ) + .contains( 'label', 'Close comments after 100 days.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="close-comments-days-select"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="close-comments-days-select"]' ) .parent() - .next('ul.nfd-select__options') - .find('li:nth-child(6)') + .next( 'ul.nfd-select__options' ) + .find( 'li:nth-child(6)' ) .click(); // 14 - cy.wait(100); - cy.get('.wppbh-app-settings-comments') - .contains('label', 'Close comments after 14 days.') - .should('be.visible'); - - cy.get('[data-id="disable-comments-toggle"]').click(); - cy.wait(100); - cy.get('[data-id="disable-comments-toggle"]').should('have.attr', 'aria-checked').and('include', 'false'); - cy.get('[data-id="close-comments-days-select"]').should('be.disabled'); - - }); - -}); + cy.wait( 100 ); + cy.get( '.wppbh-app-settings-comments' ) + .contains( 'label', 'Close comments after 14 days.' ) + .should( 'be.visible' ); + + cy.get( '[data-id="disable-comments-toggle"]' ).click(); + cy.wait( 100 ); + cy.get( '[data-id="disable-comments-toggle"]' ) + .should( 'have.attr', 'aria-checked' ) + .and( 'include', 'false' ); + cy.get( '[data-id="close-comments-days-select"]' ).should( + 'be.disabled' + ); + } ); +} ); diff --git a/tests/cypress/integration/version-check.cy.js b/tests/cypress/integration/version-check.cy.js index 1d94dbda8..3952716a2 100644 --- a/tests/cypress/integration/version-check.cy.js +++ b/tests/cypress/integration/version-check.cy.js @@ -1,24 +1,28 @@ // -describe('Page', () => { - - before(() => { +describe( 'Page', () => { + before( () => { cy.login(); - cy.visit('/wp-admin/site-health.php?tab=debug'); - }) - - it('Is running the correct WP version', () => { - - cy.get('#health-check-accordion-block-wp-core').prev().click(); - cy.get('#health-check-accordion-block-wp-core').find('tr').first().find('td').last().contains(new RegExp(`^${Cypress.env('wpVersion')}`)); - - }) - - it('Is running the correct PHP versions', () => { - - cy.get('#health-check-accordion-block-wp-server').prev().click(); - cy.get('#health-check-accordion-block-wp-server').find('tr').eq(2).find('td').last().contains(Cypress.env('phpVersion')); - - }) - -}) \ No newline at end of file + cy.visit( '/wp-admin/site-health.php?tab=debug' ); + } ); + + it( 'Is running the correct WP version', () => { + cy.get( '#health-check-accordion-block-wp-core' ).prev().click(); + cy.get( '#health-check-accordion-block-wp-core' ) + .find( 'tr' ) + .first() + .find( 'td' ) + .last() + .contains( new RegExp( `^${ Cypress.env( 'wpVersion' ) }` ) ); + } ); + + it( 'Is running the correct PHP versions', () => { + cy.get( '#health-check-accordion-block-wp-server' ).prev().click(); + cy.get( '#health-check-accordion-block-wp-server' ) + .find( 'tr' ) + .eq( 2 ) + .find( 'td' ) + .last() + .contains( Cypress.env( 'phpVersion' ) ); + } ); +} ); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 84540dcbc..b15dac9b6 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -28,62 +28,56 @@ import '@testing-library/cypress/add-commands'; -Cypress.Commands.add('login', (username, password) => { - cy - .getCookies() - .then(cookies => { - let hasMatch = false; - cookies.forEach((cookie) => { - if (cookie.name.substr(0, 20) === 'wordpress_logged_in_') { - hasMatch = true; - } - }); - if (!hasMatch) { - cy.visit('/wp-login.php').wait(1000); - cy.get('#user_login').type(username); - cy.get('#user_pass').type(`${ password }{enter}`); - - // Speed up tests by setting permalink structure once - cy.setPermalinkStructure(); +Cypress.Commands.add( 'login', ( username, password ) => { + cy.getCookies().then( ( cookies ) => { + let hasMatch = false; + cookies.forEach( ( cookie ) => { + if ( cookie.name.substr( 0, 20 ) === 'wordpress_logged_in_' ) { + hasMatch = true; } - }); -}); + } ); + if ( ! hasMatch ) { + cy.visit( '/wp-login.php' ).wait( 1000 ); + cy.get( '#user_login' ).type( username ); + cy.get( '#user_pass' ).type( `${ password }{enter}` ); -Cypress.Commands.add('logout', () => { - cy - .getCookies() - .then( - cookies => { - cookies.forEach( - cookie => { - cy.clearCookie(cookie.name); - } - ) - } - ); -}); + // Speed up tests by setting permalink structure once + cy.setPermalinkStructure(); + } + } ); +} ); -Cypress.Commands.add('setPermalinkStructure', ((structure = '/%postname%/') => { - cy.exec(`npx wp-env run cli wp rewrite structure "${structure}"`); -})); +Cypress.Commands.add( 'logout', () => { + cy.getCookies().then( ( cookies ) => { + cookies.forEach( ( cookie ) => { + cy.clearCookie( cookie.name ); + } ); + } ); +} ); -Cypress.Commands.add('deletePages', () => { - cy.visit('/wp-admin/edit.php?post_type=page').wait(1000); - cy.get('body').then(($body) => { - // synchronously ask for the body's text - // and do something based on whether it includes - // another string - if ($body.text().includes('No pages found.')) { - // nothing needed - } else { - cy.get('#cb-select-all-1').check(); - cy.get('#bulk-action-selector-top').select('trash'); - cy.get('#doaction').click(); - cy.wait(2000); - cy.get('.subsubsub .trash').click(); - cy.wait(2000); - cy.get('#delete_all').click(); +Cypress.Commands.add( + 'setPermalinkStructure', + ( structure = '/%postname%/' ) => { + cy.exec( `npx wp-env run cli wp rewrite structure "${ structure }"` ); + } +); - } - }); -}); +Cypress.Commands.add( 'deletePages', () => { + cy.visit( '/wp-admin/edit.php?post_type=page' ).wait( 1000 ); + cy.get( 'body' ).then( ( $body ) => { + // synchronously ask for the body's text + // and do something based on whether it includes + // another string + if ( $body.text().includes( 'No pages found.' ) ) { + // nothing needed + } else { + cy.get( '#cb-select-all-1' ).check(); + cy.get( '#bulk-action-selector-top' ).select( 'trash' ); + cy.get( '#doaction' ).click(); + cy.wait( 2000 ); + cy.get( '.subsubsub .trash' ).click(); + cy.wait( 2000 ); + cy.get( '#delete_all' ).click(); + } + } ); +} ); diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index ddca7e733..1615106ce 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -16,14 +16,14 @@ import 'cypress-axe'; import './commands'; -const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/ -Cypress.on('uncaught:exception', (err) => { +const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; +Cypress.on( 'uncaught:exception', ( err ) => { /* returning false here prevents Cypress from failing the test */ - if (resizeObserverLoopErrRe.test(err.message)) { - return false + if ( resizeObserverLoopErrRe.test( err.message ) ) { + return false; } -}) +} ); -before(() => { - cy.login(Cypress.env('wpUsername'), Cypress.env('wpPassword')); -}); +before( () => { + cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); +} ); From 5aec6fdade55662599d98bbba06c3ff286c169e6 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 4 Dec 2023 16:23:56 -0700 Subject: [PATCH 37/55] Use Newfold UI Page/Container components --- package-lock.json | 14 +- package.json | 2 +- src/app/components/webinars-banner/index.js | 11 +- src/app/pages/ecommerce/page.js | 2 +- src/app/pages/help/index.js | 22 ++-- src/app/pages/help/stylesheet.scss | 17 --- src/app/pages/home/index.js | 12 +- src/app/pages/home/stylesheet.scss | 123 ------------------ src/app/pages/marketplace/index.js | 17 +-- src/app/pages/performance/index.js | 27 ++-- src/app/pages/settings/automaticUpdates.js | 7 +- src/app/pages/settings/comingSoon.js | 7 +- src/app/pages/settings/commentSettings.js | 12 +- src/app/pages/settings/contentSettings.js | 7 +- src/app/pages/settings/index.js | 39 +++--- src/app/pages/staging/index.js | 16 --- src/app/util/hooks/useContainerBlockTarget.js | 43 ++++++ src/app/util/hooks/useHandlePageLoad.js | 4 + 18 files changed, 125 insertions(+), 257 deletions(-) delete mode 100644 src/app/pages/help/stylesheet.scss delete mode 100644 src/app/pages/home/stylesheet.scss create mode 100644 src/app/util/hooks/useContainerBlockTarget.js diff --git a/package-lock.json b/package-lock.json index d901c298c..221365c94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@heroicons/react": "^2.0.18", "@newfold-labs/wp-module-ecommerce": "^1.3.9", "@newfold-labs/wp-module-runtime": "^1.0.7", - "@newfold/ui-component-library": "^1.0.0", + "@newfold/ui-component-library": "^1.0.1", "@reduxjs/toolkit": "^1.9.6", "@wordpress/compose": "^6.22.0", "@wordpress/dom-ready": "^3.45.0", @@ -3219,9 +3219,9 @@ } }, "node_modules/@newfold/ui-component-library": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@newfold/ui-component-library/-/ui-component-library-1.0.0.tgz", - "integrity": "sha512-zEP2oe+WHu1VJ4B34tKb+8cOdSIefSZ5sappZHLJtA3DM+LhP4NHoVvLt34YYNdm9Zq1mL/M5PH9uqCbMQZFOg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@newfold/ui-component-library/-/ui-component-library-1.0.1.tgz", + "integrity": "sha512-p/nCSWcVNs7hOzUJNQXbyiQe82WAzUXbSENIvMX326FeLyETo0AtncqNUZJxABDIVQVQONu+19uRCAqCRvZBPQ==", "dependencies": { "@headlessui/react": "^1.7.8", "@heroicons/react": "^1.0.6", @@ -25415,9 +25415,9 @@ } }, "@newfold/ui-component-library": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@newfold/ui-component-library/-/ui-component-library-1.0.0.tgz", - "integrity": "sha512-zEP2oe+WHu1VJ4B34tKb+8cOdSIefSZ5sappZHLJtA3DM+LhP4NHoVvLt34YYNdm9Zq1mL/M5PH9uqCbMQZFOg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@newfold/ui-component-library/-/ui-component-library-1.0.1.tgz", + "integrity": "sha512-p/nCSWcVNs7hOzUJNQXbyiQe82WAzUXbSENIvMX326FeLyETo0AtncqNUZJxABDIVQVQONu+19uRCAqCRvZBPQ==", "requires": { "@headlessui/react": "^1.7.8", "@heroicons/react": "^1.0.6", diff --git a/package.json b/package.json index 740a4643a..9df9a8a87 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@heroicons/react": "^2.0.18", "@newfold-labs/wp-module-ecommerce": "^1.3.9", "@newfold-labs/wp-module-runtime": "^1.0.7", - "@newfold/ui-component-library": "^1.0.0", + "@newfold/ui-component-library": "^1.0.1", "@reduxjs/toolkit": "^1.9.6", "@wordpress/compose": "^6.22.0", "@wordpress/dom-ready": "^3.45.0", diff --git a/src/app/components/webinars-banner/index.js b/src/app/components/webinars-banner/index.js index 0a42a4b3e..c6868a70e 100644 --- a/src/app/components/webinars-banner/index.js +++ b/src/app/components/webinars-banner/index.js @@ -1,12 +1,11 @@ import { useState, useEffect } from '@wordpress/element'; -import { Button, Title } from '@newfold/ui-component-library'; +import { Button, Container, Title } from '@newfold/ui-component-library'; import { ArrowRightIcon, CalendarIcon, ClockIcon, } from '@heroicons/react/24/outline'; import { ReactComponent as WebinarsVector } from 'App/images/webinars-vector.svg'; -import { SectionContainer, SectionContent } from 'App/components/section'; /** * A component that displays the next monthly webinar. @@ -106,8 +105,8 @@ const WebinarsBanner = () => { } return ( - - + +
    @@ -173,8 +172,8 @@ const WebinarsBanner = () => {
    -
    -
    + + ); }; diff --git a/src/app/pages/ecommerce/page.js b/src/app/pages/ecommerce/page.js index 21e319c14..d9122eaa2 100644 --- a/src/app/pages/ecommerce/page.js +++ b/src/app/pages/ecommerce/page.js @@ -1,11 +1,11 @@ import './styles.scss'; import { useContext } from '@wordpress/element'; import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; +import { Page } from '@newfold/ui-component-library'; import { NewfoldECommerce } from '@newfold-labs/wp-module-ecommerce'; import '@newfold-labs/wp-module-ecommerce/bluehost.css'; import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; -import { Page } from 'App/components/page'; import { useNotification } from 'App/components/notifications'; const ECommerce = () => { diff --git a/src/app/pages/help/index.js b/src/app/pages/help/index.js index fd0961d18..b1e0db6aa 100644 --- a/src/app/pages/help/index.js +++ b/src/app/pages/help/index.js @@ -1,10 +1,10 @@ -import { Button, Card, Title } from '@newfold/ui-component-library'; -import { Page } from 'App/components/page'; import { - SectionContainer, - SectionContent, - SectionHeader, -} from 'App/components/section'; + Button, + Card, + Container, + Page, + Title, +} from '@newfold/ui-component-library'; import help from 'App/data/help'; const HelpCard = ( { item } ) => { @@ -46,17 +46,17 @@ const Help = () => { }; return ( - - + - { renderHelpCards() } - + { renderHelpCards() } + ); }; diff --git a/src/app/pages/help/stylesheet.scss b/src/app/pages/help/stylesheet.scss deleted file mode 100644 index 66ddbf4d2..000000000 --- a/src/app/pages/help/stylesheet.scss +++ /dev/null @@ -1,17 +0,0 @@ -.card-help { - text-align: center; - flex-grow: 2; - - .components-card-header, - .components-card-footer { - flex-direction: column; - justify-content: end; - } - - /* <= WP 5.8 */ - .components-card__header, - .components-card__footer { - justify-content: center; - } - -} \ No newline at end of file diff --git a/src/app/pages/home/index.js b/src/app/pages/home/index.js index 22232a333..bd7f2254c 100644 --- a/src/app/pages/home/index.js +++ b/src/app/pages/home/index.js @@ -1,6 +1,4 @@ -import './stylesheet.scss'; -import { Page } from 'App/components/page'; -import { SectionContainer, SectionContent } from 'App/components/section'; +import { Container, Page } from '@newfold/ui-component-library'; import WebinarsBanner from 'App/components/webinars-banner'; import AccountCard from './accountCard'; import HelpCard from './helpCard'; @@ -11,14 +9,14 @@ const Home = () => { - - + +
    -
    -
    + +
    ); }; diff --git a/src/app/pages/home/stylesheet.scss b/src/app/pages/home/stylesheet.scss deleted file mode 100644 index ace83d4b9..000000000 --- a/src/app/pages/home/stylesheet.scss +++ /dev/null @@ -1,123 +0,0 @@ -.wppbh-section { - margin: 0 0 2rem; - position: relative; - - .components-card__header { - background: var(--color-off-white); - border: 1px solid var(--color-border); - flex-direction: column; - @media screen and (min-width: 1132px) { - flex-direction: row; - } - .heading { - color: var(--color-title); - font-size: 1.5rem; - margin-bottom: 0 !important; // wp core override - @media screen and (min-width: 1132px) { - margin-bottom: 24px !important; - } - } - p { - color: var(--color-text); - font-weight: 700; - margin-left: 0; - } - } - .components-card__footer { - .heading { - display: flex; - align-items: center; - svg, - .dashicons { - margin-right: 4px; - } - } - } - - - &.wppbh-section-coming-soon { - - .wppbh-section-graphic { - top: -3rem; - right: -6rem; - } - } - - &:first-of-type { // allows for better reordering and injection - margin-top: 1rem; - } -} - -.section-graphic { - position: absolute; - right: 0; - top: 2rem; - transition: all .5s ease; - z-index: 0; - display: none; - @media screen and (min-width: 882px) { - display: block; - max-width: 260px; - } - @media screen and (min-width: 1190px) { - max-width: 330px; - } - @media screen and (min-width: 1399px) { - max-width: 400px; - } - - &.reverse { - transform: rotateY(180deg); - @media(prefers-reduced-motion) { - transform: none; - } - } -} - -.wppbh-section-card { - position: relative; - z-index: 1; - - @media screen and (min-width: 882px) { - max-width: 66%; - } - - .components-card__footer { - flex-direction: column; - - .wppbh-cardlist-content { - width: 100%; - .components-heading { - display: flex; - align-items: center; - .dashicons, svg { - margin-right: 8px; - color: var(--color-primary); - fill: var(--color-primary); - } - } - @media screen and (max-width: 700px) { - text-align: center; - .components-heading { - justify-content: center; - } - } - } - - .components-button { - margin: 1rem auto; - } - - @media screen and (min-width: 700px) { - flex-direction: row; - - .wppbh-cardlist-content { - max-width: 60%; - } - - .components-button { - margin: 0; - } - } - } -} \ No newline at end of file diff --git a/src/app/pages/marketplace/index.js b/src/app/pages/marketplace/index.js index ec617adcc..02e8cf6f6 100644 --- a/src/app/pages/marketplace/index.js +++ b/src/app/pages/marketplace/index.js @@ -2,12 +2,7 @@ import apiFetch from '@wordpress/api-fetch'; import { useState, useEffect } from '@wordpress/element'; import { useLocation } from 'react-router-dom'; import classnames from 'classnames'; -import { Page } from 'App/components/page'; -import { - SectionContainer, - SectionHeader, - SectionContent, -} from 'App/components/section'; +import { Container, Page } from '@newfold/ui-component-library'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; // component sourced from marketplace module import { default as NewfoldMarketplace } from '@modules/wp-module-marketplace/components/marketplace/'; @@ -44,20 +39,14 @@ const MarketplacePage = () => { NewfoldRuntime, }; - const moduleComponents = { - SectionHeader, - SectionContent, - }; - return ( - + - + ); }; diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index b5afd1e6f..74ec1795e 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -1,21 +1,15 @@ -import AppStore from '../../data/store'; -import { Page } from '../../components/page'; -import { useState, useEffect, useContext, Fragment } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; -import classnames from 'classnames'; +import { useState, useEffect, useContext, Fragment } from '@wordpress/element'; import { useUpdateEffect } from 'react-use'; +import classnames from 'classnames'; +import { Container, Page } from '@newfold/ui-component-library'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; -import { - SectionContainer, - SectionHeader, - SectionContent, - SectionSettings, -} from 'App/components/section'; -import { useNotification } from 'App/components/notifications'; +import AppStore from '../../data/store'; import { bluehostSettingsApiFetch as newfoldSettingsApiFetch, bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch, } from 'App/util/helpers'; +import { useNotification } from 'App/components/notifications'; import { default as NewfoldPerformance } from '@modules/wp-module-performance/components/performance/'; @@ -39,18 +33,13 @@ const PerformancePage = () => { }; const moduleComponents = { - Page, - SectionHeader, - SectionContent, - SectionSettings, - SectionContainer, Fragment, }; return ( - - + { methods={ moduleMethods } Components={ moduleComponents } /> - + ); }; diff --git a/src/app/pages/settings/automaticUpdates.js b/src/app/pages/settings/automaticUpdates.js index 0758c2fa2..cc22f220e 100644 --- a/src/app/pages/settings/automaticUpdates.js +++ b/src/app/pages/settings/automaticUpdates.js @@ -1,9 +1,8 @@ import { useState } from '@wordpress/element'; import { useUpdateEffect } from 'react-use'; -import { Alert, ToggleField } from '@newfold/ui-component-library'; +import { Alert, Container, ToggleField } from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch } from '../../util/helpers'; -import { SectionSettings } from 'App/components/section'; import { useNotification } from 'App/components/notifications'; const AutomaticUpdatesAll = ( { setError, notify } ) => { @@ -286,7 +285,7 @@ const AutomaticUpdates = () => { const notify = useNotification(); return ( - { ) } - + ); }; diff --git a/src/app/pages/settings/comingSoon.js b/src/app/pages/settings/comingSoon.js index de0d710cd..4e4c94573 100644 --- a/src/app/pages/settings/comingSoon.js +++ b/src/app/pages/settings/comingSoon.js @@ -1,12 +1,11 @@ import { useState } from '@wordpress/element'; import { useUpdateEffect } from 'react-use'; -import { Alert, ToggleField } from '@newfold/ui-component-library'; +import { Alert, Container, ToggleField } from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch, comingSoonAdminbarToggle, } from '../../util/helpers'; -import { SectionSettings } from 'App/components/section'; import { useNotification } from 'App/components/notifications'; const ComingSoon = () => { @@ -85,7 +84,7 @@ const ComingSoon = () => { }; return ( - { ) } - + ); }; diff --git a/src/app/pages/settings/commentSettings.js b/src/app/pages/settings/commentSettings.js index fdd66e3a5..122e1bc24 100644 --- a/src/app/pages/settings/commentSettings.js +++ b/src/app/pages/settings/commentSettings.js @@ -1,9 +1,13 @@ import { useState } from '@wordpress/element'; import { useUpdateEffect } from 'react-use'; -import { Alert, SelectField, ToggleField } from '@newfold/ui-component-library'; +import { + Alert, + Container, + SelectField, + ToggleField, +} from '@newfold/ui-component-library'; import AppStore from '../../data/store'; import { bluehostSettingsApiFetch } from '../../util/helpers'; -import { SectionSettings } from 'App/components/section'; import { useNotification } from 'App/components/notifications'; const OldPostsComments = ( { setError, notify } ) => { @@ -244,7 +248,7 @@ const CommentSettings = () => { const notify = useNotification(); return ( - { ) } - + ); }; diff --git a/src/app/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 7beb8548a..2eff0cef3 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -1,9 +1,8 @@ import { useState } from '@wordpress/element'; import { useUpdateEffect } from 'react-use'; -import { Alert, SelectField } from '@newfold/ui-component-library'; +import { Alert, Container, SelectField } from '@newfold/ui-component-library'; import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; -import { SectionSettings } from 'App/components/section'; import { useNotification } from 'App/components/notifications'; const ContentRevisions = ( { setError, notify } ) => { @@ -190,7 +189,7 @@ const ContentSettings = () => { const notify = useNotification(); return ( - { ) } - + ); }; diff --git a/src/app/pages/settings/index.js b/src/app/pages/settings/index.js index 2316d1e86..fd0e5aa93 100644 --- a/src/app/pages/settings/index.js +++ b/src/app/pages/settings/index.js @@ -1,19 +1,16 @@ +import classNames from 'classnames'; +import { Container, Page } from '@newfold/ui-component-library'; +import useContainerBlockIsTarget from 'App/util/hooks/useContainerBlockTarget'; import AutomaticUpdates from './automaticUpdates'; -import ComingSoon from './comingSoon'; import CommentSettings from './commentSettings'; +import ComingSoon from './comingSoon'; import ContentSettings from './contentSettings'; -import { Page } from 'App/components/page'; -import { - SectionContainer, - SectionHeader, - SectionContent, -} from 'App/components/section'; const Settings = () => { return ( - - + { className={ 'wppbh-app-settings-header' } /> - - + - - + - - + - + - - + + ); }; diff --git a/src/app/pages/staging/index.js b/src/app/pages/staging/index.js index f2f470699..f6ecbd651 100644 --- a/src/app/pages/staging/index.js +++ b/src/app/pages/staging/index.js @@ -3,13 +3,6 @@ import { useState, useEffect } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; import classnames from 'classnames'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; -import { Page } from 'App/components/page'; -import { - SectionContainer, - SectionHeader, - SectionContent, - SectionSettings, -} from 'App/components/section'; import { useNotification } from 'App/components/notifications'; // component sourced from staging module import { default as NewfoldStaging } from '@modules/wp-module-staging/components/staging/'; @@ -32,17 +25,8 @@ const Staging = () => { useNotification, }; - const moduleComponents = { - Page, - SectionHeader, - SectionContent, - SectionSettings, - SectionContainer, - }; - return ( diff --git a/src/app/util/hooks/useContainerBlockTarget.js b/src/app/util/hooks/useContainerBlockTarget.js new file mode 100644 index 000000000..2c7c2bcc0 --- /dev/null +++ b/src/app/util/hooks/useContainerBlockTarget.js @@ -0,0 +1,43 @@ +import { useEffect, useState } from '@wordpress/element'; + +/** + * Checks if the container block is the target element based on the query param. + * If true, the hook will return that boolean value for a few seconds. + * The hook will set the value to false and remove the query param. + * + * @param {string} id - the container block id, used to check if it's the target. + * @return {boolean} - true if the container block is the target. + */ +const useContainerBlockIsTarget = ( id ) => { + const [ isTarget, setIsTarget ] = useState( false ); + const searchParams = new URLSearchParams( window.location.search ); + + useEffect( () => { + if ( + searchParams.has( 'nfd-target' ) && + searchParams.get( 'nfd-target' ) === id + ) { + setIsTarget( true ); + + setTimeout( () => { + setIsTarget( false ); + removeTargetQueryParam(); + }, 9500 ); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ searchParams ] ); + + /* + * Remove the 'nfd-target={id}' query param from the URL + */ + const removeTargetQueryParam = () => { + searchParams.delete( 'nfd-target' ); + const currentURL = window.location.href; + const updatedURL = currentURL.replace( `&nfd-target=${ id }`, '' ); + window.history.replaceState( null, null, updatedURL ); + }; + + return isTarget; +}; + +export default useContainerBlockIsTarget; diff --git a/src/app/util/hooks/useHandlePageLoad.js b/src/app/util/hooks/useHandlePageLoad.js index ff64f706a..d90843fff 100644 --- a/src/app/util/hooks/useHandlePageLoad.js +++ b/src/app/util/hooks/useHandlePageLoad.js @@ -1,5 +1,9 @@ import { useLocation } from 'react-router-dom'; +/** + * Scrolls to top of page on route change. + * @return {boolean} - true + */ const useHandlePageLoad = () => { const location = useLocation(); const routeContents = document.querySelector( '.wppbh-app-body-inner' ); From 63da1482716d87dc82526e3dcd41749564b758ca Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 4 Dec 2023 17:03:17 -0700 Subject: [PATCH 38/55] Fix react console error Fix minor react content error due to incorrect prop key name --- src/app/pages/performance/index.js | 2 +- src/app/pages/settings/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index 74ec1795e..d1b4e3b32 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -41,7 +41,7 @@ const PerformancePage = () => { { Date: Mon, 4 Dec 2023 17:05:00 -0700 Subject: [PATCH 39/55] Bump modules Bump Marketplace, Staging and Performance modules versions. --- composer.json | 6 +++--- composer.lock | 40 ++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index b55d2311d..244fb5bdb 100644 --- a/composer.json +++ b/composer.json @@ -65,15 +65,15 @@ "newfold-labs/wp-module-global-ctb": "^1.0.9", "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", - "newfold-labs/wp-module-marketplace": "^2.1.0", + "newfold-labs/wp-module-marketplace": "^2.2.0", "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.8", "newfold-labs/wp-module-patterns": "^0.1.8", - "newfold-labs/wp-module-performance": "^1.2.2", + "newfold-labs/wp-module-performance": "^1.3.0", "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", "newfold-labs/wp-module-sso": "^1.0.4", - "newfold-labs/wp-module-staging": "^1.1.1", + "newfold-labs/wp-module-staging": "^1.2.2", "wp-forge/wp-update-handler": "^1.0", "wp-forge/wp-upgrade-handler": "^1.0" } diff --git a/composer.lock b/composer.lock index ba4d996d5..a40fdd43d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2730ca21dbfbe1f3b9893a10d832d31f", + "content-hash": "e3906ec5a8eddab6505f07052ae6440b", "packages": [ { "name": "doctrine/inflector", @@ -771,16 +771,16 @@ }, { "name": "newfold-labs/wp-module-marketplace", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-marketplace.git", - "reference": "3f836e2ae93e97e91a677e12ceb65fda90ee4d86" + "reference": "89984da21a9b069a1c47320d3b2bffbf89201e17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/3f836e2ae93e97e91a677e12ceb65fda90ee4d86", - "reference": "3f836e2ae93e97e91a677e12ceb65fda90ee4d86", + "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/89984da21a9b069a1c47320d3b2bffbf89201e17", + "reference": "89984da21a9b069a1c47320d3b2bffbf89201e17", "shasum": "" }, "require": { @@ -821,10 +821,10 @@ ], "description": "A module for rendering product data and interacting with the Hiive marketplace API.", "support": { - "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.1.0", + "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.2.0", "issues": "https://github.com/newfold-labs/wp-module-marketplace/issues" }, - "time": "2023-11-07T15:19:22+00:00" + "time": "2023-12-04T23:25:24+00:00" }, { "name": "newfold-labs/wp-module-notifications", @@ -1023,16 +1023,16 @@ }, { "name": "newfold-labs/wp-module-performance", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-performance.git", - "reference": "f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8" + "reference": "4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8", - "reference": "f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8", + "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac", + "reference": "4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac", "shasum": "" }, "require": { @@ -1061,10 +1061,10 @@ ], "description": "A module for managing caching functionality.", "support": { - "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.2.2", + "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.3.0", "issues": "https://github.com/newfold-labs/wp-module-performance/issues" }, - "time": "2023-10-30T13:02:28+00:00" + "time": "2023-12-04T23:27:28+00:00" }, { "name": "newfold-labs/wp-module-runtime", @@ -1211,16 +1211,16 @@ }, { "name": "newfold-labs/wp-module-staging", - "version": "1.1.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-staging.git", - "reference": "5a045d4345b5b6a205fb2a5a2a6ac37953b1503c" + "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/5a045d4345b5b6a205fb2a5a2a6ac37953b1503c", - "reference": "5a045d4345b5b6a205fb2a5a2a6ac37953b1503c", + "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", + "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", "shasum": "" }, "require-dev": { @@ -1254,10 +1254,10 @@ ], "description": "Newfold module for staging functionality in brand plugins", "support": { - "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.1.1", + "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.2.2", "issues": "https://github.com/newfold-labs/wp-module-staging/issues" }, - "time": "2023-09-19T22:32:47+00:00" + "time": "2023-12-04T23:24:25+00:00" }, { "name": "wp-cli/wp-config-transformer", @@ -3536,5 +3536,5 @@ "platform-overrides": { "php": "7.1.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From c9ca2b27cf2911d2a84cc8c6554d2de411e61577 Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 4 Dec 2023 17:10:06 -0700 Subject: [PATCH 40/55] Fix minor merge conflict with release branch --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 589d6e423..2a1fbab89 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.10", "newfold-labs/wp-module-patterns": "^0.1.10", - "newfold-labs/wp-module-performance": "^1.2.2", + "newfold-labs/wp-module-performance": "^1.3.0", "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", "newfold-labs/wp-module-sso": "^1.0.4", diff --git a/composer.lock b/composer.lock index 7fc03cb06..4a1e2c9bc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "91de4cbb8c627ca7ac8cbcc4f5586ca7", + "content-hash": "fa3476b38ba9ddb297bb50db3a2d0893", "packages": [ { "name": "doctrine/inflector", @@ -1063,16 +1063,16 @@ }, { "name": "newfold-labs/wp-module-performance", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-performance.git", - "reference": "f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8" + "reference": "4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8", - "reference": "f5cf5924aa6aaceebdf0b5d8b5ea7e004eb1d1a8", + "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac", + "reference": "4ac17a7ad77bb39cd90ebbb5cb207ede5336dbac", "shasum": "" }, "require": { @@ -1101,10 +1101,10 @@ ], "description": "A module for managing caching functionality.", "support": { - "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.2.2", + "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.3.0", "issues": "https://github.com/newfold-labs/wp-module-performance/issues" }, - "time": "2023-10-30T13:02:28+00:00" + "time": "2023-12-04T23:27:28+00:00" }, { "name": "newfold-labs/wp-module-runtime", From ddd6874de1fd4e0157181c6a62949cc0f8c1acfd Mon Sep 17 00:00:00 2001 From: wpalani Date: Mon, 4 Dec 2023 17:53:17 -0700 Subject: [PATCH 41/55] Bump modules (again) --- composer.json | 4 ++-- composer.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 2a1fbab89..527db3a0f 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "newfold-labs/wp-module-global-ctb": "^1.0.9", "newfold-labs/wp-module-help-center": "1.0.21", "newfold-labs/wp-module-loader": "^1.0.10", - "newfold-labs/wp-module-marketplace": "^2.1.0", + "newfold-labs/wp-module-marketplace": "^2.2.0", "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.10", "newfold-labs/wp-module-patterns": "^0.1.10", @@ -73,7 +73,7 @@ "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", "newfold-labs/wp-module-sso": "^1.0.4", - "newfold-labs/wp-module-staging": "^1.1.1", + "newfold-labs/wp-module-staging": "^1.2.2", "wp-forge/wp-update-handler": "^1.0", "wp-forge/wp-upgrade-handler": "^1.0" } diff --git a/composer.lock b/composer.lock index 4a1e2c9bc..f3fffc443 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa3476b38ba9ddb297bb50db3a2d0893", + "content-hash": "4f9f12b882b0e6b5ed7a3117834fa027", "packages": [ { "name": "doctrine/inflector", @@ -810,16 +810,16 @@ }, { "name": "newfold-labs/wp-module-marketplace", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-marketplace.git", - "reference": "3f836e2ae93e97e91a677e12ceb65fda90ee4d86" + "reference": "89984da21a9b069a1c47320d3b2bffbf89201e17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/3f836e2ae93e97e91a677e12ceb65fda90ee4d86", - "reference": "3f836e2ae93e97e91a677e12ceb65fda90ee4d86", + "url": "https://api.github.com/repos/newfold-labs/wp-module-marketplace/zipball/89984da21a9b069a1c47320d3b2bffbf89201e17", + "reference": "89984da21a9b069a1c47320d3b2bffbf89201e17", "shasum": "" }, "require": { @@ -860,10 +860,10 @@ ], "description": "A module for rendering product data and interacting with the Hiive marketplace API.", "support": { - "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.1.0", + "source": "https://github.com/newfold-labs/wp-module-marketplace/tree/2.2.0", "issues": "https://github.com/newfold-labs/wp-module-marketplace/issues" }, - "time": "2023-11-07T15:19:22+00:00" + "time": "2023-12-04T23:25:24+00:00" }, { "name": "newfold-labs/wp-module-notifications", @@ -1251,16 +1251,16 @@ }, { "name": "newfold-labs/wp-module-staging", - "version": "1.1.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-staging.git", - "reference": "5a045d4345b5b6a205fb2a5a2a6ac37953b1503c" + "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/5a045d4345b5b6a205fb2a5a2a6ac37953b1503c", - "reference": "5a045d4345b5b6a205fb2a5a2a6ac37953b1503c", + "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", + "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", "shasum": "" }, "require-dev": { @@ -1294,10 +1294,10 @@ ], "description": "Newfold module for staging functionality in brand plugins", "support": { - "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.1.1", + "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.2.2", "issues": "https://github.com/newfold-labs/wp-module-staging/issues" }, - "time": "2023-09-19T22:32:47+00:00" + "time": "2023-12-04T23:24:25+00:00" }, { "name": "wp-cli/wp-config-transformer", From 42ae9ec9824783bc3f248240a0e6ae7df4b6f73f Mon Sep 17 00:00:00 2001 From: Micah Wood Date: Mon, 4 Dec 2023 20:23:06 -0500 Subject: [PATCH 42/55] Simplify beta test runner --- .github/workflows/cypress-tests-beta.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/cypress-tests-beta.yml b/.github/workflows/cypress-tests-beta.yml index c4de4464b..fe4be16fd 100644 --- a/.github/workflows/cypress-tests-beta.yml +++ b/.github/workflows/cypress-tests-beta.yml @@ -99,13 +99,9 @@ jobs: run: npx wp-env start --debug - name: Run Cypress Tests - if: ${{ github.repository != 'bluehost/bluehost-wordpress-plugin' || github.actor == 'dependabot[bot]' }} + if: ${{ github.repository == 'bluehost/bluehost-wordpress-plugin' }} run: npm run test:e2e -- --browser chrome - - name: Run Cypress Tests - if: ${{ github.repository == 'bluehost/bluehost-wordpress-plugin' && github.actor != 'dependabot[bot]' }} - run: npm run test:e2e -- --browser chrome --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --tag "bluehost, wp-beta" - - name: Store screenshots of test failures if: failure() uses: actions/upload-artifact@v3 From e3c7e715ac44fca7517d0d610ed84f9ed09c7f3c Mon Sep 17 00:00:00 2001 From: Brad Parbs Date: Tue, 5 Dec 2023 09:13:17 -0600 Subject: [PATCH 43/55] Update settings text --- src/app/pages/settings/automaticUpdates.js | 5 ++++- src/app/pages/settings/contentSettings.js | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/pages/settings/automaticUpdates.js b/src/app/pages/settings/automaticUpdates.js index 0758c2fa2..6192d31e3 100644 --- a/src/app/pages/settings/automaticUpdates.js +++ b/src/app/pages/settings/automaticUpdates.js @@ -89,7 +89,10 @@ const AutomaticUpdatesAll = ( { setError, notify } ) => { return ( diff --git a/src/app/pages/settings/contentSettings.js b/src/app/pages/settings/contentSettings.js index 7beb8548a..2e1b13ed2 100644 --- a/src/app/pages/settings/contentSettings.js +++ b/src/app/pages/settings/contentSettings.js @@ -78,7 +78,7 @@ const ContentRevisions = ( { setError, notify } ) => { { return ( Date: Tue, 5 Dec 2023 09:16:01 -0600 Subject: [PATCH 44/55] Update comments text --- src/app/pages/settings/commentSettings.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/pages/settings/commentSettings.js b/src/app/pages/settings/commentSettings.js index fdd66e3a5..1aa30edca 100644 --- a/src/app/pages/settings/commentSettings.js +++ b/src/app/pages/settings/commentSettings.js @@ -220,9 +220,7 @@ const CommentsPerPage = ( { setError, notify } ) => { Date: Tue, 5 Dec 2023 09:34:13 -0600 Subject: [PATCH 45/55] Fix linting --- src/app/pages/settings/commentSettings.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/pages/settings/commentSettings.js b/src/app/pages/settings/commentSettings.js index 1aa30edca..fe166a4ab 100644 --- a/src/app/pages/settings/commentSettings.js +++ b/src/app/pages/settings/commentSettings.js @@ -219,9 +219,7 @@ const CommentsPerPage = ( { setError, notify } ) => { return ( Date: Tue, 5 Dec 2023 08:39:33 -0700 Subject: [PATCH 46/55] Remove local section and page components --- src/app/components/page/index.js | 15 --- src/app/components/section/index.js | 159 ---------------------------- 2 files changed, 174 deletions(-) delete mode 100644 src/app/components/page/index.js delete mode 100644 src/app/components/section/index.js diff --git a/src/app/components/page/index.js b/src/app/components/page/index.js deleted file mode 100644 index 47fd63e3c..000000000 --- a/src/app/components/page/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import classNames from 'classnames'; - -export const Page = ( { className, children } ) => { - return ( -
    - { children } -
    - ); -}; diff --git a/src/app/components/section/index.js b/src/app/components/section/index.js deleted file mode 100644 index 03a4352af..000000000 --- a/src/app/components/section/index.js +++ /dev/null @@ -1,159 +0,0 @@ -import { Button, Title } from '@newfold/ui-component-library'; -import { useState, useEffect } from '@wordpress/element'; -import classNames from 'classnames'; - -export const SectionContainer = ( { className, children } ) => { - return ( -
    - { children } -
    - ); -}; - -export const SectionHeader = ( { - title, - subTitle, - className, - primaryAction = { title: false, className: false, onClick: false }, - secondaryAction = { title: false, className: false, onClick: false }, -} ) => { - return ( -
    -
    - { title && ( -

    - { title } -

    - ) } - { subTitle &&

    { subTitle }

    } -
    - { ( primaryAction.title || secondaryAction.title ) && ( -
    - { primaryAction.title && ( - - ) } - { secondaryAction.title && ( - - ) } -
    - ) } -
    - ); -}; - -export const SectionContent = ( { - separator = false, - id, - className, - children, -} ) => { - const [ isTarget, setIsTarget ] = useState( false ); - const searchParams = new URLSearchParams( window.location.search ); - - useEffect( () => { - if ( - searchParams.has( 'nfd-target' ) && - searchParams.get( 'nfd-target' ) === id - ) { - setIsTarget( true ); - - setTimeout( () => { - setIsTarget( false ); - removeTargetQueryParam(); - }, 9500 ); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ searchParams ] ); - - /* - * Remove the 'nfd-target={id}' query param from the URL - */ - const removeTargetQueryParam = () => { - searchParams.delete( 'nfd-target' ); - const currentURL = window.location.href; - const updatedURL = currentURL.replace( `&nfd-target=${ id }`, '' ); - window.history.replaceState( null, null, updatedURL ); - }; - - return ( -
    -
    - { children } -
    -
    - ); -}; - -export const SectionSettings = ( { - className, - children, - title, - description, -} ) => { - return ( -
    -
    -
    - - { title } - - { description && ( -
    { description }
    - ) } -
    -
    - -
    - { title } -
    { children }
    -
    -
    - ); -}; From 187b5e758380c1bbdaadc5096ba8bab85eafa3de Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 11:42:12 -0500 Subject: [PATCH 47/55] bump react-use --- package-lock.json | 83 ++++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 36 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a9a43b67..0a6c58e70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "react": "^18.2.0", "react-error-boundary": "^4.0.11", "react-router-dom": "^6.20.1", - "react-use": "^17.4.0", + "react-use": "^17.4.2", "semver": "^7.5.4" }, "devDependencies": { @@ -3009,8 +3009,7 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", @@ -13021,9 +13020,9 @@ } }, "node_modules/inline-style-prefixer": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz", - "integrity": "sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-7.0.0.tgz", + "integrity": "sha512-I7GEdScunP1dQ6IM2mQWh6v0mOYdYmH3Bp31UecKdrcUgcURTcctSe1IECdUznSHKSmsHtjrT3CwCPI1pyxfUQ==", "dependencies": { "css-in-js-utils": "^3.1.0", "fast-loops": "^1.1.3" @@ -16276,18 +16275,18 @@ } }, "node_modules/nano-css": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/nano-css/-/nano-css-5.3.5.tgz", - "integrity": "sha512-vSB9X12bbNu4ALBu7nigJgRViZ6ja3OU7CeuiV1zMIbXOdmkLahgtPmh3GBOlDxbKY0CitqlPdOReGlBLSp+yg==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/nano-css/-/nano-css-5.6.1.tgz", + "integrity": "sha512-T2Mhc//CepkTa3X4pUhKgbEheJHYAxD0VptuqFhDbGMUWVV2m+lkNiW/Ieuj35wrfC8Zm0l7HvssQh7zcEttSw==", "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", "css-tree": "^1.1.2", - "csstype": "^3.0.6", + "csstype": "^3.1.2", "fastest-stable-stringify": "^2.0.2", - "inline-style-prefixer": "^6.0.0", - "rtl-css-js": "^1.14.0", - "sourcemap-codec": "^1.4.8", + "inline-style-prefixer": "^7.0.0", + "rtl-css-js": "^1.16.1", "stacktrace-js": "^2.0.2", - "stylis": "^4.0.6" + "stylis": "^4.3.0" }, "peerDependencies": { "react": "*", @@ -18790,9 +18789,9 @@ } }, "node_modules/react-use": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.4.0.tgz", - "integrity": "sha512-TgbNTCA33Wl7xzIJegn1HndB4qTS9u03QUwyNycUnXaweZkE4Kq2SB+Yoxx8qbshkZGYBDvUXbXWRUmQDcZZ/Q==", + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.4.2.tgz", + "integrity": "sha512-1jPtmWLD8OJJNYCdYLJEH/HM+bPDfJuyGwCYeJFgPmWY8ttwpgZnW5QnzgM55CYUByUiTjHxsGOnEpLl6yQaoQ==", "dependencies": { "@types/js-cookie": "^2.2.6", "@xobotyi/scrollbar-width": "^1.9.5", @@ -18800,7 +18799,7 @@ "fast-deep-equal": "^3.1.3", "fast-shallow-equal": "^1.0.0", "js-cookie": "^2.2.1", - "nano-css": "^5.3.1", + "nano-css": "^5.6.1", "react-universal-interface": "^0.6.2", "resize-observer-polyfill": "^1.5.1", "screenfull": "^5.1.0", @@ -18810,8 +18809,8 @@ "tslib": "^2.1.0" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "*", + "react-dom": "*" } }, "node_modules/react-with-direction": { @@ -20351,12 +20350,6 @@ "node": ">=0.10.0" } }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "deprecated": "Please use @jridgewell/sourcemap-codec instead" - }, "node_modules/spawnd": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-9.0.1.tgz", @@ -25228,8 +25221,7 @@ "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "@jridgewell/trace-mapping": { "version": "0.3.19", @@ -32873,9 +32865,9 @@ "dev": true }, "inline-style-prefixer": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz", - "integrity": "sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-7.0.0.tgz", + "integrity": "sha512-I7GEdScunP1dQ6IM2mQWh6v0mOYdYmH3Bp31UecKdrcUgcURTcctSe1IECdUznSHKSmsHtjrT3CwCPI1pyxfUQ==", "requires": { "css-in-js-utils": "^3.1.0", "fast-loops": "^1.1.3" @@ -35339,18 +35331,18 @@ } }, "nano-css": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/nano-css/-/nano-css-5.3.5.tgz", - "integrity": "sha512-vSB9X12bbNu4ALBu7nigJgRViZ6ja3OU7CeuiV1zMIbXOdmkLahgtPmh3GBOlDxbKY0CitqlPdOReGlBLSp+yg==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/nano-css/-/nano-css-5.6.1.tgz", + "integrity": "sha512-T2Mhc//CepkTa3X4pUhKgbEheJHYAxD0VptuqFhDbGMUWVV2m+lkNiW/Ieuj35wrfC8Zm0l7HvssQh7zcEttSw==", "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15", "css-tree": "^1.1.2", - "csstype": "^3.0.6", + "csstype": "^3.1.2", "fastest-stable-stringify": "^2.0.2", - "inline-style-prefixer": "^6.0.0", - "rtl-css-js": "^1.14.0", - "sourcemap-codec": "^1.4.8", + "inline-style-prefixer": "^7.0.0", + "rtl-css-js": "^1.16.1", "stacktrace-js": "^2.0.2", - "stylis": "^4.0.6" + "stylis": "^4.3.0" }, "dependencies": { "csstype": { @@ -37079,9 +37071,9 @@ "integrity": "sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==" }, "react-use": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.4.0.tgz", - "integrity": "sha512-TgbNTCA33Wl7xzIJegn1HndB4qTS9u03QUwyNycUnXaweZkE4Kq2SB+Yoxx8qbshkZGYBDvUXbXWRUmQDcZZ/Q==", + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.4.2.tgz", + "integrity": "sha512-1jPtmWLD8OJJNYCdYLJEH/HM+bPDfJuyGwCYeJFgPmWY8ttwpgZnW5QnzgM55CYUByUiTjHxsGOnEpLl6yQaoQ==", "requires": { "@types/js-cookie": "^2.2.6", "@xobotyi/scrollbar-width": "^1.9.5", @@ -37089,7 +37081,7 @@ "fast-deep-equal": "^3.1.3", "fast-shallow-equal": "^1.0.0", "js-cookie": "^2.2.1", - "nano-css": "^5.3.1", + "nano-css": "^5.6.1", "react-universal-interface": "^0.6.2", "resize-observer-polyfill": "^1.5.1", "screenfull": "^5.1.0", @@ -38272,11 +38264,6 @@ } } }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, "spawnd": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-9.0.1.tgz", diff --git a/package.json b/package.json index 6102c4753..c77f1bba8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react": "^18.2.0", "react-error-boundary": "^4.0.11", "react-router-dom": "^6.20.1", - "react-use": "^17.4.0", + "react-use": "^17.4.2", "semver": "^7.5.4" }, "devDependencies": { From af322bda77347eaf23f3534b3d3aaf9c37e2066f Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 12:35:27 -0500 Subject: [PATCH 48/55] accomodate copy change in settings cypress test --- tests/cypress/integration/settings.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cypress/integration/settings.cy.js b/tests/cypress/integration/settings.cy.js index 8bb3c12be..83174fdfb 100644 --- a/tests/cypress/integration/settings.cy.js +++ b/tests/cypress/integration/settings.cy.js @@ -271,7 +271,7 @@ describe( 'Settings Page', function () { .click(); // 10 cy.wait( 100 ); cy.get( '.wppbh-app-settings-comments' ) - .contains( 'label', 'Display 10 comments per page.' ) + .contains( 'label', 'Comments to display per page' ) .should( 'be.visible' ); cy.get( '[data-id="disable-comments-toggle"]' ) @@ -300,7 +300,7 @@ describe( 'Settings Page', function () { .click(); // 100 cy.wait( 100 ); cy.get( '.wppbh-app-settings-comments' ) - .contains( 'label', 'Close comments after 100 days.' ) + .contains( 'label', 'Comments to display per page' ) .should( 'be.visible' ); cy.get( '[data-id="close-comments-days-select"]' ).click(); From 713712bf2949da1b5c29fde1de718c2295fad4f2 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 13:26:03 -0500 Subject: [PATCH 49/55] update to 1.2.3 staging module with fixed e2e test --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 527db3a0f..0ed00497a 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", "newfold-labs/wp-module-sso": "^1.0.4", - "newfold-labs/wp-module-staging": "^1.2.2", + "newfold-labs/wp-module-staging": "^1.2.3", "wp-forge/wp-update-handler": "^1.0", "wp-forge/wp-upgrade-handler": "^1.0" } diff --git a/composer.lock b/composer.lock index f3fffc443..ead0a2736 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f9f12b882b0e6b5ed7a3117834fa027", + "content-hash": "0800af5443c9ad7875e9ade6a41a5244", "packages": [ { "name": "doctrine/inflector", @@ -1251,16 +1251,16 @@ }, { "name": "newfold-labs/wp-module-staging", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-staging.git", - "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966" + "reference": "87a8f2659ad256fa03a0ae2932950cb6d745dfa4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", - "reference": "c2dd6a1a381c3473cffab0d8eb49b1bd8dd0f966", + "url": "https://api.github.com/repos/newfold-labs/wp-module-staging/zipball/87a8f2659ad256fa03a0ae2932950cb6d745dfa4", + "reference": "87a8f2659ad256fa03a0ae2932950cb6d745dfa4", "shasum": "" }, "require-dev": { @@ -1294,10 +1294,10 @@ ], "description": "Newfold module for staging functionality in brand plugins", "support": { - "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.2.2", + "source": "https://github.com/newfold-labs/wp-module-staging/tree/1.2.3", "issues": "https://github.com/newfold-labs/wp-module-staging/issues" }, - "time": "2023-12-04T23:24:25+00:00" + "time": "2023-12-05T18:18:33+00:00" }, { "name": "wp-cli/wp-config-transformer", @@ -3576,5 +3576,5 @@ "platform-overrides": { "php": "7.1.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 375038e3fa42aeb065a6c48b0477eda534adc4e8 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 13:48:38 -0500 Subject: [PATCH 50/55] Upgrading newfold-labs/wp-module-patterns (0.1.10 => 0.1.11) --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 0ed00497a..bd8e99f98 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,7 @@ "newfold-labs/wp-module-marketplace": "^2.2.0", "newfold-labs/wp-module-notifications": "^1.2.1", "newfold-labs/wp-module-onboarding": "^1.11.10", - "newfold-labs/wp-module-patterns": "^0.1.10", + "newfold-labs/wp-module-patterns": "^0.1.11", "newfold-labs/wp-module-performance": "^1.3.0", "newfold-labs/wp-module-runtime": "^1.0.7", "newfold-labs/wp-module-secure-passwords": "^1.1", diff --git a/composer.lock b/composer.lock index ead0a2736..1e6e00f64 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0800af5443c9ad7875e9ade6a41a5244", + "content-hash": "893cc7d2bb794d256369f57e2ae69a02", "packages": [ { "name": "doctrine/inflector", @@ -1013,16 +1013,16 @@ }, { "name": "newfold-labs/wp-module-patterns", - "version": "0.1.10", + "version": "0.1.11", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-patterns.git", - "reference": "0f459d2df5a44eec4dd39bc216187e36e9931cba" + "reference": "1169c206db5d5a2b4c424eb1dddaca1afdc5f491" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/0f459d2df5a44eec4dd39bc216187e36e9931cba", - "reference": "0f459d2df5a44eec4dd39bc216187e36e9931cba", + "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/1169c206db5d5a2b4c424eb1dddaca1afdc5f491", + "reference": "1169c206db5d5a2b4c424eb1dddaca1afdc5f491", "shasum": "" }, "require-dev": { @@ -1056,10 +1056,10 @@ ], "description": "WordPress Cloud Patterns", "support": { - "source": "https://github.com/newfold-labs/wp-module-patterns/tree/0.1.10", + "source": "https://github.com/newfold-labs/wp-module-patterns/tree/0.1.11", "issues": "https://github.com/newfold-labs/wp-module-patterns/issues" }, - "time": "2023-11-29T19:06:10+00:00" + "time": "2023-12-05T18:40:20+00:00" }, { "name": "newfold-labs/wp-module-performance", From 69e67e6cada3dc7eac9abf0c97e5c6ab7787f9fe Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 15:07:58 -0500 Subject: [PATCH 51/55] update to use latest cypress --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a6c58e70..744aea44a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@wordpress/env": "^8.13.0", "@wordpress/eslint-plugin": "^17.4.0", "@wordpress/scripts": "^26.18.0", - "cypress": "^13.6.0", + "cypress": "^13.6.1", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", @@ -9060,9 +9060,9 @@ } }, "node_modules/cypress": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", - "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", + "version": "13.6.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.1.tgz", + "integrity": "sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -29940,9 +29940,9 @@ } }, "cypress": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", - "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", + "version": "13.6.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.1.tgz", + "integrity": "sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/package.json b/package.json index c77f1bba8..c5134a090 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@wordpress/env": "^8.13.0", "@wordpress/eslint-plugin": "^17.4.0", "@wordpress/scripts": "^26.18.0", - "cypress": "^13.6.0", + "cypress": "^13.6.1", "cypress-axe": "^1.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-plugin-import": "^2.29.0", From 2c528d7f7efcc95b1ec09fceb38436b42d420e53 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 16:04:26 -0500 Subject: [PATCH 52/55] use fixed patterns module --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 1e6e00f64..5f96ebdc5 100644 --- a/composer.lock +++ b/composer.lock @@ -1017,12 +1017,12 @@ "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-patterns.git", - "reference": "1169c206db5d5a2b4c424eb1dddaca1afdc5f491" + "reference": "ebec3c249969d86fd74e95c2f86860b7f5918ee5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/1169c206db5d5a2b4c424eb1dddaca1afdc5f491", - "reference": "1169c206db5d5a2b4c424eb1dddaca1afdc5f491", + "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/ebec3c249969d86fd74e95c2f86860b7f5918ee5", + "reference": "ebec3c249969d86fd74e95c2f86860b7f5918ee5", "shasum": "" }, "require-dev": { @@ -1059,7 +1059,7 @@ "source": "https://github.com/newfold-labs/wp-module-patterns/tree/0.1.11", "issues": "https://github.com/newfold-labs/wp-module-patterns/issues" }, - "time": "2023-12-05T18:40:20+00:00" + "time": "2023-12-05T20:56:40+00:00" }, { "name": "newfold-labs/wp-module-performance", From 5b715c193a4a1551952652ac0416e2d055652f32 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 17:46:43 -0500 Subject: [PATCH 53/55] try local wonder block test replacement --- cypress.config.js | 1 + tests/cypress/integration/wonder-blocks.cy.js | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/cypress/integration/wonder-blocks.cy.js diff --git a/cypress.config.js b/cypress.config.js index d63ccccaf..db7549c17 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -77,6 +77,7 @@ module.exports = defineConfig( { excludeSpecPattern: [ 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/4-design-steps/**', 'vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/wp-module-support/', + 'vendor/newfold-labs/wp-module-patterns/tests/cypress/integration/', ], }, retries: 1, diff --git a/tests/cypress/integration/wonder-blocks.cy.js b/tests/cypress/integration/wonder-blocks.cy.js new file mode 100644 index 000000000..0166ad902 --- /dev/null +++ b/tests/cypress/integration/wonder-blocks.cy.js @@ -0,0 +1,44 @@ +// + +describe( 'Wonder Blocks', function () { + before( () => { + cy.visit( '/wp-admin/post-new.php' ); + } ); + + it( 'Wonder Blocks button exists', () => { + cy.get( '#nfd-wba-toolbar-button' ).should( 'exist' ); + } ); + + it( 'Wonder Blocks button opens modal', () => { + cy.wait( 1000 ); + cy.get( 'body' ).click( { force: true } ); // clear welcome guide + cy.wait( 100 ); + cy.get( '#nfd-wba-toolbar-button' ).click( { force: true } ); + cy.wait( 100 ); + // body has class modal-open + cy.get( 'body' ).should( 'have.class', 'modal-open' ); + // modal window exists + cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'be.visible' ); + } ); + + it( 'Close buttons closes modal', () => { + cy.get( + '.nfd-wba-modal__header button[aria-label="Close dialog"]' + ).should( 'exist' ); + cy.get( + '.nfd-wba-modal__header button[aria-label="Close dialog"]' + ).click( { force: true } ); + cy.wait( 100 ); + cy.get( 'body' ).should( 'not.have.class', 'modal-open' ); + cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'not.exist' ); + } ); + + it( 'ESC button closes modal too', () => { + cy.get( '#nfd-wba-toolbar-button' ).click( { force: true } ); + cy.wait( 100 ); + cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'be.visible' ); + cy.get( 'body' ).type( '{esc}' ); + cy.wait( 100 ); + cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'not.exist' ); + } ); +} ); From ebf6c5a201a3840faca2ee7101128c11b525e14a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 5 Dec 2023 18:01:10 -0500 Subject: [PATCH 54/55] ensure the click occurs on the wonder block button --- tests/cypress/integration/wonder-blocks.cy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/integration/wonder-blocks.cy.js b/tests/cypress/integration/wonder-blocks.cy.js index 0166ad902..72b410c5b 100644 --- a/tests/cypress/integration/wonder-blocks.cy.js +++ b/tests/cypress/integration/wonder-blocks.cy.js @@ -13,7 +13,7 @@ describe( 'Wonder Blocks', function () { cy.wait( 1000 ); cy.get( 'body' ).click( { force: true } ); // clear welcome guide cy.wait( 100 ); - cy.get( '#nfd-wba-toolbar-button' ).click( { force: true } ); + cy.get( '#nfd-wba-toolbar-button button' ).click(); cy.wait( 100 ); // body has class modal-open cy.get( 'body' ).should( 'have.class', 'modal-open' ); @@ -27,14 +27,14 @@ describe( 'Wonder Blocks', function () { ).should( 'exist' ); cy.get( '.nfd-wba-modal__header button[aria-label="Close dialog"]' - ).click( { force: true } ); + ).click(); cy.wait( 100 ); cy.get( 'body' ).should( 'not.have.class', 'modal-open' ); cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'not.exist' ); } ); it( 'ESC button closes modal too', () => { - cy.get( '#nfd-wba-toolbar-button' ).click( { force: true } ); + cy.get( '#nfd-wba-toolbar-button button' ).click(); cy.wait( 100 ); cy.get( '.nfd-wba-modal[role="dialog"]' ).should( 'be.visible' ); cy.get( 'body' ).type( '{esc}' ); From f1ae376db85be44fb428cb9df766cd3deaae210b Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 6 Dec 2023 12:18:47 -0500 Subject: [PATCH 55/55] update WP version to 6.4.2 --- .wp-env.json | 2 +- bluehost-wordpress-plugin.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index a77cb04fd..0b02ab919 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#tags/6.4.1", + "core": "WordPress/WordPress#tags/6.4.2", "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true, diff --git a/bluehost-wordpress-plugin.php b/bluehost-wordpress-plugin.php index a3bb86081..3ceb698b3 100644 --- a/bluehost-wordpress-plugin.php +++ b/bluehost-wordpress-plugin.php @@ -15,7 +15,7 @@ * Version: 3.7.0 * Requires at least: 6.0 * Requires PHP: 7.1 - * Tested up to: 6.4.0 + * Tested up to: 6.4.2 * Author: Bluehost * Author URI: https://bluehost.com * Text Domain: wp-plugin-bluehost