Skip to content

Commit

Permalink
back to depending on resources to get the URL
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnC-80 committed Sep 20, 2023
1 parent a410e08 commit d90e474
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/DataFetcher/DataFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ const logsUrl = createUrlFromArray('metadata-provider/jobExecutions', logsUrlPar
const compositeJobsUrl = createUrlFromArray('metadata-provider/jobExecutions', [...jobsUrlParams, 'subordinationTypeNotAny=COMPOSITE_CHILD']);
const compositeLogsUrl = createUrlFromArray('metadata-provider/jobExecutions', [...logsUrlParams, 'subordinationTypeNotAny=COMPOSITE_PARENT']);

export function getJobSplittingURL(props, splittingURL, nonSplitting) {
const { resources } = props;
if (!resources?.splitStatus.isPending) {
if (resources?.splitStatus?.records[0]?.splitStatus) {
export function getJobSplittingURL(resources, splittingURL, nonSplitting) {
const { split_status: splitStatus } = resources;
if (!splitStatus?.isPending) {
if (splitStatus?.records[0]?.splitStatus) {
return splittingURL;
} else if (resources?.splitStatus?.records[0]?.splitStatus === false) {
} else if (splitStatus?.records[0]?.splitStatus === false) {
return nonSplitting;
}
}
Expand All @@ -77,13 +77,13 @@ export class DataFetcher extends Component {
static manifest = Object.freeze({
jobs: {
type: 'okapi',
path: (_q, _p, _r, _l, props) => getJobSplittingURL(props, compositeJobsUrl, jobsUrl),
path: (_q, _p, resources) => getJobSplittingURL(resources, compositeJobsUrl, jobsUrl),
accumulate: true,
throwErrors: false,
},
logs: {
type: 'okapi',
path: (_q, _p, _r, _l, props) => getJobSplittingURL(props, compositeLogsUrl, logsUrl),
path: (_q, _p, resources) => getJobSplittingURL(resources, compositeLogsUrl, logsUrl),
accumulate: true,
throwErrors: false,
},
Expand Down

0 comments on commit d90e474

Please sign in to comment.