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
1f7997fc
Commit
1f7997fc
authored
Jun 22, 2020
by
Piotr Gawron
Browse files
refresh only project that requires it
parent
846139d4
Pipeline
#28805
passed with stage
in 11 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
1f7997fc
...
...
@@ -10,6 +10,8 @@ minerva (15.1.0) unstable; urgency=medium
defining
font
color
*
Bug
fix
:
export
to
image
from
selected
polygon
contained
all
elements
inside
rectangle
bounded
by
the
polygon
coordinates
(#
1096
)
*
Bug
fix
:
continuous
refreshing
list
of
project
when
uploading
/
removing
project
did
not
allow
to
change
other
project
details
(#
996
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Thu
,
18
Jun
2020
16
:
00
:
00
+
0200
...
...
frontend-js/src/main/js/gui/admin/MapsAdminPanel.js
View file @
1f7997fc
...
...
@@ -315,7 +315,6 @@ MapsAdminPanel.prototype.setProjects = function (projects) {
var
self
=
this
;
return
self
.
getServerConnector
().
getLoggedUser
().
then
(
function
(
user
)
{
var
requireUpdate
=
false
;
var
dataTable
=
$
(
"
[name='projectsTable']
"
,
self
.
getElement
()).
DataTable
();
var
data
=
[];
var
page
=
dataTable
.
page
();
...
...
@@ -325,19 +324,10 @@ MapsAdminPanel.prototype.setProjects = function (projects) {
var
rowData
=
self
.
projectToTableRow
(
project
,
undefined
,
user
);
self
.
addUpdateListener
(
project
);
data
.
push
(
rowData
);
if
(
project
.
getStatus
().
toLowerCase
()
!==
"
ok
"
&&
project
.
getStatus
().
toLowerCase
()
!==
"
failure
"
)
{
requireUpdate
=
true
;
}
}
//it should be simplified, but I couldn't make it work
dataTable
.
clear
().
rows
.
add
(
data
).
page
(
page
).
draw
(
false
).
page
(
page
).
draw
(
false
);
if
(
requireUpdate
)
{
setTimeout
(
function
()
{
logger
.
debug
(
"
Projects auto refresh
"
);
return
self
.
onRefreshClicked
();
},
MapsAdminPanel
.
AUTO_REFRESH_TIME
);
}
});
};
...
...
@@ -355,6 +345,17 @@ MapsAdminPanel.prototype.addUpdateListener = function (project) {
project
.
removeListener
(
"
onreload
"
,
listeners
[
i
]);
}
}
var
createRefreshEventFunction
=
function
()
{
var
projectId
=
project
.
getProjectId
();
setTimeout
(
function
()
{
console
.
log
(
"
Refreshing project:
"
+
projectId
);
return
self
.
getServerConnector
().
getProject
(
projectId
).
then
(
function
(
project
)
{
if
(
project
===
null
)
{
return
self
.
onRefreshClicked
();
}
});
},
MapsAdminPanel
.
AUTO_REFRESH_TIME
);
};
var
listener
=
function
()
{
return
self
.
getServerConnector
().
getLoggedUser
().
then
(
function
(
user
)
{
var
dataTable
=
$
(
$
(
"
[name='projectsTable']
"
,
self
.
getElement
())[
0
]).
DataTable
();
...
...
@@ -363,17 +364,25 @@ MapsAdminPanel.prototype.addUpdateListener = function (project) {
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
row
=
dataTable
.
row
(
i
);
var
data
=
row
.
data
();
if
(
data
[
0
].
indexOf
(
"
>
"
+
project
.
getProjectId
()
+
"
<
"
)
>=
0
)
{
if
(
data
[
0
].
indexOf
(
"
>
"
+
project
.
getProjectId
()
+
"
<
"
)
>=
0
||
data
[
0
].
indexOf
(
project
.
getProjectId
())
===
0
)
{
self
.
projectToTableRow
(
project
,
data
,
user
);
var
page
=
dataTable
.
page
();
row
.
data
(
data
).
draw
();
dataTable
.
page
(
page
).
draw
(
false
);
}
}
if
(
project
.
getStatus
().
toLowerCase
()
!==
"
ok
"
&&
project
.
getStatus
().
toLowerCase
()
!==
"
failure
"
)
{
createRefreshEventFunction
();
}
});
};
listener
.
listenerName
=
listenerName
;
project
.
addListener
(
"
onreload
"
,
listener
);
if
(
project
.
getStatus
().
toLowerCase
()
!==
"
ok
"
&&
project
.
getStatus
().
toLowerCase
()
!==
"
failure
"
)
{
createRefreshEventFunction
();
}
};
/**
...
...
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