Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
core
Commits
4bea3f8d
Commit
4bea3f8d
authored
5 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
buttons are disabled globaly (not lnoy on the first page)
parent
17e9fa58
No related branches found
No related tags found
2 merge requests
!759
Merge 12.2.3
,
!757
buttons are disabled globaly (not lnoy on the first page)
Pipeline
#9968
passed
5 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+20
-11
20 additions, 11 deletions
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
with
22 additions
and
11 deletions
CHANGELOG
+
2
−
0
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)
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+
20
−
11
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
();
...
...
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