mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Merge pull request #13005 from marshmalien/13002-fix-source-add-schedule
Fix undefined launchConfig error in schedule form
This commit is contained in:
@@ -67,14 +67,14 @@ function ScheduleForm({
|
|||||||
if (schedule.id) {
|
if (schedule.id) {
|
||||||
if (
|
if (
|
||||||
resource.type === 'job_template' &&
|
resource.type === 'job_template' &&
|
||||||
launchConfig.ask_credential_on_launch
|
launchConfig?.ask_credential_on_launch
|
||||||
) {
|
) {
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
} = await SchedulesAPI.readCredentials(schedule.id);
|
} = await SchedulesAPI.readCredentials(schedule.id);
|
||||||
creds = results;
|
creds = results;
|
||||||
}
|
}
|
||||||
if (launchConfig.ask_labels_on_launch) {
|
if (launchConfig?.ask_labels_on_launch) {
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
} = await SchedulesAPI.readAllLabels(schedule.id);
|
} = await SchedulesAPI.readAllLabels(schedule.id);
|
||||||
@@ -82,7 +82,7 @@ function ScheduleForm({
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
resource.type === 'job_template' &&
|
resource.type === 'job_template' &&
|
||||||
launchConfig.ask_instance_groups_on_launch
|
launchConfig?.ask_instance_groups_on_launch
|
||||||
) {
|
) {
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
@@ -91,7 +91,7 @@ function ScheduleForm({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (resource.type === 'job_template') {
|
if (resource.type === 'job_template') {
|
||||||
if (launchConfig.ask_labels_on_launch) {
|
if (launchConfig?.ask_labels_on_launch) {
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
} = await JobTemplatesAPI.readAllLabels(resource.id);
|
} = await JobTemplatesAPI.readAllLabels(resource.id);
|
||||||
@@ -100,7 +100,7 @@ function ScheduleForm({
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
resource.type === 'workflow_job_template' &&
|
resource.type === 'workflow_job_template' &&
|
||||||
launchConfig.ask_labels_on_launch
|
launchConfig?.ask_labels_on_launch
|
||||||
) {
|
) {
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
@@ -123,14 +123,7 @@ function ScheduleForm({
|
|||||||
zoneLinks: data.links,
|
zoneLinks: data.links,
|
||||||
credentials: creds,
|
credentials: creds,
|
||||||
};
|
};
|
||||||
}, [
|
}, [schedule, resource.id, resource.type, launchConfig]),
|
||||||
schedule,
|
|
||||||
resource.id,
|
|
||||||
resource.type,
|
|
||||||
launchConfig.ask_labels_on_launch,
|
|
||||||
launchConfig.ask_instance_groups_on_launch,
|
|
||||||
launchConfig.ask_credential_on_launch,
|
|
||||||
]),
|
|
||||||
{
|
{
|
||||||
zonesOptions: [],
|
zonesOptions: [],
|
||||||
zoneLinks: {},
|
zoneLinks: {},
|
||||||
@@ -146,7 +139,7 @@ function ScheduleForm({
|
|||||||
const missingRequiredInventory = useCallback(() => {
|
const missingRequiredInventory = useCallback(() => {
|
||||||
let missingInventory = false;
|
let missingInventory = false;
|
||||||
if (
|
if (
|
||||||
launchConfig.inventory_needed_to_start &&
|
launchConfig?.inventory_needed_to_start &&
|
||||||
!schedule?.summary_fields?.inventory?.id
|
!schedule?.summary_fields?.inventory?.id
|
||||||
) {
|
) {
|
||||||
missingInventory = true;
|
missingInventory = true;
|
||||||
|
|||||||
@@ -180,8 +180,6 @@ function ManagementJob({ setBreadcrumb }) {
|
|||||||
loadSchedules={loadSchedules}
|
loadSchedules={loadSchedules}
|
||||||
loadScheduleOptions={loadScheduleOptions}
|
loadScheduleOptions={loadScheduleOptions}
|
||||||
setBreadcrumb={setBreadcrumb}
|
setBreadcrumb={setBreadcrumb}
|
||||||
launchConfig={{}}
|
|
||||||
surveyConfig={{}}
|
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user