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

Add url overflow handling to KP #67899

Merged
merged 9 commits into from
Jun 8, 2020
Merged

Conversation

joshdover
Copy link
Contributor

@joshdover joshdover commented Jun 1, 2020

Summary

Fixes #67776

This moves the previously Angular-only URL overflow handling to Core's global router and adds a new "error" application that will be displayed when a user encounters a very long URL.

The UI has been mostly unchanged, but it could really benefit from:

  • A copy update
  • A design pass
  • Functional tests added

However, I'm keen on getting this in for the next (last?) 7.8 BC and will iterate on this as a follow up.

Screenshot

image

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@joshdover joshdover added Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.8.0 v7.9.0 labels Jun 3, 2020
@joshdover joshdover marked this pull request as ready for review June 3, 2020 16:20
@joshdover joshdover requested a review from a team June 3, 2020 16:20
@joshdover joshdover requested review from a team as code owners June 3, 2020 16:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

values={{
storeInSessionStorageConfig: <code>state:storeInSessionStorage</code>,
kibanaSettingsLink: (
<a href={basePath.prepend('/app/management/kibana/settings')}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will need to be changed when backporting to 7.8 branch

values={{
storeInSessionStorageParam: <code>state:storeInSessionStorage</code>,
advancedSettingsLink: (
<a href={basePath.prepend('/app/management/kibana/settings')}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will need to be changed when backporting to 7.8

cchaos
cchaos previously requested changes Jun 3, 2020
const [currentLocation, setCurrentLocation] = useState(history.location);
useLayoutEffect(() => history.listen((location) => setCurrentLocation(location)), [history]);

const searchParams = new URLSearchParams(currentLocation.search);
Copy link
Contributor

Choose a reason for hiding this comment

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

URLSearchParams is not compatible with IE11: https://caniuse.com/#search=URLSearchParams (unless we have a shim?) Maybe use the 'query-string' module instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a core-js polyfill, but I will double check it works in IE 👍

@gchaps
Copy link
Contributor

gchaps commented Jun 3, 2020

Here is my suggestion for copy:

The URL for this dashboard is too long,
and we can't display the dashboard.

Things to try:

  • Enable the state:storeInSession option in Advanced Settings.
  • Remove content from your dashboard. This error occurs only for complex dashboards.

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

maps changes LGTM
code review

@@ -138,16 +138,6 @@
"charts.controls.rangeErrorMessage": "値は{min}と{max}の間でなければなりません",
"charts.controls.vislibBasicOptions.legendPositionLabel": "凡例位置",
"charts.controls.vislibBasicOptions.showTooltipLabel": "ツールヒントを表示",
"common.ui.errorUrlOverflow.breadcrumbs.errorText": "エラー",
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 changed the defaultMessage of these strings significantly, so I figured I should delete the old translations so they get updated. Is that the right process @Bamieh ?

@joshdover joshdover dismissed cchaos’s stale review June 4, 2020 22:56

Implemented design changes

@gchaps
Copy link
Contributor

gchaps commented Jun 4, 2020

Some fixes to the updated copy:

  • Remove "the" before Advanced Settings.

  • Use a bulleted list instead of a numbered list.

  • Remove "Whoa there". It doesn't add any value and is misspelled. Use this for the heading instead:

The URL for this dashboard is too long,
and we can't display the dashboard.

If the two-line title is too much, we can work on it.

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Kibana app code changes LGTM. Left one nit about the error page itself.

Not sure whether that's expected but when the error case is triggered, the error page is shown very briefly, then the page reloads.
overflow_reload

@joshdover
Copy link
Contributor Author

Kibana app code changes LGTM. Left one nit about the error page itself.

Not sure whether that's expected but when the error case is triggered, the error page is shown very briefly, then the page reloads.
overflow_reload

Will switch to using window.location.assign to eliminate that flashing. Also working with @gchaps on making the copy not dashboard-specific.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@joshdover joshdover merged commit f090775 into elastic:master Jun 8, 2020
@joshdover joshdover deleted the issue-67776 branch June 8, 2020 21:03
joshdover added a commit to joshdover/kibana that referenced this pull request Jun 8, 2020
joshdover added a commit to joshdover/kibana that referenced this pull request Jun 8, 2020
# Conflicts:
#	src/legacy/ui/public/_index.scss
#	src/plugins/kibana_legacy/public/angular/angular_config.tsx
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
@joshdover joshdover removed the v7.8.0 label Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URL overflow page no longer exists
8 participants