{
-
-
- const onChangeFormat = (style, formatToUpdate) => {
- const currentFormat = formatToUpdate == DEFAULT_FORMAT ? format : customFormat
- const field = formatToUpdate == DEFAULT_FORMAT ? 'format' : 'customFormat'
- onFormatChange(Object.assign({}, currentFormat, {style}), field)
- }
-
- const onDecimalChange = (value, formatToUpdate) => {
- const currentFormat = formatToUpdate == DEFAULT_FORMAT ? format : customFormat
- const field = formatToUpdate == DEFAULT_FORMAT ? 'format' : 'customFormat'
- onFormatChange(Object.assign({}, currentFormat, {
- minimumFractionDigits: value,
- maximumFractionDigits: value
- }), field)
- }
- const onCurrencyChange = (currency, formatToUpdate) => {
- const currentFormat = formatToUpdate == DEFAULT_FORMAT ? format : customFormat
- const field = formatToUpdate == DEFAULT_FORMAT ? 'format' : 'customFormat'
- onFormatChange(Object.assign({}, currentFormat, {currency}), field)
- }
-
-
- return [
-
-
- {
- onChangeFormat(value, DEFAULT_FORMAT)
- }}
- options={styles}
- />
-
- <>{format.style === "currency" &&
- {
- onCurrencyChange(value, DEFAULT_FORMAT)
- }}
- value={format.currency}
- options={currencies}
- />
- }>
-
- {
- onDecimalChange(value, DEFAULT_FORMAT)
- }}
- value={format.minimumFractionDigits}
- />
-
- , <>
- {!hiddenCustomAxisFormat &&
- onUseCustomAxisFormatChange(value)}/>
-
- }
- >
- ,
- <>
- {useCustomAxisFormat &&
-
- {
- onChangeFormat(value, CUSTOM_FORMAT)
- }}
- options={styles}
- />
-
- <>{customFormat.style === "currency" &&
- {
- onCurrencyChange(value, CUSTOM_FORMAT)
- }}
- value={customFormat.currency}
- options={currencies}
- />
- }>
-
- {
- onDecimalChange(value, CUSTOM_FORMAT)
- }}
- value={customFormat.minimumFractionDigits}
- />
-
- }>
-
- ]
-}
-
-export default Format
\ No newline at end of file
+/**
+ * @deprecated
+ *
+ * THIS FILE IS DEPRECATED AND MUST NOT BE USED.
+ *
+ * Use the Format component from the shared commons package instead:
+ *
+ * import { Format } from '@devgateway/dvz-wp-commons';
+ *
+ * This file exists only to surface a loud runtime error if it is accidentally
+ * re-introduced. It does NOT contain the real implementation — that lives in:
+ *
+ * data-viz-wordpress/packages/commons/src/Format.jsx
+ *
+ * To expose Prefix / Suffix fields, pass the showPrefixSuffix={true} prop.
+ */
+
+import { Format as CommonsFormat } from '@devgateway/dvz-wp-commons';
+
+const DeprecatedFormat = (props) => {
+ console.error(
+ '[DEPRECATED] charts/Format.jsx is deprecated and must not be used.\n' +
+ 'Import Format from @devgateway/dvz-wp-commons instead:\n' +
+ " import { Format } from '@devgateway/dvz-wp-commons';\n" +
+ 'To expose Prefix/Suffix fields pass showPrefixSuffix={true}.'
+ );
+ return
;
+};
+
+export default DeprecatedFormat;
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/GroupTotalSetting.jsx b/plugins/wp-react-blocks-plugin/blocks/charts/GroupTotalSetting.jsx
index 84829d3e9..73c4e5a0a 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/GroupTotalSetting.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/GroupTotalSetting.jsx
@@ -1,6 +1,6 @@
import {PanelBody, PanelRow, RangeControl, SelectControl, TextControl, ToggleControl} from '@wordpress/components';
import {__} from '@wordpress/i18n';
-import Format from "./Format.jsx";
+import { Format } from '@devgateway/dvz-wp-commons';
import Papa from "papaparse";
const Settings = ({setAttributes,allMeasures,
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/Info.jsx b/plugins/wp-react-blocks-plugin/blocks/charts/Info.jsx
index 396b8b447..7227f49d3 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/Info.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/Info.jsx
@@ -1,7 +1,7 @@
import {AnglePickerControl, PanelBody, PanelRow, SelectControl} from '@wordpress/components';
import {__} from '@wordpress/i18n';
import { ChartColors, ChartLegends} from '@devgateway/dvz-wp-commons'
-import Format from "./Format.jsx";
+import { Format } from '@devgateway/dvz-wp-commons';
const PieOptions = (props) => {
const {setAttributes, attributes: {figure}} = props;
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/Line.jsx b/plugins/wp-react-blocks-plugin/blocks/charts/Line.jsx
index 1c221d4ea..50b2b525d 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/Line.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/Line.jsx
@@ -4,7 +4,7 @@ import {__} from '@wordpress/i18n';
import { ChartColors, ChartLegends} from '@devgateway/dvz-wp-commons'
import AxisConfig from './AxisConfig.jsx'
import Labels from "./Labels.jsx"
-import Format from "./Format.jsx"
+import { Format } from '@devgateway/dvz-wp-commons'
import Papa from 'papaparse'
import Sort from "./Sort.jsx"
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/README.md b/plugins/wp-react-blocks-plugin/blocks/charts/README.md
index c75a323b5..b782d9580 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/README.md
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/README.md
@@ -59,7 +59,7 @@ A Gutenberg block that embeds a configurable data visualisation chart (Bar, Line
| `dualMode` | Boolean | `false` | Enable toggling between chart and info-graphic views |
| `toggleInfoLabel` | String | `"Info Graphic"` | Button label for info view |
| `toggleChartLabel` | String | `"Chart"` | Button label for chart view |
-| `dataSource` | String | `"NIDS"` | Data source attribution text |
+| `dataSource` | String | `"Source"` | Data source attribution text |
| `dataSourceLabel` | String | `"Source"` | Label preceding the data source text |
### Pie / Radar (selected)
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/Radar.jsx b/plugins/wp-react-blocks-plugin/blocks/charts/Radar.jsx
index 0b6b62253..3e63997f8 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/Radar.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/Radar.jsx
@@ -3,7 +3,7 @@ import {__} from '@wordpress/i18n';
import { ChartColors, ChartLegends} from '@devgateway/dvz-wp-commons'
import AxisConfig from './AxisConfig.jsx'
import Labels from "./Labels.jsx"
-import Format from "./Format.jsx"
+import { Format } from '@devgateway/dvz-wp-commons'
import Papa from 'papaparse'
diff --git a/plugins/wp-react-blocks-plugin/blocks/charts/index.js b/plugins/wp-react-blocks-plugin/blocks/charts/index.js
index 100a7b673..60aa620c5 100644
--- a/plugins/wp-react-blocks-plugin/blocks/charts/index.js
+++ b/plugins/wp-react-blocks-plugin/blocks/charts/index.js
@@ -1,8 +1,8 @@
-import {__} from '@wordpress/i18n';
-import {registerBlockType} from '@wordpress/blocks';
+import { __ } from '@wordpress/i18n';
+import { registerBlockType } from '@wordpress/blocks';
import BlockSave from "./BlockSave";
import BlockEdit from "./BlockEdit";
-import {ChartIcon, BLOCKS_NS, BLOCKS_CATEGORY} from '@devgateway/dvz-wp-commons'
+import { ChartIcon, BLOCKS_NS, BLOCKS_CATEGORY } from '@devgateway/dvz-wp-commons'
registerBlockType(BLOCKS_NS + '/chart',
{
@@ -16,6 +16,16 @@ registerBlockType(BLOCKS_NS + '/chart',
default: 500,
},
+ // Optional explicit chart-area height, decoupled from the total
+ // `height` (the resizable box). When > 0, the chart renders at this
+ // height and the legend flows naturally above/below it; the container
+ // grows to fit. When 0 (default) the legacy behavior is kept, so
+ // existing charts are unaffected.
+ chartHeight: {
+ type: 'number',
+ default: 0,
+ },
+
type: {
type: 'string',
default: "bar",
@@ -89,7 +99,7 @@ registerBlockType(BLOCKS_NS + '/chart',
},
dataSource: {
type: 'String',
- default: "NIDS"
+ default: "Source"
},
legendPosition: {
@@ -344,10 +354,10 @@ registerBlockType(BLOCKS_NS + '/chart',
types: {
type: "Array",
default: [
- {label: 'Bar', value: 'bar', supports: {singleMeasure: false, singleDimension: false}},
- {label: 'Pie', value: 'pie', supports: {singleMeasure: false, singleDimension: false}},
- {label: 'Line', value: 'line', supports: {singleMeasure: false, singleDimension: true}},
- {label: 'Radar', value: 'radar', supports: {singleMeasure: true, singleDimension: true}}
+ { label: 'Bar', value: 'bar', supports: { singleMeasure: false, singleDimension: false } },
+ { label: 'Pie', value: 'pie', supports: { singleMeasure: false, singleDimension: false } },
+ { label: 'Line', value: 'line', supports: { singleMeasure: false, singleDimension: true } },
+ { label: 'Radar', value: 'radar', supports: { singleMeasure: true, singleDimension: true } }
]
},
barColor: {
diff --git a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx
index 691f808d0..5e75da487 100644
--- a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx
@@ -16,7 +16,7 @@ import Property from "./utils/Property";
import BreaksGenerator from "./utils/BreaksGenerator";
import { PanelColorSettings } from "@wordpress/block-editor";
import PatternGenerator from "./utils/PatternGenerator";
-import Format from '../../charts/Format.jsx'
+import { Format } from '@devgateway/dvz-wp-commons'
import { isSupersetAPI } from '@devgateway/dvz-wp-commons';
import GradientGenerator from "./utils/GradientGenerator";
diff --git a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx
index 66c18afb0..bacd78d71 100644
--- a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx
@@ -16,7 +16,7 @@ import Property from "./utils/Property";
import BreaksGenerator from "./utils/BreaksGenerator";
import { PanelColorSettings } from "@wordpress/block-editor";
import PatternGenerator from "./utils/PatternGenerator";
-import Format from '../../charts/Format.jsx';
+import { Format } from '@devgateway/dvz-wp-commons';
import { isSupersetAPI } from '@devgateway/dvz-wp-commons';
const FilterSelector = ({ param, index, options, onUpdateFilterParam }) => {
diff --git a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/utils/MapMeasures.jsx b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/utils/MapMeasures.jsx
index d2f090171..00d015012 100644
--- a/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/utils/MapMeasures.jsx
+++ b/plugins/wp-react-blocks-plugin/blocks/d3Map/layers/utils/MapMeasures.jsx
@@ -1,7 +1,7 @@
import {__} from '@wordpress/i18n';
import {CheckboxControl, PanelBody, PanelRow, SelectControl, ToggleControl} from '@wordpress/components';
-import Format from '../../../charts/Format.jsx'
+import { Format } from '@devgateway/dvz-wp-commons'
import {togglePanel} from '@devgateway/dvz-wp-commons';
import {getTranslation} from '@devgateway/dvz-wp-commons';
diff --git a/plugins/wp-react-blocks-plugin/blocks/data-paragraph/BlockEdit.js b/plugins/wp-react-blocks-plugin/blocks/data-paragraph/BlockEdit.js
index 83d15dfe2..fb0c12456 100644
--- a/plugins/wp-react-blocks-plugin/blocks/data-paragraph/BlockEdit.js
+++ b/plugins/wp-react-blocks-plugin/blocks/data-paragraph/BlockEdit.js
@@ -29,7 +29,7 @@ import {
isSupersetAPI
} from '@devgateway/dvz-wp-commons';
-import Format from "../charts/Format.jsx";
+import { Format } from '@devgateway/dvz-wp-commons';
import '@wordpress/format-library';
diff --git a/plugins/wp-react-blocks-plugin/blocks/grouped-bars/BlockEdit.js b/plugins/wp-react-blocks-plugin/blocks/grouped-bars/BlockEdit.js
index 895ae2ae4..f7a9d70bf 100644
--- a/plugins/wp-react-blocks-plugin/blocks/grouped-bars/BlockEdit.js
+++ b/plugins/wp-react-blocks-plugin/blocks/grouped-bars/BlockEdit.js
@@ -17,7 +17,7 @@ import {togglePanel} from '@devgateway/dvz-wp-commons';
import {Measures} from '@devgateway/dvz-wp-commons';
import {DataFilters} from '@devgateway/dvz-wp-commons';
import {isSupersetAPI} from '@devgateway/dvz-wp-commons';
-import Format from "../charts/Format.jsx";
+import { Format } from '@devgateway/dvz-wp-commons';
import {getTranslation} from '@devgateway/dvz-wp-commons';
const defaultFormat = {
@@ -399,6 +399,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
format={format}
customFormat={{}}
useCustomAxisFormat={false}
+ showPrefixSuffix={true}
onFormatChange={(newFormat, field) => {
console.log("newFormat", newFormat)
setAttributes({format: newFormat})
@@ -798,6 +799,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
format={selectedMap[k].format || defaultFormat}
customFormat={{}}
useCustomAxisFormat={false}
+ showPrefixSuffix={true}
onFormatChange={(newFormat) => this.updateMeasureFormat(k, newFormat)}
onUseCustomAxisFormatChange={() => {}}
/>
diff --git a/plugins/wp-react-blocks-plugin/blocks/map/README.md b/plugins/wp-react-blocks-plugin/blocks/map/README.md
index b3a18775d..ba622194d 100644
--- a/plugins/wp-react-blocks-plugin/blocks/map/README.md
+++ b/plugins/wp-react-blocks-plugin/blocks/map/README.md
@@ -37,7 +37,7 @@ A Gutenberg block that renders an interactive choropleth/symbol map by embedding
| `showOverallValue` | `Boolean` | `false` | Display an overall/national average value on the map. |
| `nationalAverageLabel` | `String` | `"National Prevalence Avg"` | Label for the national average annotation. |
| `dataSourceLabel` | `String` | `"Source"` | Label prefix for the data source credit. |
-| `dataSourceText` | `String` | `"NIDS"` | Data source credit text. |
+| `dataSourceText` | `String` | `"Source"` | Data source credit text. |
| `labelFontSize` | `Numeric` | `12` | Font size (px) for admin unit labels on the map. |
| `labelFontWeight` | `String` | `"normal"` | Font weight for admin unit labels. |
| `labelFontColor` | `String` | `"%23595959"` (URL-encoded `#595959`) | Colour for admin unit labels. |
diff --git a/plugins/wp-react-blocks-plugin/blocks/map/index.js b/plugins/wp-react-blocks-plugin/blocks/map/index.js
index a52f7d079..da609bc3f 100644
--- a/plugins/wp-react-blocks-plugin/blocks/map/index.js
+++ b/plugins/wp-react-blocks-plugin/blocks/map/index.js
@@ -1,10 +1,10 @@
-import {__} from '@wordpress/i18n';
-import {registerBlockType} from '@wordpress/blocks';
+import { __ } from '@wordpress/i18n';
+import { registerBlockType } from '@wordpress/blocks';
import BlockSave from "./BlockSave";
import BlockEdit from "./BlockEdit";
-import {GenericIcon, BLOCKS_NS, BLOCKS_CATEGORY} from '@devgateway/dvz-wp-commons';
+import { GenericIcon, BLOCKS_NS, BLOCKS_CATEGORY } from '@devgateway/dvz-wp-commons';
-registerBlockType(BLOCKS_NS+'/map',
+registerBlockType(BLOCKS_NS + '/map',
{
title: __('Data Map'),
icon: GenericIcon,
@@ -21,7 +21,7 @@ registerBlockType(BLOCKS_NS+'/map',
},
dataSourceText: {
type: 'String',
- default: "NIDS"
+ default: "Source"
},
source: {
type: 'string',
@@ -62,22 +62,22 @@ registerBlockType(BLOCKS_NS+'/map',
},
types: {
type: "Array",
- default: [{label: 'Map', value: 'map', supports: {singleMeasure: false, singleDimension: false}}]
+ default: [{ label: 'Map', value: 'map', supports: { singleMeasure: false, singleDimension: false } }]
},
- showLegendLabels:{
- type:'Boolean',
+ showLegendLabels: {
+ type: 'Boolean',
default: false
},
legendBreaks: {
type: "Array",
- default: [{ min: 0, max: 2.99, color: '#66A3D9', label: '', filters: []}, { min: 3, max: 4.99, color: '#BC91D9', label: '', filters: []}, { min: 5, color: '#F26363', label: '', filters: []}]
+ default: [{ min: 0, max: 2.99, color: '#66A3D9', label: '', filters: [] }, { min: 3, max: 4.99, color: '#BC91D9', label: '', filters: [] }, { min: 5, color: '#F26363', label: '', filters: [] }]
},
showNoDataLegendItem: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
- zoomEnabled:{
- type:'Boolean',
+ zoomEnabled: {
+ type: 'Boolean',
default: false
},
mapFile: {
@@ -86,7 +86,7 @@ registerBlockType(BLOCKS_NS+'/map',
},
enabledLayers: {
type: "Array",
- default:[]
+ default: []
},
mainLayerId: {
type: "String",
@@ -101,38 +101,38 @@ registerBlockType(BLOCKS_NS+'/map',
default: "zone"
},
hasMultipleMeasures: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
- mapCenter:{
+ mapCenter: {
type: "String",
default: "NGA"
},
- mapLabelShowValue:{
- type:'Boolean',
+ mapLabelShowValue: {
+ type: 'Boolean',
default: false
},
- showTooltip:{
- type:'Boolean',
+ showTooltip: {
+ type: 'Boolean',
default: true
},
measureSelectorLabel: {
type: "String",
default: ""
},
- valueFormat:{
+ valueFormat: {
type: "String",
default: "%({value},2)"
},
- showOverallValue:{
- type:'Boolean',
+ showOverallValue: {
+ type: 'Boolean',
default: false
},
autoGenerateBreaks: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
- numberOfBreaks:{
+ numberOfBreaks: {
type: 'Numeric',
default: 5
},
@@ -141,14 +141,14 @@ registerBlockType(BLOCKS_NS+'/map',
default: 'reds'
},
showNoDataLabel: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
group: {
type: 'String',
default: 'default',
},
- mapSymbols:{
+ mapSymbols: {
type: 'Array',
default: []
},
@@ -168,11 +168,11 @@ registerBlockType(BLOCKS_NS+'/map',
type: 'String',
default: 'normal',
},
- legendFontSize:{
+ legendFontSize: {
type: 'Numeric',
default: 12,
},
- legendFontWeight:{
+ legendFontWeight: {
type: 'String',
default: 'normal',
},
@@ -192,7 +192,7 @@ registerBlockType(BLOCKS_NS+'/map',
type: "String",
default: "USD"
},
- tooltipFontSize:{
+ tooltipFontSize: {
type: 'Numeric',
default: 14,
},
@@ -216,20 +216,20 @@ registerBlockType(BLOCKS_NS+'/map',
type: 'String',
default: encodeURIComponent("#000"),
},
- highlightedLocation:{
+ highlightedLocation: {
type: "String",
default: ""
},
- highlightedLocLabelFormat:{
+ highlightedLocLabelFormat: {
type: "String",
default: "{locationName} - Score: #({value},2)"
},
- tooltipFormat:{
+ tooltipFormat: {
type: "String",
default: "{locationName} %({value},2) \n {label}: %({value},2)"
},
showNoDataTooltip: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
mapContainerBgColor: {
@@ -256,7 +256,7 @@ registerBlockType(BLOCKS_NS+'/map',
type: "Object",
default: {}
},
- pointLabelFormat:{
+ pointLabelFormat: {
type: "String",
default: "%({value},2)"
},
@@ -273,19 +273,19 @@ registerBlockType(BLOCKS_NS+'/map',
default: ""
},
enableSummaryView: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
aggregationFormula: {
type: 'String',
default: "COUNT"
},
- zoomLevelToShowPoints:{
+ zoomLevelToShowPoints: {
type: "Numeric",
default: 2
},
zoomOnFilter: {
- type:'Boolean',
+ type: 'Boolean',
default: false
},
zoomOnFilterField: {
diff --git a/plugins/wp-react-blocks-plugin/blocks/measures/BlockEdit.js b/plugins/wp-react-blocks-plugin/blocks/measures/BlockEdit.js
index bd01170f5..2022db2bf 100644
--- a/plugins/wp-react-blocks-plugin/blocks/measures/BlockEdit.js
+++ b/plugins/wp-react-blocks-plugin/blocks/measures/BlockEdit.js
@@ -12,7 +12,7 @@ import {
} from '@wordpress/components';
import {__} from '@wordpress/i18n';
import {BlockEditWithAPIMetadata} from '@devgateway/dvz-wp-commons'
-import Format from '../charts/Format.jsx'
+import { Format } from '@devgateway/dvz-wp-commons'
import {useState} from "@wordpress/element";
import {v4 as uuidv4} from "uuid";
diff --git a/plugins/wp-react-blocks-plugin/blocks/pdf-button/index.js b/plugins/wp-react-blocks-plugin/blocks/pdf-button/index.js
index cda50761c..9e085395a 100644
--- a/plugins/wp-react-blocks-plugin/blocks/pdf-button/index.js
+++ b/plugins/wp-react-blocks-plugin/blocks/pdf-button/index.js
@@ -1,8 +1,8 @@
-import {__} from '@wordpress/i18n';
-import {registerBlockType} from '@wordpress/blocks';
+import { __ } from '@wordpress/i18n';
+import { registerBlockType } from '@wordpress/blocks';
import BlockSave from "./BlockSave";
import BlockEdit from "./BlockEdit";
-import {GenericIcon, BLOCKS_NS, BLOCKS_CATEGORY} from '@devgateway/dvz-wp-commons';
+import { GenericIcon, BLOCKS_NS, BLOCKS_CATEGORY } from '@devgateway/dvz-wp-commons';
registerBlockType(BLOCKS_NS + 'viz-components/pdf-button',
{
@@ -12,7 +12,7 @@ registerBlockType(BLOCKS_NS + 'viz-components/pdf-button',
attributes: {
buttonLabel: {
type: 'string',
- default: "Download Prevalence Factsheet"
+ default: "Download"
},
height: {
type: 'Numeric',
@@ -42,4 +42,4 @@ registerBlockType(BLOCKS_NS + 'viz-components/pdf-button',
save: BlockSave,
}
)
-;
+ ;
diff --git a/wp-theme/_admin_styles.php b/wp-theme/_admin_styles.php
index 64c64e167..6801aa63f 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
diff --git a/wp-theme/_settings.php b/wp-theme/_settings.php
index 7688b1439..7c74e9070 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;
+ });
})
);
})