-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Add ML saved objects to Kibana saved objects management page #205177
base: main
Are you sure you want to change the base?
Changes from 3 commits
85b1e57
349b842
31c5c56
bc3c7b4
1450c34
ffc1890
d78992f
80ca324
25964a4
63044c1
6a83915
5c911c6
0211426
a0377ac
4b00d37
51be700
602c73f
c9c404d
63a7536
c8ca28a
ab6f7fd
e40c0ec
885662f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ import { mlJob, mlTrainedModel, mlModule } from './mappings'; | |
|
||
import { migrations } from './migrations'; | ||
import { | ||
AD_SAVED_OBJECT_TYPE, | ||
DFA_SAVED_OBJECT_TYPE, | ||
ML_JOB_SAVED_OBJECT_TYPE, | ||
ML_MODULE_SAVED_OBJECT_TYPE, | ||
ML_TRAINED_MODEL_SAVED_OBJECT_TYPE, | ||
|
@@ -27,13 +29,38 @@ interface MlModuleAttributes { | |
datafeeds: object[]; | ||
} | ||
|
||
const AD_PREFIX = `${AD_SAVED_OBJECT_TYPE}-`; | ||
const DFA_PREFIX = `${DFA_SAVED_OBJECT_TYPE}-`; | ||
|
||
export function setupSavedObjects(savedObjects: SavedObjectsServiceSetup) { | ||
savedObjects.registerType({ | ||
name: ML_JOB_SAVED_OBJECT_TYPE, | ||
hidden: false, | ||
namespaceType: 'multiple', | ||
migrations, | ||
mappings: mlJob, | ||
management: { | ||
importableAndExportable: true, | ||
peteharverson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
getTitle(obj) { | ||
return obj.id; | ||
}, | ||
getInAppUrl(obj) { | ||
if (obj.id.startsWith(AD_PREFIX)) { | ||
const jobId = obj.id.slice(AD_PREFIX.length); | ||
return { | ||
path: `/app/management/insightsAndAlerting/jobsListLink/${jobId}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Passing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, I'm removing the links for all ML objects for now until we have the PR for management page ready |
||
uiCapabilitiesPath: 'ml.canGetJobs', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to add additional capabilities checks to control what actions a user can perform and whether or not the saved objects are listed? I think should not list the SOs if the user does not have the minimum read permissions and should only be able to edit them if they have write permissions, e.g. for AD SOs: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}; | ||
} | ||
if (obj.id.startsWith(DFA_PREFIX)) { | ||
// @TODO: Temporarily hide link until new management link is ready | ||
return undefined; | ||
} | ||
return undefined; | ||
}, | ||
icon: 'machineLearningApp', | ||
displayName: 'ml', | ||
peteharverson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}); | ||
savedObjects.registerType({ | ||
name: ML_TRAINED_MODEL_SAVED_OBJECT_TYPE, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest editing this to say something like
Machine learning objects can only be deleted in the Machine Learning management page
(last part of that message needs some work!).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
1450c34
(#205177)@szabosteve Follow-up on my slack message, would love to get some feedback for this one liner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qn895 @peteharverson This tooltip message works fine. We could maybe phrase it a bit more action-oriented, something along the lines of:
Navigate to the Machine Learning management page to delete machine learning objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That text sounds good to me. Thanks @szabosteve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, until the new management pages are in, let's change this to say
Navigate to the Machine Learning pages to delete machine learning objects.