Skip to content

Commit

Permalink
separate i18n loginFlow namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jathushan-r committed Mar 21, 2024
1 parent b172dca commit d70d56b
Show file tree
Hide file tree
Showing 25 changed files with 667 additions and 645 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,19 @@ const AuthenticationFlowBuilder: FunctionComponent<AuthenticationFlowBuilderProp
const FlowModes: AuthenticationFlowBuilderModesInterface[] = readOnly ? [
{
id: 0,
label: t("console:loginFlow.modes.legacy.label"),
label: t("loginFlow:modes.legacy.label"),
mode: AuthenticationFlowBuilderModes.Classic
}
] : [
{
id: 0,
label: t("console:loginFlow.modes.legacy.label"),
label: t("loginFlow:modes.legacy.label"),
mode: AuthenticationFlowBuilderModes.Classic
},
{
extra: <Chip size="small" label="Beta" className="oxygen-chip-beta" />,
id: 1,
label: t("console:loginFlow.modes.visual.label"),
label: t("loginFlow:modes.visual.label"),
mode: AuthenticationFlowBuilderModes.Visual
}
];
Expand Down Expand Up @@ -338,7 +338,7 @@ const AuthenticationFlowBuilder: FunctionComponent<AuthenticationFlowBuilderProp
classNames("predefined-side-panel-drawer", { hidden: activeFlowMode.id === FlowModes[0].id })
}
panel={ <PredefinedFlowsSidePanel showAdaptiveLoginTemplates={ isAdaptiveAuthAvailable } /> }
panelControlsLabel={ t("console:loginFlow.predefinedFlows.panelHeader") }
panelControlsLabel={ t("loginFlow:predefinedFlows.panelHeader") }
>
<div id="drawer-container" style={ { position: "relative" } }>
<Box>
Expand Down Expand Up @@ -400,7 +400,7 @@ const AuthenticationFlowBuilder: FunctionComponent<AuthenticationFlowBuilderProp
data-componentid={ `${componentId}-update-button` }
onClick={ () => handleOnUpdate(authenticationSequence) }
>
{ t("console:loginFlow.visualEditor.actions.update.label") }
{ t("loginFlow:visualEditor.actions.update.label") }
</PrimaryButton>
</div>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,33 @@ const AuthenticationFlowModeSwitchDisclaimerModal: FunctionComponent<
onClose={ onClose }
type="warning"
closeOnDimmerClick={ false }
assertionHint={ t("console:loginFlow.modes.switchConfirmationModal.assertionHint") }
assertionHint={ t("loginFlow:modes.switchConfirmationModal.assertionHint") }
assertionType="checkbox"
primaryAction={ t("console:loginFlow.modes.switchConfirmationModal.primaryActionButtonText") }
secondaryAction={ t("console:loginFlow.modes.switchConfirmationModal.secondaryActionButtonText") }
primaryAction={ t("loginFlow:modes.switchConfirmationModal.primaryActionButtonText") }
secondaryAction={ t("loginFlow:modes.switchConfirmationModal.secondaryActionButtonText") }
data-componentid={ componentId }
onPrimaryActionClick={ () => onClose(null, null) }
onSecondaryActionClick={ (event: MouseEvent<HTMLElement>) => onClose(event, null) }
{ ...rest }
>
<ConfirmationModal.Header data-componentid={ `${componentId}-header` }>
{ t("console:loginFlow.modes.switchConfirmationModal.title") }
{ t("loginFlow:modes.switchConfirmationModal.title") }
</ConfirmationModal.Header>
<ConfirmationModal.Message
attached
warning
data-componentid={ `${componentId}-message` }
>
<Trans
i18nKey="console:loginFlow.modes.switchConfirmationModal.warningMessage"
i18nKey="loginFlow:modes.switchConfirmationModal.warningMessage"
tOptions={ { mode: mode.label } }
>
If you switch to the <strong>{ mode.label }</strong>, you will loose the
unsaved changes in the current flow. Please proceed with caution.
</Trans>
</ConfirmationModal.Message>
<ConfirmationModal.Content data-componentid={ `${componentId}-content` }>
{ t("console:loginFlow.modes.switchConfirmationModal.content") }
{ t("loginFlow:modes.switchConfirmationModal.content") }
</ConfirmationModal.Content>
</ConfirmationModal>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@ const AuthenticationFlowRevertDisclaimerModal: FunctionComponent<
onClose={ onClose }
type="warning"
closeOnDimmerClick={ false }
assertionHint={ t("console:loginFlow.revertConfirmationModal.assertionHint") }
assertionHint={ t("loginFlow:revertConfirmationModal.assertionHint") }
assertionType="checkbox"
primaryAction={ t("console:loginFlow.revertConfirmationModal.primaryActionButtonText") }
secondaryAction={ t("console:loginFlow.revertConfirmationModal.secondaryActionButtonText") }
primaryAction={ t("loginFlow:revertConfirmationModal.primaryActionButtonText") }
secondaryAction={ t("loginFlow:revertConfirmationModal.secondaryActionButtonText") }
data-componentid={ componentId }
onPrimaryActionClick={ () => onClose(null, null) }
onSecondaryActionClick={ (event: MouseEvent<HTMLElement>) => onClose(event, null) }
{ ...rest }
>
<ConfirmationModal.Header data-componentid={ `${componentId}-header` }>
{ t("console:loginFlow.revertConfirmationModal.title") }
{ t("loginFlow:revertConfirmationModal.title") }
</ConfirmationModal.Header>
<ConfirmationModal.Message
attached
warning
data-componentid={ `${componentId}-message` }
>
{ t("console:loginFlow.revertConfirmationModal.warningMessage") }
{ t("loginFlow:revertConfirmationModal.warningMessage") }
</ConfirmationModal.Message>
<ConfirmationModal.Content data-componentid={ `${componentId}-content` }>
{ t("console:loginFlow.revertConfirmationModal.content") }
{ t("loginFlow:revertConfirmationModal.content") }
</ConfirmationModal.Content>
</ConfirmationModal>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ const AuthenticationFlowVisualEditor: FunctionComponent<AuthenticationFlowVisual
style={ { marginTop: `${infoAlertBoxHeight + 15}px` } }
>
<ArrowRotateLeft />
{ t("console:loginFlow.visualEditor.actions.revert.label") }
{ t("loginFlow:visualEditor.actions.revert.label") }
</Button>
<ReactFlow
fitView
Expand All @@ -554,7 +554,7 @@ const AuthenticationFlowVisualEditor: FunctionComponent<AuthenticationFlowVisual
disabled={ !isValidAuthenticationFlow }
data-componentid={ `${componentId}-update-button` }
>
{ t("console:loginFlow.visualEditor.actions.update.label") }
{ t("loginFlow:visualEditor.actions.update.label") }
</Button>
) }
</ReactFlow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import BasicSignInOptionControls from "./basic-sign-in-option-controls";
import {
IdentityProviderManagementConstants
} from "../../../../../identity-providers/constants/identity-provider-management-constants";
import {
import {
CHROME_BROWSER_CONSTANT,
FIREFOX_BROWSER_CONSTANT
} from "../../../../constants/active-sessions-limit-constants";
Expand Down Expand Up @@ -91,8 +91,8 @@ const ActiveSessionsLimitFragment = (props: ActiveSessionsLimitFragmentPropsInte
<table>
<tr>
<th><Checkbox className="non-interactive" /></th>
<th>{ t("console:loginFlow.nodes.activeSessionsLimit.form.sessions.browserLabel") }</th>
<th>{ t("console:loginFlow.nodes.activeSessionsLimit.form.sessions.lastAccessedLabel") }</th>
<th>{ t("loginFlow:nodes.activeSessionsLimit.form.sessions.browserLabel") }</th>
<th>{ t("loginFlow:nodes.activeSessionsLimit.form.sessions.lastAccessedLabel") }</th>
</tr>
<tr>
<td><Checkbox className="non-interactive" /></td>
Expand All @@ -110,18 +110,18 @@ const ActiveSessionsLimitFragment = (props: ActiveSessionsLimitFragmentPropsInte
return (
<div className="active-sessions-limit-fragment" data-componentid={ componentId }>
<Typography align="center" className="oxygen-sign-in-header" variant="h4">
{ t("console:loginFlow.nodes.activeSessionsLimit.header") }
{ t("loginFlow:nodes.activeSessionsLimit.header") }
</Typography>
<Typography align="center" className="oxygen-sign-in-sub-header" variant="subtitle1">
{ t("console:loginFlow.nodes.activeSessionsLimit.form.help") }
{ t("loginFlow:nodes.activeSessionsLimit.form.help") }
</Typography>
<BasicSignInOptionControls
onOptionRemove={ (event: MouseEvent<HTMLButtonElement>) => {
onOptionRemove(event, {
toRemove: IdentityProviderManagementConstants.SESSION_EXECUTOR_AUTHENTICATOR
});
} }
optionRemoveTooltipContent={ t("console:loginFlow.nodes.signIn.controls.optionRemoveTooltipContent") }
optionRemoveTooltipContent={ t("loginFlow:nodes.signIn.controls.optionRemoveTooltipContent") }
>
{
getActiveSessionsTable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,43 +76,43 @@ const BasicAuthFragment = (props: BasicAuthFragmentPropsInterface): ReactElement
return (
<div className="basic-auth-fragment" data-componentid={ componentId }>
<Typography align="center" className="oxygen-sign-in-header" variant="h4">
{ t("console:loginFlow.nodes.signIn.header") }
{ t("loginFlow:nodes.signIn.header") }
</Typography>
<BasicSignInOptionControls
onOptionRemove={ (event: MouseEvent<HTMLButtonElement>) => {
onOptionRemove(event, {
toRemove: IdentityProviderManagementConstants.BASIC_AUTHENTICATOR
});
} }
optionSwitchTooltipContent={ t("console:loginFlow.nodes.signIn.controls.optionSwitchTooltipContent") }
optionRemoveTooltipContent={ t("console:loginFlow.nodes.signIn.controls.optionRemoveTooltipContent") }
optionSwitchTooltipContent={ t("loginFlow:nodes.signIn.controls.optionSwitchTooltipContent") }
optionRemoveTooltipContent={ t("loginFlow:nodes.signIn.controls.optionRemoveTooltipContent") }
>
<TextField
required
fullWidth
autoComplete="off"
label={ t("console:loginFlow.nodes.signIn.form.fields.username.label") }
label={ t("loginFlow:nodes.signIn.form.fields.username.label") }
name="text"
value={ null }
placeholder={ t("console:loginFlow.nodes.signIn.form.fields.username.placeholder") }
placeholder={ t("loginFlow:nodes.signIn.form.fields.username.placeholder") }
className="non-interactive"
/>
<TextField
required
fullWidth
name="password"
autoComplete="new-password"
label={ t("console:loginFlow.nodes.signIn.form.fields.password.label") }
label={ t("loginFlow:nodes.signIn.form.fields.password.label") }
type="password"
value={ null }
placeholder={ t("console:loginFlow.nodes.signIn.form.fields.password.placeholder") }
placeholder={ t("loginFlow:nodes.signIn.form.fields.password.placeholder") }
className="non-interactive"
/>
</BasicSignInOptionControls>
<FormGroup className="non-interactive">
<FormControlLabel
control={ <Checkbox color="secondary" /> }
label={ t("console:loginFlow.nodes.signIn.form.fields.rememberMe.label") }
label={ t("loginFlow:nodes.signIn.form.fields.rememberMe.label") }
/>
</FormGroup>
<Button
Expand All @@ -122,7 +122,7 @@ const BasicAuthFragment = (props: BasicAuthFragmentPropsInterface): ReactElement
type="submit"
fullWidth
>
{ t("console:loginFlow.nodes.signIn.form.actions.primary") }
{ t("loginFlow:nodes.signIn.form.actions.primary") }
</Button>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ const EmailOTPFragment = (props: EmailOTPFragmentPropsInterface): ReactElement =
return (
<div className="email-otp-fragment" data-componentid={ componentId }>
<Typography align="center" className="oxygen-sign-in-header" variant="h4">
{ t("console:loginFlow.nodes.emailOTP.header") }
{ t("loginFlow:nodes.emailOTP.header") }
</Typography>
<BasicSignInOptionControls
onOptionRemove={ (event: MouseEvent<HTMLButtonElement>) => {
onOptionRemove(event, {
toRemove: IdentityProviderManagementConstants.EMAIL_OTP_AUTHENTICATOR
});
} }
optionRemoveTooltipContent={ t("console:loginFlow.nodes.signIn.controls.optionRemoveTooltipContent") }
optionRemoveTooltipContent={ t("loginFlow:nodes.signIn.controls.optionRemoveTooltipContent") }
>
<TextField
required
fullWidth
name="password"
label={ t("console:loginFlow.nodes.emailOTP.form.fields.code.label") }
label={ t("loginFlow:nodes.emailOTP.form.fields.code.label") }
type="password"
placeholder={ t("console:loginFlow.nodes.emailOTP.form.fields.code.placeholder") }
placeholder={ t("loginFlow:nodes.emailOTP.form.fields.code.placeholder") }
autoComplete="off"
className="otp-input non-interactive"
/>
Expand All @@ -90,15 +90,15 @@ const EmailOTPFragment = (props: EmailOTPFragmentPropsInterface): ReactElement =
type="submit"
fullWidth
>
{ t("console:loginFlow.nodes.emailOTP.form.actions.primary") }
{ t("loginFlow:nodes.emailOTP.form.actions.primary") }
</Button>
<Button
color="secondary"
variant="contained"
className="oxygen-sign-in-cta non-interactive"
fullWidth
>
{ t("console:loginFlow.nodes.emailOTP.form.actions.secondary") }
{ t("loginFlow:nodes.emailOTP.form.actions.secondary") }
</Button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const IdentifierFirstFragment = (props: IdentifierFirstFragmentPropsInterface):
return (
<div className="identifier-first-fragment" data-componentid={ componentId }>
<Typography align="center" className="oxygen-sign-in-header" variant="h4">
{ t("console:loginFlow.nodes.identifierFirst.header") }
{ t("loginFlow:nodes.identifierFirst.header") }
</Typography>
<BasicSignInOptionControls
onOptionRemove={ (event: MouseEvent<HTMLButtonElement>) => {
Expand All @@ -85,27 +85,27 @@ const IdentifierFirstFragment = (props: IdentifierFirstFragmentPropsInterface):
});
} }
optionSwitchTooltipContent={
t("console:loginFlow.nodes.identifierFirst.controls.optionSwitchTooltipContent")
t("loginFlow:nodes.identifierFirst.controls.optionSwitchTooltipContent")
}
optionRemoveTooltipContent={
t("console:loginFlow.nodes.identifierFirst.controls.optionRemoveTooltipContent")
t("loginFlow:nodes.identifierFirst.controls.optionRemoveTooltipContent")
}
>
<TextField
required
fullWidth
label={ t("console:loginFlow.nodes.identifierFirst.form.fields.username.label") }
label={ t("loginFlow:nodes.identifierFirst.form.fields.username.label") }
name="text"
autoComplete="off"
value={ null }
placeholder={ t("console:loginFlow.nodes.identifierFirst.form.fields.username.placeholder") }
placeholder={ t("loginFlow:nodes.identifierFirst.form.fields.username.placeholder") }
className="non-interactive"
/>
</BasicSignInOptionControls>
<FormGroup className="non-interactive">
<FormControlLabel
control={ <Checkbox color="secondary" /> }
label={ t("console:loginFlow.nodes.identifierFirst.form.fields.rememberMe.label") }
label={ t("loginFlow:nodes.identifierFirst.form.fields.rememberMe.label") }
/>
</FormGroup>
<Button
Expand All @@ -115,7 +115,7 @@ const IdentifierFirstFragment = (props: IdentifierFirstFragmentPropsInterface):
type="submit"
fullWidth
>
{ t("console:loginFlow.nodes.identifierFirst.form.actions.primary") }
{ t("loginFlow:nodes.identifierFirst.form.actions.primary") }
</Button>
</div>
);
Expand Down
Loading

0 comments on commit d70d56b

Please sign in to comment.