Browse Source

Remove deprecated configuration option.

Mateusz Samsel 6 years ago
parent
commit
320dad2f05

+ 2 - 14
packages/ckeditor5-table/src/tabletoolbar.js

@@ -20,9 +20,6 @@ import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolba
  * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
  * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
  *
- * Note that the old {@link module:table/table~TableConfig#toolbar `table.toolbar` configuration option} is deprecated
- * and will be removed in the next major release.
- *
  * @extends module:core/plugin~Plugin
  */
 export default class TableToolbar extends Plugin {
@@ -48,21 +45,12 @@ export default class TableToolbar extends Plugin {
 		const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
 
 		const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
-		const deprecatedTableContentToolbarItems = editor.config.get( 'table.toolbar' );
 
 		const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
 
-		if ( deprecatedTableContentToolbarItems ) {
-			// eslint-disable-next-line
-			console.warn(
-				'`config.table.toolbar` is deprecated and will be removed in the next major release.' +
-				' Use `config.table.contentToolbar` instead.'
-			);
-		}
-
-		if ( tableContentToolbarItems || deprecatedTableContentToolbarItems ) {
+		if ( tableContentToolbarItems ) {
 			widgetToolbarRepository.register( 'tableContent', {
-				items: tableContentToolbarItems || deprecatedTableContentToolbarItems,
+				items: tableContentToolbarItems,
 				getRelatedElement: getTableWidgetAncestor
 			} );
 		}

+ 4 - 14
packages/ckeditor5-table/tests/tabletoolbar.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
-/* global document, window */
+/* global document */
 
 import ClassicTestEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
 import TableToolbar from '../src/tabletoolbar';
@@ -239,12 +239,11 @@ describe( 'TableToolbar', () => {
 	} );
 
 	describe( 'deprecated toolbar', () => {
-		let editor, editorElement, warnMock;
+		let editor, editorElement;
 
-		it( 'table.toolbar should work as table.contentToolbar', () => {
+		it( 'table.toolbar should not create toolbar any longer', () => {
 			editorElement = global.document.createElement( 'div' );
 			global.document.body.appendChild( editorElement );
-			warnMock = sinon.stub( window.console, 'warn' );
 
 			return ClassicTestEditor
 				.create( editorElement, {
@@ -257,23 +256,14 @@ describe( 'TableToolbar', () => {
 					editor = newEditor;
 
 					const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
-					const toolbarView = widgetToolbarRepository._toolbarDefinitions.get( 'tableContent' ).view;
-
-					expect( toolbarView.items ).to.have.length( 1 );
-					expect( toolbarView.items.get( 0 ).label ).to.equal( 'fake button' );
 
-					sinon.assert.calledWith(
-						warnMock,
-						'`config.table.toolbar` is deprecated and will be removed in the next major release.' +
-						' Use `config.table.contentToolbar` instead.'
-					);
+					expect( widgetToolbarRepository._toolbarDefinitions.get( 'tableContent' ) ).to.be.undefined;
 				} );
 		} );
 
 		it( 'table.contentToolbar should be used if both toolbars options are provided', () => {
 			editorElement = global.document.createElement( 'div' );
 			global.document.body.appendChild( editorElement );
-			warnMock = sinon.stub( window.console, 'warn' );
 
 			return ClassicTestEditor
 				.create( editorElement, {