Skip to content

Commit 3aa1119

Browse files
authored
Merge pull request #100 from dingo-d/bugfix/2.2.1
2.3.0 ver
2 parents 0ba8fe8 + b46e102 commit 3aa1119

23 files changed

+12735
-22921
lines changed

.stylelintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "stylelint-config-wordpress",
2+
"extends": "@wordpress/stylelint-config/scss",
33
"rules": {
44
"color-hex-length": "long",
55
"color-hex-case": "upper",

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
1313

1414
_No documentation available about unreleased changes as of yet._
1515

16+
## [2.3.0] - 2023-01-04
17+
18+
This release will fix the affected change due to Croatia entering the Euro-zone.
19+
20+
### Added
21+
22+
* Add a fallback to checking if offers exist in case the invoices don't exist
23+
* Add a way to clear Croatian National Bank API transient response
24+
25+
### Changed
26+
27+
* Update HNB API link to a new v3 working one
28+
* Fix conversion logic for currencies
29+
30+
### Fixed
31+
32+
* Fix filter type for plugin link hook
33+
1634
## [2.2.0] - 2022-01-18
1735

1836
### Added
@@ -351,6 +369,8 @@ A lot of issues were fixed. The plugin should be more stable and work better now
351369
* Initial release
352370

353371
[Unreleased]: https://github.com/dingo-d/woo-solo-api/compare/master...HEAD
372+
[2.3.0]: https://github.com/dingo-d/woo-solo-api/compare/2.2.0...2.3.0
373+
[2.2.0]: https://github.com/dingo-d/woo-solo-api/compare/2.1.0...2.2.0
354374
[2.1.0]: https://github.com/dingo-d/woo-solo-api/compare/2.0.8...2.1.0
355375
[2.0.8]: https://github.com/dingo-d/woo-solo-api/compare/2.0.7...2.0.8
356376
[2.0.7]: https://github.com/dingo-d/woo-solo-api/compare/2.0.6...2.0.7

README.txt

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
=== Woo Solo Api ===
22
Contributors: dingo_bastard
33
Tags: woocommerce, api, solo api, solo, api integration, shop, payment, woo
4-
Requires at least: 5.3
4+
Requires at least: 5.8
55
Requires PHP: 7.3
6-
Tested up to: 5.9
7-
Stable tag: 2.2.0
8-
WC requires at least: 4.0.0
9-
WC tested up to: 6.0.0
6+
Tested up to: 6.1.1
7+
Stable tag: 2.3.0
8+
WC requires at least: 6.0.0
9+
WC tested up to: 7.2.2
1010
License: MIT
1111
License URI: https://opensource.org/licenses/MIT
1212

@@ -50,9 +50,9 @@ Be sure you have WooCommerce plugin installed first, otherwise you'll get an err
5050

5151
== Requirements ==
5252

53-
* PHP 7.3 or greater
54-
* WordPress 5.3 or above
55-
* WooCommerce 4.0.0 or above
53+
* PHP 7.3 or greater (not fully tested with PHP 8+)
54+
* WordPress 5.8 or above
55+
* WooCommerce 6.0.0 or above
5656
* Non IE browser
5757

5858
== Screenshots ==
@@ -66,6 +66,25 @@ Be sure you have WooCommerce plugin installed first, otherwise you'll get an err
6666

6767
== Changelog ==
6868

69+
= 2.3.0 =
70+
Release Date: January 4th, 2023
71+
72+
This release will fix the affected change due to Croatia entering the Euro-zone.
73+
74+
### Added
75+
76+
* Add a fallback to checking if offers exist in case the invoices don't exist
77+
* Add a way to clear Croatian National Bank API transient response
78+
79+
### Changed
80+
81+
* Update HNB API link to a new v3 working one
82+
* Fix conversion logic for currencies
83+
84+
### Fixed
85+
86+
* Fix filter type for plugin link hook
87+
6988
= 2.2.0 =
7089
Release Date: January 18th, 2022
7190

assets/dev/scripts/const/currencies.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const {__} = wp.i18n;
22

33
export const currencies = [
4-
{value: '1', label: 'HRK - kn'},
4+
{value: '14', label: 'EUR - '},
55
{value: '2', label: 'AUD - $'},
66
{value: '3', label: 'CAD - $'},
77
{value: '4', label: 'CZK - Kč'},
@@ -14,6 +14,5 @@ export const currencies = [
1414
{value: '11', label: 'GBP - £'},
1515
{value: '12', label: 'USD - $'},
1616
{value: '13', label: 'BAM - KM'},
17-
{value: '14', label: 'EUR - €'},
1817
{value: '15', label: 'PLN - zł'},
1918
];

assets/dev/scripts/index.jsx

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ class App extends Component {
212212
hasErrors: true,
213213
});
214214

215+
// Should be a React reference, not DOM!
215216
const target = document.querySelector(`[name=${Object.keys(errors)[0]}]`);
216217

217218
window.scrollTo({
@@ -243,7 +244,7 @@ class App extends Component {
243244

244245
objectHasEmptyProperties(object) {
245246
for (const key in object) {
246-
if (object.hasOwnProperty(key)) {
247+
if (object?.hasOwnProperty(key)) {
247248
if (object[key] != null && object[key] !== '' && typeof(object[key]) !== 'undefined') {
248249
return false;
249250
}
@@ -263,7 +264,7 @@ class App extends Component {
263264
}
264265

265266
renderError(type) {
266-
if (this.state.errors.hasOwnProperty(type)) {
267+
if (this.state.errors?.hasOwnProperty(type)) {
267268
return (
268269
<p className='components-base-control__error'>
269270
{__('Validation error: ', 'woo-solo-api') + this.state.errors[type]}
@@ -273,7 +274,7 @@ class App extends Component {
273274
}
274275

275276
hasErrorClass(type) {
276-
return this.state.errors.hasOwnProperty(type) ? 'has-error' : '';
277+
return this.state.errors?.hasOwnProperty(type) ? 'has-error' : '';
277278
}
278279

279280
@bind
@@ -294,6 +295,20 @@ class App extends Component {
294295
});
295296
}
296297

298+
@bind
299+
deleteTransient() {
300+
this.setState({
301+
isApiRequestOver: false,
302+
});
303+
304+
apiFetch({path: '/woo-solo-api/v1/solo-clear-currency-transient'}).then(res => {
305+
this.setState({
306+
apiResponse: res ? __('Transient deleted', 'woo-solo-api') : __('Transient not deleted', 'woo-solo-api'),
307+
isApiRequestOver: true
308+
});
309+
});
310+
}
311+
297312
renderNotification() {
298313
return (
299314
<div className='notice'>
@@ -633,8 +648,7 @@ class App extends Component {
633648
<PanelRow className='components-panel__row--single'>
634649
<h4>{__('This serves for testing purposes only', 'woo-solo-api')}</h4>
635650
<p className='components-base-control__notice'>
636-
{__('Pressing the button will make a request to your Solo API account,' +
637-
'and will list all the invoices you have', 'woo-solo-api')}
651+
{__('Pressing the button will make a request to your Solo API account, and will list all the invoices or offers you have', 'woo-solo-api')}
638652
</p>
639653
<pre className='components-base-control__code'>
640654
<code>
@@ -650,6 +664,17 @@ class App extends Component {
650664
>
651665
{__('Make a request', 'woo-solo-api')}
652666
</Button>
667+
<p className='components-base-control__notice'>
668+
{__('Pressing the button will clear the Croatian Central Bank (HNB) API transient.', 'woo-solo-api')}
669+
</p>
670+
<Button
671+
isPrimary
672+
isLarge
673+
disabled={this.state.isLoading}
674+
onClick={this.deleteTransient}
675+
>
676+
{__('Delete exchange rate transient', 'woo-solo-api')}
677+
</Button>
653678
</PanelRow>
654679
</PanelBody>
655680
<div className='options-wrapper__item'>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"codeception/util-universalframework": "^1.0",
3333
"codedungeon/phpunit-result-printer": "^0.31.0",
3434
"dealerdirect/phpcodesniffer-composer-installer": "^v0.7.1",
35-
"lucatume/wp-browser": "^3.0.19",
35+
"lucatume/wp-browser": "^3.1",
3636
"php-stubs/woocommerce-stubs": "^v6.0.0",
3737
"php-stubs/wordpress-globals": "^v0.2.0",
3838
"phpcompatibility/php-compatibility": "^9.3.5",
@@ -67,7 +67,7 @@
6767
"standards:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf",
6868
"analyze": "@php ./vendor/bin/phpstan analyze",
6969
"selenium:start": "selenium-server -port 4444",
70-
"chrome:start" : "chromedriver --url-base=/wd/hub",
70+
"chrome:start" : "chromedriver --url-base=/wd/hub",
7171
"test:build": "@php ./vendor/bin/codecept build",
7272
"test:clean": "@php ./vendor/bin/codecept clean",
7373
"test:acceptance": "@php ./vendor/bin/codecept run Acceptance --ansi",

0 commit comments

Comments
 (0)