-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OB3] Improvements and Changes to Consent Manager Self-Care Portal UI #49
Conversation
@@ -17,61 +17,58 @@ | |||
*/ | |||
|
|||
export const common = { | |||
footerContent: "WSO2 Open Banking | 2021", | |||
complaintHandleLinkText: "Complaint handling and resolution", | |||
footerContent: 'WSO2 Open Banking | 2024', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we retrieve the year from current date and add here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this in a80b0de
react-apps/self-care-portal/self-care-portal-frontend/accelerator/src/specConfigs/common.js
Outdated
Show resolved
Hide resolved
...self-care-portal/self-care-portal-frontend/accelerator/src/specConfigs/specConfigurations.js
Outdated
Show resolved
Hide resolved
…tor/src/specConfigs/common.js Co-authored-by: Vimukthi Rajapaksha <[email protected]>
…tor/src/specConfigs/specConfigurations.js Co-authored-by: Vimukthi Rajapaksha <[email protected]>
@@ -127,7 +127,7 @@ export const KeyDatesInfo = ({consent, infoLabels, consentType}) => { | |||
return ( | |||
<div className="keyDatesBody"> | |||
<h5>{keyDatesConfig.keyDatesInfoLabel}</h5> | |||
{keyDatesMap} | |||
<div className="two-columns">{keyDatesMap}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without manually defining styles, can't we use existing bootstrap breakpoints[1] for this?
[1] https://getbootstrap.com/docs/5.3/layout/breakpoints/#available-breakpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in f49d74c
const getRevokeUrl = (consentId, user) => { | ||
const adminUrl = `${CONFIG.BACKEND_URL}/admin/revoke?consentID=${consentId}`; | ||
const defaultUrl = `${CONFIG.BACKEND_URL}/admin/revoke?consentID=${consentId}&userID=${user.email}`; | ||
|
||
return user.role === 'customerCareOfficer' ? adminUrl : defaultUrl; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the getRevokeUrl
arrow function out of the withdrawConsent
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in 106de5c
@@ -170,3 +172,45 @@ export const getConsentsFromAPIForSearch = (searchObj, user, appInfo) => { | |||
}); | |||
}; | |||
|
|||
export const withdrawConsent = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we rename this to revokeConsent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in 106de5c
react-apps/self-care-portal/self-care-portal-frontend/package.json
Outdated
Show resolved
Hide resolved
const response = await axios.delete(getRevokeUrl(consentId, user), { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Bearer ${Cookies.get(User.CONST.OB_SCP_ACC_TOKEN_P1)}`, | ||
'x-wso2-client-id': clientId, | ||
'x-fapi-financial-id': 'open-bank' | ||
}, | ||
}); | ||
if (response.status === 204) { | ||
setMessage(withdrawLang.withdrawModalSuccessMsg + applicationName); | ||
setWithdrawMessageIcon(faCheckCircle); | ||
setWithdrawIconId('withdrawSuccess'); | ||
} else { | ||
setMessage(withdrawLang.withdrawModalFailMsg); | ||
setWithdrawMessageIcon(faExclamationCircle); | ||
setWithdrawIconId('withdrawFail'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this function return a promise, similar to getConsentsFromAPI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the revokeConsent
function to return a Promise and moved response handling logics to WithdrawStep2.jsc
in 106de5c
[OB3] Improvements and Changes to Consent Manager Self-Care Portal UI
Issue link: #48
Doc Issue: Optional, link issue from documentation repository
Applicable Labels: OB 3.0.0
Development Checklist
Testing Checklist