-
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] DF Analytics models list: persist pagination through refresh interval #76695
[ML] DF Analytics models list: persist pagination through refresh interval #76695
Conversation
Pinging @elastic/ml-ui (:ml) |
bd1f238
to
c11f954
Compare
...data_frame_analytics/pages/analytics_management/components/models_management/models_list.tsx
Outdated
Show resolved
Hide resolved
@@ -20,6 +20,68 @@ import { | |||
Value, | |||
DataFrameAnalyticsListRow, | |||
} from '../analytics_list/common'; | |||
import { ModelItem } from '../models_management/models_list'; | |||
|
|||
export function filterAnalyticsModels( |
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.
I find this function a bit confusing. We have a collection that we want to filter based on the set of clauses.
Why not have something like
return items.filter(item => {
return // check item against clauses
)
?
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.
🤔 Agree the filtering functionality could be improved. Currently it matches what's been used in the anomaly detection list and analytics list. Might be worth refactoring all of them so the search always works the same way. I think that change is outside the scope of this PR.
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.
I'd understand if you reused filterJobs
from x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js
, but you introduced a brand new function. It would be great to have a generic one that allows you to filter the collection based on clauses. I suspect we don't need to invent our own, just get an existing funtion from EUI.
...a_frame_analytics/pages/analytics_management/components/analytics_list/use_table_settings.ts
Outdated
Show resolved
Hide resolved
...data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx
Outdated
Show resolved
Hide resolved
const filterList = () => { | ||
if (searchQueryText !== '') { | ||
const query = EuiSearchBar.Query.parse(searchQueryText); | ||
let clauses: any = []; |
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.
It is possible to avoid using any
here?
...data_frame_analytics/pages/analytics_management/components/models_management/models_list.tsx
Outdated
Show resolved
Hide resolved
Gave this a good test and functionality looks good 👍 |
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.
Tested and LGTM
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.
Latest edits LGTM
5b16035
to
08e00c3
Compare
💚 Build SucceededBuild metricsasync chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
…erval (elastic#76695) * ensure wizard error shows up correctly * wip: switch to basic table for model management * add selection and multi job action to models list * update error extraction function * use generic types in hook * simplify filtered items
Summary
Related issue #75828
Persists pagination for analytics models list. The functionality is now consistent with anomaly detection and analytics jobs list.
This PR
switches the EuiInMemoryTable used in the analytics models list to the EuiBasicTable in order to be able to externally control pagination
Uses the useTableSettings custom hook to control pagination/sort for the basic table
uses the AnalyticsSearchBar component which handles filtering of the table
Checklist
Delete any items that are not applicable to this PR.