feat: implements SHOW_REGISTRATION_LINKS feature toggle

(cherry picked from commit 3025ab5fe6f6f53d6af5b36681355efafa37c74b)
This commit is contained in:
Paulo Viadanna
2023-03-30 11:12:35 -03:00
committed by Navin Karkera
parent 59299ddb61
commit 26d8c2166d
12 changed files with 38 additions and 9 deletions

View File

@@ -76,7 +76,8 @@
this.platformName = options.platform_name;
this.supportURL = options.support_link;
this.passwordResetSupportUrl = options.password_reset_support_link;
this.createAccountOption = options.account_creation_allowed;
this.createAccountOption = options.account_creation_allowed && options.register_links_allowed;
this.showRegisterLinks = options.register_links_allowed;
this.hideAuthWarnings = options.hide_auth_warnings || false;
this.pipelineUserDetails = options.third_party_auth.pipeline_user_details;
this.enterpriseName = options.enterprise_name || '';
@@ -162,6 +163,7 @@
supportURL: this.supportURL,
passwordResetSupportUrl: this.passwordResetSupportUrl,
createAccountOption: this.createAccountOption,
showRegisterLinks: this.showRegisterLinks,
hideAuthWarnings: this.hideAuthWarnings,
pipelineUserDetails: this.pipelineUserDetails,
enterpriseName: this.enterpriseName,
@@ -187,7 +189,8 @@
this.subview.passwordHelp = new PasswordResetView({
fields: data.fields,
model: this.resetModel
model: this.resetModel,
showRegisterLinks: this.showRegisterLinks
});
// Listen for 'password-email-sent' event to toggle sub-views
@@ -212,6 +215,7 @@
hideAuthWarnings: this.hideAuthWarnings,
is_require_third_party_auth_enabled: this.is_require_third_party_auth_enabled,
enableCoppaCompliance: this.enable_coppa_compliance,
showRegisterLinks: this.showRegisterLinks
});
// Listen for 'auth-complete' event so we can enroll/redirect the user appropriately.

View File

@@ -33,9 +33,14 @@
optionalStr: gettext('(optional)'),
submitButton: '',
isEnterpriseEnable: false,
showRegisterLinks: true,
initialize: function(data) {
this.model = data.model;
this.showRegisterLinks = (
typeof data.showRegisterLinks !== 'undefined'
) ? data.showRegisterLinks : this.showRegisterLinks;
this.preRender(data);
this.tpl = $(this.tpl).html();
@@ -98,6 +103,7 @@
supplementalText: data[i].supplementalText || '',
supplementalLink: data[i].supplementalLink || '',
loginIssueSupportLink: data[i].loginIssueSupportLink || '',
showRegisterLinks: this.showRegisterLinks,
isEnterpriseEnable: this.isEnterpriseEnable
})));
}

View File

@@ -53,6 +53,9 @@
this.supportURL = data.supportURL;
this.passwordResetSupportUrl = data.passwordResetSupportUrl;
this.createAccountOption = data.createAccountOption;
this.showRegisterLinks = (
typeof data.showRegisterLinks !== 'undefined'
) ? data.showRegisterLinks : this.showRegisterLinks;
this.accountActivationMessages = data.accountActivationMessages;
this.accountRecoveryMessages = data.accountRecoveryMessages;
this.hideAuthWarnings = data.hideAuthWarnings;

View File

@@ -87,7 +87,8 @@
requiredStr: this.requiredStr,
optionalStr: fields[i].name === 'marketing_emails_opt_in' ? '' : this.optionalStr,
supplementalText: fields[i].supplementalText || '',
supplementalLink: fields[i].supplementalLink || ''
supplementalLink: fields[i].supplementalLink || '',
showRegisterLinks: this.showRegisterLinks
})));
}
html.push('</div>');