[ML] New job wizards UI#40748
[ML] New job wizards UI#40748jgowdyelastic merged 15 commits intoelastic:feature-new-ml-job-wizards-newfrom
Conversation
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
walterra
left a comment
There was a problem hiding this comment.
LGTM overall, just a bunch of questions/thoughts.
|
|
||
| // @ts-ignore: incomplete kibana types | ||
| const bounds = timefilter.getActiveBounds(); | ||
| const tf = timefilter as any; |
There was a problem hiding this comment.
Once Melissa's navbar PR is in this shouldn't be necessary anymore if you merge master then, she added the missing types to timefilter.
There was a problem hiding this comment.
x-pack/legacy/plugins/ml/public/jobs/new_job_new/common/results_loader/results_loader.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/jobs/new_job_new/common/results_loader/results_loader.ts
Outdated
Show resolved
Hide resolved
..._job_new/pages/components/pick_fields_step/components/multi_metric_view/metric_selection.tsx
Outdated
Show resolved
Hide resolved
| {metricsValid && isActive && ( | ||
| <Fragment> | ||
| <EuiHorizontalRule margin="l" /> | ||
| <MultiMetricSettings isActive={isActive} setIsValid={setSettingsValid} /> |
There was a problem hiding this comment.
ultra-semantics-nit: since setIsValid is the callback inside the component and not the setter itself, what if these kind of props were called onIsValid (similar to onChange exposed by EUI components or native listeners).
There was a problem hiding this comment.
onIsValid doesn't describe this as well as setIsValid IMO.
The prop is allowing the component to report whether it is valid. something like onSettingsChange or something like that would be more accurate, but then it loses the point that it's for validation. I'm going to leave this name as is, although it's not the great, it's better than alternatives.
| marginBottom: `-${SPACING}px`, | ||
| marginLeft: `${sideMargin}px`, | ||
| marginRight: `${sideMargin}px`, | ||
| transition: 'margin 0.2s', |
There was a problem hiding this comment.
does this need cross-browser alternatives since it's not running through SCSS compilation?
There was a problem hiding this comment.
Good point, I think it should probably be moved to SCSS.
I'll look into that in a follow up https://github.com/elastic/kibana/projects/30#card-23885080
...ublic/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx
Outdated
Show resolved
Hide resolved
...ublic/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx
Outdated
Show resolved
Hide resolved
| <EuiPageContentBody> | ||
| <EuiSpacer size="l" /> | ||
| <Wizard | ||
| jobCreator={jobCreator} |
There was a problem hiding this comment.
Could jobCreatorContext already be created in this component and be applied in the jsx here using <JobCreatorContext.Provider value={jobCreatorContext}>? Then it wouldn't be necessary to pass it down here as a prop and the code to create it wouldn't be spread across 2 files.
There was a problem hiding this comment.
possibly yes, i think i tried that but hit a problem. i'll revisit it.
There was a problem hiding this comment.
I remember now, the creation of the jobCreator needs to be in a higher level component otherwise it gets recreated on re-render.
The jobCreator, chartInterval and chartLoader classes could be created in a separate factory function above the page component.
This whole structure can be revisited later in a refactor.
There was a problem hiding this comment.
| }); | ||
| }, | ||
|
|
||
| newJobLineChart( |
There was a problem hiding this comment.
could we just pass a data object then we wouldn't have to list all the args/properties twice? (guess this might make sense once migrating to typescript because then the data object could be defined by an interface instead of having single functions args here)
There was a problem hiding this comment.
This can be addressed when we typescriptify the ml_api_service file.
peteharverson
left a comment
There was a problem hiding this comment.
Overall LGTM. Just some minor comments and questions.
Is adding data-test-subj attributes on the TODO list too?
| this._timeFieldName, | ||
| start, | ||
| end, | ||
| intervalMs * 3 |
There was a problem hiding this comment.
Why is 3 being used here? Could it be moved to a const with a comment?
There was a problem hiding this comment.
Short answer is it makes the chart look nicer by widening the buckets.
I'll see if there is a nicer way to do it, or make it a const
There was a problem hiding this comment.
x-pack/legacy/plugins/ml/public/jobs/new_job_new/common/results_loader/results_loader.ts
Outdated
Show resolved
Hide resolved
| jobIdFilterStr += `"${String(firstSplitField.value).replace(/\\/g, '\\\\')}"`; | ||
| } | ||
|
|
||
| ml.esSearch({ |
There was a problem hiding this comment.
Can this search be moved to the server-side results_service?
There was a problem hiding this comment.
yes hopefully that can happen in a later PR. I'd like all searches to happen server side
There was a problem hiding this comment.
x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/charts/common/settings.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/new_job/route.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/server/models/job_service/new_job/line_chart.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/server/models/job_service/new_job/population_chart.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/server/models/job_service/new_job/population_chart.ts
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/jobs/new_job_new/common/chart_loader/chart_loader.ts
Outdated
Show resolved
Hide resolved
|
Is adding in the |
it is now. |
|
Overall, LGTM - the only thing I'd feel more strongly about are the places Walter pointed out that the subscription to the observable could be returned so that on unmount |
💔 Build Failed |
💔 Build Failed |
peteharverson
left a comment
There was a problem hiding this comment.
Latest changes and comments LGTM
💔 Build Failed |
💚 Build Succeeded |
alvarezmelissa87
left a comment
There was a problem hiding this comment.
Latest changes LGTM ⚡️
| }; | ||
|
|
||
| function getTitle(agg: Aggregation, field: Field, splitField: SplitField): string { | ||
| // let title = ${agg.title}(${field.name})`; |
There was a problem hiding this comment.
Is this ever going to be needed?
There was a problem hiding this comment.
This was raised by Pete also #40748 (comment)
I'm going to leave it in for now as there is outstanding work on the detector titles
* [ML] Adding new job wizards services (#40718) * [ML] Adding new job wizards services * adding ts-ignore for incomplte kibana timefilter type * [ML] New job wizards UI (#40748) * [ML] New job wizards UI * small refactor * fixing type problems * updating snapshots * updating translations ids for temporary new job links * updating translation ids * fixing population by field selection * small refactor to by field select * moving component descriptions to separate files * moving chart grid component into own file * fixing event rate count detector * fixing decimal place rounding * changes based on review * more changes based on review * fixing test * [ML] Adding created_by to job (#41015) * [ML] Adding json preview (#41078) * [ML] Adding job json preview * fix typo * [ML] Fixing view results button (#41077) * [ML] Adding generic custom settings functions to job creator (#41046) * [ML] Adding generic custom settings functions to job creator * fixing typo * [ML] Adding advanced section to job details step (#41157) * [ML] Adding advanced section to job details step * disabling model plot for population * changes based on review * updating include paths * [ML] Adding additional settings section to job details step (#41339) * [ML] Adding additional settings section to job details step * changes based on review * [ML] Adding basic job validation (#41459) * [ML] Adding basic job validation * removing observable * small refactor * comments and refactors * disabling create job button * adding duplicate job and group id checks * disabling next on invalid wizard step * changes based on review * removing unused includes * [ML] Adding advanced job validation (#41634) * [ML] Adding advanced job validation * clean up * function rename * updating tests * show some previous step info * removing . from validation titles * fixes advanced validation duration check * removing include * [ML] Changing wizard layout (#41802) * [ML] Changing wizard layout * adding a comment * fixing wizard step link issue * removing greyed out controls in summary * filtering out basic validation results * adding wizards steps back into summary * moving idFilterList * removing unused includes * [ML] Adding date picker to time range step (#41978) * [ML] Adding date picker to time range step * adding comments * sorting influencers * removing euiSize for width * [ML] Displaying job creation errors (#42165) * [ML] Displaying job creation errors * removing unnecessary try/catch * [ML] Updating index pattern type (#42269) * [ML] Updating index pattern type * changes based on review
* [ML] Adding new job wizards services (elastic#40718) * [ML] Adding new job wizards services * adding ts-ignore for incomplte kibana timefilter type * [ML] New job wizards UI (elastic#40748) * [ML] New job wizards UI * small refactor * fixing type problems * updating snapshots * updating translations ids for temporary new job links * updating translation ids * fixing population by field selection * small refactor to by field select * moving component descriptions to separate files * moving chart grid component into own file * fixing event rate count detector * fixing decimal place rounding * changes based on review * more changes based on review * fixing test * [ML] Adding created_by to job (elastic#41015) * [ML] Adding json preview (elastic#41078) * [ML] Adding job json preview * fix typo * [ML] Fixing view results button (elastic#41077) * [ML] Adding generic custom settings functions to job creator (elastic#41046) * [ML] Adding generic custom settings functions to job creator * fixing typo * [ML] Adding advanced section to job details step (elastic#41157) * [ML] Adding advanced section to job details step * disabling model plot for population * changes based on review * updating include paths * [ML] Adding additional settings section to job details step (elastic#41339) * [ML] Adding additional settings section to job details step * changes based on review * [ML] Adding basic job validation (elastic#41459) * [ML] Adding basic job validation * removing observable * small refactor * comments and refactors * disabling create job button * adding duplicate job and group id checks * disabling next on invalid wizard step * changes based on review * removing unused includes * [ML] Adding advanced job validation (elastic#41634) * [ML] Adding advanced job validation * clean up * function rename * updating tests * show some previous step info * removing . from validation titles * fixes advanced validation duration check * removing include * [ML] Changing wizard layout (elastic#41802) * [ML] Changing wizard layout * adding a comment * fixing wizard step link issue * removing greyed out controls in summary * filtering out basic validation results * adding wizards steps back into summary * moving idFilterList * removing unused includes * [ML] Adding date picker to time range step (elastic#41978) * [ML] Adding date picker to time range step * adding comments * sorting influencers * removing euiSize for width * [ML] Displaying job creation errors (elastic#42165) * [ML] Displaying job creation errors * removing unnecessary try/catch * [ML] Updating index pattern type (elastic#42269) * [ML] Updating index pattern type * changes based on review
* [ML] Adding new job wizards services (#40718) * [ML] Adding new job wizards services * adding ts-ignore for incomplte kibana timefilter type * [ML] New job wizards UI (#40748) * [ML] New job wizards UI * small refactor * fixing type problems * updating snapshots * updating translations ids for temporary new job links * updating translation ids * fixing population by field selection * small refactor to by field select * moving component descriptions to separate files * moving chart grid component into own file * fixing event rate count detector * fixing decimal place rounding * changes based on review * more changes based on review * fixing test * [ML] Adding created_by to job (#41015) * [ML] Adding json preview (#41078) * [ML] Adding job json preview * fix typo * [ML] Fixing view results button (#41077) * [ML] Adding generic custom settings functions to job creator (#41046) * [ML] Adding generic custom settings functions to job creator * fixing typo * [ML] Adding advanced section to job details step (#41157) * [ML] Adding advanced section to job details step * disabling model plot for population * changes based on review * updating include paths * [ML] Adding additional settings section to job details step (#41339) * [ML] Adding additional settings section to job details step * changes based on review * [ML] Adding basic job validation (#41459) * [ML] Adding basic job validation * removing observable * small refactor * comments and refactors * disabling create job button * adding duplicate job and group id checks * disabling next on invalid wizard step * changes based on review * removing unused includes * [ML] Adding advanced job validation (#41634) * [ML] Adding advanced job validation * clean up * function rename * updating tests * show some previous step info * removing . from validation titles * fixes advanced validation duration check * removing include * [ML] Changing wizard layout (#41802) * [ML] Changing wizard layout * adding a comment * fixing wizard step link issue * removing greyed out controls in summary * filtering out basic validation results * adding wizards steps back into summary * moving idFilterList * removing unused includes * [ML] Adding date picker to time range step (#41978) * [ML] Adding date picker to time range step * adding comments * sorting influencers * removing euiSize for width * [ML] Displaying job creation errors (#42165) * [ML] Displaying job creation errors * removing unnecessary try/catch * [ML] Updating index pattern type (#42269) * [ML] Updating index pattern type * changes based on review

First PR for the jobs wizard remake UI.
In this initial version, single metric, multi metric and population jobs can be created.
For multi metric and population jobs, the data can be split in a similar way to the original wizards.
As with the original wizards, when starting the jobs the results will be polled and drawn over the charts.
Basic things missing in this PR which will be added in follow ups:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers