The TableBlock Alignment context menu item has returned, following removal in Wagtail 1.6 http://docs.wagtail.io/en/stable/releases/1.6.html#bug-fixes
Might be due to this commit: https://github.com/wagtail/wagtail/commit/6e42a7755ada9ba162e78af6535924449ce3287
table_block contrib module to a project http://docs.wagtail.io/en/stable/reference/contrib/table_block.htmlTableBlock to a StreamFieldTableBlock and right click on a cell
@richbrennan thank you for this issue report we appreciate the detail.
I have reproduced this issue on Wagtail version 1.13 as well.
The contextMenu TableBlock.default_table_options is set to True and will always override the js file options.
https://github.com/wagtail/wagtail/blob/master/wagtail/contrib/table_block/blocks.py#L45
These options are parsed in the Javascript file:
https://github.com/wagtail/wagtail/blob/master/wagtail/contrib/table_block/static/table_block/js/table.js#L102
Which causes the contextMenu to be set to True instead of the correct List
contextMenu: [
'row_above',
'row_below',
'---------',
'col_left',
'col_right',
'---------',
'remove_row',
'remove_col',
'---------',
'undo',
'redo'
]
So we can ensure the integrity of how this option is defined in the documentation.
The table.js file should parse tableOptions so that if it is contextMenu is set to true, use the default contextMenu options defaultOptions.contextMenu, otherwise set contextMenu to false.
Any other thoughts @gasman or @loicteixeira
@lb- Indeed, the JS should do a little bit more work than simply merging the dictionaries here.
However, keep in mind that contextMenu can either be a boolean (e.g. ['undo', 'redo']) or an array so the check will have to be a bit more nuanced than a simple boolean check.
Resolved with #4093