Skip to content

Commit 39e1141

Browse files
Merge branch '3.4.0' of https://github.com/codeinwp/visualizer into issue-579
2 parents 48a9cc6 + 142a137 commit 39e1141

File tree

12 files changed

+85
-13
lines changed

12 files changed

+85
-13
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/Gutenberg/build/block.css

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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/Google.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,29 @@ public static function enqueue_assets( $deps = array() ) {
8383
return 'visualizer-render-google-lib';
8484
}
8585

86-
86+
/**
87+
* Renders the role field.
88+
*
89+
* @since 3.4.0
90+
*
91+
* @access protected
92+
*/
93+
protected function _renderRoleField( $index ) {
94+
self::_renderSelectItem(
95+
esc_html__( 'Special Role', 'visualizer' ),
96+
'series[' . $index . '][role]',
97+
isset( $this->series[ $index ]['role'] ) ? $this->series[ $index ]['role'] : '',
98+
array(
99+
'' => esc_html__( 'Default (Data)', 'visualizer' ),
100+
'annotation' => esc_html__( 'Annotation', 'visualizer' ),
101+
'annotationText' => esc_html__( 'Annotation Text', 'visualizer' ),
102+
'certainty' => esc_html__( 'Certainty', 'visualizer' ),
103+
'emphasis' => esc_html__( 'Emphasis', 'visualizer' ),
104+
'scope' => esc_html__( 'Scope', 'visualizer' ),
105+
'style' => esc_html__( 'Style', 'visualizer' ),
106+
'tooltip' => esc_html__( 'Tooltip', 'visualizer' ),
107+
),
108+
sprintf( esc_html__( 'Determines whether the series has to be used for a special role as mentioned in %1$shere%2$s. You can view a few examples %3$shere%4$s.', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/roles#what-roles-are-available" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/1160-roles-for-series-visualizer" target="_blank">', '</a>' )
109+
);
110+
}
87111
}

classes/Visualizer/Render/Sidebar/Graph.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ protected function _renderSeries( $index ) {
422422
isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
423423
null
424424
);
425+
426+
$this->_renderRoleField( $index );
427+
425428
}
426429

427430
/**

classes/Visualizer/Render/Sidebar/Linear.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ protected function _renderSeries( $index ) {
289289
isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
290290
null
291291
);
292+
293+
$this->_renderRoleField( $index );
294+
292295
}
293296

294297
}

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: ... } }.

0 commit comments

Comments
 (0)