Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
4bea3f8d
Commit
4bea3f8d
authored
Apr 25, 2019
by
Piotr Gawron
Browse files
buttons are disabled globaly (not lnoy on the first page)
parent
17e9fa58
Pipeline
#9968
passed with stage
in 13 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
4bea3f8d
...
...
@@ -8,6 +8,8 @@ minerva (12.2.3) stable; urgency=medium
*
Bug
fix
:
updating
terms
of
use
could
crash
when
list
of
users
was
removed
in
separate
tab
or
by
another
user
(#
797
)
*
Bug
fix
:
name
of
the
checkbox
in
ADD
PROJECT
window
adjusted
(#
799
)
*
Bug
fix
:
when
user
didn
't have privileges to remove comments the button was
active on pages other than page 1 (#792)
* Bug fix: export of reaction to SBML didn'
t
work
when
lines
on
the
map
were
too
short
(#
805
)
...
...
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
View file @
4bea3f8d
...
...
@@ -104,31 +104,36 @@ CommentsAdminPanel.prototype.init = function () {
*/
CommentsAdminPanel
.
prototype
.
refreshComments
=
function
()
{
var
self
=
this
;
var
comments
;
return
ServerConnector
.
getComments
({
return
self
.
get
ServerConnector
()
.
getComments
({
projectId
:
self
.
getProject
().
getProjectId
()
}).
then
(
function
(
comments
)
{
var
dataTable
=
$
(
$
(
"
[name='commentsTable']
"
,
self
.
getElement
())[
0
]).
DataTable
();
var
data
=
[];
for
(
var
i
=
0
;
i
<
comments
.
length
;
i
++
)
{
data
.
push
(
self
.
commentToTableRow
(
comments
[
i
]));
}
dataTable
.
clear
().
rows
.
add
(
data
).
draw
();
}).
then
(
function
(
result
)
{
comments
=
result
;
return
self
.
getServerConnector
().
getLoggedUser
();
}).
then
(
function
(
user
)
{
var
type
=
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
EDIT_COMMENTS_PROJECT
);
var
disable
=
false
;
if
(
!
user
.
hasPrivilege
(
type
,
self
.
getProject
().
getId
()))
{
$
(
"
[name='removeComment']
"
,
self
.
getElement
()).
attr
(
"
disabled
"
,
true
);
disable
=
true
;
}
var
dataTable
=
$
(
$
(
"
[name='commentsTable']
"
,
self
.
getElement
())[
0
]).
DataTable
();
var
data
=
[];
for
(
var
i
=
0
;
i
<
comments
.
length
;
i
++
)
{
data
.
push
(
self
.
commentToTableRow
(
comments
[
i
],
disable
));
}
dataTable
.
clear
().
rows
.
add
(
data
).
draw
();
});
};
/**
*
* @param {boolean} disable
* @param {Comment} comment
* @returns {string[]}
*/
CommentsAdminPanel
.
prototype
.
commentToTableRow
=
function
(
comment
)
{
CommentsAdminPanel
.
prototype
.
commentToTableRow
=
function
(
comment
,
disable
)
{
var
self
=
this
;
var
projectId
=
self
.
getProject
().
getProjectId
();
var
toYesNo
=
function
(
val
)
{
...
...
@@ -150,11 +155,15 @@ CommentsAdminPanel.prototype.commentToTableRow = function (comment) {
title
=
comment
.
getTitle
();
}
var
disabled
=
""
;
if
(
disable
)
{
disabled
=
"
disabled
"
;
}
var
remove
=
null
;
if
(
comment
.
isRemoved
())
{
remove
=
"
YES (
"
+
comment
.
getRemoveReason
()
+
"
)
"
;
}
else
{
remove
=
"
<button name='removeComment' data='
"
+
comment
.
getId
()
+
"
'><i class='fa fa-trash-o' style='font-size:17px'></button>
"
;
remove
=
"
<button name='removeComment' data='
"
+
comment
.
getId
()
+
"
'
"
+
disabled
+
"
><i class='fa fa-trash-o' style='font-size:17px'></button>
"
;
}
var
author
=
comment
.
getAuthor
();
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment