mirror of
https://github.com/ansible/awx.git
synced 2026-05-05 08:27:39 -02:30
Merge pull request #13034 from mabashian/13033-relaunch-adhoc
Fixes bug re-launching adhoc command with passwords required
This commit is contained in:
@@ -107,6 +107,17 @@ function LaunchButton({ resource, children }) {
|
|||||||
jobPromise = JobsAPI.relaunch(resource.id, params || {});
|
jobPromise = JobsAPI.relaunch(resource.id, params || {});
|
||||||
} else if (resource.type === 'workflow_job') {
|
} else if (resource.type === 'workflow_job') {
|
||||||
jobPromise = WorkflowJobsAPI.relaunch(resource.id, params || {});
|
jobPromise = WorkflowJobsAPI.relaunch(resource.id, params || {});
|
||||||
|
} else if (resource.type === 'ad_hoc_command') {
|
||||||
|
if (params?.credential_passwords) {
|
||||||
|
// The api expects the passwords at the top level of the object instead of nested
|
||||||
|
// in credential_passwords like the other relaunch endpoints
|
||||||
|
Object.keys(params.credential_passwords).forEach((key) => {
|
||||||
|
params[key] = params.credential_passwords[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
delete params.credential_passwords;
|
||||||
|
}
|
||||||
|
jobPromise = AdHocCommandsAPI.relaunch(resource.id, params || {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data: job } = await jobPromise;
|
const { data: job } = await jobPromise;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function PromptModalForm({
|
|||||||
}}
|
}}
|
||||||
title={t`Launch | ${resource.name}`}
|
title={t`Launch | ${resource.name}`}
|
||||||
description={
|
description={
|
||||||
resource.description.length > 512 ? (
|
resource.description?.length > 512 ? (
|
||||||
<ExpandableSection
|
<ExpandableSection
|
||||||
toggleText={
|
toggleText={
|
||||||
showDescription ? t`Hide description` : t`Show description`
|
showDescription ? t`Hide description` : t`Show description`
|
||||||
|
|||||||
Reference in New Issue
Block a user