summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarah Akus <sakus@redhat.com>2022-10-06 20:18:23 +0200
committerGitHub <noreply@github.com>2022-10-06 20:18:23 +0200
commit35a7e43f22995035cd87cce0c28840d73857c764 (patch)
treef50e1d21d07c6f5bfae9f3cfb48b93dc2155df0a
parentMerge pull request #12969 from AlanCoding/code_deletions (diff)
parentFix undefined launchConfig error in schedule form (diff)
downloadawx-35a7e43f22995035cd87cce0c28840d73857c764.tar.xz
awx-35a7e43f22995035cd87cce0c28840d73857c764.zip
Merge pull request #13005 from marshmalien/13002-fix-source-add-schedule
Fix undefined launchConfig error in schedule form
-rw-r--r--awx/ui/src/components/Schedule/shared/ScheduleForm.js21
-rw-r--r--awx/ui/src/screens/ManagementJob/ManagementJob.js2
2 files changed, 7 insertions, 16 deletions
diff --git a/awx/ui/src/components/Schedule/shared/ScheduleForm.js b/awx/ui/src/components/Schedule/shared/ScheduleForm.js
index 96e25ba154..a857cc10f4 100644
--- a/awx/ui/src/components/Schedule/shared/ScheduleForm.js
+++ b/awx/ui/src/components/Schedule/shared/ScheduleForm.js
@@ -67,14 +67,14 @@ function ScheduleForm({
if (schedule.id) {
if (
resource.type === 'job_template' &&
- launchConfig.ask_credential_on_launch
+ launchConfig?.ask_credential_on_launch
) {
const {
data: { results },
} = await SchedulesAPI.readCredentials(schedule.id);
creds = results;
}
- if (launchConfig.ask_labels_on_launch) {
+ if (launchConfig?.ask_labels_on_launch) {
const {
data: { results },
} = await SchedulesAPI.readAllLabels(schedule.id);
@@ -82,7 +82,7 @@ function ScheduleForm({
}
if (
resource.type === 'job_template' &&
- launchConfig.ask_instance_groups_on_launch
+ launchConfig?.ask_instance_groups_on_launch
) {
const {
data: { results },
@@ -91,7 +91,7 @@ function ScheduleForm({
}
} else {
if (resource.type === 'job_template') {
- if (launchConfig.ask_labels_on_launch) {
+ if (launchConfig?.ask_labels_on_launch) {
const {
data: { results },
} = await JobTemplatesAPI.readAllLabels(resource.id);
@@ -100,7 +100,7 @@ function ScheduleForm({
}
if (
resource.type === 'workflow_job_template' &&
- launchConfig.ask_labels_on_launch
+ launchConfig?.ask_labels_on_launch
) {
const {
data: { results },
@@ -123,14 +123,7 @@ function ScheduleForm({
zoneLinks: data.links,
credentials: creds,
};
- }, [
- schedule,
- resource.id,
- resource.type,
- launchConfig.ask_labels_on_launch,
- launchConfig.ask_instance_groups_on_launch,
- launchConfig.ask_credential_on_launch,
- ]),
+ }, [schedule, resource.id, resource.type, launchConfig]),
{
zonesOptions: [],
zoneLinks: {},
@@ -146,7 +139,7 @@ function ScheduleForm({
const missingRequiredInventory = useCallback(() => {
let missingInventory = false;
if (
- launchConfig.inventory_needed_to_start &&
+ launchConfig?.inventory_needed_to_start &&
!schedule?.summary_fields?.inventory?.id
) {
missingInventory = true;
diff --git a/awx/ui/src/screens/ManagementJob/ManagementJob.js b/awx/ui/src/screens/ManagementJob/ManagementJob.js
index 2cb4909668..6678006b68 100644
--- a/awx/ui/src/screens/ManagementJob/ManagementJob.js
+++ b/awx/ui/src/screens/ManagementJob/ManagementJob.js
@@ -180,8 +180,6 @@ function ManagementJob({ setBreadcrumb }) {
loadSchedules={loadSchedules}
loadScheduleOptions={loadScheduleOptions}
setBreadcrumb={setBreadcrumb}
- launchConfig={{}}
- surveyConfig={{}}
/>
</Route>
) : null}