Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 84252c6

Browse files
author
Nick Litwin
committed
Add correct form error messages
1 parent 1d8b854 commit 84252c6

File tree

9 files changed

+44
-39
lines changed

9 files changed

+44
-39
lines changed

app/account/register/register.jade

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
input(right-placeholder, focused-placeholder="Last", ng-model="vm.lastname", maxlength="64", name="lastname", placeholder="Last Name", type="text", required)
1515

16-
//- Show errors for first and last names once we know whether we can handle accents, other languages, and not symbols/numbers
17-
//- .form-errors
18-
//- p.form-error(ng-show="vm.registerForm.firstname.$dirty && vm.registerForm.firstname.$error.pattern") Names must not contain symbols or numbers.
19-
2016
.country-dropdown
2117
angucomplete-alt(
2218
input-name="country",
@@ -32,7 +28,7 @@
3228
)
3329

3430
.form-errors
35-
p.form-error(ng-show="vm.registerForm.country.$error.required") Please enter a valid country.
31+
p.form-error(ng-show="vm.registerForm.country.$error.required") Please choose a country from the list.
3632

3733
.validation-bar(ng-class="{ 'error-bar': (vm.registerForm.username.$error.usernameIsFree || vm.registerForm.username.$error.minlength || vm.registerForm.username.$error.maxlength), 'success-bar': (vm.registerForm.username.$valid && !vm.registerForm.username.$error.usernameIsFree) }")
3834
input(right-placeholder, focused-placeholder="Username", ng-model="vm.username", ng-model-options="{ debounce: {'default': 500} }", ng-focus="vm.usernameTips = true", ng-blur="vm.usernameTips = false", ng-minlength="2", ng-maxlength="15", name="username", placeholder="Username", type="text", username-is-free, required)
@@ -76,14 +72,12 @@
7672

7773
p(ng-class="{ 'has-letter': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasLetter) }") At least one letter
7874

79-
p(ng-class="{ 'has-symbol': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasSymbol) }") At least one symbol
80-
81-
p(ng-class="{ 'has-number': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasNumber) }") At least one number
75+
p(ng-class="{ 'has-number': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasNumber && !vm.registerForm.password.$error.hasSymbol) }") At least one number or symbol
8276

83-
button(type="submit", ng-disabled="vm.registerForm.$invalid", ng-class="{'enabled-button': vm.registerForm.$valid}") Join Now
77+
button(type="submit", ng-disabled="vm.registerForm.$invalid", ng-class="{'enabled-button': vm.registerForm.$valid}") Join
8478

8579
section.terms
86-
p By clicking "JOIN NOW" I agree to Topcoder's
80+
p By clicking "JOIN" I agree to Topcoder's
8781

8882
p #[a(href="http://www.topcoder.com/community/how-it-works/terms/", target="_blank") Terms of Service] and #[a(href="http://www.topcoder.com/community/how-it-works/privacy-policy/", target="_blank") Privacy Policy]
8983

app/index.jade

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ html
9090
script(src='../bower_components/angular-filter/dist/angular-filter.min.js')
9191
script(src='../bower_components/angular-img-fallback/angular.dcb-img-fallback.js')
9292
script(src='../bower_components/angular-jwt/dist/angular-jwt.js')
93-
script(src='../bower_components/angular-mocks/angular-mocks.js')
9493
script(src='../bower_components/angular-sanitize/angular-sanitize.js')
9594
script(src='../bower_components/angular-ui-router/release/angular-ui-router.js')
9695
script(src='../bower_components/x2js/xml2json.min.js')

app/settings/account-info/account-info.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
.address-fields
2121
label *First name (Given name)
22-
input(name="firstname", type="text", value="{{vm.userData.firstName}}", ng-model="vm.userData.firstName")
22+
input(name="firstname", type="text", value="{{vm.userData.firstName}}", ng-model="vm.userData.firstName", maxlength="64", required)
2323

2424
label *Last name (Surname)
25-
input(name="lastname", type="text", value="{{vm.userData.lastName}}", ng-model="vm.userData.lastName")
25+
input(name="lastname", type="text", value="{{vm.userData.lastName}}", ng-model="vm.userData.lastName", maxlength="64", required)
2626

2727
label Address
2828
input(name="address", type="text", value="{{vm.homeAddress.streetAddr1}}", ng-model="vm.homeAddress.streetAddr1")
@@ -52,8 +52,8 @@
5252
minlength="1"
5353
)
5454

55-
.form-errors
56-
p.form-error(ng-show="vm.updateAccountInfo.country.$error.required") Please enter a valid country.
55+
.account-info-error
56+
p.form-error(ng-show="vm.updateAccountInfo.country.$error.required") Please choose a country from the list.
5757

5858

5959
button(type="submit", ng-disabled="vm.updateAccountInfo.$invalid", ng-class="{'enabled-button': vm.updateAccountInfo.$valid}") Save

app/settings/edit-profile/edit-profile.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
)
3434

3535
.form-errors
36-
p.form-error(ng-show="vm.editProfile.location.$error.required") Please enter a valid country.
36+
p.form-error(ng-show="vm.editProfile.location.$error.required") Please choose a country from the list.
3737

3838
.field-section.description
3939
h4.field-title About Me

