Skip to content

Commit

Permalink
[ES-1908] onBlur validation and verify otp button disable issue fixed. (
Browse files Browse the repository at this point in the history
#1035)

Signed-off-by: GurukiranP <[email protected]>
  • Loading branch information
gk-4VII authored Dec 6, 2024
1 parent ddeab5d commit fc6f913
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ mosip.esignet.ui.config.username.prefix=
mosip.esignet.ui.config.username.postfix=
mosip.esignet.ui.config.username.max-length=12
mosip.esignet.ui.config.username.input-type=text
mosip.esignet.ui.config.login-id.options={{ 'id': 'mobile', 'svg': 'mobile_icon', 'prefixes': {{'label': 'KHM', 'value': '+855', 'regex': ''}, {'label': 'IND', 'value': '+91', 'maxLength': '', 'regex': ''}, {'label': 'USA', 'value': '+1', 'maxLength': ''}}, 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'nrc', 'svg': 'nrc_id_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'vid', 'svg': 'vid_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'email', 'svg': 'email_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }}
mosip.esignet.ui.config.login-id.options={{ 'id': 'mobile', 'svg': 'mobile_icon', 'prefixes': {{'label': 'KHM', 'value': '+855', 'regex': ''}, {'label': 'IND', 'value': '+91', 'maxLength': '', 'regex': ''}}, 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'nrc', 'svg': 'nrc_id_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'vid', 'svg': 'vid_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }, { 'id': 'email', 'svg': 'email_icon', 'prefixes': '', 'postfix': '', 'maxLength': '', 'regex': '' }}

mosip.esignet.ui.config.key-values={'sbi.env': '${mosip.esignet.authenticator.ida-env:Developer}', 'sbi.timeout.DISC': 30, \
'sbi.timeout.DINFO': 30, 'sbi.timeout.CAPTURE': 30, 'sbi.capture.count.face': 1, 'sbi.capture.count.finger': 1, \
Expand Down
10 changes: 5 additions & 5 deletions oidc-ui/src/components/InputWithPrefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ const InputWithPrefix = (props) => {
e.target.name.split("_")[1]
);
const maxLength = idProperties.maxLength;
if (maxLength && e.target.value.trim().length === parseInt(maxLength)) {
setIsValid(true);
} else {
setIsValid(false);
}
const regex = idProperties.regex ? new RegExp(idProperties.regex) : null;
setIsValid(
(!maxLength || e.target.value.trim().length === parseInt(maxLength)) &&
(!regex || regex.test(e.target.value.trim()))
);
};

const handleCountryChange = (option) => {
Expand Down
15 changes: 10 additions & 5 deletions oidc-ui/src/components/OtpVerify.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,6 @@ export default function OtpVerify({
)}
</div>
)}

{status.state === states.LOADING && (
<LoadingIndicator size="medium" message={status.msg} />
)}
</div>

<div
Expand All @@ -393,6 +389,7 @@ export default function OtpVerify({
}}
autoSelect={true}
ref={(n) => (pin = n)}
disabled={status.state === states.LOADING}
/>
</div>

Expand Down Expand Up @@ -426,12 +423,20 @@ export default function OtpVerify({
text={t1("resend_otp")}
handleClick={handleSendOtp}
id="resend_otp"
disabled={(showCaptcha && captchaToken === null) || !showResendOtp}
disabled={
(showCaptcha && captchaToken === null) ||
!showResendOtp ||
status.state === states.LOADING
}
customClassName={`!bg-white !border-none !p-0 !w-max !m-auto ${
showResendOtp ? "resend_otp" : "!text-gray-400"
}`}
/>
</div>

{status.state === states.LOADING && (
<LoadingIndicator size="medium" message={status.msg} />
)}
</form>
</>
);
Expand Down

0 comments on commit fc6f913

Please sign in to comment.