PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.3
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / classes / Visualizer / Gutenberg / src / Components / Import / RemoteImport.js

RemoteImport.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.3.3, at classes/Visualizer/Gutenberg/src/Components/Import/RemoteImport.js

128 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 const { __ } = wp.i18n;
5
6 const { Component } = wp.element;
7
8 const {
9 Button,
10 ExternalLink,
11 PanelBody,
12 SelectControl,
13 TextControl
14 } = wp.components;
15
16 class RemoteImport extends Component {
17 constructor() {
18 super( ...arguments );
19 }
20
21 render() {
22 return (
23 <PanelBody
24 title={ __( 'Import data from URL' ) }
25 initialOpen={ false }
26 className="visualizer-advanced-panel"
27 >
28
29 <PanelBody
30 title={ __( 'One Time Import' ) }
31 className="visualizer-inner-sections"
32 initialOpen={ false }
33 >
34
35 <p>{ __( 'You can use this to import data from a remote CSV file. 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>
36 <p>
37 { __( 'If you are unsure about how to format your data CSV then please take a look at this sample: ' ) }
38 <ExternalLink href={ `${visualizerLocalize.absurl}samples/${this.props.chart['visualizer-chart-type']}.csv` }>
39 { `${this.props.chart['visualizer-chart-type']}.csv` }
40 </ExternalLink>
41 </p>
42 <p>{ __( 'You can also import data from Google Spreadsheet.' ) }</p>
43
44 <TextControl
45 placeholder={ __( 'Please enter the URL of your CSV file' ) }
46 value={ this.props.chart['visualizer-chart-url'] ? this.props.chart['visualizer-chart-url'] : '' }
47 onChange={ this.props.editURL }
48 />
49
50 <Button
51 isPrimary
52 isLarge
53 isBusy={ 'uploadData' === this.props.isLoading }
54 disabled={ 'uploadData' === this.props.isLoading }
55 onClick={ () => this.props.uploadData( false ) }
56 >
57 { __( 'Import Data' ) }
58 </Button>
59
60 </PanelBody>
61
62 { ( 'business' === visualizerLocalize.isPro ) ?
63 <PanelBody
64 title={ __( 'Schedule Import' ) }
65 className="visualizer-inner-sections"
66 initialOpen={ false }
67 >
68
69 <p>{ __( 'You can choose here to synchronize your chart data with a remote CSV file. ' ) }</p>
70 <p>{ __( 'You can also synchronize with your Google Spreadsheet file.' ) }</p>
71 <p>{ __( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.' ) }</p>
72
73 <TextControl
74 placeholder={ __( 'Please enter the URL of your CSV file' ) }
75 value={ this.props.chart['visualizer-chart-url'] ? this.props.chart['visualizer-chart-url'] : '' }
76 onChange={ this.props.editURL }
77 />
78
79 <SelectControl
80 label={ __( 'How often do you want to check the url?' ) }
81 value={ this.props.chart['visualizer-chart-schedule'] ? this.props.chart['visualizer-chart-schedule'] : 1 }
82 options={ [
83 { label: __( 'Each hour' ), value: '1' },
84 { label: __( 'Each 12 hours' ), value: '12' },
85 { label: __( 'Each day' ), value: '24' },
86 { label: __( 'Each 3 days' ), value: '72' }
87 ] }
88 onChange={ this.props.editSchedule }
89 />
90
91 <Button
92 isPrimary
93 isLarge
94 isBusy={ 'uploadData' === this.props.isLoading }
95 disabled={ 'uploadData' === this.props.isLoading }
96 onClick={ () => this.props.uploadData( true ) }
97 >
98 { __( 'Save Schedule' ) }
99 </Button>
100
101 </PanelBody> :
102 <PanelBody
103 title={ __( 'Schedule Import' ) }
104 icon="lock"
105 className="visualizer-inner-sections"
106 initialOpen={ false }
107 >
108
109 <p>{ __( 'Enable this feature in BUSINESS version!' ) }</p>
110
111 <Button
112 isPrimary
113 href={ visualizerLocalize.proTeaser }
114 target="_blank"
115 >
116 { __( 'Buy Now' ) }
117 </Button>
118
119 </PanelBody>
120 }
121
122 </PanelBody>
123 );
124 }
125 }
126
127 export default RemoteImport;
128