Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
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
savoirfairelinux
jami-jams
Commits
e820cf72
Commit
e820cf72
authored
4 years ago
by
William Enright
Browse files
Options
Downloads
Patches
Plain Diff
fixed UI buttons reserved for local configs appearing in user profile
Change-Id: I8094f1ce43392219179c1c2c8ed93b1523329084
parent
c4b9a98f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
jams-server/src/main/resources/webapp/js/search.js
+7
-8
7 additions, 8 deletions
jams-server/src/main/resources/webapp/js/search.js
jams-server/src/main/resources/webapp/js/user.js
+57
-40
57 additions, 40 deletions
jams-server/src/main/resources/webapp/js/user.js
with
64 additions
and
48 deletions
jams-server/src/main/resources/webapp/js/search.js
+
7
−
8
View file @
e820cf72
...
...
@@ -409,23 +409,22 @@ function revokeUser(data, statusCode, jqXHR) {
}
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
{
"
queryString
"
:
"
*
"
},
null
,
listAllUsers
);
ajaxApiCall
(
api_path_post_create_user_profile
,
'
GET
'
,
{
"
username
"
:
"
*
"
},
null
,
listAllUsers
);
userRevoke
=
''
;
}
function
handleUserAutofill
(
data
,
statusCode
,
jqXHR
)
{
if
(
jqXHR
.
status
==
200
)
{
var
resultSet
=
data
[
0
];
if
(
resultSet
.
jpegPhoto
)
b64
=
resultSet
.
jpegPhoto
;
if
(
resultSet
.
profilePicture
)
b64
=
resultSet
.
profilePicture
;
$
(
'
#input-givenName-update
'
).
val
(
resultSet
.
firstName
);
$
(
'
#input-sn-update
'
).
val
(
resultSet
.
lastName
);
$
(
'
#input-mail-update
'
).
val
(
resultSet
.
mail
);
$
(
'
#input-o-update
'
).
val
(
resultSet
.
org
);
$
(
'
#input-mail-update
'
).
val
(
resultSet
.
e
mail
);
$
(
'
#input-o-update
'
).
val
(
resultSet
.
org
anization
);
$
(
'
#input-facsimileTelephoneNumber-update
'
).
val
(
resultSet
.
faxNumber
);
$
(
'
#input-telephoneNumber-update
'
).
val
(
resultSet
.
tele
phoneNumber
);
$
(
'
#input-extension-update
'
).
val
(
resultSet
.
e
xtension
);
$
(
'
#input-mobile-update
'
).
val
(
resultSet
.
mobile
Phone
Number
);
$
(
'
#input-telephoneNumber-update
'
).
val
(
resultSet
.
phoneNumber
);
$
(
'
#input-extension-update
'
).
val
(
resultSet
.
phoneNumberE
xtension
);
$
(
'
#input-mobile-update
'
).
val
(
resultSet
.
mobileNumber
);
}
}
...
...
This diff is collapsed.
Click to expand it.
jams-server/src/main/resources/webapp/js/user.js
+
57
−
40
View file @
e820cf72
...
...
@@ -24,6 +24,7 @@ var userData = {};
var
b64
;
var
local
=
false
;
var
username
=
''
;
var
userStatus
=
''
;
$
(
document
).
ready
(
function
()
{
...
...
@@ -39,6 +40,7 @@ $(document).ready(function() {
username
=
$
.
urlParam
(
'
username
'
);
// check if we have a username parameter
if
(
username
!=
''
&&
username
!=
null
)
{
...
...
@@ -50,6 +52,20 @@ $(document).ready(function() {
"
username
"
:
username
};
ajaxApiCall
(
api_path_get_directories
,
'
GET
'
,
null
,
null
,
isLocalDB
).
then
(
function
()
{
setTimeout
(
function
()
{
ajaxApiCall
(
api_path_get_user
,
'
GET
'
,
userData
,
null
,
setStatus
).
then
(
function
()
{
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserInfoDataSource
).
then
(
function
()
{
setTimeout
(
function
()
{
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserExtendedData
);
},
300
);
});
});
},
300
)
});
// set User devices information
ajaxApiCall
(
api_path_get_auth_devices
,
'
GET
'
,
userData
,
null
,
setUserDevices
);
...
...
@@ -71,18 +87,19 @@ $(document).ready(function() {
e
.
preventDefault
();
var
data
=
{
'
givenName
'
:
$
(
'
#input-givenName-update
'
).
val
(),
'
sn
'
:
$
(
'
#input-sn-update
'
).
val
(),
'
CN
'
:
encodeURIComponent
(
userData
[
"
username
"
]),
'
mail
'
:
$
(
'
#input-mail-update
'
).
val
(),
'
jpegPhoto
'
:
b64
,
'
o
'
:
$
(
'
#input-o-update
'
).
val
(),
'
facsimileTelephoneNumber
'
:
$
(
'
#input-facsimileTelephoneNumber-update
'
).
val
(),
'
telephoneNumber
'
:
$
(
'
#input-telephoneNumber-update
'
).
val
(),
'
extension
'
:
$
(
'
#input-extension-update
'
).
val
(),
'
mobile
'
:
$
(
'
#input-mobile-update
'
).
val
()
}
ajaxApiCall
(
api_path_post_update_user
,
'
POST
'
,
data
,
null
,
handleUserUpdate
);
'
firstName
'
:
$
(
'
#input-givenName-update
'
).
val
(),
'
lastName
'
:
$
(
'
#input-sn-update
'
).
val
(),
'
username
'
:
username
,
'
email
'
:
$
(
'
#input-mail-update
'
).
val
(),
'
profilePicture
'
:
b64
,
'
organization
'
:
$
(
'
#input-o-update
'
).
val
(),
'
faxNumber
'
:
$
(
'
#input-facsimileTelephoneNumber-update
'
).
val
(),
'
phoneNumber
'
:
$
(
'
#input-telephoneNumber-update
'
).
val
(),
'
phoneNumberExtension
'
:
$
(
'
#input-extension-update
'
).
val
(),
'
mobileNumber
'
:
$
(
'
#input-mobile-update
'
).
val
()
}
ajaxApiCall
(
api_path_put_update_user_profile
,
'
PUT
'
,
data
,
null
,
handleUserUpdate
);
});
});
...
...
@@ -98,7 +115,7 @@ $(document).ready(function() {
});
$
(
'
.user-information
'
).
on
(
'
click
'
,
'
.reset-password
'
,
function
(
e
)
{
ajaxApiCall
(
api_path_
post_update
_user
,
'
GET
'
,
userData
,
null
,
handleNewOTP
);
ajaxApiCall
(
api_path_
get
_user
,
'
GET
'
,
userData
,
null
,
handleNewOTP
);
});
// change device name
...
...
@@ -141,14 +158,6 @@ $(document).ready(function() {
$
(
'
#device-id-modal
'
).
text
(
''
);
});
// set User information fields
setTimeout
(
function
()
{
ajaxApiCall
(
api_path_get_directories
,
'
GET
'
,
null
,
null
,
isLocalDB
);
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserInfoDataSource
);
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserExtendedData
);
},
300
);
}
else
{
$
(
'
.user-information-container
'
).
remove
();
...
...
@@ -165,15 +174,13 @@ function setUserInfoDataSource(data, statusCode, jqXHR) {
if
(
resultSet
.
length
>
0
)
{
// build table row for User item
for
(
i
=
0
;
i
<
resultSet
.
length
;
i
++
)
{
var
status
=
''
;
// determine User status
if
(
resultSet
[
i
].
revoked
)
{
status
=
'
Revoked
'
;
if
(
userStatus
==
"
Revoked
"
)
{
disabled
=
true
;
status_class
=
'
text-danger
'
;
}
else
{
status
=
'
Active
'
;
status_class
=
''
;
}
...
...
@@ -181,7 +188,7 @@ function setUserInfoDataSource(data, statusCode, jqXHR) {
userRow
+=
'
<div class="row"><div class="col-md-4 col-sm-12"><div id="left_panel" class="user-information__left"><h5 class="user-detail"></h5></div></div><div id="rightcolumn" class="col-md-8 col-sm-12"></div></div>
'
+
'
<h5 className="user-detail"><i id="status-whatever" class="
'
+
status_class
+
'
">
'
+
s
tatus
+
'
<h5 className="user-detail"><i id="status-whatever" class="
'
+
status_class
+
'
">
'
+
userS
tatus
+
'
</i></h5>
'
;
if
(
getAdminStatus
())
{
...
...
@@ -212,6 +219,11 @@ function setUserExtendedData(data, statusCode, jqXHR) {
var
resultSet
=
data
;
var
userRow
=
''
;
var
disabled
=
''
;
if
(
getAdminStatus
())
{
$
(
'
.mt-5
'
)[
0
].
style
=
'
display: flex
'
;
}
if
(
resultSet
.
length
>
0
)
{
// build table row for User item
for
(
i
=
0
;
i
<
1
;
i
++
)
{
...
...
@@ -292,10 +304,6 @@ function setUserExtendedData(data, statusCode, jqXHR) {
if
(
disabled
)
{
$
(
'
.de-authorize-user
'
).
prop
(
'
disabled
'
,
true
);
}
if
(
getAdminStatus
())
{
$
(
'
.mt-5
'
)[
0
].
show
();
}
}
}
}
...
...
@@ -400,10 +408,12 @@ function handleUserUpdate(){
$
(
'
.user-information
'
).
empty
();
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserInfoDataSource
).
then
(
function
()
{
setTimeout
(
function
()
{
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserInfoDataSource
);
ajaxApiCall
(
api_path_get_user_directory_search
,
'
GET
'
,
searchData
,
null
,
setUserExtendedData
);
},
1000
);
},
300
);
});
}
function
handleFileSelect
(
evt
)
{
...
...
@@ -449,16 +459,16 @@ function handleUserAutofill(data, statusCode, jqXHR) {
if
(
jqXHR
.
status
==
200
)
{
var
resultSet
=
data
[
0
];
if
(
resultSet
.
jpegPhoto
)
b64
=
resultSet
.
jpegPhoto
;
if
(
resultSet
.
profilePicture
)
b64
=
resultSet
.
profilePicture
;
$
(
'
#input-givenName-update
'
).
val
(
resultSet
.
firstName
);
$
(
'
#input-sn-update
'
).
val
(
resultSet
.
lastName
);
$
(
'
#input-mail-update
'
).
val
(
resultSet
.
mail
);
$
(
'
#input-o-update
'
).
val
(
resultSet
.
org
);
$
(
'
#input-mail-update
'
).
val
(
resultSet
.
e
mail
);
$
(
'
#input-o-update
'
).
val
(
resultSet
.
org
anization
);
$
(
'
#input-facsimileTelephoneNumber-update
'
).
val
(
resultSet
.
faxNumber
);
$
(
'
#input-telephoneNumber-update
'
).
val
(
resultSet
.
tele
phoneNumber
);
$
(
'
#input-extension-update
'
).
val
(
resultSet
.
e
xtension
);
$
(
'
#input-mobile-update
'
).
val
(
resultSet
.
mobile
Phone
Number
);
$
(
'
#input-telephoneNumber-update
'
).
val
(
resultSet
.
phoneNumber
);
$
(
'
#input-extension-update
'
).
val
(
resultSet
.
phoneNumberE
xtension
);
$
(
'
#input-mobile-update
'
).
val
(
resultSet
.
mobileNumber
);
}
}
...
...
@@ -497,6 +507,13 @@ function handleNewOTP(data) {
}
}
function
setStatus
(
data
)
{
if
(
data
.
getResponseHeader
(
'
revoked
'
)
==
'
true
'
)
userStatus
=
"
Revoked
"
;
else
userStatus
=
"
Active
"
;
}
// clean error messages when button selected
$
(
'
button
'
).
click
(
function
()
{
$
(
'
.configMessage
'
).
hide
();
...
...
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