From 4ad8689b6ee94b65bd55b805bee8cc71f559b8f3 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 21 Sep 2022 16:46:22 +0200 Subject: [PATCH] Use alias for title name (#3369) --- .../identity-providers/add/DetailSettings.tsx | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx b/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx index b1d81a49cf..b26a16c70a 100644 --- a/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx +++ b/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx @@ -2,13 +2,7 @@ import { useState } from "react"; import { useParams } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom-v5-compat"; import { useTranslation } from "react-i18next"; -import { - Controller, - FormProvider, - useForm, - useFormContext, - useWatch, -} from "react-hook-form"; +import { Controller, FormProvider, useForm } from "react-hook-form"; import { ActionGroup, AlertVariant, @@ -74,14 +68,7 @@ type IdPWithMapperAttributes = IdentityProviderMapperRepresentation & { const Header = ({ onChange, value, save, toggleDeleteDialog }: HeaderProps) => { const { t } = useTranslation("identity-providers"); - const { alias } = useParams<{ alias: string }>(); - - const { control } = useFormContext(); - const displayName = useWatch({ - name: "displayName", - control, - defaultValue: alias, - }); + const { alias: displayName } = useParams<{ alias: string }>(); const [toggleDisableDialog, DisableConfirm] = useConfirmDialog({ titleKey: "identity-providers:disableProvider",