Skip to content

Commit

Permalink
[Maps] fix save to maps for by_value map embeddables
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jun 22, 2021
1 parent d7f2325 commit 1b079fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x-pack/plugins/maps/public/routes/map_page/top_nav_config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ export function getTopNavConfig({
const saveModalProps = {
onSave: async (
props: OnSaveProps & {
returnToOrigin?: boolean;
dashboardId?: string | null;
addToLibrary?: boolean;
addToLibrary: boolean;
}
) => {
try {
Expand Down Expand Up @@ -181,7 +180,7 @@ export function getTopNavConfig({
await savedMap.save({
...props,
newTags: selectedTags,
saveByReference: Boolean(props.addToLibrary),
saveByReference: props.addToLibrary,
});
// showSaveModal wrapper requires onSave to return an object with an id to close the modal after successful save
return { id: 'id' };
Expand All @@ -204,6 +203,9 @@ export function getTopNavConfig({
saveModal = (
<SavedObjectSaveModalOrigin
{...saveModalProps}
onSave={async (props: OnSaveProps) => {
return saveModalProps.onSave({ ...props, addToLibrary: true });
}}
originatingApp={savedMap.getOriginatingApp()}
getAppNameFromId={savedMap.getAppNameFromId}
options={tagSelector}
Expand Down

0 comments on commit 1b079fa

Please sign in to comment.