← All changes
|
classes/Visualizer/Gutenberg/src/Components/Import/FileImport.js
+42
-23
3.1.3
→
3.11.7
View file →
| @@ -36,36 +36,55 @@ | ||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | render() { |
| 39 | 39 | return ( |
| 40 | - <PanelBody | |
| 41 | - title={ __( 'Import data from file' ) } | |
| 42 | - initialOpen={ false } | |
| 43 | - > | |
| 40 | + ( 'community' !== visualizerLocalize.isPro ) ? ( | |
| 41 | + <PanelBody | |
| 42 | + title={ __( 'Import data from file' ) } | |
| 43 | + initialOpen={ false } | |
| 44 | + > | |
| 44 | 45 | |
| 45 | - <p>{ __( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).' ) }</p> | |
| 46 | - <p> | |
| 47 | - { __( 'If you are unsure about how to format your data CSV then please take a look at this sample: ' ) } | |
| 48 | - <ExternalLink href={ `${visualizerLocalize.absurl}samples/${this.props.chart['visualizer-chart-type']}.csv` }> | |
| 49 | - { `${this.props.chart['visualizer-chart-type']}.csv` } | |
| 50 | - </ExternalLink> | |
| 51 | - </p> | |
| 46 | + <p>{ __( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).' ) }</p> | |
| 47 | + <p> | |
| 48 | + { __( 'If you are unsure about how to format your data CSV then please take a look at this sample: ' ) } | |
| 49 | + <ExternalLink href={ `${visualizerLocalize.absurl}samples/${this.props.chart['visualizer-chart-type']}.csv` }> | |
| 50 | + { `${this.props.chart['visualizer-chart-type']}.csv` } | |
| 51 | + </ExternalLink> | |
| 52 | + </p> | |
| 52 | 53 | |
| 53 | - <input | |
| 54 | - type="file" | |
| 55 | - accept="text/csv" | |
| 56 | - ref={ this.uploadInput } | |
| 57 | - onChange={ this.fileUploaded } | |
| 58 | - /> | |
| 54 | + <input | |
| 55 | + type="file" | |
| 56 | + accept="text/csv" | |
| 57 | + ref={ this.uploadInput } | |
| 58 | + onChange={ this.fileUploaded } | |
| 59 | + /> | |
| 59 | 60 | |
| 60 | - <Button | |
| 61 | - isPrimary | |
| 62 | - onClick={ this.uploadImport } | |
| 61 | + <Button | |
| 62 | + isPrimary | |
| 63 | + onClick={ this.uploadImport } | |
| 64 | + > | |
| 65 | + { this.state.uploadLabel } | |
| 66 | + </Button> | |
| 67 | + | |
| 68 | + </PanelBody> | |
| 69 | + ) : ( | |
| 70 | + <PanelBody | |
| 71 | + title={ __( 'Import data from file' ) } | |
| 72 | + icon="lock" | |
| 73 | + initialOpen={ false } | |
| 63 | 74 | > |
| 64 | - { this.state.uploadLabel } | |
| 65 | - </Button> | |
| 75 | + <p>{ __( 'Enable this feature in PRO version!' ) }</p> | |
| 66 | 76 | |
| 67 | - </PanelBody> | |
| 77 | + <Button | |
| 78 | + isPrimary | |
| 79 | + href={ visualizerLocalize.proTeaser } | |
| 80 | + target="_blank" | |
| 81 | + > | |
| 82 | + { __( 'Upgrade Now' ) } | |
| 83 | + </Button> | |
| 84 | + | |
| 85 | + </PanelBody> | |
| 86 | + ) | |
| 68 | 87 | ); |
| 69 | 88 | } |
| 70 | 89 | } |
| 71 | 90 | |