Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
bec2b92d
Commit
bec2b92d
authored
Feb 26, 2019
by
Piotr Gawron
Browse files
listener for removal confirmation is added on object creation not refresh
parent
c527f9db
Pipeline
#9006
passed with stage
in 11 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
bec2b92d
minerva
(
12.2.0
~
beta
.2
)
unstable
;
urgency
=
medium
*
Bug
fix
:
removing
comments
in
a
project
asked
for
confirmation
twice
after
edit
project
dialog
for
specific
project
was
opened
;
closed
and
opened
again
(#
697
)
*
Bug
fix
:
clicking
on
compartment
border
inside
pathway
should
return
compartment
,
not
a
pathway
(#
324
)
*
Bug
fix
:
clicking
outside
of
the
element
sometimes
resulted
with
the
...
...
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
View file @
bec2b92d
...
...
@@ -66,6 +66,25 @@ CommentsAdminPanel.prototype._createGui = function () {
}]
});
$
(
"
[name='commentsTable']
"
,
self
.
getElement
()).
on
(
"
click
"
,
"
[name='removeComment']
"
,
function
()
{
var
button
=
this
;
return
self
.
askConfirmRemoval
({
title
:
"
Why do you want to remove this comment?
"
,
input
:
true
}).
then
(
function
(
param
)
{
if
(
param
.
status
)
{
return
ServerConnector
.
removeComment
({
commentId
:
$
(
button
).
attr
(
"
data
"
),
reason
:
param
.
reason
,
projectId
:
self
.
getProject
().
getProjectId
()
}).
then
(
function
()
{
$
(
button
).
after
(
"
<span>YES (
"
+
param
.
reason
+
"
)</span>
"
);
button
.
style
.
display
=
"
none
"
;
});
}
}).
catch
(
GuiConnector
.
alert
)
});
};
/**
...
...
@@ -93,24 +112,6 @@ CommentsAdminPanel.prototype.refreshComments = function () {
data
.
push
(
self
.
commentToTableRow
(
comments
[
i
]));
}
dataTable
.
clear
().
rows
.
add
(
data
).
draw
();
$
(
"
[name='commentsTable']
"
,
self
.
getElement
()).
on
(
"
click
"
,
"
[name='removeComment']
"
,
function
()
{
var
button
=
this
;
return
self
.
askConfirmRemoval
({
title
:
"
Why do you want to remove this comment?
"
,
input
:
true
}).
then
(
function
(
param
)
{
if
(
param
.
status
)
{
return
ServerConnector
.
removeComment
({
commentId
:
$
(
button
).
attr
(
"
data
"
),
reason
:
param
.
reason
,
projectId
:
self
.
getProject
().
getProjectId
()
}).
then
(
function
()
{
$
(
button
).
after
(
"
<span>YES (
"
+
param
.
reason
+
"
)</span>
"
);
button
.
style
.
display
=
"
none
"
;
});
}
}).
catch
(
GuiConnector
.
alert
)
});
});
};
...
...
@@ -131,10 +132,10 @@ CommentsAdminPanel.prototype.commentToTableRow = function (comment) {
};
var
title
=
null
;
if
(
!
comment
.
isRemoved
())
{
var
commentLink
=
"
index.xhtml?id=
"
+
projectId
+
"
&x=
"
+
comment
.
getCoordinates
().
x
+
"
&y=
"
+
comment
.
getCoordinates
().
y
+
"
&zoom=12
"
+
var
commentLink
=
"
index.xhtml?id=
"
+
projectId
+
"
&x=
"
+
comment
.
getCoordinates
().
x
+
"
&y=
"
+
comment
.
getCoordinates
().
y
+
"
&zoom=12
"
+
"
&comments=on
"
;
title
=
"
<a href='
"
+
commentLink
+
"
' target='
"
+
projectId
+
"
'>
"
+
comment
.
getTitle
()
+
"
</a>
"
;
}
else
{
...
...
@@ -158,12 +159,12 @@ CommentsAdminPanel.prototype.commentToTableRow = function (comment) {
email
=
"
N/A
"
;
}
return
[
comment
.
getId
(),
xss
(
title
),
xss
(
author
),
xss
(
email
),
xss
(
comment
.
getContent
()),
remove
,
return
[
comment
.
getId
(),
xss
(
title
),
xss
(
author
),
xss
(
email
),
xss
(
comment
.
getContent
()),
remove
,
toYesNo
(
comment
.
isPinned
())];
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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