Skip to content

Commit

Permalink
[Reporting/Share Menu] use browser module for url-resolving features (e…
Browse files Browse the repository at this point in the history
…lastic#177956)

## Summary

Potentially fixes an issue where a custom build of the Reporting plugin
doesn't use the right shim for URL-resolving functionality.

### Checklist

Delete any items that are not applicable to this PR.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
  • Loading branch information
tsullivan authored Mar 5, 2024
1 parent 3aa4112 commit b4fd712
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import React, { Component, ReactElement } from 'react';
import url from 'url';

import { CSV_REPORT_TYPE, CSV_REPORT_TYPE_V2 } from '@kbn/reporting-export-types-csv-common';
import { PDF_REPORT_TYPE, PDF_REPORT_TYPE_V2 } from '@kbn/reporting-export-types-pdf-common';
Expand Down Expand Up @@ -88,7 +87,7 @@ class ReportingPanelContentUi extends Component<Props, State> {
props.reportType,
this.props.apiClient.getDecoratedJobParams(this.props.getJobParams(true))
);
return url.resolve(window.location.href, relativePath);
return new URL(relativePath, window.location.href).toString();
};

public componentDidUpdate(_prevProps: Props, prevState: State) {
Expand Down

0 comments on commit b4fd712

Please sign in to comment.