[JENKINS-36674] fix bad encoding in REST URL by creating URL based off HAL link
This commit is contained in:
parent
682860a358
commit
4dd4bdde04
|
@ -18,18 +18,9 @@ const EmptyState = () => (
|
|||
*/
|
||||
export class RunDetailsTests extends Component {
|
||||
componentWillMount() {
|
||||
if (this.context.config) {
|
||||
this.props.fetchTestResults(
|
||||
this.context.config,
|
||||
{
|
||||
isMultiBranch: this.props.isMultiBranch,
|
||||
organization: this.props.params.organization,
|
||||
pipeline: this.props.params.pipeline,
|
||||
branch: this.props.params.branch,
|
||||
runId: this.props.params.runId,
|
||||
}
|
||||
);
|
||||
}
|
||||
this.props.fetchTestResults(
|
||||
this.props.result
|
||||
);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import keymirror from 'keymirror';
|
||||
|
||||
import fetch from 'isomorphic-fetch';
|
||||
|
||||
import { State } from '../components/records';
|
||||
|
||||
import UrlConfig from '../config';
|
||||
import { getNodesInformation } from '../util/logDisplayHelper';
|
||||
|
||||
import { calculateStepsBaseUrl, calculateLogUrl, calculateNodeBaseUrl, buildUrl } from '../util/UrlUtils';
|
||||
import { calculateStepsBaseUrl, calculateLogUrl, calculateNodeBaseUrl } from '../util/UrlUtils';
|
||||
|
||||
// main actin logic
|
||||
export const ACTION_TYPES = keymirror({
|
||||
|
@ -798,17 +797,10 @@ export const actions = {
|
|||
};
|
||||
},
|
||||
|
||||
fetchTestResults(config, runDetails) {
|
||||
fetchTestResults(run) {
|
||||
return (dispatch) => {
|
||||
const baseUrl = `${config.getAppURLBase()}/rest/organizations/`;
|
||||
let url;
|
||||
if (runDetails.isMultiBranch) {
|
||||
// eslint-disable-next-line max-len
|
||||
url = `${baseUrl}${buildUrl(runDetails.organization, 'pipelines', runDetails.pipeline, 'branches', runDetails.branch, 'runs', runDetails.runId)}/testReport/result`;
|
||||
} else {
|
||||
// eslint-disable-next-line max-len
|
||||
url = `${baseUrl}${buildUrl(runDetails.organization, 'pipelines', runDetails.branch, 'runs', runDetails.runId)}/testReport/result`;
|
||||
}
|
||||
const baseUrl = UrlConfig.jenkinsRootURL;
|
||||
const url = `${baseUrl}${run._links.self.href}testReport/result`;
|
||||
|
||||
return dispatch(actions.generateData(
|
||||
url,
|
||||
|
|
Loading…
Reference in New Issue