From 31cde6b22445e2b24445262dfaa043f7293c914c Mon Sep 17 00:00:00 2001 From: Paulo Viadanna Date: Thu, 30 Mar 2023 11:12:35 -0300 Subject: [PATCH] feat: implements SHOW_REGISTRATION_LINKS feature toggle (cherry picked from commit 3025ab5fe6f6f53d6af5b36681355efafa37c74b) (cherry picked from commit 2ee57b7d59ed53fa928f9b19127038b4cf0b4620) --- lms/static/js/student_account/views/FormView.js | 6 +++++- lms/static/js/student_account/views/LoginView.js | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js index ce5cf0f0c7d9..9aca2548476b 100644 --- a/lms/static/js/student_account/views/FormView.js +++ b/lms/static/js/student_account/views/FormView.js @@ -32,10 +32,14 @@ optionalStr: gettext('(optional)'), submitButton: '', isEnterpriseEnable: false, + showRegisterLinks: true, initialize: function(data) { this.model = data.model; - this.showRegisterLinks = data.showRegisterLinks; + this.showRegisterLinks = ( + typeof data.showRegisterLinks !== 'undefined' + ) ? data.showRegisterLinks : this.showRegisterLinks; + this.preRender(data); this.tpl = $(this.tpl).html(); diff --git a/lms/static/js/student_account/views/LoginView.js b/lms/static/js/student_account/views/LoginView.js index 56fd33ef0004..a46f1f276849 100644 --- a/lms/static/js/student_account/views/LoginView.js +++ b/lms/static/js/student_account/views/LoginView.js @@ -52,7 +52,9 @@ this.supportURL = data.supportURL; this.passwordResetSupportUrl = data.passwordResetSupportUrl; this.createAccountOption = data.createAccountOption; - this.showRegisterLinks = data.showRegisterLinks; + this.showRegisterLinks = ( + typeof data.showRegisterLinks !== 'undefined' + ) ? data.showRegisterLinks : this.showRegisterLinks; this.accountActivationMessages = data.accountActivationMessages; this.accountRecoveryMessages = data.accountRecoveryMessages; this.hideAuthWarnings = data.hideAuthWarnings;