Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
635e5491
Commit
635e5491
authored
9 years ago
by
Matt Drayer
Browse files
Options
Downloads
Plain Diff
Merge pull request #9968 from edx/asadiqbal08/SOL-1225
SOL-1225: Pressing tab button does not takes user to next field
parents
772b0bff
b09c20f0
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/static/js/certificates/views/signatory_editor.js
+32
-3
32 additions, 3 deletions
cms/static/js/certificates/views/signatory_editor.js
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
+7
-1
7 additions, 1 deletion
...eptance/tests/studio/test_studio_settings_certificates.py
with
39 additions
and
4 deletions
cms/static/js/certificates/views/signatory_editor.js
+
32
−
3
View file @
635e5491
...
...
@@ -85,8 +85,10 @@ function ($, _, Backbone, gettext,
if
(
event
&&
event
.
preventDefault
)
{
event
.
preventDefault
();
}
this
.
model
.
set
(
'
name
'
,
this
.
$
(
'
.signatory-name-input
'
).
val
()
this
.
$
(
'
.signatory-name-input
'
).
val
(),
{
silent
:
true
}
);
this
.
toggleValidationErrorMessage
(
'
name
'
);
this
.
eventAgg
.
trigger
(
"
onSignatoryUpdated
"
,
this
.
model
);
},
...
...
@@ -95,8 +97,10 @@ function ($, _, Backbone, gettext,
if
(
event
&&
event
.
preventDefault
)
{
event
.
preventDefault
();
}
this
.
model
.
set
(
'
title
'
,
this
.
$
(
'
.signatory-title-input
'
).
val
()
this
.
$
(
'
.signatory-title-input
'
).
val
(),
{
silent
:
true
}
);
this
.
toggleValidationErrorMessage
(
'
title
'
);
this
.
eventAgg
.
trigger
(
"
onSignatoryUpdated
"
,
this
.
model
);
},
...
...
@@ -105,7 +109,8 @@ function ($, _, Backbone, gettext,
if
(
event
&&
event
.
preventDefault
)
{
event
.
preventDefault
();
}
this
.
model
.
set
(
'
organization
'
,
this
.
$
(
'
.signatory-organization-input
'
).
val
()
this
.
$
(
'
.signatory-organization-input
'
).
val
(),
{
silent
:
true
}
);
this
.
eventAgg
.
trigger
(
"
onSignatoryUpdated
"
,
this
.
model
);
},
...
...
@@ -178,7 +183,31 @@ function ($, _, Backbone, gettext,
}
});
modal
.
show
();
},
/**
* @desc Toggle the validation error messages. If given model attribute is not valid then show the error message
* else remove it.
* @param string modelAttribute - the attribute of the signatory model e.g. name, title.
*/
toggleValidationErrorMessage
:
function
(
modelAttribute
)
{
var
selector
=
"
div.add-signatory-
"
+
modelAttribute
;
if
(
!
this
.
model
.
isValid
()
&&
_
.
has
(
this
.
model
.
validationError
,
modelAttribute
))
{
// Show the error message if it is not exist before.
if
(
!
$
(
selector
).
hasClass
(
'
error
'
))
{
var
errorMessage
=
this
.
model
.
validationError
[
modelAttribute
];
$
(
selector
).
addClass
(
"
error
"
);
$
(
selector
).
append
(
"
<span class='message-error'>
"
+
errorMessage
+
"
</span>
"
);
}
}
else
{
// Remove the error message.
$
(
selector
).
removeClass
(
"
error
"
);
$
(
selector
+
"
>span.message-error
"
).
remove
();
}
}
});
return
SignatoryEditorView
;
});
This diff is collapsed.
Click to expand it.
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
+
7
−
1
View file @
635e5491
...
...
@@ -208,7 +208,13 @@ class CertificatesTest(StudioCourseTest):
certificate
=
self
.
create_and_verify_certificate
(
"
Course Title Override
"
,
0
,
[
self
.
make_signatory_data
(
'
Signatory title with new line character
\n
'
)]
[
{
'
name
'
:
'
Signatory Name
'
,
'
title
'
:
'
Signatory title with new line character
\n
'
,
'
organization
'
:
'
Signatory Organization
'
,
}
]
)
certificate
.
wait_for_certificate_delete_button
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment