Skip to content

Commit 78d4469

Browse files
Merge pull request #7894 from PasinduYeshan/fix/sms-resend-attemp
Provide UI support for configuring SmsOTP.ResendAttemptsCount
2 parents 43b5d80 + 9a7ff7c commit 78d4469

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

Diff for: .changeset/moody-phones-share.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@wso2is/admin.identity-providers.v1": patch
3+
"@wso2is/console": patch
4+
"@wso2is/i18n": patch
5+
---
6+
7+
Add SMS otp authenticator resend attempt config to UI

Diff for: features/admin.identity-providers.v1/components/forms/authenticators/sms-otp-authenticator-form.tsx

+17-6
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,11 @@ export const SMSOTPAuthenticatorForm: FunctionComponent<SMSOTPAuthenticatorFormP
494494
}
495495
</Label>
496496
</Field.Input>
497-
{ /* TODO: Uncomment resend attempt count field once it's finalized.
498-
499497
<Field.Input
500498
ariaLabel="Allowed Resend Attempts"
501499
inputType="number"
502500
name="SmsOTP_ResendAttemptsCount"
501+
labelPosition="right"
503502
label={
504503
t("authenticationProvider:forms.authenticatorSettings" +
505504
".smsOTP.allowedResendAttemptCount.label")
@@ -521,21 +520,33 @@ export const SMSOTPAuthenticatorForm: FunctionComponent<SMSOTPAuthenticatorFormP
521520
}
522521
required={ true }
523522
readOnly={ readOnly }
523+
max={
524+
ConnectionUIConstants
525+
.SMS_OTP_AUTHENTICATOR_SETTINGS_FORM_FIELD_CONSTRAINTS.ALLOWED_RESEND_ATTEMPT_COUNT_MAX_VALUE
526+
}
527+
min={
528+
ConnectionUIConstants
529+
.SMS_OTP_AUTHENTICATOR_SETTINGS_FORM_FIELD_CONSTRAINTS.ALLOWED_RESEND_ATTEMPT_COUNT_MIN_VALUE
530+
}
524531
maxLength={
525-
IdentityProviderManagementConstants
532+
ConnectionUIConstants
526533
.SMS_OTP_AUTHENTICATOR_SETTINGS_FORM_FIELD_CONSTRAINTS.ALLOWED_RESEND_ATTEMPT_COUNT_MAX_LENGTH
527534
}
528535
minLength={
529-
IdentityProviderManagementConstants
536+
ConnectionUIConstants
530537
.SMS_OTP_AUTHENTICATOR_SETTINGS_FORM_FIELD_CONSTRAINTS.ALLOWED_RESEND_ATTEMPT_COUNT_MIN_LENGTH
531538
}
532539
width={ 12 }
533540
data-testid={ `${ testId }-allowed-resend-attempt-count` }
534541
>
535542
<input />
543+
<Label>
544+
{
545+
t("authenticationProvider:forms.authenticatorSettings" +
546+
".smsOTP.allowedResendAttemptCount.unit")
547+
}
548+
</Label>
536549
</Field.Input>
537-
538-
*/ }
539550
<Field.Button
540551
form={ FORM_ID }
541552
size="small"

Diff for: modules/i18n/src/models/namespaces/authentication-provider-ns.ts

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ export interface AuthenticationProviderNS {
334334
hint: string;
335335
label: string;
336336
placeholder: string;
337+
unit: string;
337338
validations: {
338339
required: string;
339340
invalid: string;

Diff for: modules/i18n/src/translations/en-US/portals/authentication-provider.ts

+1
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ export const authenticationProvider:AuthenticationProviderNS = {
813813
hint: "The number of allowed OTP resend attempts.",
814814
label: "Allowed OTP resend attempt count",
815815
placeholder: "Enter allowed resend attempt count.",
816+
unit: "attempts",
816817
validations: {
817818
invalid: "Allowed OTP resend attempt count should be an integer.",
818819
range: "Allowed OTP resend attempt count should be between 0 & 100.",

0 commit comments

Comments
 (0)