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

[Code] fix query string key conflict #36620

Merged
merged 2 commits into from
May 24, 2019
Merged

[Code] fix query string key conflict #36620

merged 2 commits into from
May 24, 2019

Conversation

WangQianliang
Copy link
Contributor

Summary

fix query string key conflict
history.search would be empty if placed after a hash

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@@ -57,7 +57,7 @@ export class EditorComponent extends React.Component<IProps> {

public componentDidMount(): void {
this.container = document.getElementById('mainEditor') as HTMLElement;
this.monaco = new MonacoHelper(this.container, this.props);
this.monaco = new MonacoHelper(this.container, this.props, this.props.location.search);
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the location.search changed after the editor is created?

@@ -18,7 +19,7 @@ export function registerReferencesAction(e: editor.IStandaloneCodeEditor) {
const position = ed.getPosition();
const { uri } = parseSchema(ed.getModel().uri.toString());
const refUrl = `git:/${uri}!L${position.lineNumber - 1}:${position.column - 1}`;
const queries = queryString.parse(location.search);
const queries = url.parse(search, true).query;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to get the search from current url instead of passing by a parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

window.location.search is empty if query string is after the hash.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@WangQianliang WangQianliang requested a review from spacedragon May 23, 2019 10:39
@WangQianliang WangQianliang merged commit ff51461 into elastic:master May 24, 2019
@WangQianliang WangQianliang deleted the code-fix-find-reference-uri branch May 24, 2019 03:37
WangQianliang pushed a commit that referenced this pull request May 24, 2019
* fix code query string key conflict

* fix code go to definition url
WangQianliang pushed a commit that referenced this pull request May 25, 2019
* fix code query string key conflict

* fix code go to definition url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants