-
Notifications
You must be signed in to change notification settings - Fork 85
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
✨(frontend) add open edx profile information in learner dashboard #2329
Conversation
b22b510
to
d20dcd5
Compare
013bc65
to
7bfeff5
Compare
it('uses its own route to get user profile', async () => { | ||
const openEdxProfile = OpenEdxApiProfileFactory().one(); | ||
fetchMock.get( | ||
`https://demo.endpoint.api/api/user/v1/accounts/${openEdxProfile.username}`, |
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.
@jbpenrath
Why does this route use api/user/v1/
where other api route use /api/v1.0/user
?
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.
/api/v1.0/user
are routes developed by us in fonzie so we follow versionned route pattern we are using in our projects.
api/user/v1/
are routes of OpenEdX.
7bfeff5
to
ee68a0f
Compare
781b733
to
b5cf7ca
Compare
0cd1be7
to
b8af23b
Compare
b8af23b
to
19c83de
Compare
88a4923
to
367ccf7
Compare
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.
Last comments batch then LGTM ✅
src/frontend/js/api/lms/dummy.ts
Outdated
get: (username: string) => { | ||
return Promise.resolve({ | ||
username: 'j_do', | ||
name: 'John Do', | ||
email: '[email protected]', | ||
country: 'fr', | ||
level_of_education: OpenEdxLevelOfEducation.MASTER_OR_PROFESSIONNAL_DEGREE, | ||
gender: OpenEdxGender.MALE, | ||
year_of_birth: '1971', | ||
'pref-lang': OpenEdxLanguageIsoCode.ENGLISH, | ||
language_proficiencies: [{ code: OpenEdxLanguageIsoCode.ENGLISH }], | ||
} as OpenEdxApiProfile); |
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.
get: (username: string) => { | |
return Promise.resolve({ | |
username: 'j_do', | |
name: 'John Do', | |
email: '[email protected]', | |
country: 'fr', | |
level_of_education: OpenEdxLevelOfEducation.MASTER_OR_PROFESSIONNAL_DEGREE, | |
gender: OpenEdxGender.MALE, | |
year_of_birth: '1971', | |
'pref-lang': OpenEdxLanguageIsoCode.ENGLISH, | |
language_proficiencies: [{ code: OpenEdxLanguageIsoCode.ENGLISH }], | |
} as OpenEdxApiProfile); | |
get: (username: string): Promise<OpenEdxApiProfile> => { | |
return Promise.resolve({ | |
NathanVss marked this conversation as resolved. | |
username: 'j_do', | |
name: 'John Do', | |
email: '[email protected]', | |
country: 'fr', | |
level_of_education: OpenEdxLevelOfEducation.MASTER_OR_PROFESSIONNAL_DEGREE, | |
gender: OpenEdxGender.MALE, | |
year_of_birth: '1971', | |
'pref-lang': OpenEdxLanguageIsoCode.ENGLISH, | |
date_joined: '1970-01-01T00:00:00Z' | |
language_proficiencies: [{ code: OpenEdxLanguageIsoCode.ENGLISH }], | |
}); |
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.
Why defined the type again where it's already done in types/api.ts
?
export interface APIAuthentication {
login: () => void;
logout: () => Promise<void>;
me: () => Promise<Nullable<User>>;
register: () => void;
// routes below are only defined for fonzie auth backend
accessToken?: () => Nullable<string>;
account?: {
get: (username: string) => Promise<OpenEdxApiProfile>;
};
}
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.
Indeed you could remove the returned type. By purpose was mainly to remove the as OpenEdxApiProfile
c991bc6
to
b8f74e4
Compare
checkStatus function is used outside of api/joanie.ts and therefor need to be in a utility file.
we'll have new usage of list of DashboardBox, it's better to have a centralize component to set generic gap between them
Use new DashboardBox.List on address list page.
To easly reuse form layout, we add a Form component that centralize form's blocks
use new Form component were form classes were used
We want to display OpenEdx read-only informations about the user. To edit theses informations, a link open a new tab with OpenEdx profile form page.
use test wrapper in DashboardEditCreditCard.spec.tsx and DashboardCreditCardsManagement/index.spec.tsx
b8f74e4
to
3e22273
Compare
Purpose
Missing parts: