✨(frontend) add open edx profile information in learner dashboard#2329
Merged
rlecellier merged 7 commits intomasterfrom Apr 10, 2024
Merged
✨(frontend) add open edx profile information in learner dashboard#2329rlecellier merged 7 commits intomasterfrom
rlecellier merged 7 commits intomasterfrom
Conversation
b22b510 to
d20dcd5
Compare
013bc65 to
7bfeff5
Compare
rlecellier
commented
Mar 21, 2024
| 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}`, |
Collaborator
Author
There was a problem hiding this comment.
@jbpenrath
Why does this route use api/user/v1/ where other api route use /api/v1.0/user ?
Collaborator
There was a problem hiding this comment.
/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
NathanVss
reviewed
Mar 25, 2024
781b733 to
b5cf7ca
Compare
jbpenrath
reviewed
Apr 2, 2024
0cd1be7 to
b8af23b
Compare
jbpenrath
reviewed
Apr 8, 2024
b8af23b to
19c83de
Compare
88a4923 to
367ccf7
Compare
jbpenrath
approved these changes
Apr 9, 2024
src/frontend/js/api/lms/dummy.ts
Outdated
Comment on lines
+100
to
+111
| get: (username: string) => { | ||
| return Promise.resolve({ | ||
| username: 'j_do', | ||
| name: 'John Do', | ||
| email: 'j.do@whois.net', | ||
| 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); |
Collaborator
There was a problem hiding this comment.
Suggested change
| get: (username: string) => { | |
| return Promise.resolve({ | |
| username: 'j_do', | |
| name: 'John Do', | |
| email: 'j.do@whois.net', | |
| 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: 'j.do@whois.net', | |
| 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 }], | |
| }); |
Collaborator
Author
There was a problem hiding this comment.
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>;
};
}
Collaborator
There was a problem hiding this comment.
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Missing parts: