Skip to content

[Synthetics] Add missing monitorType and tag info in cards !!#188824

Merged
shahzad31 merged 11 commits intoelastic:mainfrom
shahzad31:add-tags-to-card
Jul 23, 2024
Merged

[Synthetics] Add missing monitorType and tag info in cards !!#188824
shahzad31 merged 11 commits intoelastic:mainfrom
shahzad31:add-tags-to-card

Conversation

@shahzad31
Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 commented Jul 22, 2024

Summary

Add missing monitorType and tag info in cards !!

Testing

Easiest way to test is connect to an oblt cluster and go to synthetics UI to create few monitors

After

image

Before

image

Highlighted change

image

@shahzad31 shahzad31 added the release_note:skip Skip the PR/issue when compiling release notes label Jul 22, 2024
@obltmachine
Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@shahzad31
Copy link
Copy Markdown
Contributor Author

/ci

@shahzad31 shahzad31 marked this pull request as ready for review July 22, 2024 12:16
@shahzad31 shahzad31 requested a review from a team as a code owner July 22, 2024 12:16
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. labels Jul 22, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@maryam-saeidi
Copy link
Copy Markdown
Member

@shahzad31 Can you please highlight what has changed in the before and after images? It feels like a find the difference game :D Also, would you please share how should we test this PR?

Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there are many tags and they are uncollapsed, the UI appears broken.

Also, the monitor type tag is not keyboard accessible, and needs to be since it can be used to apply a filter to the page.

See how the tags themselves are keyboard accessible since they are kickable.

https://www.loom.com/share/d37ebaaf53dd4c3783d9d2f7659e481b?sid=e0b330bb-4976-4479-af02-8aafc0995382

@shahzad31 shahzad31 requested a review from a team as a code owner July 22, 2024 19:53
@kibana-ci
Copy link
Copy Markdown

kibana-ci commented Jul 22, 2024

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 973 974 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
observabilityShared 350 351 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityShared 54.9KB 54.9KB +22.0B
synthetics 847.8KB 847.1KB -735.0B
total -713.0B
Unknown metric groups

API count

id before after diff
observabilityShared 355 356 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some nits

Comment on lines +23 to +47
<EuiBadge
onClick={onClick}
onClickAriaLabel={getFilterTitle(monitorType)}
title={ariaLabel}
aria-label={ariaLabel}
iconType={getMonitorTypeBadgeIcon(monitorType)}
onMouseDown={(e: MouseEvent) => {
// Prevents the click event from being propagated to the @elastic/chart metric
e.stopPropagation();
}}
>
{getMonitorTypeBadgeTitle(monitorType)}
</EuiBadge>
) : (
badge
<EuiBadge
title={ariaLabel}
aria-label={ariaLabel}
iconType={getMonitorTypeBadgeIcon(monitorType)}
onMouseDown={(e: MouseEvent) => {
// Prevents the click event from being propagated to the @elastic/chart metric
e.stopPropagation();
}}
>
{getMonitorTypeBadgeTitle(monitorType)}
</EuiBadge>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to check if onClick is defined and have two variants for this component. If onClick is undefined it'll pass undefined to the EuiBadge component.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried it doesn't work with onClickAriaLabel being present always. it's kinda weird.

Comment on lines +17 to +37
const tags = monitor.tags;
const history = useHistory();

return (
<>
<EuiSpacer size="xs" />
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<MonitorTypeBadge
monitorType={monitor[ConfigKey.MONITOR_TYPE]}
ariaLabel={labels.getFilterForTypeMessage(monitor[ConfigKey.MONITOR_TYPE])}
onClick={() => {
history.push({
search: `monitorTypes=${encodeURIComponent(
JSON.stringify([monitor[ConfigKey.MONITOR_TYPE]])
)}`,
});
}}
/>
</EuiFlexItem>
{(tags ?? []).length > 0 && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const tags = monitor.tags;
const history = useHistory();
return (
<>
<EuiSpacer size="xs" />
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<MonitorTypeBadge
monitorType={monitor[ConfigKey.MONITOR_TYPE]}
ariaLabel={labels.getFilterForTypeMessage(monitor[ConfigKey.MONITOR_TYPE])}
onClick={() => {
history.push({
search: `monitorTypes=${encodeURIComponent(
JSON.stringify([monitor[ConfigKey.MONITOR_TYPE]])
)}`,
});
}}
/>
</EuiFlexItem>
{(tags ?? []).length > 0 && (
const tags = monitor.tags ?? [];
const history = useHistory();
return (
<>
<EuiSpacer size="xs" />
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<MonitorTypeBadge
monitorType={monitor[ConfigKey.MONITOR_TYPE]}
ariaLabel={labels.getFilterForTypeMessage(monitor[ConfigKey.MONITOR_TYPE])}
onClick={() => {
history.push({
search: `monitorTypes=${encodeURIComponent(
JSON.stringify([monitor[ConfigKey.MONITOR_TYPE]])
)}`,
});
}}
/>
</EuiFlexItem>
{tags.length > 0 && (

Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shahzad31 shahzad31 merged commit 1d08044 into elastic:main Jul 23, 2024
@shahzad31 shahzad31 deleted the add-tags-to-card branch July 23, 2024 18:15
@kibanamachine kibanamachine added v8.16.0 backport:skip This PR does not require backporting labels Jul 23, 2024
TinLe added a commit to TinLe/kibana that referenced this pull request Jul 30, 2024
* master: (3487 commits)
  `BedrockChat` & `GeminiChat` (elastic#186809)
  [ResponseOps] log error when ES Query rules find docs out of time range (elastic#186332)
  skip flaky suite (elastic#188997)
  [Security solution][Alert Details] Enable preview feature flag and cypress tests (elastic#188580)
  [EuiProviders] Warn Developer if EuiProvider is missing (elastic#184608)
  [Security Solution ] Fixes Timeline infinite loading bug (elastic#188943)
  Improve SearchSource SearchRequest type (elastic#186862)
  Deprecate Search Sessions config (elastic#188037)
  [Synthetics] Add missing monitorType and tag info in cards !! (elastic#188824)
  [Console Monaco] Resolve uncaught error from tokenizer (elastic#188746)
  [Data Forge] Add `service.logs` dataset as a  data stream (elastic#188786)
  [Console] Fix failing bulk requests (elastic#188552)
  Update dependency terser to ^5.31.2 (main) (elastic#188528)
  [APM][ECO] Telemetry (elastic#188627)
  [Fleet] Fix uninstall package validation accross space (elastic#188749)
  Update warning on `xpack.fleet.enableExperimental` (elastic#188917)
  [DOCS][Cases] Automate more screenshots for cases (elastic#188697)
  [Fleet] Fix get one agent when feature flag disabled (elastic#188953)
  chore(investigate): Add investigate-app plugin from poc (elastic#188122)
  [Monaco Editor] Add Search functionality (elastic#188337)
  ...
TinLe added a commit to TinLe/kibana that referenced this pull request Jul 30, 2024
* master: (2400 commits)
  `BedrockChat` & `GeminiChat` (elastic#186809)
  [ResponseOps] log error when ES Query rules find docs out of time range (elastic#186332)
  skip flaky suite (elastic#188997)
  [Security solution][Alert Details] Enable preview feature flag and cypress tests (elastic#188580)
  [EuiProviders] Warn Developer if EuiProvider is missing (elastic#184608)
  [Security Solution ] Fixes Timeline infinite loading bug (elastic#188943)
  Improve SearchSource SearchRequest type (elastic#186862)
  Deprecate Search Sessions config (elastic#188037)
  [Synthetics] Add missing monitorType and tag info in cards !! (elastic#188824)
  [Console Monaco] Resolve uncaught error from tokenizer (elastic#188746)
  [Data Forge] Add `service.logs` dataset as a  data stream (elastic#188786)
  [Console] Fix failing bulk requests (elastic#188552)
  Update dependency terser to ^5.31.2 (main) (elastic#188528)
  [APM][ECO] Telemetry (elastic#188627)
  [Fleet] Fix uninstall package validation accross space (elastic#188749)
  Update warning on `xpack.fleet.enableExperimental` (elastic#188917)
  [DOCS][Cases] Automate more screenshots for cases (elastic#188697)
  [Fleet] Fix get one agent when feature flag disabled (elastic#188953)
  chore(investigate): Add investigate-app plugin from poc (elastic#188122)
  [Monaco Editor] Add Search functionality (elastic#188337)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants