Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9ac08ac5
Commit
9ac08ac5
authored
Apr 14, 2015
by
muzaffaryousaf
Committed by
Andy Armstrong
Apr 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving the country field to the required section of account setting page.
TNL-1856
parent
bc05cd0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
18 deletions
+23
-18
common/test/acceptance/tests/lms/test_account_settings.py
+3
-3
lms/static/js/spec/student_account/account_settings_factory_spec.js
+10
-6
lms/static/js/student_account/views/account_settings_factory.js
+10
-9
No files found.
common/test/acceptance/tests/lms/test_account_settings.py
View file @
9ac08ac5
...
...
@@ -101,6 +101,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
'Email Address'
,
'Password'
,
'Language'
,
'Country or Region'
]
},
{
...
...
@@ -109,7 +110,6 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
'Education Completed'
,
'Gender'
,
'Year of Birth'
,
'Country or Region'
,
'Preferred Language'
,
]
},
...
...
@@ -286,8 +286,8 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
self
.
_test_dropdown_field
(
u'country'
,
u'Country or Region'
,
u''
,
[
u'Pakistan'
,
u''
],
u'
Afghanistan
'
,
[
u'Pakistan'
,
u'
Palau
'
],
)
def
test_preferred_language_field
(
self
):
...
...
lms/static/js/spec/student_account/account_settings_factory_spec.js
View file @
9ac08ac5
...
...
@@ -148,7 +148,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
var
sectionsData
=
accountSettingsView
.
options
.
sectionsData
;
expect
(
sectionsData
[
0
].
fields
.
length
).
toBe
(
5
);
expect
(
sectionsData
[
0
].
fields
.
length
).
toBe
(
6
);
var
textFields
=
[
sectionsData
[
0
].
fields
[
1
],
sectionsData
[
0
].
fields
[
2
]];
for
(
var
i
=
0
;
i
<
textFields
.
length
;
i
++
)
{
...
...
@@ -165,10 +165,14 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
},
requests
);
}
expect
(
sectionsData
[
1
].
fields
.
length
).
toBe
(
5
);
for
(
var
i
=
0
;
i
<
4
;
i
++
)
{
var
view
=
sectionsData
[
1
].
fields
[
i
].
view
;
expect
(
sectionsData
[
1
].
fields
.
length
).
toBe
(
4
);
var
dropdownFields
=
[
sectionsData
[
1
].
fields
[
0
],
sectionsData
[
1
].
fields
[
1
],
sectionsData
[
1
].
fields
[
2
]
];
_
.
each
(
dropdownFields
,
function
(
field
)
{
var
view
=
field
.
view
;
FieldViewsSpecHelpers
.
verifyDropDownField
(
view
,
{
title
:
view
.
options
.
title
,
valueAttribute
:
view
.
options
.
valueAttribute
,
...
...
@@ -178,7 +182,7 @@ define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'j
invalidValue2
:
Helpers
.
FIELD_OPTIONS
[
3
][
0
],
validationError
:
"Nope, this will not do!"
},
requests
);
}
}
);
var
section2Fields
=
sectionsData
[
2
].
fields
;
expect
(
section2Fields
.
length
).
toBe
(
2
);
...
...
lms/static/js/student_account/views/account_settings_factory.js
View file @
9ac08ac5
...
...
@@ -81,6 +81,15 @@
),
options
:
fieldsData
.
language
.
options
})
},
{
view
:
new
FieldViews
.
DropdownFieldView
({
model
:
userAccountModel
,
required
:
true
,
title
:
gettext
(
'Country or Region'
),
valueAttribute
:
'country'
,
options
:
fieldsData
[
'country'
][
'options'
]
})
}
]
},
...
...
@@ -108,15 +117,7 @@
model
:
userAccountModel
,
title
:
gettext
(
'Year of Birth'
),
valueAttribute
:
'year_of_birth'
,
options
:
fieldsData
.
year_of_birth
.
options
})
},
{
view
:
new
FieldViews
.
DropdownFieldView
({
model
:
userAccountModel
,
title
:
gettext
(
'Country or Region'
),
valueAttribute
:
'country'
,
options
:
fieldsData
.
country
.
options
options
:
fieldsData
[
'year_of_birth'
][
'options'
]
})
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment