Fixing user create page QR-generation issues

revert-70aa11f8
dilanua 8 years ago
parent 73b4abc46b
commit 0836b2c99e

@ -113,15 +113,17 @@
<div id="user-created-msg" class="container col-centered wr-content hidden"> <div id="user-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form"> <div class="wr-form">
<p class="page-sub-title">User was added successfully.</p> <p class="page-sub-title">User was added successfully.</p>
<br> <p>
An invitation mail will be sent to this user to initiate device enrollment. An invitation mail will be sent to this user to initiate device enrollment.
Below QR code can also be used to enroll a device. Below QR code can also be used to enroll a device.
</p>
<div class="panel panel-default"> <div class="panel panel-default">
<div id="qr-code-modal" class="hidden" data-enrollment-url="{{enrollmentURL}}"></div>
<div class="panel-body"> <div class="panel-body">
<div class="qr-code col-lg-5 col-md-6 col-centered"></div> <div class="qr-code col-lg-5 col-md-6 col-centered"></div>
</div> </div>
</div> </div>
<br>Please click <b>"Add Another User"</b>, if you wish to add another user or click <br>Please click <b>"Add Another User"</b>, if you wish to add another user or click
<b>"View User List"</b> to complete the process and go back to the user list. <b>"View User List"</b> to complete the process and go back to the user list.
<hr/> <hr/>

@ -39,6 +39,7 @@ function onRequest() {
page["firstnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"]; page["firstnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"];
page["lastnameJSRegEx"] = devicemgtProps["userValidationConfig"]["lastnameJSRegEx"]; page["lastnameJSRegEx"] = devicemgtProps["userValidationConfig"]["lastnameJSRegEx"];
page["lastnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"]; page["lastnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"];
page["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["enrollmentDir"];
return page; return page;
} }

@ -86,7 +86,7 @@ validateInline["user-name"] = function () {
validateInline["first-name"] = function () { validateInline["first-name"] = function () {
var firstnameInput = $("input#firstname"); var firstnameInput = $("input#firstname");
if (firstnameInput.val()) { if (firstnameInput.val()) {
disableInlineError("firstNameField", "fnError"); disableInlineError("firstNameField", "fnError");
} else { } else {
enableInlineError("firstNameField", "fnError"); enableInlineError("firstNameField", "fnError");
} }
@ -161,6 +161,18 @@ function emailIsValid(email) {
return regExp.test(email); return regExp.test(email);
} }
/*
* QR-code generation function.
*/
function generateQRCode(qrCodeClass) {
var enrollmentURL = $("#qr-code-modal").data("enrollment-url");
$(qrCodeClass).qrcode({
text: enrollmentURL,
width: 200,
height: 200
});
}
$("#userStore").change( $("#userStore").change(
function () { function () {
var str = ""; var str = "";

Loading…
Cancel
Save