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

Commit

Permalink
Other: Removed the default value of config.cloudServices.uploadUrl.…
Browse files Browse the repository at this point in the history
… Closes #12.

BREAKING CHANGE: The `config.cloudServices.uploadUrl` needs to be defined to your organization's CKEditor Cloud Services upload URL.
  • Loading branch information
Reinmar committed Mar 7, 2018
1 parent a030b77 commit d718e54
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
14 changes: 6 additions & 8 deletions src/cloudservices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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( ... )
Expand All @@ -106,13 +102,15 @@ 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
*/

/**
* 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
*/
11 changes: 9 additions & 2 deletions tests/_utils/cloudservices-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
4 changes: 2 additions & 2 deletions tests/cloudservices.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ describe( 'CloudServices', () => {
} );
} );

it( 'should expose default uploadUrl if is not provided', () => {
it( 'should not expose any default uploadUrl', () => {
return ClassicTestEditor
.create( element, {
plugins: [ 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;
} );
} );

Expand Down

0 comments on commit d718e54

Please sign in to comment.