Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e tests for the global inserter to the Nav Editor screen #34803

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8b4eadb
Scaffold out very basic interface
getdave Sep 14, 2021
91c11d2
Wire up store state and UI
getdave Sep 7, 2021
04a1008
Add inserter button to header toolbar
getdave Sep 7, 2021
080da88
Use correct classname
getdave Sep 7, 2021
ce85b36
Use optimal props on inserter toggle
getdave Sep 7, 2021
a248cf2
Allow global inserter to insert blocks at root level of Nav block
getdave Sep 7, 2021
ff8c787
Avoid displaying inserter if there are no blocks to insert
getdave Sep 7, 2021
cf3a33f
Hide previews as they don't provide much value here
getdave Sep 7, 2021
3338882
Refactor Inserter to dedicate component
getdave Sep 8, 2021
14f0e31
Remove hardcoded conditional
getdave Sep 8, 2021
a30ac83
Remove unwanted ref usage
getdave Sep 8, 2021
c867936
Add toggle button styles and remove close button on larger screens
getdave Sep 8, 2021
d721afb
Allow tools to show on mobile viewports
getdave Sep 8, 2021
88c5de6
Conditionalise render of sidebar
getdave Sep 14, 2021
21b9b0e
Only hide undo/redo on smaller viewports
getdave Sep 8, 2021
2c3793f
Simplify Navigation Block hook
getdave Sep 8, 2021
70354c8
Ensure global inserter always targets root nav block
getdave Sep 8, 2021
8d1d7c8
Ensure items always inserted at end if root nav block is selected
getdave Sep 9, 2021
497d830
Update to use correct exported variable name
getdave Sep 9, 2021
d28bdaf
Handle focus and tab trapping via hook
getdave Sep 9, 2021
020a9a2
Rename component to make it clear it's the inserter button
getdave Sep 10, 2021
2d68661
Simplify secondary sidebar
getdave Sep 14, 2021
119c6ce
Alter directory structure in order to improve portability of code
getdave Sep 10, 2021
7518cb5
Make insertion point logic explicit
getdave Sep 10, 2021
3002c38
Add docblocks to store
getdave Sep 10, 2021
197204c
Add selector state guard
getdave Sep 10, 2021
1136792
Implement Browse All on quick inserter.
getdave Sep 10, 2021
02124b0
Move constant outside component body
getdave Sep 14, 2021
1571d00
Add dep to useSelect
getdave Sep 14, 2021
ed0ba2a
Add another dep to useSelect
getdave Sep 14, 2021
7d98bcf
Remove ref
getdave Sep 14, 2021
09edddc
Sort out Prettier's mess
getdave Sep 14, 2021
b7da582
Rename Inserter Button to Inserter Toggle for clarity and consistency
getdave Sep 14, 2021
a63d3ce
Apply correct CSS naming convention
getdave Sep 14, 2021
8deabcb
Initial visibility and functionality tests for toggle
getdave Sep 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename component to make it clear it's the inserter button
getdave committed Sep 14, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 020a9a2980dc2e93aeeb992c926cf8cae6b140d0
4 changes: 2 additions & 2 deletions packages/edit-navigation/src/components/header/index.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
import SaveButton from './save-button';
import UndoButton from './undo-button';
import RedoButton from './redo-button';
import Inserter from './inserter';
import InserterButton from './inserter-button';
import MenuSwitcher from '../menu-switcher';
import { useMenuEntityProp } from '../../hooks';

@@ -58,7 +58,7 @@ export default function Header( {
className="edit-navigation-header__toolbar"
aria-label={ __( 'Document tools' ) }
>
<Inserter />
<InserterButton />
{ isMediumViewport && (
<>
<UndoButton />
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import { plus } from '@wordpress/icons';
import { useNavigationEditorRootBlock } from '../../hooks';
import { store as editNavigationStore } from '../../store';

function Inserter() {
function InserterButton() {
const inserterButton = useRef();
const { navBlockClientId } = useNavigationEditorRootBlock();

@@ -52,4 +52,4 @@ function Inserter() {
);
}

export default Inserter;
export default InserterButton;