EZP-27914: As an Editor I want to remove permanently a language from a content item#949
EZP-27914: As an Editor I want to remove permanently a language from a content item#949andrerom merged 2 commits intoezsystems:1.13from
Conversation
| if ( !this.get('id') ) { | ||
| return callback(false); | ||
| } | ||
| contentService.removeTranslation(this.get('id'), languageCode, callback); |
| 'tap': '_newTranslationLanguageSelectionBox', | ||
| } | ||
| }, | ||
|
|
| }; | ||
|
|
||
| e.preventDefault(); | ||
| this.fire('deleteTranslation', data); |
| }, | ||
|
|
||
| /** | ||
| * Removes translation form content. |
There was a problem hiding this comment.
I think it should be ...from content.
| }; | ||
|
|
||
| content.removeTranslation(options, languageCode, Y.bind(function() { | ||
| this._notify( |
There was a problem hiding this comment.
I don't see any error handling for remove translation or I missed that. This assumes it will be always the success.
| }, | ||
|
|
||
| /** | ||
| * `deleteTranslationAction` event handler, |
There was a problem hiding this comment.
deleteTranslation this is the name of the event.
| 'content-delete-translation-' + content.get('id'), 'error', 0 | ||
| ); | ||
| } else { | ||
| this.fire('confirmBoxOpen', { |
|
|
||
| content.removeTranslation(options, languageCode, Y.bind(function() { | ||
| this._notify( | ||
| Y.eZ.trans('success.delete.content.translation', {}, 'bar'), |
There was a problem hiding this comment.
In translation there is a placeholder for language I don't see it here.
|
PR updated according to @dew326 suggestions 😉 |
|
|
||
| this.props.cancelExclusive(); | ||
|
|
||
| if (navigator.userAgent.indexOf('Chrome') > -1) { |
There was a problem hiding this comment.
It looks like I've deleted it by accident. Thanks for vigilance
| * Fired when the translation is deleted | ||
| * | ||
| * @event deleteTranslation | ||
| * @param {e.translation} Language code of translation |
| Y.eZ.trans('failed.delete.content.translation', { language: languageCode }, 'bar'), | ||
| 'content-delete-translation-' + content.get('id'), 'error', 0 | ||
| ); | ||
| return ; |
| /** | ||
| * Opens confirmation modal of deleting translation | ||
| * | ||
| * @event deleteTranslation |
| contentService = capi.getContentService(); | ||
|
|
||
| if ( !this.get('id') ) { | ||
| return callback(false); |
There was a problem hiding this comment.
This will be displayed as a success, I'm not sure if we want this.
There was a problem hiding this comment.
True. There is no checking of id in other methods (besides delete) so I've removed this condition (API should return 404 in this case).
feb1daf to
197807b
Compare
|
@adamwojs No rush on this one, but tests are failing here while they are passing on 1.13 now. |
…e from a content item
|
Got geen light from @SylvainGuittard on this on friday, so adding this to 1.13.1-rc2 for testing. |
Description
Impl. of EZP-27914: As an Editor I want to remove permanently a language from a content item
Note: