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

[OBX-UX-MNGMT][BUG]APM creation rules flyout is broken when it's accessed from Stack Management #186970

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fkanout
Copy link
Contributor

@fkanout fkanout commented Jun 26, 2024

Summary

It fixes #186969 by migrating to emotions from styled-component

Screenshot 2024-06-26 at 12 52 16
Screenshot 2024-06-26 at 12 51 49

@fkanout fkanout added bug Fixes for quality problems that affect the customer experience Feature:Alerting Team:obs-ux-management Observability Management User Experience Team v8.15.0 labels Jun 26, 2024
@fkanout fkanout self-assigned this Jun 26, 2024
@obltmachine
Copy link

🤖 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!)

@@ -110,7 +110,7 @@ export function Controls() {
);

const [zoom, setZoom] = useState((cy && cy.zoom()) || 1);
const duration = parseInt(theme.eui.euiAnimSpeedFast, 10);
const duration = parseInt(String(theme.animation.fast), 10);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about this one.

export const getAnimationOptions = (
theme: UseEuiThemeWithColorsVis
): cytoscape.AnimationOptions => ({
duration: parseInt(String(theme.animation.normal), 10),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

@fkanout fkanout changed the title APM creation rules flyout is broken when it's accessed from Stack Management [OBX-UX-MNGMT][BUG]APM creation rules flyout is broken when it's accessed from Stack Management Jun 26, 2024
@fkanout fkanout marked this pull request as ready for review June 26, 2024 10:56
@fkanout fkanout requested a review from a team as a code owner June 26, 2024 10:56
@elasticmachine
Copy link
Contributor

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

@fkanout fkanout added the release_note:skip Skip the PR/issue when compiling release notes label Jun 26, 2024
Copy link
Contributor

@kpatticha kpatticha left a comment

Choose a reason for hiding this comment

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

@fkanout why is failing in alerts management page but it work as expected for APM?

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Jun 26, 2024
@elasticmachine
Copy link
Contributor

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

@fkanout
Copy link
Contributor Author

fkanout commented Jun 27, 2024

@fkanout why is failing in alerts management page but it work as expected for APM?

@kpatticha, there is an initiative/requirement to move from the styled-component to emotion for all Kibana. And I think due to an update the styled-component context is no longer available in the context of the alert management.
BTW, we had similar issue under observability for some component #186248

Copy link
Contributor

@kpatticha kpatticha left a comment

Choose a reason for hiding this comment

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

code LGTM I didn't test it locally though

@maryam-saeidi maryam-saeidi self-assigned this Jun 28, 2024
@maryam-saeidi maryam-saeidi enabled auto-merge (squash) June 28, 2024 15:21
),
};
return {
...euiTheme,
Copy link
Member

Choose a reason for hiding this comment

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

@fkanout Was there any challenge in returning the same data shape as before? (i.e., EuiTheme from '@kbn/kibana-react-plugin/common')

I am wondering, for fixing types, whether it would be better to find a way and make returning EuiTheme work or change the places that uses useTheme to follow the new structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maryam-saeidi, good question! When I started working on the refactoring, I thought I had only to replace the imports from styled-components and use the equivalents from emotion. After asking the eui-team, it appeared that it was more than just that.
As you can see from the updates in the hook the data are coming from different objects with different structure and types. e.g., there is no euiColorVis anymore in emotion (only an array of values called euiPaletteColorBlind) that I mapped back to old names. Also some value changed regarding the duration (as I commented initially).

So, to sum up, I'm using the same name of the last element, e.g. euiColorVis5, euiColorVis9BehindText, to confirm this is the replacement of the old one. But the object, the structure, and the object path to reach that is different. With that hybrid solution, I think we get a good balance as we still know what we are using by keeping the old names, and at the same time, we know it's the new structure from emotion

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 2, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / AllCasesListGeneric Actions Assignees should show the assignees column on platinum license
  • [job] [logs] FTR Configs #63 / APM specs correlations latency correlations space with no features disabled sets the timePicker to return data
  • [job] [logs] FTR Configs #78 / Journey[apm_service_inventory] Navigate to Service Inventory Page
  • [job] [logs] FTR Configs #78 / Journey[apm_service_inventory] Navigate to Service Inventory Page

History

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

cc @fkanout @maryam-saeidi

@maryam-saeidi maryam-saeidi removed their assignment Jul 2, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 2, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #100 / @skipInServerless endpoint @ess @serverless For each artifact list under management When on the Event Filters entries list should be able to add a new Event Filters entry
  • [job] [logs] Jest Tests #5 / Timeline TimelineAxisContainer should render with data
  • [job] [logs] Jest Tests #5 / Timeline TimelineAxisContainer should render with data
  • [job] [logs] Jest Tests #5 / Timeline VerticalLinesContainer should render with data
  • [job] [logs] Jest Tests #5 / Timeline VerticalLinesContainer should render with data
  • [job] [logs] Jest Tests #5 / useCytoscapeEventHandlers when data is received runs the layout
  • [job] [logs] Jest Tests #5 / useCytoscapeEventHandlers when data is received runs the layout
  • [job] [logs] Jest Tests #5 / useCytoscapeEventHandlers when data is received with a service name sets the primary class
  • [job] [logs] Jest Tests #5 / useCytoscapeEventHandlers when data is received with a service name sets the primary class

History

cc @fkanout

@maryam-saeidi
Copy link
Member

We created a separate PR to fix this issue and possibly backport it to v8.14.

We can revisit the changes in this PR later in order to migrate from styled-component to emotion and remove the related provider that was added in the above fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review bug Fixes for quality problems that affect the customer experience ci:project-deploy-observability Create an Observability project Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OBX-UX-MNGMT][BUG] APM creation rules flyout is broken when it's accessed from Stack Management
7 participants