Skip to content

Commit

Permalink
Merge branch 'development' into feat/circle-and-progress-style-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 23, 2023
2 parents c0ca601 + 6b8d0c0 commit 9b52b96
Show file tree
Hide file tree
Showing 39 changed files with 240 additions and 80 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
##### [Version 2.3.4](https://github.com/Codeinwp/otter-blocks/compare/v2.3.3...v2.3.4) (2023-08-23)

- Fix z-index with Shape Divider in Section
- Fix Tabs Block Resetting Editor Sidebar When Changing Viewport
- Fix Fatal Error in Form Submission Page in Certain Cases If Viewed as Super Admin
- Fix Progress Bar Height for Mobile Devices
- Fix Stripe Block Not Working Correctly in WP 5.9
- Fix Form Submit Messages Not Working

##### [Version 2.3.3](https://github.com/Codeinwp/otter-blocks/compare/v2.3.2...v2.3.3) (2023-08-11)

- WordPress 6.3 Compatibility
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "codeinwp/otter-blocks",
"description": "A set of awesome Gutenberg Blocks by ThemeIsle.",
"type": "wordpress-plugin",
"version": "2.3.3",
"version": "2.3.4",
"require-dev": {
"squizlabs/php_codesniffer": "^3.3",
"wp-coding-standards/wpcs": "^1",
Expand Down
20 changes: 16 additions & 4 deletions inc/integrations/api/form-response-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ class Form_Data_Response {
* @since 2.0.0
*/
public function __construct() {
$this->response['success'] = false;
$this->response['reasons'] = array();
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
$this->response['displayError'] = 'Error. Please try again.';
$this->response['success'] = false;
$this->response['reasons'] = array();
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
$this->response['displayError'] = 'Error. Please try again.';
$this->response['submitMessage'] = 'Success';
}

/**
Expand Down Expand Up @@ -148,6 +149,17 @@ public function set_reasons( $reasons ) {
return $this;
}

/**
* Set success message.
*
* @param string $message The message.
* @since 2.4
*/
public function set_success_message( $message ) {
$this->response['submitMessage'] = $message;
return $this;
}

/**
* Check if success.
*
Expand Down
5 changes: 5 additions & 0 deletions inc/plugins/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ private function the_otter_banner() {
.otter-banner__version {
align-self: center;
}

/* Hide the "Add New" button for Multisite WP. Second part is for Elementor */
a.page-title-action:first-of-type, #e-admin-top-bar-root:not(.e-admin-top-bar--active)~#wpbody .wrap a.page-title-action:first-of-type {
display: none;
}
</style>
<div class="otter-banner">
<div class="otter-banner__image">
Expand Down
16 changes: 9 additions & 7 deletions inc/server/class-form-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,22 @@ public function frontend( $request ) {
do_action( 'otter_form_after_submit', $form_data );

if ( ! ( $form_data instanceof Form_Data_Request ) ) {
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
$res->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
}

if ( $form_data->has_error() ) {
$res->set_code( $form_data->get_error_code() );
$res->set_code( $form_data->get_error_code() )
->set_display_error( $form_options->get_error_message() );
} else {
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND );
$res->mark_as_success();
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND )
->set_success_message( $form_options->get_submit_message() )
->mark_as_success();
}
}
} catch ( Exception $e ) {
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
$res->add_reason( $e->getMessage() );
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
->add_reason( $e->getMessage() );
$form_data->set_error( Form_Data_Response::ERROR_RUNTIME_ERROR, $e->getMessage() );
$this->send_error_email( $form_data );
} finally {
Expand Down
4 changes: 2 additions & 2 deletions otter-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: Otter – Page Builder Blocks & Extensions for Gutenberg
* Plugin URI: https://themeisle.com/plugins/otter-blocks
* Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
* Version: 2.3.3
* Version: 2.3.4
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-2.0+
Expand All @@ -26,7 +26,7 @@
define( 'OTTER_BLOCKS_BASEFILE', __FILE__ );
define( 'OTTER_BLOCKS_URL', plugins_url( '/', __FILE__ ) );
define( 'OTTER_BLOCKS_PATH', dirname( __FILE__ ) );
define( 'OTTER_BLOCKS_VERSION', '2.3.3' );
define( 'OTTER_BLOCKS_VERSION', '2.3.4' );
define( 'OTTER_BLOCKS_PRO_SUPPORT', true );
define( 'OTTER_BLOCKS_SHOW_NOTICES', false );

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "otter-blocks",
"version": "2.3.3",
"version": "2.3.4",
"description": "Otter – Page Builder Blocks & Extensions for Gutenberg",
"scripts": {
"build": "npm-run-all --parallel prod:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/blocks-animation/blocks-animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Blocks Animation: CSS Animations for Gutenberg Blocks
* Plugin URI: https://github.com/Codeinwp/otter-blocks
* Description: Blocks Animation allows you to add CSS Animations to all of your Gutenberg blocks in the most elegent way.
* Version: 2.3.3
* Version: 2.3.4
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-3.0+
Expand Down
2 changes: 1 addition & 1 deletion plugins/blocks-css/blocks-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Blocks CSS: CSS Editor for Gutenberg Blocks
* Plugin URI: https://github.com/Codeinwp/otter-blocks
* Description: Blocks CSS allows you add custom CSS to your Blocks straight from the Block Editor (Gutenberg).
* Version: 2.3.3
* Version: 2.3.4
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-3.0+
Expand Down
4 changes: 2 additions & 2 deletions plugins/otter-pro/otter-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: Otter Pro
* Plugin URI: https://themeisle.com/plugins/otter-blocks
* Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
* Version: 2.3.3
* Version: 2.3.4
* Author: ThemeIsle
* Author URI: https://themeisle.com
* License: GPL-2.0+
Expand All @@ -28,7 +28,7 @@
define( 'OTTER_PRO_PATH', dirname( __FILE__ ) );
define( 'OTTER_PRO_BUILD_URL', plugins_url( '/', __FILE__ ) . 'build/pro/' );
define( 'OTTER_PRO_BUILD_PATH', dirname( __FILE__ ) . '/build/pro/' );
define( 'OTTER_PRO_VERSION', '2.3.3' );
define( 'OTTER_PRO_VERSION', '2.3.4' );

require_once dirname( __FILE__ ) . '/autoloader.php';
$autoloader = new \ThemeIsle\OtterPro\Autoloader();
Expand Down
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ The Patterns have been designed to make it easier for you to build your site usi

## Changelog ##

##### [Version 2.3.4](https://github.com/Codeinwp/otter-blocks/compare/v2.3.3...v2.3.4) (2023-08-23)

- Fix z-index with Shape Divider in Section
- Fix Tabs Block Resetting Editor Sidebar When Changing Viewport
- Fix Fatal Error in Form Submission Page in Certain Cases If Viewed as Super Admin
- Fix Progress Bar Height for Mobile Devices
- Fix Stripe Block Not Working Correctly in WP 5.9
- Fix Form Submit Messages Not Working




##### [Version 2.3.3](https://github.com/Codeinwp/otter-blocks/compare/v2.3.2...v2.3.3) (2023-08-11)

- WordPress 6.3 Compatibility
Expand Down
12 changes: 12 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ The Patterns have been designed to make it easier for you to build your site usi

== Changelog ==

##### [Version 2.3.4](https://github.com/Codeinwp/otter-blocks/compare/v2.3.3...v2.3.4) (2023-08-23)

- Fix z-index with Shape Divider in Section
- Fix Tabs Block Resetting Editor Sidebar When Changing Viewport
- Fix Fatal Error in Form Submission Page in Certain Cases If Viewed as Super Admin
- Fix Progress Bar Height for Mobile Devices
- Fix Stripe Block Not Working Correctly in WP 5.9
- Fix Form Submit Messages Not Working




##### [Version 2.3.3](https://github.com/Codeinwp/otter-blocks/compare/v2.3.2...v2.3.3) (2023-08-11)

- WordPress 6.3 Compatibility
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/accordion/group/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
} from '../../../helpers/helper-functions.js';

import { useResponsiveAttributes } from '../../../helpers/utility-hooks.js';
import { useTabSwitch } from '../../../helpers/block-utility';

const styles = [
{
Expand Down Expand Up @@ -79,7 +80,7 @@ const Inspector = ({
setAttributes,
getValue
}) => {
const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const globalColorControls = [
{
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/advanced-heading/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import { makeBox } from '../../plugins/copy-paste/utils';
import { _px } from '../../helpers/helper-functions.js';
import { useTabSwitch } from '../../helpers/block-utility';

/**
*
Expand All @@ -65,7 +66,7 @@ const Inspector = ({
setAttributes
}) => {

const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );
const { responsiveSetAttributes, responsiveGetAttributes } = useResponsiveAttributes( setAttributes );

const changeFontFamily = value => {
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/button-group/button/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { ColorDropdownControl, InspectorHeader, SyncControlDropdown, ToogleGroup
import { changeActiveStyle, getActiveStyle, objectOrNumberAsBox } from '../../../helpers/helper-functions.js';
import AutoDisableSyncAttr from '../../../components/auto-disable-sync-attr/index';
import { uniq } from 'lodash';
import { useTabSwitch } from '../../../helpers/block-utility';

const styles = [
{
Expand Down Expand Up @@ -150,7 +151,7 @@ const Inspector = ({
);
};

const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

return (
<InspectorControls>
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/button-group/group/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { InspectorHeader, SyncControlDropdown } from '../../../components/index.
import { getChoice, _i, _px } from '../../../helpers/helper-functions.js';
import TypographySelectorControl from '../../../components/typography-selector-control/index';
import AutoDisableSyncAttr from '../../../components/auto-disable-sync-attr';
import { useTabSwitch } from '../../../helpers/block-utility';

/**
*
Expand Down Expand Up @@ -116,7 +117,7 @@ const Inspector = ({
};
};

const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const [ proxyStore, setProxyStore ] = useState({
padding: makeBoxFromSplitAxis(
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/countdown/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
import { mergeBoxDefaultValues, removeBoxDefaultValues, setUtm } from '../../helpers/helper-functions.js';

import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import { useTabSwitch } from '../../helpers/block-utility';

const defaultFontSizes = [
{
Expand Down Expand Up @@ -174,7 +175,7 @@ const Inspector = ({
}
};

const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const settings = __experimentalGetSettings();

Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/flip/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
import { alignBottom, alignTop, alignCenter as oAlignCenter } from '../../helpers/icons.js';

import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import { useTabSwitch } from '../../helpers/block-utility';

const defaultFontSizes = [
{
Expand Down Expand Up @@ -102,7 +103,7 @@ const Inspector = ({
currentSide,
setSide
}) => {
const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const {
responsiveSetAttributes,
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/blocks/form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,10 @@ const Edit = ({
<Fragment>
<div>
<div className='o-form-server-response o-success' style={{ color: attributes.submitMessageColor }}>
{ formOptions.submitMessage || __( 'Success', 'otter-blocks' ) }
{ formOptions.submitMessage ?? __( 'Success', 'otter-blocks' ) }
</div>
<div className='o-form-server-response o-error' style={{ color: attributes.submitMessageErrorColor, margin: '0px' }}>
{ __( 'Error. Please try again.', 'otter-blocks' ) }
{ formOptions.errorMessage ?? __( 'Error. Please try again.', 'otter-blocks' ) }
</div>
</div>
{
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/form/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import { _px, setUtm } from '../../helpers/helper-functions.js';
import { SortableInputField } from './sortable-input-fields';
import AutoDisableSyncAttr from '../../components/auto-disable-sync-attr/index';
import { selectAllFieldsFromForm } from './common';
import { useTabSwitch } from '../../helpers/block-utility';

const compare = x => {
return x?.[1] && x[0] !== x[1];
Expand Down Expand Up @@ -310,7 +311,7 @@ const Inspector = ({
setAttributes
}) => {

const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );
const [ buttonColorView, setButtonColorView ] = useState( 'normal' );

const {
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/google-map/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {

import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import MarkerWrapper from './components/marker-wrapper.js';
import { useTabSwitch } from '../../helpers/block-utility';

const px = value => value ? `${ value }px` : value;

Expand All @@ -64,7 +65,7 @@ const Inspector = ({
changeAPI,
saveAPIKey
}) => {
const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const {
responsiveSetAttributes,
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/icon-list/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {

import { _px } from '../../helpers/helper-functions.js';
import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import { useTabSwitch } from '../../helpers/block-utility';

/**
*
Expand All @@ -50,7 +51,7 @@ const Inspector = ({
attributes,
setAttributes
}) => {
const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const { responsiveSetAttributes, responsiveGetAttributes } = useResponsiveAttributes( setAttributes );

Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/popup/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {

import { removeBoxDefaultValues, setUtm } from '../../helpers/helper-functions.js';
import { useResponsiveAttributes } from '../../helpers/utility-hooks.js';
import { useTabSwitch } from '../../helpers/block-utility';

/**
*
Expand Down Expand Up @@ -79,7 +80,7 @@ const Inspector = ({
attributes,
setAttributes
}) => {
const [ tab, setTab ] = useState( 'settings' );
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const {
responsiveSetAttributes,
Expand Down
Loading

0 comments on commit 9b52b96

Please sign in to comment.