Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fixed Geo chart [PRO] flickering issue
- Added disable legend option for ChartJS chart
- Enhanced security
  • Loading branch information
vytisbulkevicius authored Dec 21, 2022
2 parents f148afb + e93da29 commit 160c59e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions classes/Visualizer/Module/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ public function renderChartPages() {
set_current_screen( 'visualizer_render_chart' );
// check chart, if chart not exists, will create new one and redirects to the same page with proper chart id
$chart_id = isset( $_GET['chart'] ) ? filter_var( $_GET['chart'], FILTER_VALIDATE_INT ) : '';
if ( ! empty( $_POST ) ) {
$_POST = map_deep( $_POST, 'wp_strip_all_tags' );
}
if ( ! $chart_id || ! ( $chart = get_post( $chart_id ) ) || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) {
if ( empty( $_GET['lang'] ) || empty( $_GET['parent_chart_id'] ) ) {
$this->deleteOldCharts();
Expand Down
2 changes: 2 additions & 0 deletions classes/Visualizer/Render/Sidebar/ChartJS.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function __construct( $data = array() ) {
'right' => esc_html__( 'Right of the chart', 'visualizer' ),
'top' => esc_html__( 'Above the chart', 'visualizer' ),
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
'none' => esc_html__( 'Omit the legend', 'visualizer' ),
);

}
Expand Down
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pass": "wordpress",
"urls": {
"library": "/wp-admin/admin.php?page=visualizer",
"samples": "https://s3.amazonaws.com/downloads.themeisle.com/samples-visualizer/"
"samples": "https://s3.amazonaws.com/verti-utils/samples-visualizer/"
},
"chart_types": {
"free": 4,
Expand Down
3 changes: 2 additions & 1 deletion js/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
clearTimeout(timeout);
timeout = setTimeout(function() {
var settings = $('#settings-form').serializeObject();

settings = JSON.stringify( settings ).replace( /<\/?[^>]+(>|$)/g, '' );
settings = JSON.parse( settings );
delete settings['width'];
delete settings['height'];

Expand Down
4 changes: 4 additions & 0 deletions js/render-chartjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@
}
}

settings.plugins = {
legend: settings.legend,
};

handleAxes(settings, chart);

override(settings, chart);
Expand Down
2 changes: 1 addition & 1 deletion js/render-google.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var chartWrapperError = [];
function renderSpecificChart(id, chart) {
var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;

if ( $('#' + id).hasClass('visualizer-chart-loaded') ) {
if ( $('#' + id).hasClass('visualizer-chart-loaded') || $('#' + id).children( ':not(.loader)' ).length > 0 ) {
return;
}

Expand Down

0 comments on commit 160c59e

Please sign in to comment.