Skip to content

Commit

Permalink
Release 3.0.4 (#143)
Browse files Browse the repository at this point in the history
* Fix update preset dropdown not saving

* Add translator messages

* Reset preset when changing page

* Version bump
  • Loading branch information
johngodley authored Aug 19, 2022
1 parent 0fd315c commit 31707e7
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 50 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -38,15 +38,15 @@
},
"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",
"@types/react-redux": "^7.1.24",
"@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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion search-regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/component/presets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Presets( props ) {
};
const updatePreset = ( ev ) => {
ev.preventDefault();
onUpdatePreset( currentPreset, search );
onUpdatePreset( currentPreset, { search } );
};

const presetActions = [];
Expand Down
2 changes: 2 additions & 0 deletions src/component/replace-progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
5 changes: 4 additions & 1 deletion src/component/rest-api-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ class RestApiStatus extends React.Component {

<div className="api-result-progress">
<span className={ statusClass }>
{ percent < 100 && sprintf( __( 'Testing - %s%%', 'search-regex' ), percent ) }
{
/* translators: test percent */
percent < 100 && sprintf( __( 'Testing - %s%%', 'search-regex' ), percent )
}
{ percent >= 100 && this.getApiStatusText( status ) }
</span>

Expand Down
2 changes: 1 addition & 1 deletion src/component/result/column/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function ResultColumn( props ) {
{ ! showMore && contexts.length > MORE_CONTEXTS && (
<p>
<button className="button button-secondary" onClick={ () => setShowMore( true ) } type="button">
{ sprintf( _n( 'Show %s more', 'Show %s more', remainingCount, 'search-regex' ),
{ /* translators: number of results to show */ sprintf( _n( 'Show %s more', 'Show %s more', remainingCount, 'search-regex' ),
new Intl.NumberFormat( window.SearchRegexi10n.locale ).format( remainingCount ),
) }
</button>
Expand Down
1 change: 1 addition & 0 deletions src/component/schema/modify/types/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
} ) ) }
/>
Expand Down
13 changes: 11 additions & 2 deletions src/page/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 <CacheDetect />;
}

function pageChange() {
onClearErrors();
onResetPreset();
}

return (
<ErrorBoundary renderCrash={ CrashHandler } extra={ { page } }>
<div className="wrap searchregex">
<PageRouter page={ page } setPage={ setPage } onPageChange={ onClearErrors }>
<PageRouter page={ page } setPage={ setPage } onPageChange={ pageChange }>
<h1 className="wp-heading-inline">{ getTitles()[ page ] }</h1>

<UpdateNotice />
Expand Down Expand Up @@ -107,6 +113,9 @@ function mapDispatchToProps( dispatch ) {
onClearNotices: () => {
dispatch( clearNotices() );
},
onResetPreset: () => {
dispatch( setPreset( null ) );
}
};
}

Expand Down
1 change: 1 addition & 0 deletions src/page/home/update-notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function UpdateNotice() {
<Notice>
<p>
{ createInterpolateElement(
/* translators: version installed */
sprintf( __( 'Version %s installed! Please read the {{url}}release notes{{/url}} for details.', 'search-regex' ), update_notice ),
{
url: <ExternalLink url={ 'https://searchregex.com/blog/searchregex-version-' + update_notice.replace( '.', '-' ) + '/' } />
Expand Down
60 changes: 20 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit 31707e7

Please sign in to comment.