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

Generalize lesson block inserters #3952

Merged
merged 4 commits into from Feb 8, 2021
Merged

Conversation

yscik
Copy link
Contributor

@yscik yscik commented Feb 1, 2021

Some more preparation work for sharing helpers with the Quiz block

Changes proposed in this Pull Request

  • Break out useAutoInserter to automatically insert an empty inner block (as used for the module and lesson blocks)
  • Break out Enter/Backspace logic to insert/remove/navigate siblings blocks into useKeydownInserter

Testing instructions

  • Edit a course with modules and lessons
  • Make sure empty lessons are inserter to the end of the module when selected
  • Make sure empty lesson can be deleted with Backspace, and new one created with Enter. (Should behave the same as before)

@yscik yscik added this to the 3.9.0 milestone Feb 1, 2021
@yscik yscik requested a review from a team February 1, 2021 19:54
@yscik yscik force-pushed the refactor/lesson-block-inserters branch from 11d97aa to 216d701 Compare February 1, 2021 20:01
@yscik yscik force-pushed the refactor/lesson-block-inserters branch from 216d701 to e947dce Compare February 1, 2021 20:11
Copy link
Contributor

@gikaragia gikaragia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a documentation update.

import { useCallback, useEffect, useState } from '@wordpress/element';

/**
* Insert an empty lesson block to the end of the module when it's selected.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs updating.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 31fca71

Copy link
Contributor

@gikaragia gikaragia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yscik yscik merged commit fcc63a4 into master Feb 8, 2021
@yscik yscik deleted the refactor/lesson-block-inserters branch February 8, 2021 16:32
@donnapep donnapep changed the title [Refactor] Generalize lesson block inserters Generalize lesson block inserters Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants