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

Editor: Display an item in Table of Contents when only one heading added #3648

Merged
merged 1 commit into from
Nov 24, 2017

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Nov 24, 2017

Description

You need to add at least 2 heading to the document to see them listed in the table of contents. This PR tries to fix that. It also adds unit tests which will prevent regression in the future.

How Has This Been Tested?

Manually + newly created unit tests.

Screenshots (jpeg or gifs if applicable):

Before

screen shot 2017-11-24 at 13 55 18

After

screen shot 2017-11-24 at 14 37 14

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@gziolo gziolo added [Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended labels Nov 24, 2017
@gziolo gziolo self-assigned this Nov 24, 2017
@codecov
Copy link

codecov bot commented Nov 24, 2017

Codecov Report

Merging #3648 into master will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3648      +/-   ##
==========================================
+ Coverage   36.91%   37.15%   +0.24%     
==========================================
  Files         275      275              
  Lines        6629     6629              
  Branches     1201     1202       +1     
==========================================
+ Hits         2447     2463      +16     
+ Misses       3530     3517      -13     
+ Partials      652      649       -3
Impacted Files Coverage Δ
editor/components/document-outline/index.js 75% <100%> (+57.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78db139...c066e63. Read the comment docs.

Copy link
Member

@mtias mtias left a comment

Choose a reason for hiding this comment

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

I approve the change.

@gziolo gziolo merged commit bccede6 into master Nov 24, 2017
@gziolo gziolo deleted the fix/document-outline-tests branch November 24, 2017 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants