Skip to content
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

[Actionable Observability] Display action connector icon in o11y rule details page #132026

Merged
merged 9 commits into from
May 20, 2022

Conversation

mgiota
Copy link
Contributor

@mgiota mgiota commented May 11, 2022

Fixes #132220
Fixes #132580

Screenshot 2022-05-18 at 08 58 39

@mgiota mgiota self-assigned this May 16, 2022
@mgiota mgiota added Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.3.0 release_note:skip Skip the PR/issue when compiling release notes labels May 16, 2022
@mgiota mgiota force-pushed the action_connector_iconClass branch from 5d14f58 to 584b174 Compare May 16, 2022 18:22
@mgiota mgiota force-pushed the action_connector_iconClass branch from 584b174 to 292a67b Compare May 16, 2022 20:57
@mgiota mgiota marked this pull request as ready for review May 17, 2022 06:38
@mgiota mgiota requested a review from a team as a code owner May 18, 2022 07:01
@mgiota mgiota force-pushed the action_connector_iconClass branch 2 times, most recently from c702f31 to a4be29e Compare May 18, 2022 07:10
@mgiota mgiota force-pushed the action_connector_iconClass branch from a4be29e to 8b6c669 Compare May 18, 2022 07:36
@mgiota mgiota requested a review from fkanout May 18, 2022 07:36
@mgiota mgiota changed the title [Actionable Observability] get action connector iconClass for actionTypeRegistry [Actionable Observability] Display action connector icon in o11y rule details page May 18, 2022
@mgiota
Copy link
Contributor Author

mgiota commented May 18, 2022

@elasticmachine merge upstream

Copy link
Contributor

@katrin-freihofner katrin-freihofner left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

@mgiota there is size inconsistency between the app icons. IBM logo is too small, xMatter icon too big, swimlane is truncated. Most likely it's related to SVG view box size, I would say.

Screenshot 2022-05-18 at 13 44 18

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

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

LGTM, as this is just an export of a fairly generic component and I don't want to block @mgiota .

That said - I was wondering whether suspendedComponentWithProps is so generic that it actually shouldn't be in TriggerActionsUI at all? 🤔
Any thoughts @elastic/response-ops-ram ?

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

ResponseOps changes LGTM

Copy link
Contributor

@JiaweiWu JiaweiWu left a comment

Choose a reason for hiding this comment

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

LGTM!

@JiaweiWu
Copy link
Contributor

@gmmorris Yea I think the implementation is so trivial that it might make sense as a guideline (suspended components must use the EUI loading indicator) rather than a reusable component. I would even argue that having it as a reusable component add an unnecessary layer of abstraction.

@mgiota
Copy link
Contributor Author

mgiota commented May 19, 2022

@fkanout I tried a few things with eui styled components (wrapping a div around the icon and applying some custom styles), but the problem still persists. Regarding xmatters, I noticed that xLarge is defined directly in the logo.tsx https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/xmatters/logo.tsx#L15, which I think should be removed anyway.

Regarding the smaller icons you mentioned, I am not sure if we can do anything about it, other than changing the svgs, but that would require more testing on the rest places icons appear.

Do you have any suggestions how we can fix the above problem with xmatters? Current Github issue was mainly about using the actionTypeRegistry to retrieve the existing logos. Do you think we can merge this one and fix the UI problem in a separate Github issue?

@mgiota mgiota requested a review from fkanout May 19, 2022 07:08
@fkanout
Copy link
Contributor

fkanout commented May 19, 2022

@mgiota, I know dealing with SVG is not the easiest thing 😮‍💨 . I will take a look.

However, I wonder how they are size-standardized in the connectors' panel 🤔 ?
Screenshot 2022-05-19 at 12 26 08

@mgiota
Copy link
Contributor Author

mgiota commented May 19, 2022

@fkanout My first guess is that these icons are of size="l" or size="xl", so resizing svgs to the biggest dimension would make all of them look the same. The other way around causes troubles, having some bigger svgs and trying to make them smaller, which is exactly the challenge we face right now. In our code we have size="m" for the EuiIcon and all icons apart from xmatters get resized and look kind of ok. But xmatters has className="euiIcon euiIcon--xLarge euiCard__icon" in the logo.tsx. Even removing this didn't fix the issue. I will definitely dig into it and hopefully find a solution. Let me know if you find something.

UPDATE Yep my assumption is correct. In the connector's panel they specify their icons as size="xl". I changed to size="m" as we have in our code and the exact same issue is reproducible. Good news is that we know for sure that only xmatters is problematic.
Screenshot 2022-05-19 at 21 53 48.

Accordingly if I change our icons to size="xl" they all look fine. I am not suggesting of course to make them that big (I am not a fan of big icons anyway). We just need a new svg for xmatters. I summarized the needed steps in your suggested solution below.
Screenshot 2022-05-19 at 22 01 47

{actions.map((action) => (
<>
{actions.map(({ actionTypeId, name }) => (
<React.Fragment key={actionTypeId}>
<EuiFlexGroup alignItems="baseline">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<EuiFlexGroup alignItems="baseline">
<EuiFlexGroup alignItems="center">
<EuiFlexItem
style={{
position: 'relative',
width: '26px',
height: '26px',
}}
grow={false}
>
<EuiIcon
style={{
position: 'absolute',
height: '100%',
width: '100%',
left: 0,
top: 0,
}}
size="m"
type={getActionIconClass(actionTypeId) ?? 'apps'}
/>
</EuiFlexItem>

@mgiota, It's not perfect, but it seems a bit better. feel free to add it if you think so
Screenshot 2022-05-19 at 14 33 46

Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

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

@fkanout Great, I am back to this PR and I am gad to see it is already looks better, more symmetrical. I can take it from here and do a bit of refactoring regarding using import { euiStyled } from '@kbn/kibana-react-plugin/common'; to not do the styling inline. But this doesn't fix the root of the problem, which is the xmatters svg icon.

Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

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

@fkanout @katrin-freihofner Here's what I suggest:

  1. Remove className="euiIcon euiIcon--xLarge euiCard__icon" from xmatters logo.tsx file
  2. Decide on the width and height of the custom container. I think 26px is a little bit big. @katrin-freihofner What do you think?
  3. Fix xmatters svg

Here's how it looks with the first 2 changes. Step 3 is missing and I think it should look fine.
Screenshot 2022-05-19 at 16 58 00

@katrin-freihofner Could you provide us with a new SVG for xmatters? Here you can find the existing svg. I started playing and changing viewBox etc, but no success.

You can also read my comment above for more context #132026 (comment)

Copy link
Contributor Author

@mgiota mgiota May 19, 2022

Choose a reason for hiding this comment

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

Good news, I played a bit more with the xmatters svg file and I fixed the issue. Step 2 (custom dimensions) is not needed anymore, since xmatters behaves well now with the specified size="m" 😄

Screenshot 2022-05-19 at 22 37 00

Sidenote: Alignment is a bit off, but I guess this is out of scope of this PR, since I noticed more alignment issues anyway.

Screenshot 2022-05-19 at 22 48 30

Copy link
Contributor

Choose a reason for hiding this comment

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

@mgiota, great work! 👏🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fkanout Small issues surfaced with this PR, good that it looks much better now! Your approval is still needed for this PR.

@mgiota mgiota requested a review from katrin-freihofner May 19, 2022 15:05
@mgiota mgiota requested a review from fkanout May 19, 2022 20:13
@mgiota
Copy link
Contributor Author

mgiota commented May 19, 2022

@fkanout I fixed the issue. Could you do one more round of testing?

I created a ticket to track the fix we did for xmatters icon #132580, since this PR fixes current Rules and Connectors page as well. Regarding smaller icons they also don't look perfect there as well.

Current status Rules and connectors
Screenshot 2022-05-20 at 09 47 42

After our fix
Screenshot 2022-05-20 at 09 48 33

@katrin-freihofner Adding custom width and height in our page is not going to fix the issue with smaller icons. The svg icons need to be changed as well. I suggest we create a new ticket and we fix this seperately. This is definitely out of scope of current issue.

UPDATE: Here's the new issue to fix smaller logo icons.

@mgiota mgiota enabled auto-merge (squash) May 20, 2022 08:38
@mgiota
Copy link
Contributor Author

mgiota commented May 20, 2022

@elasticmachine merge upstream

Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

LGTM. The icons render a lot better. The Swimlane icon seems to need some fix in separate PR as it's out of the scope of this one.

Screenshot 2022-05-20 at 11 31 49

@mgiota
Copy link
Contributor Author

mgiota commented May 20, 2022

@fkanout Yep exactly! Here's the new issue regarding taking care of smaller svg icons #132591

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

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
triggersActionsUi 370 373 +3

Async chunks

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

id before after diff
observability 452.3KB 452.5KB +183.0B
triggersActionsUi 786.3KB 786.4KB +16.0B
total +199.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 115.5KB 115.5KB +62.0B
Unknown metric groups

API count

id before after diff
triggersActionsUi 384 387 +3

History

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

cc @mgiota

@mgiota mgiota merged commit de90ea5 into elastic:main May 20, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 20, 2022
@mgiota mgiota deleted the action_connector_iconClass branch September 29, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.3.0
Projects
No open projects
8 participants