Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fix broken dropdown style issue 
- Add block support in widget area
- Add wp alpha color picker support
- Fix broken chart layout issue when add long title
  • Loading branch information
selul authored Aug 4, 2021
2 parents 5445962 + 1dd9a04 commit c3fb3ce
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 9 deletions.
8 changes: 8 additions & 0 deletions classes/Visualizer/Gutenberg/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ public function enqueue_gutenberg_scripts() {
$version = $this->version;
}

if ( ! wp_script_is( 'visualizer-datatables', 'registered' ) ) {
wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core' ), Visualizer_Plugin::VERSION );
}

if ( ! wp_style_is( 'visualizer-datatables', 'registered' ) ) {
wp_register_style( 'visualizer-datatables', VISUALIZER_ABSURL . 'css/lib/datatables.min.css', array(), Visualizer_Plugin::VERSION );
}

// Enqueue the bundled block JS file
wp_enqueue_script( 'handsontable', $handsontableJS );
wp_enqueue_script( 'visualizer-gutenberg-block', $blockPath, array( 'wp-api', 'handsontable', 'visualizer-datatables', 'moment' ), $version, true );
Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Gutenberg/build/block.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions classes/Visualizer/Gutenberg/build/block.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion classes/Visualizer/Gutenberg/src/Components/ChartRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ChartRender extends Component {

render() {

let chartVersion = google.visualization.Version || 'current';
let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current';

let chart, footer;

Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Gutenberg/src/Components/ChartSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ChartSelect extends Component {

render() {

let chartVersion = google.visualization.Version || 'current';
let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current';

let chart, footer;

Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Gutenberg/src/Components/Charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Charts extends Component {

render() {

let chartVersion = google.visualization.Version || 'current';
let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current';

const { charts, isBusy, chartsLoaded, perPage } = this.state;

Expand Down
5 changes: 5 additions & 0 deletions classes/Visualizer/Gutenberg/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@
z-index: 999999 !important;
}

.components-panel {
.components-select-control {
height:auto !important;
}
}
@media ( min-width: 768px ) {
.visualizer-json-query-modal {
width: 668px;
Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Render/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ protected static function _renderColorPickerItem( $title, $name, $value, $defaul
echo '<div class="viz-section-item">';
echo '<b>', $title, '</b>';
echo '<div>';
echo '<input type="text" class="color-picker-hex color-picker" data-alpha="true" name="', $name, '" maxlength="7" placeholder="', esc_attr__( 'Hex Value', 'visualizer' ), '" value="', is_null( $value ) ? $default : esc_attr( $value ), '" data-default-color="', $default, '">';
echo '<input type="text" class="color-picker-hex color-picker" data-alpha-enabled="true" name="', $name, '" maxlength="7" placeholder="', esc_attr__( 'Hex Value', 'visualizer' ), '" value="', is_null( $value ) ? $default : esc_attr( $value ), '" data-default-color="', $default, '">';
echo '</div>';
echo '</div>';
}
Expand Down
3 changes: 3 additions & 0 deletions css/frame.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ div.viz-group-content .viz-group-description {
padding: 0;
}

#viz-tabs .wp-color-picker {
width: 4rem !important;
}
/******************************************************************************/
/******************************** TOOLBAR ***********************************/
/******************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions css/library.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ input:checked + .visualizer-slider:before {
padding-bottom: 5px;
font-weight: bold;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

div.visualizer-library-form .viz-filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Test Free - gutenberg (datatable)', function() {
cy.wrap(charts).each((value, i, array) => {
// insert a visualizer block
cy.get('div.edit-post-header__toolbar button.edit-post-header-toolbar__inserter-toggle').click();
cy.get('.edit-post-layout__inserter-panel-content').then(function ($popup) {
cy.get('.edit-post-editor__inserter-panel-content').then(function ($popup) {
cy.wrap($popup).find('.block-editor-inserter__search-input').type('visua');
cy.wrap($popup).find('.block-editor-block-types-list .editor-block-list-item-visualizer-chart').should('have.length', 1);
cy.wrap($popup).find('.block-editor-block-types-list .editor-block-list-item-visualizer-chart').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/gutenberg/free-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Test Free - gutenberg', function() {
cy.wrap(charts).each((value, i, array) => {
// insert a visualizer block
cy.get('div.edit-post-header__toolbar button.edit-post-header-toolbar__inserter-toggle').click();
cy.get('.edit-post-layout__inserter-panel-content').then(function ($popup) {
cy.get('.edit-post-editor__inserter-panel-content').then(function ($popup) {
cy.wrap($popup).find('.block-editor-inserter__search-input').type('visua');
cy.wrap($popup).find('.block-editor-block-types-list .editor-block-list-item-visualizer-chart').should('have.length', 1);
cy.wrap($popup).find('.block-editor-block-types-list .editor-block-list-item-visualizer-chart').click();
Expand Down
1 change: 1 addition & 0 deletions js/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
margin = width * 0.02;

width *= 0.305;
$(this).prev( '.visualizer-chart-title' ).width(width - 14);
$(this).width(width - 14).height(width * 0.75).parent().css('margin-right', margin + 'px').css('margin-bottom', margin + 'px');
});
};
Expand Down

0 comments on commit c3fb3ce

Please sign in to comment.