From 31707e777efc7176f0fbe91fae45c2fcfa06329d Mon Sep 17 00:00:00 2001 From: John Date: Fri, 19 Aug 2022 10:06:19 +0100 Subject: [PATCH] Release 3.0.4 (#143) * Fix update preset dropdown not saving * Add translator messages * Reset preset when changing page * Version bump --- package.json | 8 +-- readme.txt | 4 ++ search-regex.php | 2 +- src/component/presets/index.js | 2 +- src/component/replace-progress/index.js | 2 + src/component/rest-api-status/index.js | 5 +- src/component/result/column/index.js | 2 +- src/component/schema/modify/types/string.js | 1 + src/page/home/index.js | 13 ++++- src/page/home/update-notice.js | 1 + yarn.lock | 60 +++++++-------------- 11 files changed, 50 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index c173ad7..d7a63cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search-regex", - "version": "3.0.3", + "version": "3.0.4", "description": "Adds search and replace functionality across posts, pages, comments, and meta-data, with full regular expression support", "main": "search-regex.php", "sideEffects": true, @@ -38,7 +38,7 @@ }, "homepage": "https://github.com/johngodley/search-regex", "devDependencies": { - "@types/jest": "^28.1.6", + "@types/jest": "^28.1.7", "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", "@types/react-highlight-words": "^0.16.4", @@ -46,7 +46,7 @@ "@wordpress/base-styles": "^4.7.0", "@wordpress/eslint-plugin": "^12.9.0", "@wordpress/prettier-config": "^1.4.0", - "@wordpress/scripts": "^23.7.1", + "@wordpress/scripts": "^23.7.2", "apidoc": "^0.52.0", "chai": "^4.3.6", "download": "^8.0.0", @@ -74,7 +74,7 @@ "@wordpress/element": "^4.13.0", "@wordpress/i18n": "^4.15.0", "classnames": "^2.3.1", - "date-fns": "^2.29.1", + "date-fns": "^2.29.2", "deep-equal": "^2.0.5", "file-saver": "^2.0.5", "qs": "^6.11.0", diff --git a/readme.txt b/readme.txt index d72ab0a..62a4e3f 100644 --- a/readme.txt +++ b/readme.txt @@ -113,6 +113,10 @@ Full documentation can be found on the [Search Regex](http://searchregex.com/) s == Changelog == += 3.0.4 - August 19th 2022 = +* Fix 'update preset' dropdown menu not updating +* Fix current preset when switching pages + = 3.0.3 - August 14th 2022 = * Fix error in error message * Fix error when removing text diff --git a/search-regex.php b/search-regex.php index ec96452..17433ec 100644 --- a/search-regex.php +++ b/search-regex.php @@ -3,7 +3,7 @@ Plugin Name: Search Regex Plugin URI: https://searchregex.com/ Description: Adds search and replace functionality across posts, pages, comments, and meta-data, with full regular expression support -Version: 3.0.3 +Version: 3.0.4 Author: John Godley Text Domain: search-regex Domain Path: /locale diff --git a/src/component/presets/index.js b/src/component/presets/index.js index 48e617e..e352f0d 100644 --- a/src/component/presets/index.js +++ b/src/component/presets/index.js @@ -73,7 +73,7 @@ function Presets( props ) { }; const updatePreset = ( ev ) => { ev.preventDefault(); - onUpdatePreset( currentPreset, search ); + onUpdatePreset( currentPreset, { search } ); }; const presetActions = []; diff --git a/src/component/replace-progress/index.js b/src/component/replace-progress/index.js index 6b1d70f..0cadbf5 100644 --- a/src/component/replace-progress/index.js +++ b/src/component/replace-progress/index.js @@ -23,9 +23,11 @@ function getTotalCount( name, count ) { const formattedCount = new Intl.NumberFormat( window.SearchRegexi10n.locale ).format( count ); if ( name === 'delete' ) { + /** translators: number of rows deleted */ return sprintf( _n( '%s row deleted.', '%s rows deleted.', count, 'search-regex' ), formattedCount ); } + /** translators: number of rows deleted */ return sprintf( _n( '%s row.', '%s rows.', count, 'search-regex' ), formattedCount ); } diff --git a/src/component/rest-api-status/index.js b/src/component/rest-api-status/index.js index 82405a4..980c74e 100644 --- a/src/component/rest-api-status/index.js +++ b/src/component/rest-api-status/index.js @@ -156,7 +156,10 @@ class RestApiStatus extends React.Component {
- { percent < 100 && sprintf( __( 'Testing - %s%%', 'search-regex' ), percent ) } + { + /* translators: test percent */ + percent < 100 && sprintf( __( 'Testing - %s%%', 'search-regex' ), percent ) + } { percent >= 100 && this.getApiStatusText( status ) } diff --git a/src/component/result/column/index.js b/src/component/result/column/index.js index 9c04c28..70a6195 100644 --- a/src/component/result/column/index.js +++ b/src/component/result/column/index.js @@ -93,7 +93,7 @@ function ResultColumn( props ) { { ! showMore && contexts.length > MORE_CONTEXTS && (

diff --git a/src/component/schema/modify/types/string.js b/src/component/schema/modify/types/string.js index 971fe71..70a4bb9 100644 --- a/src/component/schema/modify/types/string.js +++ b/src/component/schema/modify/types/string.js @@ -114,6 +114,7 @@ function ModifyString( props ) { onChange={ setLocalOperation } extraItems={ modifiedFilters.map( ( item ) => ( { value: item.column + '-' + item.value, + /* translators: text to replace */ label: sprintf( __( 'Replace "%1s"', 'search-regex' ), item.value.substr( 0, 20 ) ) } ) ) } /> diff --git a/src/page/home/index.js b/src/page/home/index.js index 92f83b9..c9085d7 100644 --- a/src/page/home/index.js +++ b/src/page/home/index.js @@ -14,6 +14,7 @@ import { getPluginPage } from '../../lib/plugin'; import { Snackbar, Menu, ErrorBoundary, Error } from '@wp-plugin-components'; import { has_page_access } from '../../lib/capabilities'; import { clearErrors, clearNotices } from '../../state/message/action'; +import { setPreset } from '../../state/preset/action'; import DebugReport from './debug'; import ErrorDetails from './error-details'; import CrashHandler from './crash-handler'; @@ -53,17 +54,22 @@ const getMenu = () => ].filter( ( option ) => has_page_access( option.value ) || ( option.value === '' && has_page_access( 'search' ) ) ); function Home( props ) { - const { onClearErrors, errors, onClearNotices, notices } = props; + const { onClearErrors, onResetPreset, errors, onClearNotices, notices } = props; const [ page, setPage ] = useState( getPluginPage() ); if ( SEARCHREGEX_VERSION !== SearchRegexi10n.version ) { return ; } + function pageChange() { + onClearErrors(); + onResetPreset(); + } + return (

- +

{ getTitles()[ page ] }

@@ -107,6 +113,9 @@ function mapDispatchToProps( dispatch ) { onClearNotices: () => { dispatch( clearNotices() ); }, + onResetPreset: () => { + dispatch( setPreset( null ) ); + } }; } diff --git a/src/page/home/update-notice.js b/src/page/home/update-notice.js index 309fb15..846dab5 100644 --- a/src/page/home/update-notice.js +++ b/src/page/home/update-notice.js @@ -29,6 +29,7 @@ function UpdateNotice() {

{ createInterpolateElement( + /* translators: version installed */ sprintf( __( 'Version %s installed! Please read the {{url}}release notes{{/url}} for details.', 'search-regex' ), update_notice ), { url: diff --git a/yarn.lock b/yarn.lock index 243836f..9ad5386 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2463,12 +2463,12 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^28.1.6": - version "28.1.6" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.6.tgz#d6a9cdd38967d2d746861fb5be6b120e38284dd4" - integrity sha512-0RbGAFMfcBJKOmqRazM8L98uokwuwD5F8rHrv/ZMbrZBwVOWZUyPG6VFNscjYr/vjM3Vu4fRrCPbOs42AfemaQ== +"@types/jest@^28.1.7": + version "28.1.7" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.7.tgz#a680c5d05b69634c2d54a63cb106d7fb1adaba16" + integrity sha512-acDN4VHD40V24tgu0iC44jchXavRNVFXQ/E6Z5XNsswgoSO/4NgsXoEYmPUGookKldlZQyIpmrEXsHI9cA3ZTA== dependencies: - jest-matcher-utils "^28.0.0" + expect "^28.0.0" pretty-format "^28.0.0" "@types/jsdom@^16.2.4": @@ -3104,10 +3104,10 @@ "@babel/runtime" "^7.16.0" jest-matcher-utils "^27.4.2" -"@wordpress/jest-preset-default@^8.5.1": - version "8.5.1" - resolved "https://registry.yarnpkg.com/@wordpress/jest-preset-default/-/jest-preset-default-8.5.1.tgz#596c905caca2deac9af2c3e0135dff367b7d92ea" - integrity sha512-p84ILJvXxoLr6mAJra3tCtMYNCqcscU+XyuoDy3pro9zVDGFLbWLc6nw0TCQRPvRD5HvK3VGmcLB74ZsiYM0Bg== +"@wordpress/jest-preset-default@^8.5.2": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@wordpress/jest-preset-default/-/jest-preset-default-8.5.2.tgz#af1356c7b33c0cb97967382bb621740d8837e00a" + integrity sha512-xlo8LNDcjuXbb1OVI9SFDm2u6JeWXu945Jo8LtPtWbRgCfgBZfQh4Y/csMbkiiIRq/Hpi5/VK2WWJJXSe5EsRQ== dependencies: "@wojtekmaj/enzyme-adapter-react-17" "^0.6.1" "@wordpress/jest-console" "^5.4.0" @@ -3133,10 +3133,10 @@ resolved "https://registry.yarnpkg.com/@wordpress/prettier-config/-/prettier-config-1.4.0.tgz#8eaeb8daf7253e8b0806da2279017d4f4fef0f62" integrity sha512-uvrgUAhRnOvIysXjcXH9VDsrKLqH9r3BfdGoy+WFLSHFnTfdMhW7bdDQXl4F4UIUuefUwGi+ZvT/rChg9zoBkQ== -"@wordpress/scripts@^23.7.1": - version "23.7.1" - resolved "https://registry.yarnpkg.com/@wordpress/scripts/-/scripts-23.7.1.tgz#ca4b4a744698f94f14f63312ab0f789826f7e531" - integrity sha512-KllePk/QAJo0X6Vp5pkXv2CzCRjo1fIJ60mdd28gP0W7iG+ncw+SGSEWbXOjSInQHzq/FnZf2RkkKWsu//2c8A== +"@wordpress/scripts@^23.7.2": + version "23.7.2" + resolved "https://registry.yarnpkg.com/@wordpress/scripts/-/scripts-23.7.2.tgz#93f38354d799ed91cc9adc27144927c6935ce413" + integrity sha512-/VyDK5IeiJyB3abGsj/NbNgnj6fA9AkITCGQkelZX/IbNbGekR1+ocEr2qD2aigHuXVF10Be7W8yRBAXdHy/VQ== dependencies: "@babel/core" "^7.16.0" "@pmmmwh/react-refresh-webpack-plugin" "^0.5.2" @@ -3145,7 +3145,7 @@ "@wordpress/browserslist-config" "^4.1.2" "@wordpress/dependency-extraction-webpack-plugin" "^3.7.0" "@wordpress/eslint-plugin" "^12.9.0" - "@wordpress/jest-preset-default" "^8.5.1" + "@wordpress/jest-preset-default" "^8.5.2" "@wordpress/npm-package-json-lint-config" "^4.1.2" "@wordpress/postcss-plugins-preset" "^3.10.0" "@wordpress/prettier-config" "^1.4.0" @@ -5331,10 +5331,10 @@ date-fns@^2.24.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== -date-fns@^2.29.1: - version "2.29.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.1.tgz#9667c2615525e552b5135a3116b95b1961456e60" - integrity sha512-dlLD5rKaKxpFdnjrs+5azHDFOPEu4ANy/LTh04A1DTzMM7qoajmKCBc8pkKRFT41CNzw+4gQh79X5C+Jq27HAw== +date-fns@^2.29.2: + version "2.29.2" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.2.tgz#0d4b3d0f3dff0f920820a070920f0d9662c51931" + integrity sha512-0VNbwmWJDS/G3ySwFSJA3ayhbURMTJLtwM2DTxf9CWondCnh6DTNlO9JgRSq6ibf4eD0lfMJNBxUdEAHHix+bA== debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" @@ -6697,7 +6697,7 @@ expect@^27.5.1: jest-matcher-utils "^27.5.1" jest-message-util "^27.5.1" -expect@^28.1.3: +expect@^28.0.0, expect@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== @@ -9295,16 +9295,6 @@ jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-diff@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.1.tgz#1a3eedfd81ae79810931c63a1d0f201b9120106c" - integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== - dependencies: - chalk "^4.0.0" - diff-sequences "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.1" - jest-diff@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" @@ -9500,16 +9490,6 @@ jest-matcher-utils@^27.4.2, jest-matcher-utils@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^28.0.0: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" - integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== - dependencies: - chalk "^4.0.0" - jest-diff "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.1" - jest-matcher-utils@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" @@ -12342,7 +12322,7 @@ pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^28.0.0, pretty-format@^28.1.1: +pretty-format@^28.0.0: version "28.1.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw==