[ML] Anomaly Detection: Improves layout for custom URLs list#231751
[ML] Anomaly Detection: Improves layout for custom URLs list#231751KodeRad merged 12 commits intoelastic:mainfrom
Conversation
d31b89d to
59221ae
Compare
|
/ci |
...tform/plugins/shared/ml/public/application/components/custom_urls/custom_url_editor/list.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/components/custom_urls/custom_urls.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/components/custom_urls/custom_urls.tsx
Outdated
Show resolved
Hide resolved
...onents/job_details_step/components/additional_section/components/custom_urls/description.tsx
Outdated
Show resolved
Hide resolved
...onents/job_details_step/components/additional_section/components/custom_urls/description.tsx
Outdated
Show resolved
Hide resolved
5b112bb to
8b14d92
Compare
|
Pinging @elastic/ml-ui (:ml) |
| const customUrlRows = customUrls.map((customUrl, index) => { | ||
| // Validate the label. | ||
| const label = customUrl.url_name; | ||
| const effectiveLabel = label || `Custom URL ${index + 1}`; |
There was a problem hiding this comment.
I don't think label will be undefined here, unless you've see it when testing? The type says it is non-optional, so I don't think this effectiveLabel variable is needed.
If it is needed, the Custom URL ${index + 1} text will need to be translated.
Also we prefer to use the nullish coalescing operator ?? for checks for null/undefined like this.
If this variable is needed, we might need a different approach as I don't think it is good practice to combine two translated strings as is happening below 'URL value for {label}'
There was a problem hiding this comment.
That's right. I re-checked and there is no need to guard against undefined label, as it is already done through TS. Thanks for pointing that out 👍
...tform/plugins/shared/ml/public/application/components/custom_urls/custom_url_editor/list.tsx
Outdated
Show resolved
Hide resolved
10beca7 to
daf6566
Compare
daf6566 to
e184ac2
Compare
jgowdyelastic
left a comment
There was a problem hiding this comment.
Left a comment, but otherwise LGTM
| }, | ||
| }, | ||
| }); | ||
| const styles = { |
There was a problem hiding this comment.
nit, this could be wrapped in a useMemo
There was a problem hiding this comment.
I intentionally skipped this as there are no computation going on in these styles. It is just a plain object with css. Do you think we still need to use useMemo in this particular case?
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @KodeRad |
) ## Summary Follow-up PR to the #231751 There is another place in which this component is used. It is located at **Data Frame Analytics** > **Create Job** wizard Screenshot with the fix: <img width="1011" height="430" alt="Screenshot 2025-08-22 at 10 08 02" src="https://github.com/user-attachments/assets/fcabbf2e-ca12-4141-93e0-d3751b848d9c" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
…#231751) ## Summary This PR fixes elastic#115426. Changes include: - Re-arranging the **Custom URL list layout**: - Wrapping each Custom URL in an `EuiPanel` - Changing the field order from **Label, URL, Time Range** → **Label, Time Range, URL** - Moving the trash and test buttons to the top-right - Moving the **Add Custom URL** button to the bottom - Fixing the width of the URL field - Displaying the Custom URL list vertically in the **Create Job** Wizard - Improving accessibility (a11y) throughout - Updating test snapshot ## Fly-out: <img width="1226" height="485" alt="Screenshot 2025-08-18 at 10 30 50" src="https://github.com/user-attachments/assets/8025f17f-9a6a-48d6-b31a-a4a826756321" /> <img width="738" height="486" alt="Screenshot 2025-08-18 at 10 31 08" src="https://github.com/user-attachments/assets/a3e7dbda-04cd-4b57-aeed-b24016aab058" /> <img width="524" height="598" alt="Screenshot 2025-08-18 at 10 31 24" src="https://github.com/user-attachments/assets/259db332-587f-40d0-8030-d93b01a52443" /> <img width="417" height="740" alt="Screenshot 2025-08-18 at 10 31 40" src="https://github.com/user-attachments/assets/757c3640-ae9a-4f4b-b4f6-e9ca05e5ff94" /> ## Create Job Wizard: <img width="1048" height="932" alt="Screenshot 2025-08-18 at 15 31 59" src="https://github.com/user-attachments/assets/562930fb-0457-457c-8bde-c8ab0bbbf02c" /> <img width="618" height="477" alt="Screenshot 2025-08-18 at 15 32 28" src="https://github.com/user-attachments/assets/a548a078-d430-41e3-aed9-6815f2c8a32c" /> <img width="506" height="597" alt="Screenshot 2025-08-18 at 15 32 38" src="https://github.com/user-attachments/assets/4ee7657b-01b1-49c6-bc39-841d09252122" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
Summary
This PR fixes #115426.
Changes include:
EuiPanelFly-out:
Create Job Wizard:
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.