Explorar el Código

Moved `uploadUrl` config to ckeditor5-cloudservices package.

Maciej Bukowski hace 8 años
padre
commit
97bff201bf

+ 2 - 44
packages/ckeditor5-easy-image/src/cloudservicesuploadadapter.js

@@ -18,7 +18,7 @@ import CloudServices from '@ckeditor/ckeditor5-cloudservices/src/cloudservices';
  * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
  * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
  *
  *
  * After enabling this adapter you need to configure the Cloud Services integration through
  * After enabling this adapter you need to configure the Cloud Services integration through
- * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig `config.cloudServices`}.
+ * {@link module:cloudservices/cloudservices~CloudServicesConfig `config.cloudServices`}.
  *
  *
  * @extends module:core/plugin~Plugin
  * @extends module:core/plugin~Plugin
  */
  */
@@ -39,7 +39,7 @@ export default class CloudServicesUploadAdapter extends Plugin {
 		const cloudServices = editor.plugins.get( CloudServices );
 		const cloudServices = editor.plugins.get( CloudServices );
 
 
 		const token = cloudServices.token;
 		const token = cloudServices.token;
-		const uploadUrl = cloudServices.uploadUrl || 'https://files.cke-cs.com/upload/';
+		const uploadUrl = cloudServices.uploadUrl;
 
 
 		if ( !token ) {
 		if ( !token ) {
 			return;
 			return;
@@ -82,45 +82,3 @@ class Adapter {
 // Store the API in static property to easily overwrite it in tests.
 // Store the API in static property to easily overwrite it in tests.
 // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
 // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
 CloudServicesUploadAdapter._UploadGateway = UploadGateway;
 CloudServicesUploadAdapter._UploadGateway = UploadGateway;
-
-/**
- * The configuration of the {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter Cloud Services upload adapter}.
- *
- * It is used mainly by the {@link module:easy-image/easyimage~EasyImage} feature.
- *
- * Read more in {@link module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig}.
- *
- * @member {module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig}
- *         module:core/editor/editorconfig~EditorConfig#cloudServices
- */
-
-/**
- * The configuration of the {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter Cloud Services upload adapter}.
- *
- * It is used mainly by the {@link module:easy-image/easyimage~EasyImage} feature.
- *
- *		ClassicEditor
- *			.create( editorElement, {
- * 				cloudServices: {
- *					tokenUrl: '...'
- * 				}
- *			} )
- *			.then( ... )
- *			.catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface CloudServicesAdapterConfig
- */
-
-/**
- * The URL to which the files should be uploaded.
- *
- * @member {String} [module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig#uploadUrl='https://files.cke-cs.com/upload/']
- */
-
-/**
- * The token to the Cloud Services application. You can obtain it from the token service.
- *
- * @member {String} module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig#token
- */

+ 1 - 1
packages/ckeditor5-easy-image/src/easyimage.js

@@ -22,7 +22,7 @@ import ImageUpload from '@ckeditor/ckeditor5-upload/src/imageupload';
  * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
  * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
  *
  *
  * After enabling the Easy Image plugin you need to configure the Cloud Services integration through
  * After enabling the Easy Image plugin you need to configure the Cloud Services integration through
- * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesAdapterConfig `config.cloudServices`}.
+ * {@link module:cloudservices/cloudservices~CloudServicesConfig `config.cloudServices`}.
  *
  *
  * @extends module:core/plugin~Plugin
  * @extends module:core/plugin~Plugin
  */
  */

+ 0 - 17
packages/ckeditor5-easy-image/tests/cloudservicesuploadadapter.js

@@ -73,23 +73,6 @@ describe( 'CloudServicesUploadAdapter', () => {
 					return editor.destroy();
 					return editor.destroy();
 				} );
 				} );
 		} );
 		} );
-
-		it( 'should set the default uploadUrl', () => {
-			const expectedDefaultUrl = 'https://files.cke-cs.com/upload/';
-
-			return ClassicTestEditor
-				.create( div, {
-					plugins: [ CloudServicesUploadAdapter ],
-					cloudServices: {
-						tokenUrl: 'abc'
-					}
-				} )
-				.then( editor => {
-					expect( UploadGatewayMock.lastUploadUrl ).to.equal( expectedDefaultUrl );
-
-					return editor.destroy();
-				} );
-		} );
 	} );
 	} );
 
 
 	describe( 'Adapter', () => {
 	describe( 'Adapter', () => {