mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Adds elements and identifiers for cypress tests
Properly display instance groups and labels on node details view
This commit is contained in:
parent
d63c940e2f
commit
ead56bfa1b
@ -132,7 +132,7 @@ function CredentialsStep({
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div data-cy="credentials-prompt">
|
||||
{meta.error && (
|
||||
<CredentialErrorAlert variant="danger" isInline title={meta.error} />
|
||||
)}
|
||||
@ -208,7 +208,7 @@ function CredentialsStep({
|
||||
}}
|
||||
renderItemChip={renderChip}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -66,50 +66,52 @@ function ExecutionEnvironmentStep() {
|
||||
}
|
||||
|
||||
return (
|
||||
<OptionsList
|
||||
value={field.value ? [field.value] : []}
|
||||
options={execution_environments}
|
||||
optionCount={count}
|
||||
columns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image',
|
||||
},
|
||||
]}
|
||||
searchColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name__icontains',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image__icontains',
|
||||
},
|
||||
]}
|
||||
sortColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image',
|
||||
},
|
||||
]}
|
||||
searchableKeys={searchableKeys}
|
||||
relatedSearchableKeys={relatedSearchableKeys}
|
||||
header={t`Execution Environments`}
|
||||
name="execution_environment"
|
||||
qsConfig={QS_CONFIG}
|
||||
readOnly
|
||||
selectItem={helpers.setValue}
|
||||
deselectItem={() => helpers.setValue(null)}
|
||||
/>
|
||||
<div data-cy="execution-environment-prompt">
|
||||
<OptionsList
|
||||
value={field.value ? [field.value] : []}
|
||||
options={execution_environments}
|
||||
optionCount={count}
|
||||
columns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image',
|
||||
},
|
||||
]}
|
||||
searchColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name__icontains',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image__icontains',
|
||||
},
|
||||
]}
|
||||
sortColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: t`Image`,
|
||||
key: 'image',
|
||||
},
|
||||
]}
|
||||
searchableKeys={searchableKeys}
|
||||
relatedSearchableKeys={relatedSearchableKeys}
|
||||
header={t`Execution Environments`}
|
||||
name="execution_environment"
|
||||
qsConfig={QS_CONFIG}
|
||||
readOnly
|
||||
selectItem={helpers.setValue}
|
||||
deselectItem={() => helpers.setValue(null)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -68,38 +68,40 @@ function InstanceGroupsStep() {
|
||||
}
|
||||
|
||||
return (
|
||||
<OptionsList
|
||||
value={selected}
|
||||
options={instance_groups}
|
||||
optionCount={count}
|
||||
searchColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name__icontains',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
name: t`Credential Name`,
|
||||
key: 'credential__name__icontains',
|
||||
},
|
||||
]}
|
||||
sortColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
]}
|
||||
searchableKeys={searchableKeys}
|
||||
relatedSearchableKeys={relatedSearchableKeys}
|
||||
multiple
|
||||
header={t`Instance Groups`}
|
||||
name="instanceGroups"
|
||||
qsConfig={QS_CONFIG}
|
||||
selectItem={handleSelect}
|
||||
deselectItem={handleSelect}
|
||||
sortSelectedItems={(selectedItems) => setSelected(selectedItems)}
|
||||
isSelectedDraggable
|
||||
/>
|
||||
<div data-cy="instance-groups-prompt">
|
||||
<OptionsList
|
||||
value={selected}
|
||||
options={instance_groups}
|
||||
optionCount={count}
|
||||
searchColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name__icontains',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
name: t`Credential Name`,
|
||||
key: 'credential__name__icontains',
|
||||
},
|
||||
]}
|
||||
sortColumns={[
|
||||
{
|
||||
name: t`Name`,
|
||||
key: 'name',
|
||||
},
|
||||
]}
|
||||
searchableKeys={searchableKeys}
|
||||
relatedSearchableKeys={relatedSearchableKeys}
|
||||
multiple
|
||||
header={t`Instance Groups`}
|
||||
name="instanceGroups"
|
||||
qsConfig={QS_CONFIG}
|
||||
selectItem={handleSelect}
|
||||
deselectItem={handleSelect}
|
||||
sortSelectedItems={(selectedItems) => setSelected(selectedItems)}
|
||||
isSelectedDraggable
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ function InventoryStep({ warningMessage = null }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div data-cy="inventory-prompt">
|
||||
{meta.touched && meta.error && (
|
||||
<InventoryErrorAlert variant="danger" isInline title={meta.error} />
|
||||
)}
|
||||
@ -109,7 +109,7 @@ function InventoryStep({ warningMessage = null }) {
|
||||
selectItem={helpers.setValue}
|
||||
deselectItem={() => field.onChange(null)}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -28,95 +28,97 @@ function OtherPromptsStep({ launchConfig, variablesMode, onVarModeChange }) {
|
||||
? jobHelpText
|
||||
: workflowHelpText;
|
||||
return (
|
||||
<Form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{launchConfig.ask_job_type_on_launch && (
|
||||
<JobTypeField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_scm_branch_on_launch && (
|
||||
<FormField
|
||||
id="prompt-scm-branch"
|
||||
name="scm_branch"
|
||||
label={t`Source Control Branch`}
|
||||
tooltip={helpTextSource.sourceControlBranch}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_labels_on_launch && (
|
||||
<LabelsField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_forks_on_launch && (
|
||||
<FormField
|
||||
id="prompt-forks"
|
||||
name="forks"
|
||||
label={t`Forks`}
|
||||
type="number"
|
||||
min="0"
|
||||
tooltip={helpTextSource.forks}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_limit_on_launch && (
|
||||
<FormField
|
||||
id="prompt-limit"
|
||||
name="limit"
|
||||
label={t`Limit`}
|
||||
tooltip={helpTextSource.limit}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_verbosity_on_launch && (
|
||||
<VerbosityField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_job_slice_count_on_launch && (
|
||||
<FormField
|
||||
id="prompt-job-slicing"
|
||||
name="job_slice_count"
|
||||
label={t`Job Slicing`}
|
||||
type="number"
|
||||
min="1"
|
||||
tooltip={helpTextSource.jobSlicing}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_timeout_on_launch && (
|
||||
<FormField
|
||||
id="prompt-timeout"
|
||||
name="timeout"
|
||||
label={t`Timeout`}
|
||||
type="number"
|
||||
min="0"
|
||||
tooltip={helpTextSource.timeout}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_diff_mode_on_launch && <ShowChangesToggle />}
|
||||
{launchConfig.ask_tags_on_launch && (
|
||||
<TagField
|
||||
id="prompt-job-tags"
|
||||
name="job_tags"
|
||||
label={t`Job Tags`}
|
||||
aria-label={t`Job Tags`}
|
||||
tooltip={helpTextSource.jobTags}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_skip_tags_on_launch && (
|
||||
<TagField
|
||||
id="prompt-skip-tags"
|
||||
name="skip_tags"
|
||||
label={t`Skip Tags`}
|
||||
aria-label={t`Skip Tags`}
|
||||
tooltip={helpTextSource.skipTags}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_variables_on_launch && (
|
||||
<VariablesField
|
||||
id="prompt-variables"
|
||||
name="extra_vars"
|
||||
label={t`Variables`}
|
||||
initialMode={variablesMode}
|
||||
onModeChange={onVarModeChange}
|
||||
/>
|
||||
)}
|
||||
</Form>
|
||||
<div data-cy="other-prompts">
|
||||
<Form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{launchConfig.ask_job_type_on_launch && (
|
||||
<JobTypeField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_scm_branch_on_launch && (
|
||||
<FormField
|
||||
id="prompt-scm-branch"
|
||||
name="scm_branch"
|
||||
label={t`Source Control Branch`}
|
||||
tooltip={helpTextSource.sourceControlBranch}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_labels_on_launch && (
|
||||
<LabelsField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_forks_on_launch && (
|
||||
<FormField
|
||||
id="prompt-forks"
|
||||
name="forks"
|
||||
label={t`Forks`}
|
||||
type="number"
|
||||
min="0"
|
||||
tooltip={helpTextSource.forks}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_limit_on_launch && (
|
||||
<FormField
|
||||
id="prompt-limit"
|
||||
name="limit"
|
||||
label={t`Limit`}
|
||||
tooltip={helpTextSource.limit}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_verbosity_on_launch && (
|
||||
<VerbosityField helpTextSource={helpTextSource} />
|
||||
)}
|
||||
{launchConfig.ask_job_slice_count_on_launch && (
|
||||
<FormField
|
||||
id="prompt-job-slicing"
|
||||
name="job_slice_count"
|
||||
label={t`Job Slicing`}
|
||||
type="number"
|
||||
min="1"
|
||||
tooltip={helpTextSource.jobSlicing}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_timeout_on_launch && (
|
||||
<FormField
|
||||
id="prompt-timeout"
|
||||
name="timeout"
|
||||
label={t`Timeout`}
|
||||
type="number"
|
||||
min="0"
|
||||
tooltip={helpTextSource.timeout}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_diff_mode_on_launch && <ShowChangesToggle />}
|
||||
{launchConfig.ask_tags_on_launch && (
|
||||
<TagField
|
||||
id="prompt-job-tags"
|
||||
name="job_tags"
|
||||
label={t`Job Tags`}
|
||||
aria-label={t`Job Tags`}
|
||||
tooltip={helpTextSource.jobTags}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_skip_tags_on_launch && (
|
||||
<TagField
|
||||
id="prompt-skip-tags"
|
||||
name="skip_tags"
|
||||
label={t`Skip Tags`}
|
||||
aria-label={t`Skip Tags`}
|
||||
tooltip={helpTextSource.skipTags}
|
||||
/>
|
||||
)}
|
||||
{launchConfig.ask_variables_on_launch && (
|
||||
<VariablesField
|
||||
id="prompt-variables"
|
||||
name="extra_vars"
|
||||
label={t`Variables`}
|
||||
initialMode={variablesMode}
|
||||
onModeChange={onVarModeChange}
|
||||
/>
|
||||
)}
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div data-cy="prompt-preview">
|
||||
{formErrors && (
|
||||
<ErrorMessageWrapper>
|
||||
{t`Some of the previous step(s) have errors`}
|
||||
@ -70,7 +70,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) {
|
||||
launchConfig={launchConfig}
|
||||
overrides={overrides}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -31,16 +31,18 @@ function SurveyStep({ surveyConfig }) {
|
||||
float: NumberField,
|
||||
};
|
||||
return (
|
||||
<Form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{surveyConfig.spec.map((question) => {
|
||||
const Field = fieldTypes[question.type];
|
||||
return <Field key={question.variable} question={question} />;
|
||||
})}
|
||||
</Form>
|
||||
<div data-cy="survey-prompts">
|
||||
<Form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{surveyConfig.spec.map((question) => {
|
||||
const Field = fieldTypes[question.type];
|
||||
return <Field key={question.variable} question={question} />;
|
||||
})}
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
SurveyStep.propTypes = {
|
||||
|
||||
@ -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 = {};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user