-
Notifications
You must be signed in to change notification settings - Fork 13
#4471 - BCSC - Enable using the address from BCSC in SIMS profile #5001
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
Conversation
db9458e to
4dc9726
Compare
| bcscParsedToken.address.country.toLowerCase() === "ca" || | ||
| bcscParsedToken.address.country.toLowerCase() === "canada" |
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.
Is there any expectation to receive "ca" and "canada" as a country?
If not, please use the xpcetd one only and have it declared as a constant.
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.
Thanks @andrewsignori-aot ,
Code updated.
| const studentStore = useStudentStore(); | ||
| const processing = ref(false); | ||
| const populateBcscAddressFields = (data: StudentProfileFormModel) => { |
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.
BCSC goes uppercase for this name: populateBCSCAddressFields.
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.
Thanks @andrewsignori-aot ,
Code updated.
andrewsignori-aot
left a comment
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.
Nice work, please take a look at the comments.
| if (bcscParsedToken.address.street_address) { | ||
| const normalizedAddress = | ||
| bcscParsedToken.address.street_address.replace(/\\n/g, "\n"); | ||
| const addressParts = normalizedAddress.split("\n"); | ||
| data.addressLine1 = addressParts[0]; | ||
| if (addressParts.length > 1) { | ||
| data.addressLine2 = addressParts.slice(1).join("\n"); | ||
| } | ||
| } |
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.
Suggested code:
if (bcscParsedToken.address.street_address) {
const [address1, address2] =
bcscParsedToken.address.street_address.split("\n");
data.addressLine1 = address1?.trim();
data.addressLine2 = address2?.trim();
}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.
We don't need it anymore this logic as we are populate all in addressLine1.
sh16011993
left a comment
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.
Nice work @bidyashish 👍
| const processing = ref(false); | ||
| const populateBCSCAddressFields = (data: StudentProfileFormModel) => { | ||
| if (!bcscParsedToken.address) return; |
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.
If bcscParsedToken.address is no longer optional, the check can be removed.
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.
Check removed.
| data.provinceState = bcscParsedToken.address.region; | ||
| data.canadaPostalCode = bcscParsedToken.address.postal_code; | ||
| data.country = bcscParsedToken.address.country; | ||
| data.selectedCountry = |
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.
Minor, the "CA" can be added as a const.
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.
"CA" moved to system const.
| data.provinceState = bcscParsedToken.address.region; | ||
| data.canadaPostalCode = bcscParsedToken.address.postal_code; |
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.
Is this respecting the below AC?
For address info that is non-Canadian: bring over the street address, city, country
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.
Thanks,.
Updated the code.
|
andrewsignori-aot
left a comment
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.
Nice work, thanks for making the changes, looks good 👍



AC
Update keycloak to accept new fields from BCSC logins (BCSC in DEV/TEST are currently configured to send these fields)
Keycloak
Dev Done ✅
Pending:
Test/Staging
Prod
Demo
Keycloack Demo