From 72bd55c5f26397fb928e45e33e4f73b89ada74b0 Mon Sep 17 00:00:00 2001 From: Sebastian Dimunzio Date: Tue, 31 Mar 2026 13:12:58 -0300 Subject: [PATCH 1/8] fix: Check HTTP response status before showing cache-clear success message The cache-eviction requests now properly validate that each fetch response has response.ok === true before indicating success to the user. Previously, the code would show 'Cache cleared successfully!' even when the server returned 4xx or 5xx error responses, since fetch() only rejects on network errors, not HTTP error status codes. Now if any cache eviction request fails with a non-2xx status, an error is thrown with details (app name, status code, and status text) which is caught by the existing error handler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- wp-theme/_settings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-theme/_settings.php b/wp-theme/_settings.php index c590c687..7de2d1bf 100644 --- a/wp-theme/_settings.php +++ b/wp-theme/_settings.php @@ -284,7 +284,13 @@ function wp_superset_cache_evict_callback() } return Promise.all( supersetApps.map(function (app) { - return fetch('/api/' + app + '/cacheEvict'); + return fetch('/api/' + app + '/cacheEvict') + .then(function (response) { + if (!response.ok) { + throw new Error('Cache eviction failed for ' + app + ': ' + response.status + ' ' + response.statusText); + } + return response; + }); }) ); }) From 5e22d965cb11fd17addecafc0ed7bb315ddcad8a Mon Sep 17 00:00:00 2001 From: Sebastian Dimunzio Date: Tue, 31 Mar 2026 13:14:08 -0300 Subject: [PATCH 2/8] fix: Import createRef from @wordpress/element and use it instead of React.createRef Blocks.jsx was using React.createRef() without importing React, which would cause a ReferenceError at runtime in bundler/module environments that don't provide a global React variable. Fixed by: 1. Importing createRef from @wordpress/element (WordPress recommendation) 2. Replacing React.createRef() with createRef() This follows WordPress best practices for ref creation in components. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/commons/src/Blocks.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/commons/src/Blocks.jsx b/packages/commons/src/Blocks.jsx index 0fb4f5ac..a1b938b3 100644 --- a/packages/commons/src/Blocks.jsx +++ b/packages/commons/src/Blocks.jsx @@ -10,7 +10,7 @@ import { __experimentalText as Text, __experimentalScrollable as Scrollable } from '@wordpress/components'; -import { Component } from '@wordpress/element'; +import { Component, createRef } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; import { togglePanel } from "./Util"; @@ -50,7 +50,7 @@ export class ComponentWithSettings extends Component { } } }, false); - this.iframe = React.createRef(); + this.iframe = createRef(); this.unsubscribe = wp.data.subscribe(() => { const newPreviewMode = wp.data.select("core/editor").getDeviceType(); if (newPreviewMode !== this.state.previewMode) { From 4d696a5124f10afcfbf178adffc7b104b48f3609 Mon Sep 17 00:00:00 2001 From: Sebastian Dimunzio Date: Thu, 9 Apr 2026 09:39:17 -0300 Subject: [PATCH 3/8] fix: Remove unnecessary state check for filters in BlockEdit component --- plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js b/plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js index b0f8c26b..76774572 100644 --- a/plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js +++ b/plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js @@ -293,7 +293,7 @@ class BlockEdit extends BlockEditWithAPIMetadata { } - {app == 'csv' && this.state.filters && + {app == 'csv' && setAttributes({ param })} From d48d6b6114d559041b14a8e0dae4730029586b47 Mon Sep 17 00:00:00 2001 From: Sebastian Dimunzio Date: Fri, 10 Apr 2026 11:51:19 -0300 Subject: [PATCH 4/8] refactor: isolate block editor styles to enqueue_block_editor_assets hook --- wp-theme/_admin_styles.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wp-theme/_admin_styles.php b/wp-theme/_admin_styles.php index 64c64e16..6801aa63 100644 --- a/wp-theme/_admin_styles.php +++ b/wp-theme/_admin_styles.php @@ -3,11 +3,17 @@ function admin_style() { - + // Load semantic-ui only on admin pages that need it (not the block editor canvas). wp_enqueue_style('semantic-styles', 'https://cdn.jsdelivr.net/npm/semantic-ui-css@2.5.0/semantic.min.css'); wp_enqueue_style('react-styles_common', '/../scss/themes/common.css'); +} +add_action('admin_enqueue_scripts', 'admin_style'); + +// editor.css is scoped to .editor-styles-wrapper and must only load inside +// the Gutenberg block editor — not on settings pages, plugins, etc. +function block_editor_style() +{ wp_register_style('admin', get_stylesheet_directory_uri() . '/css/editor.css'); wp_enqueue_style('admin'); - } -add_action('admin_enqueue_scripts', 'admin_style'); \ No newline at end of file +add_action('enqueue_block_editor_assets', 'block_editor_style'); \ No newline at end of file From de30306f73a666d517ff17cc8cd742dc124e11a5 Mon Sep 17 00:00:00 2001 From: Sebastian Dimunzio Date: Tue, 14 Apr 2026 08:51:53 -0300 Subject: [PATCH 5/8] refactor: migrate Format component to @devgateway/dvz-wp-commons and add percentChangeFormat support to big-number-trend block --- packages/commons/src/Format.jsx | 11 +- .../blocks/big-number-trend/BlockEdit.js | 23 +- .../blocks/big-number-trend/BlockSave.js | 21 +- .../blocks/big-number-trend/index.js | 8 + .../blocks/big-number/BlockEdit.js | 2 +- .../blocks/charts/Format.jsx | 476 ++---------------- .../blocks/charts/GroupTotalSetting.jsx | 2 +- .../blocks/charts/Info.jsx | 2 +- .../blocks/charts/Line.jsx | 2 +- .../blocks/charts/Radar.jsx | 2 +- .../blocks/d3Map/layers/Data.jsx | 2 +- .../blocks/d3Map/layers/Flow.jsx | 2 +- .../blocks/d3Map/layers/utils/MapMeasures.jsx | 2 +- .../blocks/data-paragraph/BlockEdit.js | 2 +- .../blocks/grouped-bars/BlockEdit.js | 4 +- .../blocks/measures/BlockEdit.js | 2 +- 16 files changed, 85 insertions(+), 478 deletions(-) diff --git a/packages/commons/src/Format.jsx b/packages/commons/src/Format.jsx index e76eda7f..85660d09 100644 --- a/packages/commons/src/Format.jsx +++ b/packages/commons/src/Format.jsx @@ -341,7 +341,8 @@ export const Format = ({ onUseCustomAxisFormatChange, customFormat, hiddenCustomAxisFormat, - useCustomAxisFormat + useCustomAxisFormat, + showPrefixSuffix = false }) => { @@ -398,7 +399,7 @@ export const Format = ({ value={format.minimumFractionDigits} /> - + {showPrefixSuffix && { @@ -406,8 +407,8 @@ export const Format = ({ }} value={format.prefix} /> - - + } + {showPrefixSuffix && { @@ -415,7 +416,7 @@ export const Format = ({ }} value={format.suffix} /> - + } , <> {!hiddenCustomAxisFormat && setAttributes({ iconUp: media.url })} allowedTypes={["image"]} - value={iconImage} + value={iconUp} render={({ open }) => (