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
becf15e5
Commit
becf15e5
authored
Jul 27, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give teams view error messages focus.
parent
dccc36a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
common/static/common/templates/components/paging-footer.underscore
+2
-1
lms/djangoapps/teams/static/teams/js/spec/teams_tab_spec.js
+8
-2
lms/djangoapps/teams/static/teams/js/views/teams_tab.js
+1
-0
lms/djangoapps/teams/static/teams/templates/teams_tab.underscore
+1
-1
No files found.
common/static/common/templates/components/paging-footer.underscore
View file @
becf15e5
...
...
@@ -3,7 +3,8 @@
<div class="nav-item page">
<div class="pagination-form">
<label class="page-number-label" for="page-number-input"><%= gettext("Page number") %></label>
<input id="page-number-input" class="page-number-input" name="page-number" type="text" size="4" autocomplete="off" />
<input id="page-number-input" class="page-number-input" name="page-number" type="text" size="4" autocomplete="off" aria-describedby="page-number-input-helper"/>
<span class="sr field-helper" id="page-number-input-helper"><%= gettext("Enter the page number you'd like to quickly navigate to.") %></span>
</div>
<span class="current-page"><%= current_page %></span>
...
...
lms/djangoapps/teams/static/teams/js/spec/teams_tab_spec.js
View file @
becf15e5
...
...
@@ -16,6 +16,9 @@ define([
},
expectError
=
function
(
text
)
{
expect
(
teamsTabView
.
$
(
'.warning'
).
text
()).
toContain
(
text
);
},
expectFocus
=
function
(
element
)
{
expect
(
element
.
focus
).
toHaveBeenCalled
();
};
beforeEach
(
function
()
{
...
...
@@ -40,6 +43,7 @@ define([
course_id
:
'test/course/id'
}).
render
();
Backbone
.
history
.
start
();
spyOn
(
$
.
fn
,
'focus'
);
});
afterEach
(
function
()
{
...
...
@@ -58,17 +62,19 @@ define([
expectContent
(
'This is the new Teams tab.'
);
});
it
(
'displays an error message when trying to navigate to a nonexistent route'
,
function
()
{
it
(
'displays an
d focuses an
error message when trying to navigate to a nonexistent route'
,
function
()
{
teamsTabView
.
router
.
navigate
(
'test'
,
{
trigger
:
true
});
expectError
(
'The page "test" could not be found.'
);
expectFocus
(
teamsTabView
.
$
(
'.warning'
));
});
it
(
'displays an error message when trying to navigate to a nonexistent topic'
,
function
()
{
it
(
'displays an
d focuses an
error message when trying to navigate to a nonexistent topic'
,
function
()
{
var
requests
=
AjaxHelpers
.
requests
(
this
);
teamsTabView
.
router
.
navigate
(
'topics/test'
,
{
trigger
:
true
});
AjaxHelpers
.
expectRequest
(
requests
,
'GET'
,
'api/topics/test,course_id'
,
null
);
AjaxHelpers
.
respondWithError
(
requests
,
404
);
expectError
(
'The topic "test" could not be found.'
);
expectFocus
(
teamsTabView
.
$
(
'.warning'
));
});
});
});
lms/djangoapps/teams/static/teams/js/views/teams_tab.js
View file @
becf15e5
...
...
@@ -255,6 +255,7 @@
var
warningEl
=
this
.
$
(
'.warning'
);
warningEl
.
find
(
'.copy'
).
html
(
'<p>'
+
message
+
'</p'
);
warningEl
.
toggleClass
(
'is-hidden'
,
false
);
warningEl
.
focus
();
},
hideWarning
:
function
()
{
...
...
lms/djangoapps/teams/static/teams/templates/teams_tab.underscore
View file @
becf15e5
<div class="wrapper-msg is-incontext urgency-low warning is-hidden">
<div class="wrapper-msg is-incontext urgency-low warning is-hidden"
tabindex="-1"
>
<div class="msg">
<div class="msg-content">
<div class="copy">
...
...
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