mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-11 23:43:20 +08:00
fix(mail-merge): Keep column links state properly in sync #2493
Summary: See https://phab.nylas.com/D3112 for full description - Update EditorAPI.insertCustomComponent to take a pre-generated anchorId Test Plan: Unit tests + manual Reviewers: bengotow, halla, jackie Reviewed By: jackie Differential Revision: https://phab.nylas.com/D3113
This commit is contained in:
parent
79d879ff79
commit
f77cbc02f5
4 changed files with 7 additions and 7 deletions
|
@ -69,14 +69,14 @@ describe('TableDataSource', function describeBlock() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('removeColumn', () => {
|
||||
describe('removeLastColumn', () => {
|
||||
it('removes last column from the data source\'s columns', () => {
|
||||
const res = testDataSource.removeColumn()
|
||||
const res = testDataSource.removeLastColumn()
|
||||
expect(res.columns()).toEqual(['col1', 'col2'])
|
||||
});
|
||||
|
||||
it('removes last column from every row', () => {
|
||||
const res = testDataSource.removeColumn()
|
||||
const res = testDataSource.removeLastColumn()
|
||||
expect(res.rows()).toEqual([
|
||||
[1, 2],
|
||||
[4, 5],
|
||||
|
|
|
@ -74,7 +74,7 @@ class EditorAPI
|
|||
|
||||
insertCustomComponent: (componentKey, props = {}) ->
|
||||
OverlaidComponents ?= require('../overlaid-components/overlaid-components').default
|
||||
{anchorId, anchorTag} = OverlaidComponents.buildAnchorTag(componentKey, props)
|
||||
{anchorId, anchorTag} = OverlaidComponents.buildAnchorTag(componentKey, props, props.anchorId)
|
||||
@insertHTML(anchorTag)
|
||||
return anchorId
|
||||
|
||||
|
|
|
@ -137,9 +137,9 @@ export default class TableDataSource {
|
|||
* Removes last column and all of its data.
|
||||
*
|
||||
* @return {TableDataSource} - updated data source instance
|
||||
* @method removeColumn
|
||||
* @method removeLastColumn
|
||||
*/
|
||||
removeColumn() {
|
||||
removeLastColumn() {
|
||||
const nextRows = this.rows().map(row => row.slice(0, row.length - 1))
|
||||
const nextColumns = this.columns().slice(0, this.columns().length - 1)
|
||||
return new TableDataSource({
|
||||
|
|
2
src/pro
2
src/pro
|
@ -1 +1 @@
|
|||
Subproject commit aac7ee6017a38af8a93d1a352e5fe3c0153db4a0
|
||||
Subproject commit 14db8b4122fbcb7d6a86f45651cd013a35fb5d9b
|
Loading…
Reference in a new issue