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] Refactor header #58836

Merged
merged 16 commits into from
Mar 3, 2020
Merged

[Uptime] Refactor header #58836

merged 16 commits into from
Mar 3, 2020

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Feb 28, 2020

Summary

Cleanup implementation of the header to let pages embed the header rather than the weird sort of control the header works with today. Also uses kibana context in a way that makes more sense, and provide a path forward for #53550 since that will need to add a new header type (and some buttons next to the picker).

Fixes #58835

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@andrewvc andrewvc added [zube]: In Progress technical debt Improvement of the software architecture and operational architecture Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Feb 28, 2020
@andrewvc andrewvc self-assigned this Feb 28, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@andrewvc andrewvc changed the title Partial work toward setting breadcrumbs from context [Uptime] Refactor header Feb 28, 2020
@andrewvc andrewvc requested a review from shahzad31 February 28, 2020 22:12
Comment on lines +97 to +114

const mapStateToProps: MapStateToPropsParam<StateProps, {}, AppState> = state => ({
selectedMonitor: selectSelectedMonitor(state),
});

const mapDispatchToProps: MapDispatchToPropsFunction<DispatchProps, {}> = (dispatch, own) => {
return {
dispatchGetMonitorStatus: (monitorId: string) => {
dispatch(
getSelectedMonitor({
monitorId,
})
);
},
};
};

export const MonitorPage = connect(mapStateToProps, mapDispatchToProps)(MonitorPageComponent);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this part of component to components/connected/pages? we are trying to keep all the data injecting in same folder. It helps us in testing presentational components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After thinking about it, since we've decided to reorganize this all soon, are you OK with it being left here for this PR?

@@ -73,6 +74,7 @@ export const OverviewPageComponent = ({ autocomplete, indexPattern, setEsKueryFi

return (
<>
<PageHeader headingText={'Overview'} breadcrumbs={[]} datePicker={true} />
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use label

i18n.translate('xpack.uptime.overviewPage.headerText', {
        defaultMessage: 'Overview',
        description: `The text that will be displayed in the app's heading when the Overview page loads.`,
      }) 

for "Overview".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! Done

Comment on lines 20 to 25
export const BaseBreadcrumb: ChromeBreadcrumb = {
text: i18n.translate('xpack.uptime.breadcrumbs.overviewBreadcrumbText', {
defaultMessage: 'Uptime',
}),
href: '#/',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized, when on monitor page, and if you click on uptime link to go back to overview page, it resets all filters, i think we can persist all those filters from overview page once we navigate to monitor page.

Especially date range filters, can append those here into href?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good call

@andrewvc andrewvc added release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Mar 2, 2020
@andrewvc
Copy link
Contributor Author

andrewvc commented Mar 2, 2020

@shahzad31 this is ready for another review, I believe I've addressed all comments

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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


const params = useUrlParams()[0]();
Copy link
Contributor

Choose a reason for hiding this comment

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

we should try to make usage of urlParams hooks easy, it's so awkward using it in current state.

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM !!

@andrewvc andrewvc merged commit 1995a05 into elastic:master Mar 3, 2020
@andrewvc andrewvc deleted the cleanup-header branch March 3, 2020 14:04
andrewvc added a commit to andrewvc/kibana that referenced this pull request Mar 3, 2020
Cleanup implementation of the header to let pages embed the header rather than the weird sort of control the header works with today. Also uses kibana context in a way that makes more sense, and provide a path forward for elastic#53550 since that will need to add a new header type (and some buttons next to the picker).

Fixes elastic#58835
andrewvc added a commit that referenced this pull request Mar 4, 2020
Cleanup implementation of the header to let pages embed the header rather than the weird sort of control the header works with today. Also uses kibana context in a way that makes more sense, and provide a path forward for #53550 since that will need to add a new header type (and some buttons next to the picker).

Fixes #58835
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 technical debt Improvement of the software architecture and operational architecture v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Fix header
4 participants