Update usage of useBrandName

useBrandName return variables were updated. Update a few places using
this custom hook.

See: https://github.com/ansible/awx/issues/10775
This commit is contained in:
nixocio 2021-07-28 14:53:49 -04:00
parent 07a4683f08
commit 452848ff27
4 changed files with 17 additions and 9 deletions

View File

@ -22,7 +22,9 @@ const TooltipWrapper = styled.div`
`;
function AdHocDetailsStep({ verbosityOptions, moduleOptions }) {
const brandName = useBrandName();
const {
current: { brandName },
} = useBrandName();
const [moduleNameField, moduleNameMeta, moduleNameHelpers] = useField({
name: 'module_name',
validate: required(null),
@ -65,7 +67,7 @@ function AdHocDetailsStep({ verbosityOptions, moduleOptions }) {
}
labelIcon={
<Popover
content={t`These are the modules that ${brandName.current} supports running commands against.`}
content={t`These are the modules that ${brandName} supports running commands against.`}
/>
}
>

View File

@ -14,7 +14,9 @@ const ManualSubForm = ({
project_base_dir,
project_local_paths,
}) => {
const brandName = useBrandName();
const {
current: { brandName },
} = useBrandName();
const localPaths = [...new Set([...project_local_paths, localPath])];
const options = [
{
@ -49,7 +51,7 @@ const ManualSubForm = ({
Either that directory is empty, or all of the contents are already
assigned to other projects. Create a new directory there and make
sure the playbook files can be read by the "awx" system user,
or have ${brandName.current} directly retrieve your playbooks from
or have ${brandName} directly retrieve your playbooks from
source control using the Source Control Type option above.`}
</Alert>
)}

View File

@ -45,11 +45,13 @@ const CardDescription = styled.div`
function SettingList() {
const config = useConfig();
const brandName = useBrandName();
const {
current: { brandName },
} = useBrandName();
const settingRoutes = [
{
header: t`Authentication`,
description: t`Enable simplified login for your ${brandName.current} applications`,
description: t`Enable simplified login for your ${brandName} applications`,
id: 'authentication',
routes: [
{
@ -84,7 +86,7 @@ function SettingList() {
},
{
header: t`Jobs`,
description: t`Update settings pertaining to Jobs within ${brandName.current}`,
description: t`Update settings pertaining to Jobs within ${brandName}`,
id: 'jobs',
routes: [
{

View File

@ -66,7 +66,9 @@ function JobTemplateForm({
Boolean(template.webhook_service)
);
const isMounted = useIsMounted();
const brandName = useBrandName();
const {
current: { brandName },
} = useBrandName();
const [askInventoryOnLaunchField] = useField('ask_inventory_on_launch');
const [jobTypeField, jobTypeMeta, jobTypeHelpers] = useField({
@ -566,7 +568,7 @@ function JobTemplateForm({
&nbsp;
<Popover
content={t`Enables creation of a provisioning
callback URL. Using the URL a host can contact ${brandName.current}
callback URL. Using the URL a host can contact ${brandName}
and request a configuration update using this job
template.`}
/>