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

[Uptime] Remove tabs from details page #85955

Closed
wants to merge 6 commits into from

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Dec 15, 2020

Summary

Fixes: #85826

Removed tabs from detail monitor pages.

image

@shahzad31 shahzad31 marked this pull request as ready for review December 15, 2020 14:57
@shahzad31 shahzad31 requested a review from a team as a code owner December 15, 2020 14:57
@shahzad31 shahzad31 added release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v8.0.0 labels Dec 15, 2020
Copy link
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.

Looks good! A few comments/questions. Reviewed isMonitorRoute flow but wasn't able to review isStepDetailRoute as of yet. Also need to run tests on this branch but ran into issues. Will re-review after X-School.

@@ -52,19 +53,20 @@ export const PageHeader = () => {

const isMonRoute = useRouteMatch(MONITOR_ROUTE);

if (isStepDetailRoute) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need unit tests for these? I'd use react testing library to check if these pieces, either the tabs, monitor heading, or nothing, were in the DOM depending on the route found with useRouteMatch

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 totally agree, those are missing

@@ -0,0 +1,55 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this new component need unit tests?

// generated id like `auto-http-0X8D6082B94BBE3B8A`.
// We may deprecate this behavior in the next major release, because
// the heartbeat config will require an explicit ID.
const getPageTitle = (monId: string, selectedMonitor: Ping | null) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer monitorId to monId. It seems we are using the full word elsewhere, so I think it'd be helpful to keep it consistent and explicit.

@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiSpacer } from '@elastic/eui';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect a test to fail from removing this much markup. Do we have unit tests for this component?

*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, do you have any standards for how you order imports? I've worked at companies where there were strong opinions about how to order imports. I noticed that in this component third party libraries are listed after internal libraries, whereas in another its reversed, so just curious.

Copy link
Contributor

Choose a reason for hiding this comment

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

My $0.02 cents is that so long as the linter doesn't complain it's fine, esp. given that imports tend to be mostly managed by editors these days.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't sort alphabetically, but we have lint rule for relative/absolute import orders

@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Dec 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

return autoGeneratedId.test(id);
};

// For monitors with no explicit ID, we display the URL instead of the
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the comment!

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this case is working right, here's what I see:

image

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 fixed this

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

Seems to work on the happy path, but tests are failing, and the behavior with auto-generated IDs isn't right.

return autoGeneratedId.test(id);
};

// For monitors with no explicit ID, we display the URL instead of the
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this case is working right, here's what I see:

image

@shahzad31
Copy link
Contributor Author

@andrewvc fixed the issue

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
uptime 566 567 +1

Async chunks

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

id before after diff
uptime 1.0MB 1.0MB -43.0B

Distributable file count

id before after diff
default 47241 48001 +760

History

To update your PR or re-run it, just comment with:
@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

@shahzad31 shahzad31 closed this Jan 4, 2021
@shahzad31 shahzad31 deleted the details-page-tabs branch January 4, 2021 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime UI] Overview tab is not selected
6 participants