PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.10.7
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.10.7
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.10.7, at classes/Visualizer/Gutenberg/src/Components/Import/RemoteImport.js

145 lines 4.2 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 /**
17 * Internal dependencies
18 */
19 import JSONImport from './JSONImport.js';
20
21 class RemoteImport extends Component {
22 constructor() {
23 super( ...arguments );
24 }
25
26 render() {
27 return (
28 <PanelBody
29 title={ __( 'Import data from URL' ) }
30 initialOpen={ false }
31 className="visualizer-advanced-panel"
32 >
33
34 <PanelBody
35 title={ __( 'One Time Import' ) }
36 className="visualizer-inner-sections"
37 initialOpen={ false }
38 >
39
40 <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>
41 <p>
42 { __( 'If you are unsure about how to format your data CSV then please take a look at this sample: ' ) }
43 <ExternalLink href={ `${visualizerLocalize.absurl}samples/${this.props.chart['visualizer-chart-type']}.csv` }>
44 { `${this.props.chart['visualizer-chart-type']}.csv` }
45 </ExternalLink>
46 </p>
47 <p>{ __( 'You can also import data from Google Spreadsheet.' ) }</p>
48
49 <TextControl
50 placeholder={ __( 'Please enter the URL of your CSV file' ) }
51 value={ this.props.chart['visualizer-chart-url'] ? this.props.chart['visualizer-chart-url'] : '' }
52 onChange={ this.props.editURL }
53 />
54
55 <Button
56 isPrimary
57 isLarge
58 isBusy={ 'uploadData' === this.props.isLoading }
59 disabled={ 'uploadData' === this.props.isLoading }
60 onClick={ () => this.props.uploadData( false ) }
61 >
62 { __( 'Import Data' ) }
63 </Button>
64
65 </PanelBody>
66
67 { ( 'business' === visualizerLocalize.isPro ) ?
68 <PanelBody
69 title={ __( 'Schedule Import' ) }
70 className="visualizer-inner-sections"
71 initialOpen={ false }
72 >
73
74 <p>{ __( 'You can choose here to synchronize your chart data with a remote CSV file. ' ) }</p>
75 <p>{ __( 'You can also synchronize with your Google Spreadsheet file.' ) }</p>
76 <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>
77
78 <TextControl
79 placeholder={ __( 'Please enter the URL of your CSV file' ) }
80 value={ this.props.chart['visualizer-chart-url'] ? this.props.chart['visualizer-chart-url'] : '' }
81 onChange={ this.props.editURL }
82 />
83
84 <SelectControl
85 label={ __( 'How often do you want to check the url?' ) }
86 value={ this.props.chart['visualizer-chart-schedule'] ? this.props.chart['visualizer-chart-schedule'] : 1 }
87 options={ [
88 { label: __( 'Each hour' ), value: '1' },
89 { label: __( 'Live' ), value: '0' },
90 { label: __( 'Each 12 hours' ), value: '12' },
91 { label: __( 'Each day' ), value: '24' },
92 { label: __( 'Each 3 days' ), value: '72' }
93 ] }
94 onChange={ this.props.editSchedule }
95 />
96
97 <Button
98 isPrimary
99 isLarge
100 isBusy={ 'uploadData' === this.props.isLoading }
101 disabled={ 'uploadData' === this.props.isLoading }
102 onClick={ () => this.props.uploadData( true ) }
103 >
104 { __( 'Save Schedule' ) }
105 </Button>
106
107 </PanelBody> :
108 <PanelBody
109 title={ __( 'Schedule Import' ) }
110 icon="lock"
111 className="visualizer-inner-sections"
112 initialOpen={ false }
113 >
114
115 <p>{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }</p>
116
117 <Button
118 isPrimary
119 href={ visualizerLocalize.proTeaser }
120 target="_blank"
121 >
122 { __( 'Upgrade Now' ) }
123 </Button>
124
125 </PanelBody>
126 }
127
128 <JSONImport
129 id={ this.props.id }
130 chart={ this.props.chart }
131 editSchedule={ this.props.editJSONSchedule }
132 editJSONURL={ this.props.editJSONURL }
133 editJSONHeaders={ this.props.editJSONHeaders }
134 editJSONRoot={ this.props.editJSONRoot }
135 editJSONPaging={ this.props.editJSONPaging }
136 JSONImportData={ this.props.JSONImportData }
137 />
138
139 </PanelBody>
140 );
141 }
142 }
143
144 export default RemoteImport;
145