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

Fix [Details Popup] Missing Run on spot, Priority data in Job Details Popup. #355

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/elements/DetailsPopUp/JobPopUp/JobPopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'

import { isEmpty } from 'lodash'
import { useDispatch, useSelector } from 'react-redux'
Expand All @@ -28,7 +28,7 @@ import DetailsPopUp from '../DetailsPopUp'
import { parseJob } from '../../../utils/parseJob'
import { generatePageData } from '../../JobsTable/jobsTable.util'
import { getJobLogs } from '../../../utils/getJobLogs.util'
import { monitorJob } from '../../../components/Jobs/jobs.util'
import { enrichRunWithFunctionFields, monitorJob } from '../../../components/Jobs/jobs.util'
import { generateActionsMenu } from '../../../components/Jobs/MonitorJobs/monitorJobs.util'
import { showErrorNotification } from '../../../utils/notifications.util'
import { usePods } from '../../../hooks/usePods.hook'
Expand All @@ -41,6 +41,7 @@ const JobPopUp = ({ isOpen, jobData, onResolve }) => {
const frontendSpec = useSelector(store => store.appStore.frontendSpec)
const [selectedJob, setSelectedJob] = useState({})
const [isLoading, setIsLoading] = useState(true)
const fetchJobFunctionsPromiseRef = useRef()

usePods(dispatch, detailsActions.fetchJobPods, detailsActions.removePods, selectedJob)

Expand Down Expand Up @@ -105,8 +106,13 @@ const JobPopUp = ({ isOpen, jobData, onResolve }) => {
.unwrap()
.then(job => {
if (job) {
setSelectedJob(parseJob(job))
setIsLoading(false)
enrichRunWithFunctionFields(dispatch, parseJob(job), fetchJobFunctionsPromiseRef).then(
jobRun => {
setSelectedJob(jobRun)
setIsLoading(false)
fetchJobFunctionsPromiseRef.current = null
}
)
} else {
showErrorNotification(dispatch, {}, '', 'Failed to retrieve job data')
onResolve()
Expand Down