Skip to content

Commit 0249b57

Browse files
prakhar1989bojeil-google
authored andcommitted
replaced shouldDisplayName to requireDisplayName
1 parent 2781d65 commit 0249b57

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

demo/public/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var uiConfig = {
4949
// Terms of service url.
5050
'tosUrl': 'https://www.google.com',
5151
// Whether the display name should be displayed in Sign Up page.
52-
'shouldDisplayName': false
52+
'requireDisplayName': false
5353
};
5454

5555
// Initialize the FirebaseUI Widget using Firebase.

javascript/ui/page/passwordsignup.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ goog.require('firebaseui.auth.ui.page.Base');
3131
/**
3232
* Password sign-up UI component.
3333
* @param {?string} tosUrl The ToS URL.
34-
* @param {boolean} showDisplayName Whether to show the display name.
34+
* @param {boolean} requireDisplayName Whether to show the display name.
3535
* @param {function()} onSubmitClick Callback to invoke when the submit button
3636
* is clicked.
3737
* @param {function()=} opt_onCancelClick Callback to invoke when the cancel
@@ -44,7 +44,7 @@ goog.require('firebaseui.auth.ui.page.Base');
4444
*/
4545
firebaseui.auth.ui.page.PasswordSignUp = function(
4646
tosUrl,
47-
showDisplayName,
47+
requireDisplayName,
4848
onSubmitClick,
4949
opt_onCancelClick,
5050
opt_email,
@@ -56,7 +56,7 @@ firebaseui.auth.ui.page.PasswordSignUp = function(
5656
firebaseui.auth.soy2.page.passwordSignUp,
5757
{
5858
email: opt_email,
59-
showDisplayName: showDisplayName,
59+
requireDisplayName: requireDisplayName,
6060
name: opt_name,
6161
tosUrl: tosUrl,
6262
allowCancel: !!opt_onCancelClick
@@ -65,7 +65,7 @@ firebaseui.auth.ui.page.PasswordSignUp = function(
6565
'passwordSignUp');
6666
this.onSubmitClick_ = onSubmitClick;
6767
this.onCancelClick_ = opt_onCancelClick;
68-
this.showDisplayName_ = showDisplayName;
68+
this.requireDisplayName_ = requireDisplayName;
6969
};
7070
goog.inherits(firebaseui.auth.ui.page.PasswordSignUp,
7171
firebaseui.auth.ui.page.Base);
@@ -74,7 +74,7 @@ goog.inherits(firebaseui.auth.ui.page.PasswordSignUp,
7474
/** @override */
7575
firebaseui.auth.ui.page.PasswordSignUp.prototype.enterDocument = function() {
7676
this.initEmailElement();
77-
if (this.showDisplayName_) {
77+
if (this.requireDisplayName_) {
7878
this.initNameElement();
7979
}
8080
this.initNewPasswordElement();
@@ -98,7 +98,7 @@ firebaseui.auth.ui.page.PasswordSignUp.prototype.disposeInternal = function() {
9898
*/
9999
firebaseui.auth.ui.page.PasswordSignUp.prototype.setupFocus_ = function() {
100100
// Focus order.
101-
if (this.showDisplayName_) {
101+
if (this.requireDisplayName_) {
102102
this.focusToNextOnEnter(this.getEmailElement(), this.getNameElement());
103103
this.focusToNextOnEnter(this.getNameElement(), this.getNewPasswordElement());
104104
} else {
@@ -115,7 +115,7 @@ firebaseui.auth.ui.page.PasswordSignUp.prototype.setupFocus_ = function() {
115115
// Auto focus.
116116
if (!firebaseui.auth.ui.element.getInputValue(this.getEmailElement())) {
117117
this.getEmailElement().focus();
118-
} else if (this.showDisplayName_ &&
118+
} else if (this.requireDisplayName_ &&
119119
!firebaseui.auth.ui.element.getInputValue(this.getNameElement())) {
120120
this.getNameElement().focus();
121121
} else {

javascript/ui/page/passwordsignup_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ var infoBarTestHelper =
4949
new firebaseui.auth.ui.element.InfoBarTestHelper().registerTests();
5050

5151

52-
function createComponent(tosUrl, shouldDisplayName, opt_name) {
52+
function createComponent(tosUrl, requireDisplayName, opt_name) {
5353
var component = new firebaseui.auth.ui.page.PasswordSignUp(
5454
tosUrl,
55-
shouldDisplayName,
55+
requireDisplayName,
5656
goog.bind(
5757
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
5858
formTestHelper),

javascript/widgets/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ firebaseui.auth.widget.Config = function() {
7272
* Determines whether the user is asked for entering display name
7373
* while going through the email/password signup flow.
7474
*/
75-
this.config_.define('shouldDisplayName', true);
75+
this.config_.define('requireDisplayName', true);
7676
};
7777

7878

@@ -296,8 +296,8 @@ firebaseui.auth.widget.Config.prototype.getTosUrl = function() {
296296

297297

298298
/** @return {boolean} Whether the display name should be displayed. */
299-
firebaseui.auth.widget.Config.prototype.getShouldDisplayName = function() {
300-
return /** @type {boolean} */ (this.config_.get('shouldDisplayName'));
299+
firebaseui.auth.widget.Config.prototype.getRequireDisplayName = function() {
300+
return /** @type {boolean} */ (this.config_.get('requireDisplayName'));
301301
};
302302

303303

javascript/widgets/config_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ function testGetTosUrl() {
243243

244244

245245
function testShouldDisplayName() {
246-
assertTrue(config.getShouldDisplayName());
247-
config.update('shouldDisplayName', false);
248-
assertFalse(config.getShouldDisplayName());
246+
assertTrue(config.getRequireDisplayName());
247+
config.update('requireDisplayName', false);
248+
assertFalse(config.getRequireDisplayName());
249249
}
250250

251251

javascript/widgets/handler/passwordsignup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ firebaseui.auth.widget.handler.handlePasswordSignUp = function(
4848
// Render the UI.
4949
var component = new firebaseui.auth.ui.page.PasswordSignUp(
5050
app.getConfig().getTosUrl(),
51-
app.getConfig().getShouldDisplayName(),
51+
app.getConfig().getRequireDisplayName(),
5252
// On submit.
5353
function() {
5454
firebaseui.auth.widget.handler.onSignUpSubmit_(app, component);
@@ -70,13 +70,13 @@ firebaseui.auth.widget.handler.handlePasswordSignUp = function(
7070
* @private
7171
*/
7272
firebaseui.auth.widget.handler.onSignUpSubmit_ = function(app, component) {
73-
var shouldDisplayName = app.getConfig().getShouldDisplayName();
73+
var requireDisplayName = app.getConfig().getRequireDisplayName();
7474

7575
// Check fields are valid.
7676
var email = component.checkAndGetEmail();
7777

7878
var name = null;
79-
if (shouldDisplayName) {
79+
if (requireDisplayName) {
8080
name = component.checkAndGetName();
8181
}
8282

@@ -85,7 +85,7 @@ firebaseui.auth.widget.handler.onSignUpSubmit_ = function(app, component) {
8585
component.getEmailElement().focus();
8686
return;
8787
}
88-
if (shouldDisplayName && !name) {
88+
if (requireDisplayName && !name) {
8989
component.getNameElement().focus();
9090
return;
9191
}

soy/pages.soy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
*/
7777
{template .passwordSignUp}
7878
{@param? email: string} /** The email address to prefill. */
79-
{@param? showDisplayName: bool} /** Whether to show the display name. */
79+
{@param? requireDisplayName: bool} /** Whether to show the display name. */
8080
{@param? name: string} /** The name to prefill. */
8181
{@param? tosUrl: string} /** The Terms of Service URL. */
8282
{@param? allowCancel: bool} /** Whether to show the cancel link. */
@@ -90,7 +90,7 @@
9090
</div>
9191
<div class="{css firebaseui-card-content}">
9292
{call firebaseui.auth.soy2.element.email data="all" /}
93-
{if $showDisplayName}
93+
{if $requireDisplayName}
9494
{call firebaseui.auth.soy2.element.name data="all" /}
9595
{/if}
9696
{call firebaseui.auth.soy2.element.newPassword}

0 commit comments

Comments
 (0)