| @@ -105,10 +105,9 @@ | ||
| 105 | 105 | |
| 106 | 106 | this.setState({ |
| 107 | 107 | route: 'chartSelect', |
| 108 | 108 | chart: result['chart_data'], |
| 109 | - isLoading: true, | |
| 110 | - isModified: true | |
| 109 | + isLoading: false | |
| 111 | 110 | }); |
| 112 | 111 | |
| 113 | 112 | this.props.setAttributes({ |
| 114 | 113 | id, |
| @@ -123,11 +122,8 @@ | ||
| 123 | 122 | } |
| 124 | 123 | |
| 125 | 124 | editSettings( settings ) { |
| 126 | 125 | let chart = { ...this.state.chart }; |
| 127 | - if ( '1' !== settings.pagination ) { | |
| 128 | - delete settings.pageSize; | |
| 129 | - } | |
| 130 | 126 | chart['visualizer-settings'] = settings; |
| 131 | 127 | this.setState({ |
| 132 | 128 | chart, |
| 133 | 129 | isModified: true |
| @@ -468,20 +464,8 @@ | ||
| 468 | 464 | </Notice> |
| 469 | 465 | ); |
| 470 | 466 | } |
| 471 | 467 | |
| 472 | - if ( '1' === visualizerLocalize.isFullSiteEditor ) { | |
| 473 | - return ( | |
| 474 | - <Notice | |
| 475 | - status="error" | |
| 476 | - isDismissible={ false } | |
| 477 | - > | |
| 478 | - <Dashicon icon="chart-pie" /> | |
| 479 | - { __( '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.' ) } | |
| 480 | - </Notice> | |
| 481 | - ); | |
| 482 | - } | |
| 483 | - | |
| 484 | 468 | if ( 'renderChart' === this.state.route && null !== this.state.chart ) { |
| 485 | 469 | return ( |
| 486 | 470 | <ChartRender |
| 487 | 471 | id={ this.props.attributes.id } |
| @@ -586,9 +570,9 @@ | ||
| 586 | 570 | { ( 'showCharts' === this.state.route || 'chartSelect' === this.state.route ) && |
| 587 | 571 | <ButtonGroup> |
| 588 | 572 | |
| 589 | 573 | <Button |
| 590 | - variant="secondary" | |
| 574 | + isDefault | |
| 591 | 575 | isLarge |
| 592 | 576 | onClick={ () => { |
| 593 | 577 | let route; |
| 594 | 578 | if ( 'showCharts' === this.state.route ) { |
| @@ -595,9 +579,9 @@ | ||
| 595 | 579 | route = 'home'; |
| 596 | 580 | } else if ( 'chartSelect' === this.state.route ) { |
| 597 | 581 | route = 'showCharts'; |
| 598 | 582 | } |
| 599 | - this.setState({ route, isLoading: false }); | |
| 583 | + this.setState({ route }); | |
| 600 | 584 | this.props.setAttributes({ route }); |
| 601 | 585 | } } |
| 602 | 586 | > |
| 603 | 587 | { __( 'Back' ) } |
| @@ -607,13 +591,13 @@ | ||
| 607 | 591 | <Fragment> |
| 608 | 592 | |
| 609 | 593 | { false === this.state.isModified ? |
| 610 | 594 | <Button |
| 611 | - variant="secondary" | |
| 595 | + isDefault | |
| 612 | 596 | isLarge |
| 613 | 597 | className="visualizer-bttn-done" |
| 614 | 598 | onClick={ () => { |
| 615 | - this.setState({ route: 'renderChart', isModified: true }); | |
| 599 | + this.setState({ route: 'renderChart' }); | |
| 616 | 600 | this.props.setAttributes({ route: 'renderChart' }); |
| 617 | 601 | } } |
| 618 | 602 | > |
| 619 | 603 | { __( 'Done' ) } |