Merge pull request #11489 from nixocio/ui_issue_11452

Fix relaunch of jobs
This commit is contained in:
Kersom 2022-01-04 08:34:50 -05:00 committed by GitHub
commit afc210a70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View File

@ -135,7 +135,7 @@ function JobListItem({
<Button
ouiaId={`${job.id}-relaunch-button`}
variant="plain"
onClick={handleRelaunch}
onClick={() => handleRelaunch()}
aria-label={t`Relaunch`}
isDisabled={isLaunching}
>

View File

@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { withRouter } from 'react-router-dom';
import { useHistory } from 'react-router-dom';
import { number, shape } from 'prop-types';
import { t } from '@lingui/macro';
@ -32,7 +32,8 @@ function canLaunchWithoutPrompt(launchData) {
);
}
function LaunchButton({ resource, children, history }) {
function LaunchButton({ resource, children }) {
const history = useHistory();
const [showLaunchPrompt, setShowLaunchPrompt] = useState(false);
const [launchConfig, setLaunchConfig] = useState(null);
const [surveyConfig, setSurveyConfig] = useState(null);
@ -184,4 +185,4 @@ LaunchButton.propTypes = {
}).isRequired,
};
export default withRouter(LaunchButton);
export default LaunchButton;

View File

@ -452,7 +452,7 @@ function JobDetail({ job, inventorySourceLabels }) {
<Button
ouiaId="job-detail-relaunch-button"
type="submit"
onClick={handleRelaunch}
onClick={() => handleRelaunch()}
isDisabled={isLaunching}
>
{t`Relaunch`}

View File

@ -161,7 +161,7 @@ const OutputToolbar = ({ job, onDelete, isDeleteDisabled, jobStatus }) => {
<Button
ouiaId="job-output-relaunch-button"
variant="plain"
onClick={handleRelaunch}
onClick={() => handleRelaunch()}
aria-label={t`Relaunch`}
isDisabled={isLaunching}
>