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 list start, reversed settings (in progress) #15113

Merged
merged 5 commits into from Aug 15, 2019

Conversation

@Jackie6
Copy link
Contributor

commented Apr 22, 2019

Description

Partially fixes #13888
Fix #17040

How has this been tested?

  • unit test
  • browser test
  • e2e test but sometimes failed

Screenshots

YXv6W6sBZb

To do list

  • Add type start reversed options
  • Update the CSS style
  • Enable the null input for start value
  • Fix the preview inconsistent issue
  • Fix failed tests

@Jackie6 Jackie6 changed the title Add list type, start, reversed settings Add list type, start, reversed settings (in progress) Apr 22, 2019

.travis.yml Outdated Show resolved Hide resolved
@ellatrix

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

Great work so far! Thank you!

It looks like when I set the list to reversed, the other attributes are also set:

Screenshot 2019-04-24 at 11 57 42

Also when I later set the list back to unordered (ul), the attributes remain:

Screenshot 2019-04-24 at 11 59 09

The should probably be reset to undefined.

packages/block-library/src/list/list-type-picker.js Outdated Show resolved Hide resolved
packages/block-library/src/list/editor.scss Outdated Show resolved Hide resolved
@@ -119,6 +119,18 @@ export default class Editable extends Component {
this.editorNode.className = classnames( nextProps.className, CLASS_NAME );
}

if ( this.props.start !== nextProps.start ) {
this.editorNode.setAttribute( 'start', nextProps.start );

This comment has been minimized.

Copy link
@gziolo

gziolo Apr 25, 2019

Member

Why this node gets updated using setAttribute but in other places the value is set through direct mutation?

This comment has been minimized.

Copy link
@ellatrix

ellatrix Apr 25, 2019

Member

Probably because the others need to be removed if needed. Would be good to unify this though.

@Jackie6 Jackie6 force-pushed the Jackie6:update/list-block branch from 3aae7fc to 88dc84c Apr 25, 2019

label={ __( 'List Type' ) }
value={ type }
options={ [
{ label: 'Decimal', value: '1' },

This comment has been minimized.

Copy link
@ellatrix

ellatrix Apr 25, 2019

Member

Would it be possible to unset the attribute if "Decimal" is selected?

This comment has been minimized.

Copy link
@Jackie6

Jackie6 May 1, 2019

Author Contributor

Why do we need to unset the attribute?

This comment has been minimized.

Copy link
@ellatrix

ellatrix May 2, 2019

Member

Thinking about it more, you are right that it shouldn't be unset. But then there should be one extra option that wouldn't set the attribute. Perhaps we can call this option "Theme", as it would have whatever type the theme defined (usually decimal).

This comment has been minimized.

Copy link
@ellatrix

ellatrix Jul 31, 2019

Member

@Jackie6 Could you add an extra button then to unset the value?

Squash for easier merge:
f6ad4f0 (HEAD -> update/list-block, Jackie6/update/list-block) Add id to BaseControl
212cab1 Fix unit test and e2e test
421a198 Refine the type definition of start and reversed
4172707 Fix typo
21ed1db Update CSS styles
925f1ab Update list type style and remove description
ef0aca9 Allow the start to be NaN
495166d Change to check strict equality
216ca51 Fix the accidental change of travis yml
8e31259 Change local state to attributes
09199ff Add list type, start, reversed settings

@ellatrix ellatrix force-pushed the Jackie6:update/list-block branch from e78b23f to 3fbf11f Aug 15, 2019

@ellatrix ellatrix changed the title Add list type, start, reversed settings (in progress) Add list start, reversed settings (in progress) Aug 15, 2019

ellatrix added 2 commits Aug 15, 2019

@ellatrix ellatrix added this to the Gutenberg 6.4 milestone Aug 15, 2019

@ellatrix

This comment has been minimized.

Copy link
Member

commented Aug 15, 2019

Thank you, @Jackie6, for working on this PR! 🎉

@ellatrix ellatrix merged commit 43250ce into WordPress:master Aug 15, 2019

4 checks passed

Filter opened
Details
Filter opened
Details
Milestone It
Details
Travis CI - Pull Request Build Passed
Details
@ellatrix

This comment has been minimized.

Copy link
Member

commented Aug 15, 2019

@Jackie6 Feel free to create a separate PR for the type attribute. I would just implement with all the CSS overrides and push the (core) themes to change their CSS. Perhaps that should be done first. #15113 (comment)

mchowning added a commit that referenced this pull request Aug 16, 2019
[RNMobile] update mobile to not use ListEdit
This update is in response to changes made on the web side in #15113
that were causing a crash on mobile.
@mchowning mchowning referenced this pull request Aug 16, 2019
5 of 5 tasks complete
mchowning added a commit that referenced this pull request Aug 18, 2019
Pass non shared logic into component with shared logic
This update is in response to changes made on the web side in #15113
that were causing a crash on mobile.
mchowning added a commit that referenced this pull request Aug 20, 2019
[RNMobile] update mobile to not use ListEdit (#17070)
* [RNMobile] update mobile to not use ListEdit

This update is in response to changes made on the web side in #15113
that were causing a crash on mobile.

* Extract list block logic not shared with mobile to separate component

* Improve name of AdditionalSettings component
@ellatrix ellatrix referenced this pull request Aug 22, 2019
5 of 5 tasks complete
donmhico added a commit to donmhico/gutenberg that referenced this pull request Aug 27, 2019
[RNMobile] update mobile to not use ListEdit (WordPress#17070)
* [RNMobile] update mobile to not use ListEdit

This update is in response to changes made on the web side in WordPress#15113
that were causing a crash on mobile.

* Extract list block logic not shared with mobile to separate component

* Improve name of AdditionalSettings component
gziolo added a commit that referenced this pull request Aug 29, 2019
List block: add start and reversed attributes (#15113)
* Squash for easier merge:
f6ad4f0 (HEAD -> update/list-block, Jackie6/update/list-block) Add id to BaseControl
212cab1 Fix unit test and e2e test
421a198 Refine the type definition of start and reversed
4172707 Fix typo
21ed1db Update CSS styles
925f1ab Update list type style and remove description
ef0aca9 Allow the start to be NaN
495166d Change to check strict equality
216ca51 Fix the accidental change of travis yml
8e31259 Change local state to attributes
09199ff Add list type, start, reversed settings

* Revert adding  attribute for now, let's extract to a separate PR

* Use proper TextControl

* Adjust toggle control to unset attribute

* Clearer label
gziolo added a commit that referenced this pull request Aug 29, 2019
[RNMobile] update mobile to not use ListEdit (#17070)
* [RNMobile] update mobile to not use ListEdit

This update is in response to changes made on the web side in #15113
that were causing a crash on mobile.

* Extract list block logic not shared with mobile to separate component

* Improve name of AdditionalSettings component
gziolo added a commit that referenced this pull request Aug 29, 2019
List block: add start and reversed attributes (#15113)
* Squash for easier merge:
f6ad4f0 (HEAD -> update/list-block, Jackie6/update/list-block) Add id to BaseControl
212cab1 Fix unit test and e2e test
421a198 Refine the type definition of start and reversed
4172707 Fix typo
21ed1db Update CSS styles
925f1ab Update list type style and remove description
ef0aca9 Allow the start to be NaN
495166d Change to check strict equality
216ca51 Fix the accidental change of travis yml
8e31259 Change local state to attributes
09199ff Add list type, start, reversed settings

* Revert adding  attribute for now, let's extract to a separate PR

* Use proper TextControl

* Adjust toggle control to unset attribute

* Clearer label
gziolo added a commit that referenced this pull request Aug 29, 2019
[RNMobile] update mobile to not use ListEdit (#17070)
* [RNMobile] update mobile to not use ListEdit

This update is in response to changes made on the web side in #15113
that were causing a crash on mobile.

* Extract list block logic not shared with mobile to separate component

* Improve name of AdditionalSettings component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.