Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
Browse files Browse the repository at this point in the history
…-ref HEAD~1..HEAD --fix'
  • Loading branch information
kibanamachine committed Oct 19, 2023
1 parent 630d94e commit d426fa9
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,20 @@ function createDefaultChangeSpacesHandler(
);

// Only if there are also spaces being added, affect any referenced/related objects
const updateRelated = spacesToAdd.length > 0 ? spacesManager.updateSavedObjectsSpaces(objectsToUpdate, spacesToAdd, []) : undefined;
const updateRelated =
spacesToAdd.length > 0
? spacesManager.updateSavedObjectsSpaces(objectsToUpdate, spacesToAdd, [])
: undefined;

await Promise.all([updateTarget, updateRelated]).catch((e) => {
error = e;
});
} else {
await spacesManager.updateSavedObjectsSpaces(objectsToUpdate, spacesToAdd, spacesToRemove).catch((e) => {
error = e;
});
await spacesManager
.updateSavedObjectsSpaces(objectsToUpdate, spacesToAdd, spacesToRemove)
.catch((e) => {
error = e;
});
}

const isSharedToAllSpaces = spacesToAdd.includes(ALL_SPACES_ID);
Expand All @@ -142,8 +147,7 @@ function createDefaultChangeSpacesHandler(
description: `Uses output of xpack.spaces.shareToSpace.spacesTarget or xpack.spaces.shareToSpace.allSpacesTarget as 'spacesTarget...' inputs. Example strings: "'Finance dashboard' was added to 1 space. 'Finance dashboard' was removed from 2 spaces.", "'Finance dashboard' and 2 related objects were added to 3 spaces. 'Finance dashboard' was removed from all spaces."`,
}),
});
}
else {
} else {
if (spacesToAdd.length > 0 && spacesToRemove.length > 0 && !isSharedToAllSpaces) {
toastText = i18n.translate('xpack.spaces.shareToSpace.shareSuccessAddRemoveText', {
defaultMessage: `'{object}' {relativesCount, plural, =0 {was} =1 {and {relativesCount} related object were} other {and {relativesCount} related objects were}} added to {spacesTargetAdd}. '{object}' was removed from {spacesTargetRemove}.`,
Expand Down

0 comments on commit d426fa9

Please sign in to comment.