-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-33225: Now sub menus are navigating to resp. page. (#454)
Signed-off-by: Anil_Kumar_Majji <[email protected]>
- Loading branch information
1 parent
8e1bfca
commit 9ccccd6
Showing
6 changed files
with
264 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
pmp-reactjs-ui/src/pages/authenticationServices/DeactivateOidcClient.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from "react"; | ||
import { useState, useEffect } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
import { getUserProfile } from "../../services/UserProfileService"; | ||
import { isLangRTL } from "../../utils/AppUtils"; | ||
import backArrow from "../../svg/back_arrow.svg"; | ||
import { formatDate, moveToOidcClientsList } from "../../utils/AppUtils"; | ||
|
||
function DeactivateOidcClient() { | ||
const { t } = useTranslation(); | ||
const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode); | ||
const navigate = useNavigate(); | ||
const [oidcClientDetails, setOidcClientDetails] = useState([]); | ||
|
||
useEffect(() => { | ||
const clientData = localStorage.getItem('selectedClientData'); | ||
if (clientData) { | ||
try { | ||
const selectedClient = JSON.parse(clientData); | ||
setOidcClientDetails(selectedClient); | ||
} catch (error) { | ||
navigate('/partnermanagement/authenticationServices/oidcClientsList'); | ||
console.error('Error in viewOidcClientDetails page :', error); | ||
} | ||
} else { | ||
navigate('/partnermanagement/authenticationServices/oidcClientsList'); | ||
} | ||
}, [navigate]); | ||
|
||
const moveToHome = () => { | ||
navigate("/partnermanagement"); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className={`flex-col w-full p-5 bg-anti-flash-white h-full font-inter mb-[2%] ${isLoginLanguageRTL ? "mr-[8%]" : "ml-[8%]"} overflow-x-scroll`}> | ||
<div className="flex justify-between mb-5"> | ||
<div className="flex items-center gap-x-2"> | ||
<img | ||
src={backArrow} | ||
alt="" | ||
onClick={() => moveToOidcClientsList(navigate)} | ||
className={`cursor-pointer ${isLoginLanguageRTL ? "rotate-180" : null}`} | ||
/> | ||
<div className="flex-col"> | ||
<h1 className="font-bold text-lg text-md text-dark-blue"> | ||
{t("deactivateOidcClient.deactivateOidcClient")} | ||
</h1> | ||
<div className="flex space-x-1"> | ||
<p | ||
onClick={() => moveToHome()} | ||
className="font-semibold text-tory-blue text-xs cursor-pointer" | ||
> | ||
{t("commons.home")} / | ||
</p> | ||
<p onClick={() => moveToOidcClientsList(navigate)} className="font-semibold text-tory-blue text-xs cursor-pointer"> | ||
{t("deactivateOidcClient.authenticationServiceSection")} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default DeactivateOidcClient; |
69 changes: 69 additions & 0 deletions
69
pmp-reactjs-ui/src/pages/authenticationServices/EditOidcClient.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from "react"; | ||
import { useState, useEffect } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
import { getUserProfile } from "../../services/UserProfileService"; | ||
import { isLangRTL } from "../../utils/AppUtils"; | ||
import backArrow from "../../svg/back_arrow.svg"; | ||
import { formatDate, moveToOidcClientsList } from "../../utils/AppUtils"; | ||
|
||
function EditOidcClient() { | ||
const { t } = useTranslation(); | ||
const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode); | ||
const navigate = useNavigate(); | ||
const [oidcClientDetails, setOidcClientDetails] = useState([]); | ||
|
||
useEffect(() => { | ||
const clientData = localStorage.getItem('selectedClientData'); | ||
if (clientData) { | ||
try { | ||
const selectedClient = JSON.parse(clientData); | ||
setOidcClientDetails(selectedClient); | ||
} catch (error) { | ||
navigate('/partnermanagement/authenticationServices/oidcClientsList'); | ||
console.error('Error in viewOidcClientDetails page :', error); | ||
} | ||
} else { | ||
navigate('/partnermanagement/authenticationServices/oidcClientsList'); | ||
} | ||
}, [navigate]); | ||
|
||
const moveToHome = () => { | ||
navigate("/partnermanagement"); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className={`flex-col w-full p-5 bg-anti-flash-white h-full font-inter mb-[2%] ${isLoginLanguageRTL ? "mr-[8%]" : "ml-[8%]"} overflow-x-scroll`}> | ||
<div className="flex justify-between mb-5"> | ||
<div className="flex items-center gap-x-2"> | ||
<img | ||
src={backArrow} | ||
alt="" | ||
onClick={() => moveToOidcClientsList(navigate)} | ||
className={`cursor-pointer ${isLoginLanguageRTL ? "rotate-180" : null}`} | ||
/> | ||
<div className="flex-col"> | ||
<h1 className="font-bold text-lg text-md text-dark-blue"> | ||
{t("editOidcClient.editOidcClient")} | ||
</h1> | ||
<div className="flex space-x-1"> | ||
<p | ||
onClick={() => moveToHome()} | ||
className="font-semibold text-tory-blue text-xs cursor-pointer" | ||
> | ||
{t("commons.home")} / | ||
</p> | ||
<p onClick={() => moveToOidcClientsList(navigate)} className="font-semibold text-tory-blue text-xs cursor-pointer"> | ||
{t("editOidcClient.authenticationServiceSection")} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default EditOidcClient; |
Oops, something went wrong.