Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ import { ApplicationManagementConstants } from "../../../../constants/applicatio
import { AuthenticationStepInterface } from "../../../../models/application";
import { SignInMethodUtils } from "../../../../utils/sign-in-method-utils";

const INFO_LABEL: JSX.Element = (
<Label attached="top">
<Icon name="info circle" /> Info
</Label>
);

/**
* Proptypes for the authenticators component.
*/
Expand Down Expand Up @@ -187,12 +193,6 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
* @returns React element.
*/
const resolvePopupContent = (authenticator: GenericAuthenticatorInterface): ReactElement => {
const InfoLabel: JSX.Element = (
<Label attached="top">
<Icon name="info circle" /> Info
</Label>
);

if (
authenticator.category === AuthenticatorCategories.SECOND_FACTOR ||
authenticator.category === AuthenticatorCategories.TWO_FACTOR_CUSTOM
Expand All @@ -201,7 +201,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
<>
{ currentStep === 0 ? (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{ applicationConfig.signInMethod.authenticatorSelection.messages
.secondFactorDisabledInFirstStep ??
Expand All @@ -214,7 +214,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
</Fragment>
) : (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{ applicationConfig.signInMethod.authenticatorSelection.messages
.secondFactorDisabled ?? (
Expand Down Expand Up @@ -244,7 +244,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
<>
{ currentStep === 0 ? (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{ t(
"applications:edit.sections" +
Expand All @@ -255,7 +255,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
</Fragment>
) : (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{ t(
"applications:edit.sections" +
Expand All @@ -270,7 +270,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
} else if (authenticator.category === AuthenticatorCategories.SOCIAL) {
return (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{ t(
"applications:edit.sections.signOnMethod.sections." +
Expand All @@ -291,7 +291,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (

return (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{
t(
Expand All @@ -307,7 +307,7 @@ export const Authenticators: FunctionComponent<AuthenticatorsPropsInterface> = (
.ACTIVE_SESSION_LIMIT_HANDLER_AUTHENTICATOR_NAME) {
return (
<Fragment>
{ InfoLabel }
{ INFO_LABEL }
<Text>
{
(authenticationSteps[currentStep]?.options?.length !== 0)
Expand Down