Update account settings page for enterprise learners - #16703
Conversation
|
@zubair-arbi FYI, https://github.com/edx/edx-platform/pull/16624 is merged 👍 |
2c40ff7 to
2584e45
Compare
7cb1502 to
d835358
Compare
| userPreferencesModel.url = userPreferencesApiUrl; | ||
|
|
||
| if (allowEmailChange) { | ||
| if (syncLearnerProfileData && enterpriseName) { |
There was a problem hiding this comment.
Have you written/updated the Jasmine tests for these changes ?
There was a problem hiding this comment.
I am updating the jaamine tests.
| sync_learner_profile_data = identity_provider.sync_learner_profile_data if identity_provider else False | ||
|
|
||
| context['sync_learner_profile_data'] = sync_learner_profile_data | ||
| context['edx_support_url'] = settings.SUPPORT_SITE_LINK |
There was a problem hiding this comment.
should we get the value first from site configuration here ?
configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK)
| enterprise_customer_name = None | ||
| sync_learner_profile_data = False | ||
| enterprise_learner_data = get_enterprise_learner_data(site=request.site, user=request.user) | ||
| if enterprise_learner_data and 'enterprise_customer' in enterprise_learner_data[0]: |
There was a problem hiding this comment.
Is that possible a Learner is not associated with enterprise customer in fetch results?
why is it necessary to check ---- 'enterprise_customer' in enterprise_learner_data[0] ?
There was a problem hiding this comment.
I am not sure if it is possible for a Learner which is present in enterprise API, to not link with enterprise customer. It seems we are not checking this condition on other places so I am going to remove it.
| valueAttribute: 'email', | ||
| helpMessage: StringUtils.interpolate( | ||
| gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), // eslint-disable-line max-len | ||
| gettext('You receive messages from {platform_name} and course teams at this address.'), // eslint-disable-line max-len |
There was a problem hiding this comment.
Is that message pointing to current or future state ?
There was a problem hiding this comment.
This text is provided by UX team.
| gettext('When you select "Reset Your Password", a message will be sent to the email address for your {platform_name} account. Click the link in the message to reset your password.'), // eslint-disable-line max-len | ||
| {platform_name: platformName} | ||
| ) | ||
| helpMessage: gettext('Check your email account for instructions to reset your password.') // eslint-disable-line max-len |
There was a problem hiding this comment.
just a suggestion, should we point out the user current email id in that message too for better readability?
as an example, in most websites I saw the user email address too e.g. password/username reset etc etc.
There was a problem hiding this comment.
the email address will be visible in its related email field.
There was a problem hiding this comment.
may be we can take suggestion from product owner here? It is just a suggestion.
There was a problem hiding this comment.
This help text will be displayed on account settings pages where a learner can view all field including the email address. Please check sandbox https://business.sandbox.edx.org/account/settings.
| syncLearnerProfileData, | ||
| enterpriseName, | ||
| enterpriseReadonlyAccountFields, | ||
| edxSupportUrl |
There was a problem hiding this comment.
question: can we add trailing , here? so next time that line will not be marked dirty.
There was a problem hiding this comment.
this is not python code.
d835358 to
65fc720
Compare
|
@asadiqbal08 I have added jasmine tests for front end, please have another look at the PR. |
|
@georgebabey please have a look on the changes. You can view the changes on business sandbox https://business.sandbox.edx.org/account/settings (credentials: sappluto@yopmail.com / edx). |
brittneyexline
left a comment
There was a problem hiding this comment.
I've verified this on the sandbox and it behaves as described. I've read through the code and only have one formatting request, but this LGTM!
|
|
||
| if (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1) { | ||
| fullnameFieldView = { | ||
| view: new AccountSettingsFieldViews.ReadonlyFieldView({ |
There was a problem hiding this comment.
seems like there is an opportunity to reduce code duplication here and below by defining the json object outside of the field object initialization, since most of that data is the same.
| Helpers.expectLoadingErrorIsVisible(accountSettingsView, true); | ||
| }); | ||
|
|
||
|
|
| AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData()); | ||
| AjaxHelpers.respondWithJson(requests, Helpers.TIME_ZONE_RESPONSE); | ||
| AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData()); | ||
| AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event |
There was a problem hiding this comment.
Why analytics event required in that test?
There was a problem hiding this comment.
These checks were implemented in existing code so I also move them in new tests.
| expect(sectionsData[0].fields.length).toBe(7); | ||
|
|
||
| // Verify that username, name and email fields are readonly | ||
| textFields = [sectionsData[0].fields[0], sectionsData[0].fields[1], sectionsData[0].fields[2]]; |
There was a problem hiding this comment.
Can we map the field indexes to some readable constants names? e.g. Enums
| helpMessage: '', | ||
| validValue: Helpers.FIELD_OPTIONS[1][0], | ||
| invalidValue1: Helpers.FIELD_OPTIONS[2][0], | ||
| invalidValue2: Helpers.FIELD_OPTIONS[3][0], |
There was a problem hiding this comment.
difficult to understand the values behind [1][0], [2][0] ... etc etc. any other way or comments would be helpful
|
@asadiqbal08 @brittneyexline I have addressed feedback. Please take another look. |
19dfb98 to
2ac544c
Compare
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Friday, December 08, 2017. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
ENT-762
@asadiqbal08 @saleem-latif @douglashall
Update account settings page:
Username,Full Name,Email AddressandPasswordYour profile settings are managed by {ENTERPRISE}. Contact your administrator or {edX Support} for helpto enterprise learners instead of subtitle for TabBasic Account Information.Username,Full Name,Email Address (Sign In)andCountryreadonly for the enterprise learnersRemaining tasks:
Sandbox:
https://business.sandbox.edx.org/account/settings
credentials: sappluto@yopmail.com / edx