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
1bd63549
Commit
1bd63549
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
link to comment on map added
parent
e8d7feb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!115
Resolve "admin panel should use API"
,
!114
Resolve "admin panel should use API"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+48
-21
48 additions, 21 deletions
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
with
48 additions
and
21 deletions
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+
48
−
21
View file @
1bd63549
...
...
@@ -123,29 +123,56 @@ CommentsAdminPanel.prototype.refreshProjects = function() {
});
};
CommentsAdminPanel
.
prototype
.
getSelectedProjectId
=
function
()
{
var
projectSelect
=
$
(
"
[name='projectSelect']
"
,
this
.
getElement
())[
0
];
return
projectSelect
.
value
;
};
CommentsAdminPanel
.
prototype
.
onProjectChange
=
function
()
{
var
self
=
this
;
var
projectSelect
=
$
(
"
[name='projectSelect']
"
,
self
.
getElement
())[
0
];
return
ServerConnector
.
getComments
({
projectId
:
projectSelect
.
value
,
}).
then
(
function
(
comments
)
{
var
dataTable
=
$
(
$
(
"
[name='commentsTable']
"
,
self
.
getElement
())[
0
]).
DataTable
();
var
data
=
[];
var
toYesNo
=
function
(
val
)
{
if
(
val
)
{
return
"
YES
"
;
}
else
{
return
"
NO
"
;
}
}
for
(
var
i
=
0
;
i
<
comments
.
length
;
i
++
)
{
var
comment
=
comments
[
i
];
data
.
push
([
comment
.
getId
(),
comment
.
getTitle
(),
comment
.
getAuthor
(),
comment
.
getEmail
(),
comment
.
getContent
(),
toYesNo
(
comment
.
isRemoved
()),
toYesNo
(
comment
.
isPinned
())
]);
logger
.
debug
(
"
Add comment:
"
,
comments
[
i
]);
}
dataTable
.
clear
().
rows
.
add
(
data
).
draw
();
});
projectId
:
self
.
getSelectedProjectId
(),
}).
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
();
});
};
CommentsAdminPanel
.
prototype
.
commentToTableRow
=
function
(
comment
)
{
var
self
=
this
;
var
projectId
=
self
.
getSelectedProjectId
();
var
toYesNo
=
function
(
val
)
{
if
(
val
)
{
return
"
YES
"
;
}
else
{
return
"
NO
"
;
}
};
var
title
=
null
;
if
(
!
comment
.
isRemoved
())
{
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
{
title
=
comment
.
getTitle
();
}
var
row
=
[
comment
.
getId
(),
//
title
,
//
comment
.
getAuthor
(),
//
comment
.
getEmail
(),
//
comment
.
getContent
(),
//
toYesNo
(
comment
.
isRemoved
()),
//
toYesNo
(
comment
.
isPinned
())
];
return
row
;
}
module
.
exports
=
CommentsAdminPanel
;
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