Przeglądaj źródła

Other: Removed the default value of `config.cloudServices.uploadUrl`. Closes #12.

BREAKING CHANGE: The `config.cloudServices.uploadUrl` needs to be defined to your organization's CKEditor Cloud Services upload URL.
Piotrek Koszuliński 7 lat temu
rodzic
commit
f9c43d9785

+ 6 - 8
packages/ckeditor5-cloud-services/src/cloudservices.js

@@ -45,10 +45,6 @@ export default class CloudServices extends Plugin {
 		 * @member {String} #uploadUrl
 		 */
 
-		if ( !this.uploadUrl ) {
-			this.uploadUrl = 'https://files.cke-cs.com/upload/';
-		}
-
 		/**
 		 * Other plugins use this token for the authorization process. It handles token requesting and refreshing.
 		 * Its value is `null` when {@link module:cloudservices/cloudservices~CloudServicesConfig#tokenUrl} is not provided.
@@ -85,8 +81,8 @@ CloudServices.Token = Token;
  *		ClassicEditor
  *			.create( document.querySelector( '#editor' ), {
  *				cloudServices: {
- *					uploadUrl: 'https://your-organisation-id.cke-cs.com/easyimage/upload/',
- *					tokenUrl: 'https://example.com/cs-token-endpoint'
+ *					tokenUrl: 'https://example.com/cs-token-endpoint',
+ *					uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/'
  *				}
  *			} )
  *			.then( ... )
@@ -106,7 +102,7 @@ CloudServices.Token = Token;
  * {@glink @cs guides/token-endpoints/tokenendpoint Creating token endpoint} guide
  * in {@glink @cs index Cloud Services documentation}.
  *
- * See [Cloud Services Quick Start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
+ * See also [Cloud Services Quick start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
  *
  * @member {String} module:cloudservices/cloudservices~CloudServicesConfig#tokenUrl
  */
@@ -114,5 +110,7 @@ CloudServices.Token = Token;
 /**
  * The URL to which the files should be uploaded.
  *
- * @member {String} [module:cloudservices/cloudservices~CloudServicesConfig#uploadUrl]
+ * Read more in [Cloud Services Quick start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
+ *
+ * @member {String} module:cloudservices/cloudservices~CloudServicesConfig#uploadUrl
  */

+ 9 - 2
packages/ckeditor5-cloud-services/tests/_utils/cloudservices-config.js

@@ -5,8 +5,15 @@
 
 // WARNING: The URLs below should not be used for any other purpose than Easy Image plugin development.
 // Images uploaded using the testing token service may be deleted automatically at any moment.
-// If you would like to try the Easy Image service, please wait until the official launch of Easy Image and sign up for a free trial.
+// If you would like to try the Easy Image service, please sign up for a free trial (https://ckeditor.com/ckeditor-cloud-services/).
 // Images uploaded during the free trial will not be deleted for the whole trial period and additionally the trial service can be converted
 // into a subscription at any moment, allowing you to preserve all uploaded images.
 
-export const TOKEN_URL = 'https://j2sns7jmy0.execute-api.eu-central-1.amazonaws.com/prod/token-new';
+export const TOKEN_URL = 'https://33333.cke-cs.com/token/dev/ijrDsqFix838Gh3wGO3F77FSW94BwcLXprJ4APSp3XQ26xsUHTi0jcb1hoBt';
+
+export const UPLOAD_URL = 'https://33333.cke-cs.com/easyimage/upload/';
+
+export const CS_CONFIG = {
+	tokenUrl: TOKEN_URL,
+	uploadUrl: UPLOAD_URL
+};

+ 2 - 2
packages/ckeditor5-cloud-services/tests/cloudservices.js

@@ -53,7 +53,7 @@ describe( 'CloudServices', () => {
 				} );
 		} );
 
-		it( 'should expose default uploadUrl if is not provided', () => {
+		it( 'should not expose any default uploadUrl', () => {
 			return ClassicTestEditor
 				.create( element, {
 					plugins: [ CloudServices ]
@@ -61,7 +61,7 @@ describe( 'CloudServices', () => {
 				.then( editor => {
 					const cloudServicesPlugin = editor.plugins.get( CloudServices );
 
-					expect( cloudServicesPlugin.uploadUrl ).to.equal( 'https://files.cke-cs.com/upload/' );
+					expect( cloudServicesPlugin.uploadUrl ).to.be.undefined;
 				} );
 		} );