Skip to content

Commit a837c2d

Browse files
Merge pull request #483 from HardeepAsrani/development
Add notice for ChartsJS
2 parents e5dd5f9 + f169035 commit a837c2d

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

classes/Visualizer/Gutenberg/Block.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public function enqueue_gutenberg_scripts() {
9595
'proTeaser' => Visualizer_Plugin::PRO_TEASER_URL,
9696
'absurl' => VISUALIZER_ABSURL,
9797
'charts' => Visualizer_Module_Admin::_getChartTypesLocalized(),
98+
'adminPage' => menu_page_url( 'visualiezr', false ),
9899
);
99100
wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
100101

classes/Visualizer/Gutenberg/build/block.js

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

classes/Visualizer/Gutenberg/build/handsontable.js

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: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const {
3131
ButtonGroup,
3232
Dashicon,
3333
Placeholder,
34-
Spinner
34+
Spinner,
35+
Notice
3536
} = wp.components;
3637

3738
class Editor extends Component {
@@ -354,30 +355,34 @@ class Editor extends Component {
354355
{ 'home' === this.state.route && (
355356
<div className="visualizer-settings__content">
356357

358+
<Notice
359+
status="warning"
360+
isDismissible={ false }
361+
>
362+
{ __( 'ChartsJS charts are currently not a avialable to select form the block. You can find them on Visualizer admin page.' ) }
363+
</Notice>
364+
357365
<div className="visualizer-settings__content-description">
358366
{ __( 'Make a new chart or display an existing one?' ) }
359367
</div>
360368

361369
{ /* You can apply "locked" class to lock any of the following list items. */ }
362370

363-
<div
364-
className="visualizer-settings__content-option locked"
365-
onClick={ () => {
366-
return false;
367-
this.setState({ route: 'createChart' });
368-
this.props.setAttributes({ route: 'createChart' });
369-
} }
371+
<a
372+
href={ visualizerLocalize.adminPage }
373+
target="_blank"
374+
className="visualizer-settings__content-option"
370375
>
371376

372377
<span className="visualizer-settings__content-option-title">
373378
{ __( 'Create a new chart' ) }
374379
</span>
375380

376381
<div className="visualizer-settings__content-option-icon">
377-
<Dashicon icon="lock" />
382+
<Dashicon icon="arrow-right-alt2" />
378383
</div>
379384

380-
</div>
385+
</a>
381386

382387
<div
383388
className="visualizer-settings__content-option"

0 commit comments

Comments
 (0)