Skip to content

Commit

Permalink
fix multiedit action 'save article'
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Jul 3, 2024
1 parent 89d683b commit cb4f432
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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>,
cloneAfterGenerateHtml?: boolean,
) {
for (const fn of (requestEditor3DirectivesToGenerateHtml ?? [])) {
fn();
}

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

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

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

authoringWorkspace.update(origItem);

console.log(__item, '__item'); // monitoring good, multiedit bad one

Check failure on line 610 in scripts/apps/authoring/authoring/services/AuthoringService.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement

Check failure on line 611 in scripts/apps/authoring/authoring/services/AuthoringService.ts

View workflow job for this annotation

GitHub Actions / test

Trailing spaces not allowed
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

0 comments on commit cb4f432

Please sign in to comment.