Skip to content

Update account settings page for enterprise learners - #16703

Merged
zubair-arbi merged 1 commit into
masterfrom
zub/ENT-762-update-account-settings-page-for-enterprise-sso
Dec 8, 2017
Merged

Update account settings page for enterprise learners#16703
zubair-arbi merged 1 commit into
masterfrom
zub/ENT-762-update-account-settings-page-for-enterprise-sso

Conversation

@zubair-arbi

@zubair-arbi zubair-arbi commented Nov 29, 2017

Copy link
Copy Markdown
Contributor

ENT-762
@asadiqbal08 @saleem-latif @douglashall

Update account settings page:

  • new help text for fields Username, Full Name, Email Address and Password
  • display info message Your profile settings are managed by {ENTERPRISE}. Contact your administrator or {edX Support} for help to enterprise learners instead of subtitle for Tab Basic Account Information.
  • make fields Username, Full Name, Email Address (Sign In) and Country readonly for the enterprise learners
  • Update styling for the new readonly fields

Remaining tasks:

  • Update tests [bokchoy, unittests, frontend]

Sandbox:
https://business.sandbox.edx.org/account/settings
credentials: sappluto@yopmail.com / edx

accountsettings-accountinfo-annotations

@UmanShahzad

Copy link
Copy Markdown
Contributor

@zubair-arbi FYI, https://github.com/edx/edx-platform/pull/16624 is merged 👍

@zubair-arbi
zubair-arbi force-pushed the zub/ENT-762-update-account-settings-page-for-enterprise-sso branch from 2c40ff7 to 2584e45 Compare November 29, 2017 13:06
@zubair-arbi zubair-arbi changed the title WIP: Update account settings page for enterprise learners Update account settings page for enterprise learners Nov 30, 2017
@zubair-arbi
zubair-arbi force-pushed the zub/ENT-762-update-account-settings-page-for-enterprise-sso branch 3 times, most recently from 7cb1502 to d835358 Compare December 5, 2017 07:07
userPreferencesModel.url = userPreferencesApiUrl;

if (allowEmailChange) {
if (syncLearnerProfileData && enterpriseName) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you written/updated the Jasmine tests for these changes ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am updating the jaamine tests.

Comment thread lms/djangoapps/student_account/views.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we get the value first from site configuration here ?
configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK)

Comment thread lms/djangoapps/student_account/views.py Outdated
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]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that message pointing to current or future state ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@asadiqbal08 asadiqbal08 Dec 5, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the email address will be visible in its related email field.

@asadiqbal08 asadiqbal08 Dec 5, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we can take suggestion from product owner here? It is just a suggestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it. Thanks

syncLearnerProfileData,
enterpriseName,
enterpriseReadonlyAccountFields,
edxSupportUrl

@asadiqbal08 asadiqbal08 Dec 5, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: can we add trailing , here? so next time that line will not be marked dirty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not python code.

@zubair-arbi
zubair-arbi force-pushed the zub/ENT-762-update-account-settings-page-for-enterprise-sso branch from d835358 to 65fc720 Compare December 6, 2017 07:27
@zubair-arbi

Copy link
Copy Markdown
Contributor Author

@asadiqbal08 I have added jasmine tests for front end, please have another look at the PR.

@zubair-arbi

Copy link
Copy Markdown
Contributor Author

@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 brittneyexline left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
});


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check quality here

AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData());
AjaxHelpers.respondWithJson(requests, Helpers.TIME_ZONE_RESPONSE);
AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData());
AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why analytics event required in that test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difficult to understand the values behind [1][0], [2][0] ... etc etc. any other way or comments would be helpful

@zubair-arbi

Copy link
Copy Markdown
Contributor Author

@asadiqbal08 @brittneyexline I have addressed feedback. Please take another look.

@zubair-arbi
zubair-arbi force-pushed the zub/ENT-762-update-account-settings-page-for-enterprise-sso branch from 19dfb98 to 2ac544c Compare December 8, 2017 10:41
@zubair-arbi
zubair-arbi merged commit 979c7cd into master Dec 8, 2017
@zubair-arbi
zubair-arbi deleted the zub/ENT-762-update-account-settings-page-for-enterprise-sso branch December 8, 2017 12:56
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

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-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants