Navigation Block - refactor edit
function definition
#22932
Labels
[Block] Navigation
Affects the Navigation Block
[Status] In Progress
Tracking issues with work in progress
[Type] Code Quality
Issues or PRs that relate to code quality
...the edit function seems to be getting a bit big, I think it'd be nice if it were moved out and given a JSDoc description.
Originally posted by @talldan in https://github.com/_render_node/MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NDI0MjE0OTA5/pull_request_reviews/more_threads
See also:
#18869 (comment)
The Problem
Essentially over time the
edit
function def has grown organically and it's now being unwieldy. Once #18869 is merged then this problem will become worse. Let's take a moment to refactor it to make it easier to work with and reason about.Due to the complexity of the block and the rapid development currently underway let's try to break these out into tasks with 1 PR per task to keep it simple to review:
buildNavLinkBlocksFromMenuItems
andbuildNavLinkBlocksFromPages
to utilise this.handleCreate
pure-er by providing arguments directly (eg:selectedCreateActionOption
,hasPages
...etc).cc @talldan @draganescu
The text was updated successfully, but these errors were encountered: