← All changes
|
classes/Visualizer/Gutenberg/src/Components/Sidebar/FrontendActions.js
+41
-1
3.1.3
→
3.7.7
View file →
| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | Fragment |
| 9 | 9 | } = wp.element; |
| 10 | 10 | |
| 11 | 11 | const { |
| 12 | + Button, | |
| 12 | 13 | CheckboxControl, |
| 13 | 14 | PanelBody |
| 14 | 15 | } = wp.components; |
| 15 | 16 | |
| @@ -30,10 +31,12 @@ | ||
| 30 | 31 | |
| 31 | 32 | render() { |
| 32 | 33 | |
| 33 | 34 | const settings = this.props.chart['visualizer-settings']; |
| 35 | + const type = this.props.chart['visualizer-chart-type']; | |
| 34 | 36 | |
| 35 | 37 | return ( |
| 38 | + ( '' !== visualizerLocalize.proFeaturesLocked ) ? | |
| 36 | 39 | <PanelBody |
| 37 | 40 | title={ __( 'Frontend Actions' ) } |
| 38 | 41 | initialOpen={ false } |
| 39 | 42 | className="visualizer-advanced-panel" |
| @@ -110,13 +113,50 @@ | ||
| 110 | 113 | this.props.edit( settings ); |
| 111 | 114 | } } |
| 112 | 115 | /> |
| 113 | 116 | |
| 117 | + { ( -1 >= [ 'dataTable', 'tabular', 'gauge', 'table' ].indexOf( type ) ) && ( | |
| 118 | + <CheckboxControl | |
| 119 | + label={ __( 'Download Image' ) } | |
| 120 | + help={ __( 'To download the chart as an image.' ) } | |
| 121 | + checked={ ( 0 <= settings.actions.indexOf( 'image' ) ) } | |
| 122 | + onChange={ e => { | |
| 123 | + if ( 0 <= settings.actions.indexOf( 'image' ) ) { | |
| 124 | + const index = settings.actions.indexOf( 'image' ); | |
| 125 | + if ( -1 !== index ) { | |
| 126 | + settings.actions.splice( index, 1 ); | |
| 127 | + } | |
| 128 | + } else { | |
| 129 | + settings.actions.push( 'image' ); | |
| 130 | + } | |
| 131 | + this.props.edit( settings ); | |
| 132 | + } } | |
| 133 | + /> | |
| 134 | + ) } | |
| 135 | + | |
| 114 | 136 | </Fragment> |
| 115 | 137 | |
| 116 | 138 | ) } |
| 117 | 139 | |
| 118 | - </PanelBody> | |
| 140 | + </PanelBody> : | |
| 141 | + <PanelBody | |
| 142 | + title={ __( 'Frontend Actions' ) } | |
| 143 | + initialOpen={ false } | |
| 144 | + icon="lock" | |
| 145 | + className="visualizer-advanced-panel" | |
| 146 | + > | |
| 147 | + | |
| 148 | + <p>{ __( 'Enable this feature in PRO version!' ) }</p> | |
| 149 | + | |
| 150 | + <Button | |
| 151 | + isPrimary | |
| 152 | + href={ visualizerLocalize.proTeaser } | |
| 153 | + target="_blank" | |
| 154 | + > | |
| 155 | + { __( 'Buy Now' ) } | |
| 156 | + </Button> | |
| 157 | + | |
| 158 | + </PanelBody> | |
| 119 | 159 | ); |
| 120 | 160 | } |
| 121 | 161 | } |
| 122 | 162 | |