Skip to content

Commit c76ed08

Browse files
Merge pull request #592 from contactashish13/issue-585
DataTable charts - Infinity Pagination
2 parents 43889d4 + 0e3acdf commit c76ed08

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
matrix:
77
fast_finish: true
88
include:
9+
- php: 7.3
910
- php: 7.2
1011
- php: 7.1
1112
- php: 7.0

classes/Visualizer/Gutenberg/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function enqueue_gutenberg_scripts() {
9393
}
9494
}
9595

96-
$table_col_mapping = Visualizer_Source_Query_Params::get_all_db_tables_column_mapping();
96+
$table_col_mapping = Visualizer_Source_Query_Params::get_all_db_tables_column_mapping( null, false );
9797

9898
$translation_array = array(
9999
'isPro' => $type,

classes/Visualizer/Module/Sources.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,14 @@ public function filterChartData( $data, $chart_id ) {
130130
* @return string The new html code.
131131
*/
132132
public function addProUpsell( $old, $feature = null ) {
133+
$pro_features = Visualizer_Module::get_features_for_license( 1 );
133134
$biz_features = Visualizer_Module::get_features_for_license( 2 );
134135
$return = '';
135136
$feature = strval( $feature );
136-
if ( empty( $feature ) || ( in_array( $feature, $biz_features, true ) && ! apply_filters( 'visualizer_is_business', false ) ) ) {
137+
if ( empty( $feature ) ||
138+
( in_array( $feature, $biz_features, true ) && ! apply_filters( 'visualizer_is_business', false ) ) ||
139+
( in_array( $feature, $pro_features, true ) && ! Visualizer_Module::is_pro() )
140+
) {
137141
$msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' );
138142
if ( Visualizer_Module::is_pro() && in_array( $feature, $biz_features, true ) ) {
139143
$msg = sprintf( __( 'Upgrade your license to at least the %s version to activate this feature!', 'visualizer' ), 'DEVELOPER' );

classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ protected function _renderTableSettings() {
176176
'pageLength_int',
177177
$this->pageLength_int,
178178
esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
179-
'10'
179+
10,
180+
'number',
181+
array( 'min' => 1 )
180182
);
181183

182184
echo '<div class="viz-section-delimiter section-delimiter"></div>';

js/render-datatables.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@
140140
if(parseInt(valoo) > 0){
141141
valoo = parseInt(valoo);
142142
}
143+
if(i === 'pageLength' && (valoo === '' || parseInt(valoo) < 0)){
144+
valoo = 1;
145+
}
143146
}
144147

145148
// if the setting name has an '_' this means it is a sub-setting e.g. select_items means { select: { items: ... } }.

js/render-google.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ var __visualizer_chart_images = [];
7474
}
7575
}
7676
}
77-
settings.series = adjusted_series;
77+
if(adjusted_series.length > 0){
78+
settings.series = adjusted_series;
79+
}
7880
}
81+
7982
if ( settings['explorer_enabled'] && settings['explorer_enabled'] == 'true' ) { // jshint ignore:line
8083
var $explorer = {};
8184
$explorer['keepInBounds'] = true;

0 commit comments

Comments
 (0)