-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Sync ML saved objects to all spaces (#202175)
When manually syncing ML saved objects using the sync flyout, the saved objects are now tagged to the `*` space. This now matches the behaviour of the server side auto sync and the sync which happens when the trained models page is loaded. The trained models page load sync has been extended to the AD and DA jobs lists and the overview page. If the user does not have write permission for ML in every space they cannot sync jobs to the `*` space. In this situation a warning is shown in the flyout and when they sync, the jobs/models will only be added to the current space. ![image](https://github.com/user-attachments/assets/9e6ede10-d7aa-4724-9b1c-adabe96593a8) (cherry picked from commit 3d65e89)
- Loading branch information
1 parent
567b237
commit bef9cfd
Showing
19 changed files
with
265 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ns/shared/ml/public/application/components/job_spaces_sync/sync_to_all_spaces_warning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { EuiCallOut, EuiLink, EuiText } from '@elastic/eui'; | ||
import { useMlKibana } from '../../contexts/kibana/kibana_context'; | ||
|
||
export const SyncToAllSpacesWarning: FC = () => { | ||
const { | ||
services: { | ||
docLinks: { links }, | ||
}, | ||
} = useMlKibana(); | ||
const docLink = links.security.kibanaPrivileges; | ||
return ( | ||
<EuiCallOut | ||
size="s" | ||
iconType="help" | ||
title={ | ||
<FormattedMessage | ||
id="xpack.ml.management.syncSavedObjectsFlyout.allSpacesWarning.title" | ||
defaultMessage="Sync can only add items to the current space" | ||
/> | ||
} | ||
color="warning" | ||
> | ||
<EuiText size="s"> | ||
<FormattedMessage | ||
id="xpack.ml.management.syncSavedObjectsFlyout.allSpacesWarning.description" | ||
defaultMessage="Without {readAndWritePrivilegesLink} for all spaces you can only add jobs and trained models to the current space when syncing." | ||
values={{ | ||
readAndWritePrivilegesLink: ( | ||
<EuiLink href={docLink} target="_blank"> | ||
<FormattedMessage | ||
id="xpack.ml.management.syncSavedObjectsFlyout.privilegeWarningLink" | ||
defaultMessage="read and write privileges" | ||
/> | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</EuiText> | ||
</EuiCallOut> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.