Skip to content

Commit

Permalink
Merge pull request #131 from MadhuMosip/MOSIP-32336
Browse files Browse the repository at this point in the history
MOSIP-34342 MOSIP-34353 disabled register btn when error occurred and focusing the options when hover.
  • Loading branch information
ckm007 authored Jul 11, 2024
2 parents d677a16 + 24d54ad commit e5a100c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
<>
{(currentLanguageTag !== languageTag) && (
<>
<span key={languageTag} onClick={() => changeLocale(languageTag)} className="text-[#0D3077] px-[14px] py-[10px] flex content-center justify-between cursor-pointer">
<span key={languageTag} onClick={() => changeLocale(languageTag)} className="text-[#0D3077] px-[14px] py-[10px] flex content-center justify-between cursor-pointer hover:bg-[#F4F8FF]">
<a href="#">
<span className="text-xl">{labelBySupportedLanguageTag[languageTag]}</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import eyeIconOff from '../assets/visibility_off.svg';
import info from '../assets/info.svg';
import error from '../assets/error.svg'
import ToolTip from "./shared/Tooltip";
import arrowRight from "../assets/arrow_right_rtl.svg"
import arrowRight from "../assets/arrow_right_rtl.svg";

declare global {
interface Window {
Expand Down Expand Up @@ -54,9 +54,10 @@ export default function Register(props: PageProps<Extract<KcContext, { pageId: "
const [confPasswordMatch, checkConfPasswordMatch] = useState(false);
const [orgData, setOrgData] = useState(organisationData ? organisationData.slice() : undefined);
const [isReloadBtn, setReloadBtn] = useState(false);
const [minMaxLength, checkminMaxLength] = useState(false)
const [invalidFirstName, checkInvalidFirstName] = useState(false)
const [invalidLastName, checkInvalidLastName] = useState(false)
const [minMaxLength, checkminMaxLength] = useState(false);
const [invalidFirstName, checkInvalidFirstName] = useState(false);
const [invalidLastName, checkInvalidLastName] = useState(false);
const [errorMessage, setErrorMsg] = useState({...message});

const inputRef = useRef<HTMLInputElement>(null);
const menuRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -206,6 +207,12 @@ export default function Register(props: PageProps<Extract<KcContext, { pageId: "
}
}

if(errorMessage.summary){
delete dummyFormData.password
delete dummyFormData["password-confirm"]
setErrorMsg({})
}

const { msg, msgStr } = i18n;
return (
<Template {...{ kcContext, i18n, doUseDefaultCss, classes }} headerNode={
Expand Down Expand Up @@ -263,13 +270,18 @@ export default function Register(props: PageProps<Extract<KcContext, { pageId: "
</div>
{partnerTypesMenu && (
<div ref={partnerTypesMenuRef} className="absolute max-[490px]:w-[88%] max-[840px]:w-[91.5%] w-[93.5%] z-10 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border border-bColor mt-[2px]" >
<ul className="py-1 px-5 text-xl text-[#031640] font-inter" role="none" >
<li onClick={() => selectedPartnerTypeValue('Device_Provider')} className="block py-2 cursor-pointer border-b" role="menuitem">Device Provider</li>
<li onClick={() => selectedPartnerTypeValue('FTM_Provider')} className="block py-2 cursor-pointer border-b" role="menuitem">FTM Provider</li>
<li onClick={() => selectedPartnerTypeValue('Authentication_Partner')} className="block py-2 cursor-pointer border-b" role="menuitem">Authentication Partner</li>
<li onClick={() => selectedPartnerTypeValue('Credential_Partner_or_ISP')} className="block py-2 cursor-pointer border-b" role="menuitem">Credential Partner or ISP</li>
<li onClick={() => selectedPartnerTypeValue('ABIS_Partner')} className="block py-2 cursor-pointer border-b" role="menuitem">ABIS Partner</li>
<li onClick={() => selectedPartnerTypeValue('SDK_Partner')} className="block py-2 cursor-pointer" role="menuitem">SDK Partner</li>
<ul className="py-[1px] text-xl text-[#031640] font-inter" role="none" >
<li onClick={() => selectedPartnerTypeValue('Device_Provider')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">Device Provider</li>
<hr className="mx-4 border-[#D8D8D8]" />
<li onClick={() => selectedPartnerTypeValue('FTM_Provider')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">FTM Provider</li>
<hr className="mx-4 border-[#D8D8D8]" />
<li onClick={() => selectedPartnerTypeValue('Authentication_Partner')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">Authentication Partner</li>
<hr className="mx-4 border-[#D8D8D8]" />
<li onClick={() => selectedPartnerTypeValue('Credential_Partner_or_ISP')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">Credential Partner or ISP</li>
<hr className="mx-4 border-[#D8D8D8]"/>
<li onClick={() => selectedPartnerTypeValue('ABIS_Partner')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">ABIS Partner</li>
<hr className="mx-4 border-[#D8D8D8]" />
<li onClick={() => selectedPartnerTypeValue('SDK_Partner')} className="block py-3 px-5 cursor-pointer hover:bg-[#F4F8FF]" role="menuitem">SDK Partner</li>
</ul>
</div>
)}
Expand Down

0 comments on commit e5a100c

Please sign in to comment.