Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix multiedit action 'save article' #4563

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ export function AuthoringService(
*/
this.save = function saveAuthoring(
origItem: IArticle,
_item: IArticle,
__item: IArticle,
requestEditor3DirectivesToGenerateHtml?: Array<()=> void>,
cloneAfterGeneratingHtml?: boolean,
) {
for (const fn of (requestEditor3DirectivesToGenerateHtml ?? [])) {
fn();
}

const _item = cloneAfterGeneratingHtml === true ? cloneDeep(__item) : __item;

return authoringApiCommon.saveBefore(_item, origItem).then((item: IArticle) => {
angular.extend(_item, item);

Expand Down Expand Up @@ -603,6 +606,7 @@ export function AuthoringService(
const authoringWorkspace: AuthoringWorkspaceService = $injector.get('authoringWorkspace');

authoringWorkspace.update(origItem);

return origItem;
});
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/apps/authoring/multiedit/multiedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ function MultieditArticleDirective(authoring, content, multiEdit, lock, $timeout
scope.save = function() {
return authoring.save(
scope.origItem,
cloneDeep(scope.item),
scope.item,
scope.requestEditor3DirectivesToGenerateHtml,
true,
).then((res) => {
scope.dirty = false;
InitializeMedia.initMedia(scope);
Expand Down
Loading