From ead56bfa1bc65efd0924d780045f6b31db7c6468 Mon Sep 17 00:00:00 2001 From: mabashian Date: Tue, 13 Sep 2022 14:42:58 -0400 Subject: [PATCH] Adds elements and identifiers for cypress tests Properly display instance groups and labels on node details view --- .../LaunchPrompt/steps/CredentialsStep.js | 4 +- .../steps/ExecutionEnvironmentStep.js | 90 ++++----- .../LaunchPrompt/steps/InstanceGroupsStep.js | 66 +++---- .../LaunchPrompt/steps/InventoryStep.js | 4 +- .../LaunchPrompt/steps/OtherPromptsStep.js | 180 +++++++++--------- .../LaunchPrompt/steps/PreviewStep.js | 4 +- .../LaunchPrompt/steps/SurveyStep.js | 22 ++- .../Modals/NodeModals/NodeViewModal.js | 7 +- 8 files changed, 195 insertions(+), 182 deletions(-) diff --git a/awx/ui/src/components/LaunchPrompt/steps/CredentialsStep.js b/awx/ui/src/components/LaunchPrompt/steps/CredentialsStep.js index 1e8c1cd92b..a79f04405c 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/CredentialsStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/CredentialsStep.js @@ -132,7 +132,7 @@ function CredentialsStep({ ); return ( - <> +
{meta.error && ( )} @@ -208,7 +208,7 @@ function CredentialsStep({ }} renderItemChip={renderChip} /> - +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/ExecutionEnvironmentStep.js b/awx/ui/src/components/LaunchPrompt/steps/ExecutionEnvironmentStep.js index 35dc12cdf5..83adee2880 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/ExecutionEnvironmentStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/ExecutionEnvironmentStep.js @@ -66,50 +66,52 @@ function ExecutionEnvironmentStep() { } return ( - helpers.setValue(null)} - /> +
+ helpers.setValue(null)} + /> +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/InstanceGroupsStep.js b/awx/ui/src/components/LaunchPrompt/steps/InstanceGroupsStep.js index c4ea9d60fe..dfdb922bcc 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/InstanceGroupsStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/InstanceGroupsStep.js @@ -68,38 +68,40 @@ function InstanceGroupsStep() { } return ( - setSelected(selectedItems)} - isSelectedDraggable - /> +
+ setSelected(selectedItems)} + isSelectedDraggable + /> +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/InventoryStep.js b/awx/ui/src/components/LaunchPrompt/steps/InventoryStep.js index 494e54e815..3882abd602 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/InventoryStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/InventoryStep.js @@ -70,7 +70,7 @@ function InventoryStep({ warningMessage = null }) { } return ( - <> +
{meta.touched && meta.error && ( )} @@ -109,7 +109,7 @@ function InventoryStep({ warningMessage = null }) { selectItem={helpers.setValue} deselectItem={() => field.onChange(null)} /> - +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/OtherPromptsStep.js b/awx/ui/src/components/LaunchPrompt/steps/OtherPromptsStep.js index fa8bccf63f..b4c97312fd 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/OtherPromptsStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/OtherPromptsStep.js @@ -28,95 +28,97 @@ function OtherPromptsStep({ launchConfig, variablesMode, onVarModeChange }) { ? jobHelpText : workflowHelpText; return ( -
{ - e.preventDefault(); - }} - > - {launchConfig.ask_job_type_on_launch && ( - - )} - {launchConfig.ask_scm_branch_on_launch && ( - - )} - {launchConfig.ask_labels_on_launch && ( - - )} - {launchConfig.ask_forks_on_launch && ( - - )} - {launchConfig.ask_limit_on_launch && ( - - )} - {launchConfig.ask_verbosity_on_launch && ( - - )} - {launchConfig.ask_job_slice_count_on_launch && ( - - )} - {launchConfig.ask_timeout_on_launch && ( - - )} - {launchConfig.ask_diff_mode_on_launch && } - {launchConfig.ask_tags_on_launch && ( - - )} - {launchConfig.ask_skip_tags_on_launch && ( - - )} - {launchConfig.ask_variables_on_launch && ( - - )} - +
+
{ + e.preventDefault(); + }} + > + {launchConfig.ask_job_type_on_launch && ( + + )} + {launchConfig.ask_scm_branch_on_launch && ( + + )} + {launchConfig.ask_labels_on_launch && ( + + )} + {launchConfig.ask_forks_on_launch && ( + + )} + {launchConfig.ask_limit_on_launch && ( + + )} + {launchConfig.ask_verbosity_on_launch && ( + + )} + {launchConfig.ask_job_slice_count_on_launch && ( + + )} + {launchConfig.ask_timeout_on_launch && ( + + )} + {launchConfig.ask_diff_mode_on_launch && } + {launchConfig.ask_tags_on_launch && ( + + )} + {launchConfig.ask_skip_tags_on_launch && ( + + )} + {launchConfig.ask_variables_on_launch && ( + + )} + +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/PreviewStep.js b/awx/ui/src/components/LaunchPrompt/steps/PreviewStep.js index b2612a55fb..753133b109 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/PreviewStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/PreviewStep.js @@ -52,7 +52,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) { } return ( - <> +
{formErrors && ( {t`Some of the previous step(s) have errors`} @@ -70,7 +70,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) { launchConfig={launchConfig} overrides={overrides} /> - +
); } diff --git a/awx/ui/src/components/LaunchPrompt/steps/SurveyStep.js b/awx/ui/src/components/LaunchPrompt/steps/SurveyStep.js index 9e526c984b..770983f05e 100644 --- a/awx/ui/src/components/LaunchPrompt/steps/SurveyStep.js +++ b/awx/ui/src/components/LaunchPrompt/steps/SurveyStep.js @@ -31,16 +31,18 @@ function SurveyStep({ surveyConfig }) { float: NumberField, }; return ( -
{ - e.preventDefault(); - }} - > - {surveyConfig.spec.map((question) => { - const Field = fieldTypes[question.type]; - return ; - })} - +
+
{ + e.preventDefault(); + }} + > + {surveyConfig.spec.map((question) => { + const Field = fieldTypes[question.type]; + return ; + })} + +
); } SurveyStep.propTypes = { diff --git a/awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeViewModal.js b/awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeViewModal.js index 181f5045eb..61dd6d477a 100644 --- a/awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeViewModal.js +++ b/awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeViewModal.js @@ -19,6 +19,8 @@ function NodeViewModal({ readOnly }) { const { fullUnifiedJobTemplate, originalNodeCredentials, + originalNodeInstanceGroups, + originalNodeLabels, originalNodeObject, promptValues, } = nodeToView; @@ -160,7 +162,7 @@ function NodeViewModal({ readOnly }) { originalNodeObject.summary_fields.execution_environment; } if (launchConfig.ask_labels_on_launch) { - overrides.labels = originalNodeObject.labels; + overrides.labels = originalNodeLabels || []; } if (launchConfig.ask_forks_on_launch) { overrides.forks = originalNodeObject.forks; @@ -204,6 +206,9 @@ function NodeViewModal({ readOnly }) { if (launchConfig.ask_credential_on_launch) { overrides.credentials = originalNodeCredentials || []; } + if (launchConfig.ask_instance_groups_on_launch) { + overrides.instance_groups = originalNodeInstanceGroups || []; + } } let nodeUpdatedConvergence = {};