@ -179,6 +179,7 @@ $("#userStore").change(
$ ( "select option:selected" ) . each ( function ( ) {
$ ( "select option:selected" ) . each ( function ( ) {
str += $ ( this ) . text ( ) + "" ;
str += $ ( this ) . text ( ) + "" ;
} ) ;
} ) ;
if ( $ ( "#roles" ) . length > 0 ) {
var getRolesAPI = deviceMgtAPIsBasePath + "/roles?user-store=" + str + "&limit=100" ;
var getRolesAPI = deviceMgtAPIsBasePath + "/roles?user-store=" + str + "&limit=100" ;
invokerUtil . get (
invokerUtil . get (
@ -200,6 +201,8 @@ $("#userStore").change(
}
}
) ;
) ;
}
} ) . change ( ) ;
} ) . change ( ) ;
$ ( document ) . ready ( function ( ) {
$ ( document ) . ready ( function ( ) {
@ -224,7 +227,10 @@ $(document).ready(function () {
var firstname = firstnameInput . val ( ) ;
var firstname = firstnameInput . val ( ) ;
var lastname = lastnameInput . val ( ) ;
var lastname = lastnameInput . val ( ) ;
var emailAddress = $ ( "input#emailAddress" ) . val ( ) ;
var emailAddress = $ ( "input#emailAddress" ) . val ( ) ;
var roles = $ ( "select#roles" ) . val ( ) ;
var roles ;
if ( $ ( "#roles" ) . length > 0 ) {
roles = $ ( "select#roles" ) . val ( ) ;
}
var errorMsgWrapper = "#user-create-error-msg" ;
var errorMsgWrapper = "#user-create-error-msg" ;
var errorMsg = "#user-create-error-msg span" ;
var errorMsg = "#user-create-error-msg span" ;
if ( ! username ) {
if ( ! username ) {
@ -272,7 +278,9 @@ $(document).ready(function () {
$ ( "input#firstname" ) . val ( "" ) ;
$ ( "input#firstname" ) . val ( "" ) ;
$ ( "input#lastname" ) . val ( "" ) ;
$ ( "input#lastname" ) . val ( "" ) ;
$ ( "input#email" ) . val ( "" ) ;
$ ( "input#email" ) . val ( "" ) ;
if ( $ ( "#roles" ) . length > 0 ) {
$ ( "select#roles" ) . select2 ( "val" , "" ) ;
$ ( "select#roles" ) . select2 ( "val" , "" ) ;
}
// Refreshing with success message
// Refreshing with success message
$ ( "#user-create-form" ) . addClass ( "hidden" ) ;
$ ( "#user-create-form" ) . addClass ( "hidden" ) ;
$ ( "#user-created-msg" ) . removeClass ( "hidden" ) ;
$ ( "#user-created-msg" ) . removeClass ( "hidden" ) ;