Skip to content

Commit

Permalink
release: version 2.6.1
Browse files Browse the repository at this point in the history
### Bug Fixes
- **Fixes infinite redirect loop**: Fixes an issue where activating Raft leads to an infinite loop.
- **Fixes third-party style conflicts**: Fixes CSS messing up styles of some third-party plugins.
- **Fixes Woo products conditions not working**: Fixes Woo conditions in the Block Conditions module not working correctly.
  • Loading branch information
HardeepAsrani authored Dec 19, 2023
2 parents f4c3904 + 65006fb commit dfe53ab
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .wp-env.override.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"development": {
"themes": [ "./test/emptytheme" ],
"mappings": {
"wp-content/themes/raft": "https://github.com/Codeinwp/raft/archive/refs/heads/onboarding.zip"
"wp-content/themes/raft": "https://downloads.wordpress.org/theme/raft.zip"
}
},
"tests": {
Expand All @@ -29,9 +29,9 @@
"wp-content/mu-plugins": "./packages/e2e-tests/mu-plugins",
"wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins",
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes",
"wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip",
"wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip",
"wp-content/themes/raft": "https://github.com/Codeinwp/raft/archive/refs/heads/onboarding.zip"
"wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.zip",
"wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.zip",
"wp-content/themes/raft": "https://downloads.wordpress.org/theme/raft.zip"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions inc/plugins/class-fse-onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public function on_switch_theme() {
return;
}

// Flag onboarding status in case being run from a theme.
self::set_onboarding_status();

// Run the onboarding.
$redirect = add_query_arg(
array(
Expand Down
2 changes: 1 addition & 1 deletion inc/plugins/class-options-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ function ( $item ) {
'themeisle_blocks_settings_onboarding_wizard',
array(
'type' => 'boolean',
'description' => __( 'Enable Onboarding Wizard.', 'otter-blocks' ),
'description' => __( 'Enable FSE Onboarding Wizard.', 'otter-blocks' ),
'show_in_rest' => true,
'default' => true,
)
Expand Down
6 changes: 5 additions & 1 deletion src/blocks/editor.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.block-editor-block-inspector {
.components-tools-panel-item {
.components-base-control:not(.components-input-control) {
margin: 24px 0;
}
Expand Down Expand Up @@ -212,3 +212,7 @@ svg.o-block-icon {
}
}
}

.w-full {
width: 100%;
}
7 changes: 0 additions & 7 deletions src/blocks/helpers/block-utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,6 @@ export function pullReusableBlockContentById( id ) {
return parse( reusableBlock.content.raw ?? reusableBlock.content );
}

/**
* Open the Otter sidebar menu.
*/
export function openOtterSidebarMenu() {
document?.querySelector( '.interface-pinned-items button[aria-label~="Otter"]' )?.click();
}

/**
* Insert a block below the given block.
*
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/plugins/conditions/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ const Edit = ({
<select
value={ condObj.type || '' }
onChange={ e => changeCondition( e.target.value, index, condIdx ) }
className="components-select-control__input"
className="components-select-control__input w-full"
id={ `o-conditions-${ index }-${ condIdx }` }
>
<option value="none">{ __( 'Select a condition', 'otter-blocks' ) }</option>
Expand Down
11 changes: 8 additions & 3 deletions src/blocks/plugins/otter-tools-inspector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import {

import { createHigherOrderComponent } from '@wordpress/compose';

import {
useDispatch,
useSelect
} from '@wordpress/data';

import { Fragment } from '@wordpress/element';

import {
Expand All @@ -23,8 +28,6 @@ import {
*/
import './editor.scss';
import { useInspectorSlot } from '../../components/inspector-slot-fill/index.js';
import { useSelect } from '@wordpress/data';
import { openOtterSidebarMenu } from '../../helpers/block-utility';

const FeaturePanel = ({ props }) => {

Expand All @@ -33,6 +36,8 @@ const FeaturePanel = ({ props }) => {
select( 'core/preferences' );
}, []);

const { enableComplementaryArea } = useDispatch( 'core/interface' );

return (
<ToolsPanel
label={ __( 'Block Tools' ) }
Expand All @@ -42,7 +47,7 @@ const FeaturePanel = ({ props }) => {
<ToolsPanelItem
hasValue={ () => false }
label={ __( 'Manage Default Tools', 'otter-blocks' ) }
onSelect={ openOtterSidebarMenu }
onSelect={ () => enableComplementaryArea( 'core/edit-post', 'themeisle-blocks/otter-options' ) }
isShownByDefault={ false }
/>
</ToolsPanel>
Expand Down
5 changes: 4 additions & 1 deletion src/onboarding/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ const actions = {
const pageTemplates = select.getLibrary( 'page_templates' );
const importedTemplates = select.getImportedTemplates();

event.imported_items = selectedTemplates;
event.imported_items = selectedTemplates.reduce( ( obj, item ) => {
obj[item] = true;
return obj;
}, {});

await Promise.all(
selectedTemplates
Expand Down
6 changes: 3 additions & 3 deletions src/pro/plugins/conditions/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,16 @@ const ProductsMultiselect = ( props ) => {
} = select( COLLECTIONS_STORE_KEY );

// eslint-disable-next-line camelcase
const productsError = getCollectionError?.( '/wc/store', 'products', { per_page: -1 });
const productsError = getCollectionError?.( '/wc/store', 'products', { per_page: 0 });

const products = productsError ? [] : ( getCollection?.( '/wc/store', 'products', { 'per_page': -1 }) ?? [])?.map( result => ({
const products = productsError ? [] : ( getCollection?.( '/wc/store', 'products', { 'per_page': 0 }) ?? [])?.map( result => ({
value: result.id,
label: decodeEntities( result.name )
}) );

return {
products,
isLoading: isResolving( 'getCollection', [ '/wc/store', 'products', { 'per_page': -1 }])
isLoading: isResolving( 'getCollection', [ '/wc/store', 'products', { 'per_page': 0 }])
};
}, []);

Expand Down

0 comments on commit dfe53ab

Please sign in to comment.