app/settings/update-password/update-password.jade

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
.reset-password
55
form(name="vm.newPasswordForm", role="form", ng-submit="vm.newPasswordForm.$valid && vm.submitNewPassword()", novalidate)
6-
.validation-bar(ng-class="{ 'error-bar': (vm.newPasswordForm.currentPassword.$dirty && vm.newPasswordForm.currentPassword.$invalid), 'success-bar': (vm.newPasswordForm.currentPassword.$valid) }")
7-
input(right-placeholder, focused-placeholder="Current", name="currentPassword", type="password", placeholder="Enter Current Password")
6+
input(right-placeholder, focused-placeholder="Current", name="currentPassword", type="password", placeholder="Enter Current Password")
87

98
.form-errors
10-
p.form-error(ng-show="vm.newPasswordForm.currentPassword.$error.wrongPassword") The password entered was incorrect.
9+
p.form-error(ng-show="vm.newPasswordForm.currentPassword.$error.wrongPassword") Your current password is incorrect. Please check that you entered the right one.
1110

1211
.validation-bar(ng-class="{ 'success-bar': (vm.newPasswordForm.password.$valid) }")
1312
toggle-password

app/topcoder.constants.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
angular.module("CONSTANTS", [])
22

33
.constant("CONSTANTS", {
4-
"API_URL": "https://api.topcoder-qa.com/v3",
5-
"API_URL_V2": "https://api.topcoder-qa.com/v2",
4+
"API_URL": "https://api.topcoder-dev.com/v3",
5+
"API_URL_V2": "https://api.topcoder-dev.com/v2",
66
"ASSET_PREFIX": "",
7-
"auth0Callback": "https://api.topcoder-qa.com/pub/callback.html",
8-
"auth0Domain": "topcoder-qa.auth0.com",
9-
"BLOG_LOCATION": "https://www.topcoder-qa.com/feed/?post_type=blog",
10-
"clientId": "EVOgWZlCtIFlbehkq02treuRRoJk12UR",
11-
"COMMUNITY_URL": "//community.topcoder-qa.com",
12-
"domain": "topcoder-qa.com",
13-
"ENVIRONMENT": "qa",
14-
"FORUMS_APP_URL": "forums.topcoder-qa.com",
15-
"HELP_APP_URL": "help.topcoder-qa.com",
16-
"MAIN_URL": "https://www.topcoder-qa.com",
7+
"auth0Callback": "https://api.topcoder-dev.com/pub/callback.html",
8+
"auth0Domain": "topcoder-dev.auth0.com",
9+
"BLOG_LOCATION": "https://www.topcoder-dev.com/feed/?post_type=blog",
10+
"clientId": "JFDo7HMkf0q2CkVFHojy3zHWafziprhT",
11+
"COMMUNITY_URL": "//community.topcoder-dev.com",
12+
"domain": "topcoder-dev.com",
13+
"ENVIRONMENT": "development",
14+
"FORUMS_APP_URL": "forums.topcoder-dev.com",
15+
"HELP_APP_URL": "help.topcoder-dev.com",
16+
"MAIN_URL": "https://www.topcoder-dev.com",
1717
"NEW_CHALLENGES_URL": "https://www.topcoder.com/challenges/develop/upcoming/",
1818
"NEW_RELIC_APPLICATION_ID": "",
19-
"PHOTO_LINK_LOCATION": "https://community.topcoder-qa.com",
19+
"PHOTO_LINK_LOCATION": "https://community.topcoder-dev.com",
2020
"submissionDownloadPath": "/review/actions/DownloadContestSubmission?uid=",
2121
"SWIFT_PROGRAM_ID": 3445,
22-
"SWIFT_PROGRAM_URL": "apple.topcoder-qa.com",
22+
"SWIFT_PROGRAM_URL": "apple.topcoder-dev.com",
2323
"UPCOMING_SRMS_URL": "https://www.topcoder.com/challenges/data/upcoming/",
2424
"EVENT_USER_LOGGED_IN": "user_logged_in",
2525
"EVENT_USER_LOGGED_OUT": "user_logged_out",

assets/css/settings/account-info.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
label {
1818
display: block;
19+
position: relative;
1920
margin-bottom: 15px;
2021
}
2122

@@ -24,8 +25,10 @@
2425
margin-top: 7px;
2526
}
2627

27-
.form-errors {
28-
margin-top: 8px;
28+
.account-info-error {
29+
position: absolute;
30+
top: 65px;
31+
left: 3px;
2932
}
3033

3134
button.enabled-button {

assets/css/settings/edit-profile.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,14 @@
118118
@include ui-enabled-button;
119119
}
120120
}
121+
122+
.field-section {
123+
position: relative;
124+
}
125+
126+
.form-errors {
127+
position: absolute;
128+
top: 70px;
129+
left: 3px;
130+
}
121131
}

assets/css/settings/update-password.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
margin-bottom: 10px;
1010
}
1111

12-
p {
13-
margin: 5px 0 12px 5px;
14-
}
15-
1612
button {
1713
width: 200px;
1814
text-transform: none;
@@ -24,4 +20,8 @@
2420
}
2521
}
2622
}
23+
24+
.form-error {
25+
margin: 0 0 20px 3px;
26+
}
2727
}

0 commit comments

Comments
 (0)