Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit d718e54

Browse files
committed
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.
1 parent a030b77 commit d718e54

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/cloudservices.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ export default class CloudServices extends Plugin {
4545
* @member {String} #uploadUrl
4646
*/
4747

48-
if ( !this.uploadUrl ) {
49-
this.uploadUrl = 'https://files.cke-cs.com/upload/';
50-
}
51-
5248
/**
5349
* Other plugins use this token for the authorization process. It handles token requesting and refreshing.
5450
* Its value is `null` when {@link module:cloudservices/cloudservices~CloudServicesConfig#tokenUrl} is not provided.
@@ -85,8 +81,8 @@ CloudServices.Token = Token;
8581
* ClassicEditor
8682
* .create( document.querySelector( '#editor' ), {
8783
* cloudServices: {
88-
* uploadUrl: 'https://your-organisation-id.cke-cs.com/easyimage/upload/',
89-
* tokenUrl: 'https://example.com/cs-token-endpoint'
84+
* tokenUrl: 'https://example.com/cs-token-endpoint',
85+
* uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/'
9086
* }
9187
* } )
9288
* .then( ... )
@@ -106,13 +102,15 @@ CloudServices.Token = Token;
106102
* {@glink @cs guides/token-endpoints/tokenendpoint Creating token endpoint} guide
107103
* in {@glink @cs index Cloud Services documentation}.
108104
*
109-
* See [Cloud Services Quick Start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
105+
* See also [Cloud Services Quick start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
110106
*
111107
* @member {String} module:cloudservices/cloudservices~CloudServicesConfig#tokenUrl
112108
*/
113109

114110
/**
115111
* The URL to which the files should be uploaded.
116112
*
117-
* @member {String} [module:cloudservices/cloudservices~CloudServicesConfig#uploadUrl]
113+
* Read more in [Cloud Services Quick start](https://docs.ckeditor.com/cs/latest/guides/quick-start.html).
114+
*
115+
* @member {String} module:cloudservices/cloudservices~CloudServicesConfig#uploadUrl
118116
*/

tests/_utils/cloudservices-config.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55

66
// WARNING: The URLs below should not be used for any other purpose than Easy Image plugin development.
77
// Images uploaded using the testing token service may be deleted automatically at any moment.
8-
// 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.
8+
// If you would like to try the Easy Image service, please sign up for a free trial (https://ckeditor.com/ckeditor-cloud-services/).
99
// Images uploaded during the free trial will not be deleted for the whole trial period and additionally the trial service can be converted
1010
// into a subscription at any moment, allowing you to preserve all uploaded images.
1111

12-
export const TOKEN_URL = 'https://j2sns7jmy0.execute-api.eu-central-1.amazonaws.com/prod/token-new';
12+
export const TOKEN_URL = 'https://33333.cke-cs.com/token/dev/ijrDsqFix838Gh3wGO3F77FSW94BwcLXprJ4APSp3XQ26xsUHTi0jcb1hoBt';
13+
14+
export const UPLOAD_URL = 'https://33333.cke-cs.com/easyimage/upload/';
15+
16+
export const CS_CONFIG = {
17+
tokenUrl: TOKEN_URL,
18+
uploadUrl: UPLOAD_URL
19+
};

tests/cloudservices.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ describe( 'CloudServices', () => {
5353
} );
5454
} );
5555

56-
it( 'should expose default uploadUrl if is not provided', () => {
56+
it( 'should not expose any default uploadUrl', () => {
5757
return ClassicTestEditor
5858
.create( element, {
5959
plugins: [ CloudServices ]
6060
} )
6161
.then( editor => {
6262
const cloudServicesPlugin = editor.plugins.get( CloudServices );
6363

64-
expect( cloudServicesPlugin.uploadUrl ).to.equal( 'https://files.cke-cs.com/upload/' );
64+
expect( cloudServicesPlugin.uploadUrl ).to.be.undefined;
6565
} );
6666
} );
6767

0 commit comments

Comments
 (0)