Skip to content

Commit 65112de

Browse files
feat: implements SHOW_REGISTRATION_LINKS feature toggle (#566)
(cherry picked from commit 3025ab5) (cherry picked from commit 2ee57b7d59ed53fa928f9b19127038b4cf0b4620) Co-authored-by: Paulo Viadanna <paulo@opencraft.com>
1 parent e100302 commit 65112de

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

lms/static/js/student_account/views/AccessView.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
this.supportURL = options.support_link;
7777
this.passwordResetSupportUrl = options.password_reset_support_link;
7878
this.createAccountOption = options.account_creation_allowed && options.register_links_allowed;
79-
this.showRegisterLinks = options.register_links_allowed
79+
this.showRegisterLinks = options.register_links_allowed;
8080
this.hideAuthWarnings = options.hide_auth_warnings || false;
8181
this.pipelineUserDetails = options.third_party_auth.pipeline_user_details;
8282
this.enterpriseName = options.enterprise_name || '';
@@ -162,7 +162,8 @@
162162
supportURL: this.supportURL,
163163
passwordResetSupportUrl: this.passwordResetSupportUrl,
164164
createAccountOption: this.createAccountOption,
165-
showRegisterLinks: this.showRegisterLinks,hideAuthWarnings: this.hideAuthWarnings,
165+
showRegisterLinks: this.showRegisterLinks,
166+
hideAuthWarnings: this.hideAuthWarnings,
166167
pipelineUserDetails: this.pipelineUserDetails,
167168
enterpriseName: this.enterpriseName,
168169
enterpriseSlugLoginURL: this.enterpriseSlugLoginURL,
@@ -188,8 +189,8 @@
188189
this.subview.passwordHelp = new PasswordResetView({
189190
fields: data.fields,
190191
model: this.resetModel,
191-
showRegisterLinks: this.showRegisterLinks
192-
});
192+
showRegisterLinks: this.showRegisterLinks
193+
});
193194

194195
// Listen for 'password-email-sent' event to toggle sub-views
195196
this.listenTo(this.subview.passwordHelp, 'password-email-sent', this.passwordEmailSent);
@@ -213,8 +214,8 @@
213214
hideAuthWarnings: this.hideAuthWarnings,
214215
is_require_third_party_auth_enabled: this.is_require_third_party_auth_enabled,
215216
enableCoppaCompliance: this.enable_coppa_compliance,
216-
showRegisterLinks: this.showRegisterLinks
217-
});
217+
showRegisterLinks: this.showRegisterLinks
218+
});
218219

219220
// Listen for 'auth-complete' event so we can enroll/redirect the user appropriately.
220221
this.listenTo(this.subview.register, 'auth-complete', this.authComplete);

lms/static/js/student_account/views/FormView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
optionalStr: gettext('(optional)'),
3333
submitButton: '',
3434
isEnterpriseEnable: false,
35+
showRegisterLinks: true,
3536

3637
initialize: function(data) {
3738
this.model = data.model;
38-
this.showRegisterLinks = data.showRegisterLinks;
39+
this.showRegisterLinks = (
40+
typeof data.showRegisterLinks !== 'undefined'
41+
) ? data.showRegisterLinks : this.showRegisterLinks;
42+
3943
this.preRender(data);
4044

4145
this.tpl = $(this.tpl).html();

lms/static/js/student_account/views/LoginView.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
this.supportURL = data.supportURL;
5353
this.passwordResetSupportUrl = data.passwordResetSupportUrl;
5454
this.createAccountOption = data.createAccountOption;
55-
this.showRegisterLinks = data.showRegisterLinks;
55+
this.showRegisterLinks = (
56+
typeof data.showRegisterLinks !== 'undefined'
57+
) ? data.showRegisterLinks : this.showRegisterLinks;
5658
this.accountActivationMessages = data.accountActivationMessages;
5759
this.accountRecoveryMessages = data.accountRecoveryMessages;
5860
this.hideAuthWarnings = data.hideAuthWarnings;

lms/static/js/student_account/views/RegisterView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
optionalStr: fields[i].name === 'marketing_emails_opt_in' ? '' : this.optionalStr,
9090
supplementalText: fields[i].supplementalText || '',
9191
supplementalLink: fields[i].supplementalLink || '',
92-
showRegisterLinks: this.showRegisterLinks})));
92+
showRegisterLinks: this.showRegisterLinks
93+
})));
9394
}
9495
html.push('</div>');
9596
return html;

0 commit comments

Comments
 (0)