Skip to content

Commit 33247e0

Browse files
Merge pull request #1016 from Codeinwp/bugfix/1015
Fixed compatibility issue with the FSE editor
2 parents c74c0a4 + 6839e87 commit 33247e0

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

classes/Visualizer/Gutenberg/Block.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function __construct() {
6767
* Enqueue front end and editor JavaScript and CSS
6868
*/
6969
public function enqueue_gutenberg_scripts() {
70-
global $wp_version;
70+
global $wp_version, $pagenow;
7171

7272
$blockPath = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/block.js';
7373
$handsontableJS = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/handsontable.js';
@@ -112,6 +112,7 @@ public function enqueue_gutenberg_scripts() {
112112
'sqlTable' => $table_col_mapping,
113113
'chartsPerPage' => defined( 'TI_CYPRESS_TESTING' ) ? 20 : 6,
114114
'proFeaturesLocked' => Visualizer_Module_Admin::proFeaturesLocked(),
115+
'isFullSiteEditor' => 'site-editor.php' === $pagenow,
115116
);
116117
wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
117118

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/build/handsontable.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/src/Editor.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,18 @@ class Editor extends Component {
466466
);
467467
}
468468

469+
if ( '1' === visualizerLocalize.isFullSiteEditor ) {
470+
return (
471+
<Notice
472+
status="error"
473+
isDismissible={ false }
474+
>
475+
<Dashicon icon="chart-pie" />
476+
{ __( 'Visualizer block charts are currently not available for selection here, you must visit the library, get the shortcode, and add the chart here in a shortcode tag.' ) }
477+
</Notice>
478+
);
479+
}
480+
469481
if ( 'renderChart' === this.state.route && null !== this.state.chart ) {
470482
return (
471483
<ChartRender

0 commit comments

Comments
 (0)