mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
LaunchButton: rename isSending to isLaunching
This commit is contained in:
parent
dc0256441f
commit
5e228c4d98
@ -91,22 +91,22 @@ function JobListItem({
|
||||
>
|
||||
{job.status === 'failed' && job.type === 'job' ? (
|
||||
<LaunchButton resource={job}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<ReLaunchDropDown
|
||||
handleRelaunch={handleRelaunch}
|
||||
isSending={isSending}
|
||||
isLaunching={isLaunching}
|
||||
/>
|
||||
)}
|
||||
</LaunchButton>
|
||||
) : (
|
||||
<LaunchButton resource={job}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId={`${job.id}-relaunch-button`}
|
||||
variant="plain"
|
||||
onClick={handleRelaunch}
|
||||
aria-label={i18n._(t`Relaunch`)}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
<RocketIcon />
|
||||
</Button>
|
||||
|
||||
@ -36,12 +36,12 @@ function LaunchButton({ resource, i18n, children, history }) {
|
||||
const [showLaunchPrompt, setShowLaunchPrompt] = useState(false);
|
||||
const [launchConfig, setLaunchConfig] = useState(null);
|
||||
const [surveyConfig, setSurveyConfig] = useState(null);
|
||||
const [isSending, setIsSending] = useState(false);
|
||||
const [isLaunching, setIsLaunching] = useState(false);
|
||||
const [resourceCredentials, setResourceCredentials] = useState([]);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const handleLaunch = async () => {
|
||||
setIsSending(true);
|
||||
setIsLaunching(true);
|
||||
const readLaunch =
|
||||
resource.type === 'workflow_job_template'
|
||||
? WorkflowJobTemplatesAPI.readLaunch(resource.id)
|
||||
@ -99,7 +99,7 @@ function LaunchButton({ resource, i18n, children, history }) {
|
||||
history.push(`/jobs/${job.id}/output`);
|
||||
} catch (launchError) {
|
||||
setError(launchError);
|
||||
setIsSending(false);
|
||||
setIsLaunching(false);
|
||||
}
|
||||
};
|
||||
|
||||
@ -107,7 +107,7 @@ function LaunchButton({ resource, i18n, children, history }) {
|
||||
let readRelaunch;
|
||||
let relaunch;
|
||||
|
||||
setIsSending(true);
|
||||
setIsLaunching(true);
|
||||
if (resource.type === 'inventory_update') {
|
||||
// We'll need to handle the scenario where the src no longer exists
|
||||
readRelaunch = InventorySourcesAPI.readLaunchUpdate(
|
||||
@ -151,7 +151,7 @@ function LaunchButton({ resource, i18n, children, history }) {
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err);
|
||||
setIsSending(false);
|
||||
setIsLaunching(false);
|
||||
}
|
||||
};
|
||||
|
||||
@ -160,7 +160,7 @@ function LaunchButton({ resource, i18n, children, history }) {
|
||||
{children({
|
||||
handleLaunch,
|
||||
handleRelaunch,
|
||||
isSending,
|
||||
isLaunching,
|
||||
})}
|
||||
{error && (
|
||||
<AlertModal
|
||||
|
||||
@ -14,7 +14,7 @@ import { RocketIcon } from '@patternfly/react-icons';
|
||||
function ReLaunchDropDown({
|
||||
isPrimary = false,
|
||||
handleRelaunch,
|
||||
isSending,
|
||||
isLaunching,
|
||||
i18n,
|
||||
ouiaId,
|
||||
}) {
|
||||
@ -41,7 +41,7 @@ function ReLaunchDropDown({
|
||||
onClick={() => {
|
||||
handleRelaunch({ hosts: 'all' });
|
||||
}}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
{i18n._(t`All`)}
|
||||
</DropdownItem>,
|
||||
@ -53,7 +53,7 @@ function ReLaunchDropDown({
|
||||
onClick={() => {
|
||||
handleRelaunch({ hosts: 'failed' });
|
||||
}}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
{i18n._(t`Failed hosts`)}
|
||||
</DropdownItem>,
|
||||
|
||||
@ -176,11 +176,11 @@ function TemplateListItem({
|
||||
tooltip={i18n._(t`Launch Template`)}
|
||||
>
|
||||
<LaunchButton resource={template}>
|
||||
{({ handleLaunch, isSending }) => (
|
||||
{({ handleLaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId={`${template.id}-launch-button`}
|
||||
id={`template-action-launch-${template.id}`}
|
||||
isDisabled={isDisabled || isSending}
|
||||
isDisabled={isDisabled || isLaunching}
|
||||
aria-label={i18n._(t`Launch template`)}
|
||||
variant="plain"
|
||||
onClick={handleLaunch}
|
||||
|
||||
@ -371,23 +371,23 @@ function JobDetail({ job, i18n }) {
|
||||
job.summary_fields.user_capabilities.start &&
|
||||
(job.status === 'failed' && job.type === 'job' ? (
|
||||
<LaunchButton resource={job}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<ReLaunchDropDown
|
||||
ouiaId="job-detail-relaunch-dropdown"
|
||||
isPrimary
|
||||
handleRelaunch={handleRelaunch}
|
||||
isSending={isSending}
|
||||
isLaunching={isLaunching}
|
||||
/>
|
||||
)}
|
||||
</LaunchButton>
|
||||
) : (
|
||||
<LaunchButton resource={job} aria-label={i18n._(t`Relaunch`)}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId="job-detail-relaunch-button"
|
||||
type="submit"
|
||||
onClick={handleRelaunch}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
{i18n._(t`Relaunch`)}
|
||||
</Button>
|
||||
|
||||
@ -144,23 +144,23 @@ const OutputToolbar = ({
|
||||
>
|
||||
{job.status === 'failed' && job.type === 'job' ? (
|
||||
<LaunchButton resource={job}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<ReLaunchDropDown
|
||||
handleRelaunch={handleRelaunch}
|
||||
ouiaId="job-output-relaunch-dropdown"
|
||||
isSending={isSending}
|
||||
isLaunching={isLaunching}
|
||||
/>
|
||||
)}
|
||||
</LaunchButton>
|
||||
) : (
|
||||
<LaunchButton resource={job}>
|
||||
{({ handleRelaunch, isSending }) => (
|
||||
{({ handleRelaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId="job-output-relaunch-button"
|
||||
variant="plain"
|
||||
onClick={handleRelaunch}
|
||||
aria-label={i18n._(t`Relaunch`)}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
<RocketIcon />
|
||||
</Button>
|
||||
|
||||
@ -116,13 +116,13 @@ function ProjectJobTemplateListItem({
|
||||
{canLaunch && template.type === 'job_template' && (
|
||||
<Tooltip content={i18n._(t`Launch Template`)} position="top">
|
||||
<LaunchButton resource={template}>
|
||||
{({ handleLaunch, isSending }) => (
|
||||
{({ handleLaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId={`${template.id}-launch-button`}
|
||||
css="grid-column: 1"
|
||||
variant="plain"
|
||||
onClick={handleLaunch}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
<RocketIcon />
|
||||
</Button>
|
||||
|
||||
@ -387,13 +387,13 @@ function JobTemplateDetail({ i18n, template }) {
|
||||
)}
|
||||
{canLaunch && (
|
||||
<LaunchButton resource={template} aria-label={i18n._(t`Launch`)}>
|
||||
{({ handleLaunch, isSending }) => (
|
||||
{({ handleLaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId="job-template-detail-launch-button"
|
||||
variant="secondary"
|
||||
type="submit"
|
||||
onClick={handleLaunch}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
{i18n._(t`Launch`)}
|
||||
</Button>
|
||||
|
||||
@ -227,13 +227,13 @@ function WorkflowJobTemplateDetail({ template, i18n }) {
|
||||
)}
|
||||
{canLaunch && (
|
||||
<LaunchButton resource={template} aria-label={i18n._(t`Launch`)}>
|
||||
{({ handleLaunch, isSending }) => (
|
||||
{({ handleLaunch, isLaunching }) => (
|
||||
<Button
|
||||
ouiaId="workflow-job-template-detail-launch-button"
|
||||
variant="secondary"
|
||||
type="submit"
|
||||
onClick={handleLaunch}
|
||||
isDisabled={isSending}
|
||||
isDisabled={isLaunching}
|
||||
>
|
||||
{i18n._(t`Launch`)}
|
||||
</Button>
|
||||
|
||||
@ -125,12 +125,12 @@ function VisualizerToolbar({
|
||||
resource={template}
|
||||
aria-label={i18n._(t`Launch workflow`)}
|
||||
>
|
||||
{({ handleLaunch, isSending }) => (
|
||||
{({ handleLaunch, isLaunching }) => (
|
||||
<ActionButton
|
||||
id="visualizer-launch"
|
||||
variant="plain"
|
||||
isDisabled={
|
||||
hasUnsavedChanges || totalNodes === 0 || isSending
|
||||
hasUnsavedChanges || totalNodes === 0 || isLaunching
|
||||
}
|
||||
onClick={handleLaunch}
|
||||
>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user