Merge pull request #9596 from nixocio/ui_issue_9592

Allow one to select non-global execution environments for organizations

Allow one to select non-global EE when editing an Organization.
See: #9592
All those EE should be present as a choice when editing the Default organization.

Editing Default organization.

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
This commit is contained in:
softwarefactory-project-zuul[bot]
2021-03-22 19:38:44 +00:00
committed by GitHub

View File

@@ -20,7 +20,12 @@ import { required, minMaxValue } from '../../../util/validators';
import { FormColumnLayout } from '../../../components/FormLayout';
import CredentialLookup from '../../../components/Lookup/CredentialLookup';
function OrganizationFormFields({ i18n, instanceGroups, setInstanceGroups }) {
function OrganizationFormFields({
i18n,
instanceGroups,
setInstanceGroups,
organizationId,
}) {
const { license_info = {}, me = {} } = useConfig();
const { setFieldValue } = useFormikContext();
@@ -97,6 +102,7 @@ function OrganizationFormFields({ i18n, instanceGroups, setInstanceGroups }) {
t`Select the default execution environment for this organization.`
)}
globallyAvailable
organizationId={organizationId}
isDefaultEnvironment
/>
<CredentialLookup
@@ -194,6 +200,7 @@ function OrganizationForm({
<OrganizationFormFields
instanceGroups={instanceGroups}
setInstanceGroups={setInstanceGroups}
organizationId={organization?.id || null}
{...rest}
/>
<FormSubmitError error={submitError} />
@@ -217,6 +224,7 @@ OrganizationForm.propTypes = {
OrganizationForm.defaultProps = {
organization: {
id: '',
name: '',
description: '',
max_hosts: '0',