Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fixed Navigation block error
- Fixed Starter Sites loading and the problem with saving in the template cloud
  • Loading branch information
vytisbulkevicius authored Jul 18, 2024
2 parents a1fc7b9 + ebecb8f commit db2a19a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v1
with:
php-version: '7.1'
php-version: '7.4'
extensions: simplexml
tools: composer:v2.1
- name: Checkout source code
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
extensions: simplexml, mysql
tools: phpunit-polyfills
- name: Checkout source code
Expand Down
6 changes: 6 additions & 0 deletions bin/e2e-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ init_environment(){
# Install dependent plugins
docker-compose -f $DOCKER_FILE run --rm -u root cli wp --allow-root plugin install --force --activate otter-blocks
docker-compose -f $DOCKER_FILE run --rm -u root cli wp --allow-root plugin install --force --activate optimole-wp

# Disable Neve Onboarding
docker-compose -f $DOCKER_FILE run --rm -u root cli wp --allow-root config set TI_ONBOARDING_DISABLED true --raw

# Disable Otter Onboarding
docker-compose -f $DOCKER_FILE run --rm -u root cli wp --allow-root config set ENABLE_OTTER_PRO_DEV true --raw
}

docker-compose -f $DOCKER_FILE run --rm -u root wordpress mkdir -p /var/www/html/wp-content/uploads
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

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

24 changes: 24 additions & 0 deletions e2e-tests/cypress/e2e/editor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
describe( 'Gutenberg Editor', () => {
beforeEach(() => {
cy.visit('/');
cy.visit('/wp-admin/post-new.php');
});

it( 'Add a navigation block', () => {
cy.intercept({
method: 'OPTIONS',
url: '/wp-json/wp/v2/navigation/**'
}).as('getNavigation');

cy.window().then( win => {
const navBlock = win.wp.blocks.createBlock( 'core/navigation' );
win.wp.data.dispatch( 'core/block-editor' ).insertBlocks( navBlock ).then(() => {
cy.wait('@getNavigation') // Wait for navigation to pull its data.
.then(() => {
// We should have no rendering warning.
cy.get('.block-editor-warning__message').should('not.exist');
});
})
} );
} );
});
2 changes: 1 addition & 1 deletion editor/src/plugins/site-editor-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TextControl,
} from '@wordpress/components';
import { useDispatch, useSelect } from '@wordpress/data';
import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-site';
import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
import { Fragment, useEffect, useState } from '@wordpress/element';
import { store as coreStore } from '@wordpress/core-data';
import api from '@wordpress/api';
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public function enqueue() {
wp_style_add_data( 'tiobObd', 'rtl', 'replace' );
wp_enqueue_style( 'tiobObd' );

wp_register_script( 'tiobObd', TIOB_URL . 'onboarding/build/index.js', array_merge( $onboarding_dependencies['dependencies'], array( 'updates' ) ), $onboarding_dependencies['version'], true );
wp_register_script( 'tiobObd', TIOB_URL . 'onboarding/build/index.js', array_merge( $onboarding_dependencies['dependencies'], array( 'updates', 'regenerator-runtime' ) ), $onboarding_dependencies['version'], true );
wp_localize_script( 'tiobObd', 'tiobDash', apply_filters( 'neve_dashboard_page_data', $this->get_localization() ) );
wp_enqueue_script( 'tiobObd' );

Expand Down Expand Up @@ -667,7 +667,7 @@ public function enqueue() {
wp_style_add_data( 'tiob', 'rtl', 'replace' );
wp_enqueue_style( 'tiob' );

wp_register_script( 'tiob', TIOB_URL . 'assets/build/app.js', array_merge( $dependencies['dependencies'], array( 'updates' ) ), $dependencies['version'], true );
wp_register_script( 'tiob', TIOB_URL . 'assets/build/app.js', array_merge( $dependencies['dependencies'], array( 'updates', 'regenerator-runtime' ) ), $dependencies['version'], true );
$tiob_dash = apply_filters( 'neve_dashboard_page_data', $this->get_localization() );
if ( $is_tiob_page ) {
$tiob_dash['hideStarterSites'] = true;
Expand Down
2 changes: 1 addition & 1 deletion includes/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function register_block() {
wp_register_script(
$this->handle,
TIOB_URL . 'editor/build/index.js',
array_merge( $deps['dependencies'], array( 'wp-api' ) ),
array_merge( $deps['dependencies'], array( 'wp-api', 'regenerator-runtime' ) ),
$deps['version']
);

Expand Down
2 changes: 1 addition & 1 deletion tests/digital-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function wpSetUpBeforeClass( $factory ) {
/**
* setUp
*/
public function setUp() {
public function setUp(): void {
parent::setUp();
wp_set_current_user( self::$admin_id );
add_theme_support(
Expand Down
2 changes: 1 addition & 1 deletion tests/import-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Import_Test extends WP_UnitTestCase {

public function setUp() {
public function setUp(): void {
parent::setUp();
register_taxonomy(
'product_type',
Expand Down
2 changes: 1 addition & 1 deletion tests/rest-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function wpSetUpBeforeClass( $factory ) {
/**
* setUp
*/
public function setUp() {
public function setUp(): void {
parent::setUp();
wp_set_current_user( self::$admin_id );
add_theme_support( 'themeisle-demo-import', [
Expand Down

0 comments on commit db2a19a

Please sign in to comment.