-
Notifications
You must be signed in to change notification settings - Fork 18
I/6546: Implement remove column util #300
Conversation
src/tableutils.js
Outdated
function adjustHeadingColumns( table, removedColumnIndexes, writer ) { | ||
const headingColumns = table.getAttribute( 'headingColumns' ) || 0; | ||
|
||
if ( headingColumns && removedColumnIndexes.first <= headingColumns ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removedColumnIndexes.first
is an index and headingColumns
is count (probably <
is enough), if those are equal the resulting headingsRemoved
will equal 0
so no change is needed.
@@ -418,7 +418,7 @@ describe( 'RemoveColumnCommand', () => { | |||
] ) ); | |||
} ); | |||
|
|||
it( 'should work property if the rowspan is in the first column (#1)', () => { | |||
it( 'should work property if the rowspan is in the first column (the other cell in row is selected)', () => { | |||
setData( model, modelTable( [ | |||
[ { rowspan: 2, contents: '00' }, '[]01' ], | |||
[ '10' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be 11
.
] ) ); | ||
} ); | ||
|
||
it( 'should work property if the rowspan is in the first column (#2)', () => { | ||
it( 'should work property if the rowspan is in the first column (the cell in row below is selected)', () => { | ||
setData( model, modelTable( [ | ||
[ { rowspan: 2, contents: '00' }, '01' ], | ||
[ '[]10' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be 11
.
] ) ); | ||
} ); | ||
|
||
it( 'should work property if the rowspan is in the first column (#3)', () => { | ||
it( 'should work property if the rowspan is in the first column (the cell with rowspan is selected)', () => { | ||
setData( model, modelTable( [ | ||
[ { rowspan: 2, contents: '00[]' }, '01' ], | ||
[ '10' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 11
.
tests/tableutils.js
Outdated
[ { colspan: 4, contents: '00' }, '03' ], | ||
[ { colspan: 3, contents: '10' }, '13' ], | ||
[ { colspan: 2, contents: '20' }, '22', '23' ], | ||
[ '30', { colspan: 2, contents: '31' }, '33' ], | ||
[ '40', '41', '42', '43' ] | ||
] ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table seems invalid:
+----+----+----+----+----+
| 00 | 03 |
+----+----+----+----+----+
| 10 | 13 |
+----+----+----+----+
| 20 | 22 | 23 |
+----+----+----+----+
| 30 | 31 | 33 |
+----+----+----+----+
| 40 | 41 | 42 | 43 |
+----+----+----+----+
tests/tableutils.js
Outdated
[ { colspan: 3, contents: '00' }, '03' ], | ||
[ { colspan: 2, contents: '10' }, '13' ], | ||
[ '20', '21', '22', '23' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems invalid table:
+----+----+----+----+
| 00 | 03 |
+----+----+----+----+
| 10 | 13 |
+----+----+----+----+
| 20 | 21 | 22 | 23 |
+----+----+----+----+
tests/tableutils.js
Outdated
it( 'should remove column with rowspan (first column)', () => { | ||
setData( model, modelTable( [ | ||
[ { rowspan: 2, contents: '00' }, '01' ], | ||
[ '10' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 11
.
[ '30', { colspan: 2, contents: '31' }, '33' ], | ||
[ '40', '41', '42', '43' ] | ||
[ { colspan: 4, contents: '00' }, '04' ], | ||
[ { colspan: 3, contents: '10' }, '14' ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 13
.
tests/tableutils.js
Outdated
[ '30', { colspan: 2, contents: '31' }, '33' ], | ||
[ '40', '41', '42', '43' ] | ||
[ { colspan: 4, contents: '00' }, '04' ], | ||
[ { colspan: 3, contents: '10' }, '14' ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 13
.
Suggested merge commit message (convention)
Feature: Introduce
TableUtils.removeColumns()
method. Closes ckeditor/ckeditor5#6546. Closes ckeditor/ckeditor5#6439.Additional information