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 unit type selection for table cell height #3075

Merged
merged 32 commits into from
Jun 17, 2019
Merged

Add unit type selection for table cell height #3075

merged 32 commits into from
Jun 17, 2019

Conversation

Dumluregn
Copy link
Contributor

@Dumluregn Dumluregn commented Apr 25, 2019

What is the purpose of this pull request?

New feature

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

I copied the solution used for cell width.

Closes #2084.
Closes #3098.
Closes #3164.

Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

I see two issues, not a big deal, everything else is just refactoring and other code related issues.

  • Manual test is missing.

  • Unit pickers have different width, although they are the same and they are preceded with inputs of same width, can this be corrected?
    Screenshot 2019-05-10 at 16 29 46

About refactoring:
height and width dialog field definitions have methods which are almost identical: onLoad, setup, commit. It can be refactored by moving it's logic to helpers, that will return given callback. E.g.

setup: setupSizeField( 'width' )

However after looking at surrounding code I realised that whole definitions are almost identical, they differ only by property name which can be height or width. So we could go even further and do nice refactoring:

Replace
{
requiredContent: 'td{width}',
type: 'hbox',
widths: [ '70%', '30%' ],
children: [ {
...
},{
requiredContent: 'td{height}',
type: 'hbox',
widths: [ '70%', '30%' ],
children: [ {
...
},

With:

	getCellSizeFieldDefinition( 'width' ),
	getCellSizeFieldDefinition( 'height' ),

CHANGES.md Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
tests/plugins/tabletools/cellproperties.js Outdated Show resolved Hide resolved
tests/plugins/tabletools/cellproperties.js Outdated Show resolved Hide resolved
tests/plugins/tabletools/cellproperties.js Outdated Show resolved Hide resolved
@Dumluregn
Copy link
Contributor Author

Problem with pickers width reported - #3098

Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

Just a few more comments from me.

plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
tests/plugins/tabletools/manual/cellheight.md Outdated Show resolved Hide resolved
tests/plugins/tabletools/manual/cellheight.md Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
@Dumluregn Dumluregn force-pushed the t/2084 branch 2 times, most recently from 5aec7f7 to 5b70c6f Compare May 20, 2019 12:57
@engineering-this engineering-this self-assigned this May 29, 2019
Copy link
Contributor

@engineering-this engineering-this 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, last things from me:

tests/plugins/tabletools/manual/cellheight.md Outdated Show resolved Hide resolved
tests/plugins/tabletools/manual/cellheight.md Outdated Show resolved Hide resolved
tests/plugins/tabletools/manual/cellheight.md Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
@engineering-this engineering-this removed their assignment May 29, 2019
Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

LG2M 👍

@Comandeer Comandeer self-assigned this Jun 13, 2019
@Comandeer Comandeer self-requested a review June 13, 2019 13:43
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

New changes broke the existing layout:

  1. Open http://tests.ckeditor.test:1030/tests/plugins/tabletools/manual/allowedcontent
  2. Check "Width" and "Height".
  3. Open cell properties dialog.

Expected:

Everything's alright

Unexpected:

Wild scrollbar appears!

Screenshot 2019-06-13 at 18 31 56

Please also report issue mentioned here: #3075 (comment)

CHANGES.md Outdated Show resolved Hide resolved
plugins/tabletools/dialogs/tableCell.js Outdated Show resolved Hide resolved
@Dumluregn
Copy link
Contributor Author

Dumluregn commented Jun 14, 2019

Wild scrollbar tamed, it will no longer cause us trouble. I also fixed the changelog and reported side issues.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Please add missing entries to dev/langtool/meta/ckeditor.plugin-table/meta.txt (probably dev/langtool/update_meta_files.sh can help). Other than that everything looks good.

@Comandeer Comandeer removed their assignment Jun 14, 2019
@Dumluregn Dumluregn requested a review from Comandeer June 14, 2019 14:27
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

LGTM!

@Comandeer Comandeer merged commit c071b48 into major Jun 17, 2019
@Comandeer Comandeer deleted the t/2084 branch June 17, 2019 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants