-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
bump query-string version to remove manual type definitions #78143
Conversation
{ sort: false, encode: false } | ||
); | ||
const newValue = | ||
typeof urlState === 'undefined' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stringify
types do not accept undefined
expect(addEmbeddableToDashboardUrl(url, id, 'visualization')).toEqual( | ||
`/pep/app/dashboards#/view/9b780cd0-3dd3-11e8-b2b9-5d5dc1715159?_a=%28description%3A%27%27%2Cfilters%3A%21%28%29%29&_g=%28refreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3Anow-15m%2Cto%3Anow%29%29&addEmbeddableId=${id}&addEmbeddableType=visualization` | ||
expect(addEmbeddableToDashboardUrl(url, id, 'visualization')).toBe( | ||
'/pep/app/dashboards?addEmbeddableId=123eb456cd&addEmbeddableType=visualization#%2Fview%2F9b780cd0-3dd3-11e8-b2b9-5d5dc1715159%3F_g%3D%28refreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3Anow-15m%2Cto%3Anow%29%29%26_a%3D%28description%3A%27%27%2Cfilters%3A%21%28%29%29' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fragment after query seems to be the correct order https://tools.ietf.org/html/rfc3986#page-16
@@ -34,12 +34,14 @@ export function addEmbeddableToDashboardUrl( | |||
embeddableId: string, | |||
embeddableType: string | |||
) { | |||
const { url, query } = parseUrl(dashboardUrl); | |||
const { url, query, fragmentIdentifier } = parseUrl(dashboardUrl, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseUrl seems to be broken in an intermediate release and fixed in 6.13.0
sindresorhus/query-string#222
Pinging @elastic/kibana-platform (Team:Platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uptime changes LGTM
Pinging @elastic/uptime (Team:uptime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Infra changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIEM changes LGTM! Thanks @restrry! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Kibana app changes do an incompatible change AFAICT, but I'm not sure whether this part of the code is still used. Let's wait for Devon or Maja to chime in.
expect(addEmbeddableToDashboardUrl(url, id, 'visualization')).toEqual( | ||
`/pep/app/dashboards#/view/9b780cd0-3dd3-11e8-b2b9-5d5dc1715159?_a=%28description%3A%27%27%2Cfilters%3A%21%28%29%29&_g=%28refreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3Anow-15m%2Cto%3Anow%29%29&addEmbeddableId=${id}&addEmbeddableType=visualization` | ||
expect(addEmbeddableToDashboardUrl(url, id, 'visualization')).toBe( | ||
'/pep/app/dashboards?addEmbeddableId=123eb456cd&addEmbeddableType=visualization#%2Fview%2F9b780cd0-3dd3-11e8-b2b9-5d5dc1715159%3F_g%3D%28refreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3Anow-15m%2Cto%3Anow%29%29%26_a%3D%28description%3A%27%27%2Cfilters%3A%21%28%29%29' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@restrry You are correct query comes before fragment in "regular" URLs, but in angular it's the other way around when using hash routing:
- Docs https://code.angularjs.org/1.8.0/docs/guide/$location#hashbang-and-html5-modes
- Our config
const setupLocationProvider = () => ($locationProvider: ILocationProvider) => {
However I'm not sure whether we still need this - it seems like we switched to transport this information using the history state and this is just a leftover. @ThomThomson @majagrubic can you please verify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this up. AFAIK, this is not used anymore and should be safe to remove entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@majagrubic is it okay if I merge this PR and you remove it in a follow-up? I still need an approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok on @elastic/kibana-app side
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
page load bundle size
distributable file count
History
To update your PR or re-run it, just comment with: |
…78143) * bump query-string version to remove manual type definitions * remove manual type declaration * fix cypress tests * add ) # Conflicts: # x-pack/plugins/security_solution/cypress/integration/ml_conditional_links.spec.ts
…78441) * bump query-string version to remove manual type definitions * remove manual type declaration * fix cypress tests * add ) # Conflicts: # x-pack/plugins/security_solution/cypress/integration/ml_conditional_links.spec.ts
Summary
Reverts #59633 since we do not support IE 11 anymore. https://github.com/sindresorhus/query-string/releases/tag/v6.0.0
Required to remove manually maintained type definitions that we have to include in every ts project.
Checklist
Delete any items that are not applicable to this PR.
For maintainers