Use alias for title name (#3369)
This commit is contained in:
parent
5dd606e726
commit
4ad8689b6e
1 changed files with 2 additions and 15 deletions
|
@ -2,13 +2,7 @@ import { useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { Link, useNavigate } from "react-router-dom-v5-compat";
|
import { Link, useNavigate } from "react-router-dom-v5-compat";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import { Controller, FormProvider, useForm } from "react-hook-form";
|
||||||
Controller,
|
|
||||||
FormProvider,
|
|
||||||
useForm,
|
|
||||||
useFormContext,
|
|
||||||
useWatch,
|
|
||||||
} from "react-hook-form";
|
|
||||||
import {
|
import {
|
||||||
ActionGroup,
|
ActionGroup,
|
||||||
AlertVariant,
|
AlertVariant,
|
||||||
|
@ -74,14 +68,7 @@ type IdPWithMapperAttributes = IdentityProviderMapperRepresentation & {
|
||||||
|
|
||||||
const Header = ({ onChange, value, save, toggleDeleteDialog }: HeaderProps) => {
|
const Header = ({ onChange, value, save, toggleDeleteDialog }: HeaderProps) => {
|
||||||
const { t } = useTranslation("identity-providers");
|
const { t } = useTranslation("identity-providers");
|
||||||
const { alias } = useParams<{ alias: string }>();
|
const { alias: displayName } = useParams<{ alias: string }>();
|
||||||
|
|
||||||
const { control } = useFormContext();
|
|
||||||
const displayName = useWatch({
|
|
||||||
name: "displayName",
|
|
||||||
control,
|
|
||||||
defaultValue: alias,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [toggleDisableDialog, DisableConfirm] = useConfirmDialog({
|
const [toggleDisableDialog, DisableConfirm] = useConfirmDialog({
|
||||||
titleKey: "identity-providers:disableProvider",
|
titleKey: "identity-providers:disableProvider",
|
||||||
|
|
Loading…
Reference in a new issue