diff --git a/awx/ui/src/screens/Inventory/InventoryDetail/InventoryDetail.js b/awx/ui/src/screens/Inventory/InventoryDetail/InventoryDetail.js index b25630cb89..0ad2398a3a 100644 --- a/awx/ui/src/screens/Inventory/InventoryDetail/InventoryDetail.js +++ b/awx/ui/src/screens/Inventory/InventoryDetail/InventoryDetail.js @@ -2,7 +2,14 @@ import React, { useCallback, useEffect } from 'react'; import { Link, useHistory } from 'react-router-dom'; import { t } from '@lingui/macro'; -import { Button, Chip } from '@patternfly/react-core'; +import { + Button, + Chip, + TextList, + TextListItem, + TextListItemVariants, + TextListVariants, +} from '@patternfly/react-core'; import AlertModal from 'components/AlertModal'; import { CardBody, CardActionsRow } from 'components/Card'; import { DetailList, Detail, UserDateDetail } from 'components/DetailList'; @@ -50,9 +57,24 @@ function InventoryDetail({ inventory }) { const { organization, user_capabilities: userCapabilities } = inventory.summary_fields; + const prevent_instance_group_fallback = + inventory.prevent_instance_group_fallback; + const deleteDetailsRequests = relatedResourceDeleteRequests.inventory(inventory); + const renderOptionsField = prevent_instance_group_fallback; + + const renderOptions = ( + + {prevent_instance_group_fallback && ( + + {t`Prevent Instance Group Fallback`} + + )} + + ); + if (isLoading) { return ; } @@ -104,6 +126,22 @@ function InventoryDetail({ inventory }) { isEmpty={instanceGroups.length === 0} /> )} + {prevent_instance_group_fallback && ( + + )} + {renderOptionsField && ( + + )} {inventory.summary_fields.labels && ( ({ the dropdown or enter a file within the input.`, preventInstanceGroupFallback: t`If enabled, the inventory will prevent adding any organization instance groups to the list of preferred instances groups to run associated job templates on. Note: If this setting is enabled and you provided an empty list, the global instance groups will be applied.`, + enabledOptions: ( + <> +

{t`Prevent Instance Group Fallback: If enabled, the inventory will prevent adding any organization instance groups to the list of preferred instances groups to run associated job templates on.`}

+ + ), }); export default getInventoryHelpTextStrings; diff --git a/awx/ui/src/screens/Template/JobTemplateDetail/JobTemplateDetail.js b/awx/ui/src/screens/Template/JobTemplateDetail/JobTemplateDetail.js index 22506185d6..dd5fdc837a 100644 --- a/awx/ui/src/screens/Template/JobTemplateDetail/JobTemplateDetail.js +++ b/awx/ui/src/screens/Template/JobTemplateDetail/JobTemplateDetail.js @@ -63,6 +63,7 @@ function JobTemplateDetail({ template }) { webhook_service, related: { webhook_receiver }, webhook_key, + prevent_instance_group_fallback, custom_virtualenv, } = template; const { id: templateId } = useParams(); @@ -111,7 +112,8 @@ function JobTemplateDetail({ template }) { host_config_key || allow_simultaneous || use_fact_cache || - webhook_service; + webhook_service || + prevent_instance_group_fallback; const renderOptions = ( @@ -140,6 +142,11 @@ function JobTemplateDetail({ template }) { {t`Webhooks`} )} + {prevent_instance_group_fallback && ( + + {t`Prevent Instance Group Fallback`} + + )} ); @@ -335,6 +342,13 @@ function JobTemplateDetail({ template }) { } /> )} + {prevent_instance_group_fallback && ( + + )}