Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
b6acc1ac
Commit
b6acc1ac
authored
Nov 14, 2019
by
Piotr Gawron
Browse files
plugins in admin panel can be revalidated
parent
e785b1fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
b6acc1ac
...
...
@@ -11,6 +11,8 @@ minerva (15.0.0~alpha.1) stable; urgency=medium
upload
(#
820
)
*
Small
improvement
:
items
in
context
menu
are
reorganized
(#
787
)
*
Small
improvement
:
CellDesigner
files
from
version
2.5
should
be
parseable
*
Small
improvement
:
plugins
in
admin
panel
can
be
revalidated
to
update
info
about
the
plugins
(
name
,
version
)
*
Bug
fix
:
compartments
limited
by
corner
(
left
-
top
corner
compartment
,
etc
)
are
parsed
properly
from
CellDesigner
files
*
Bug
fix
:
structural
states
of
proteins
are
imported
properly
from
SBGNML
PD
...
...
frontend-js/src/main/js/ServerConnector.js
View file @
b6acc1ac
...
...
@@ -1399,6 +1399,8 @@ ServerConnector.removePlugin = function (params) {
* @param {Object} params
* @param {string} params.hash
* @param {boolean} [params.isDefault]
* @param {boolean} [params.version]
* @param {boolean} [params.name]
*
* @returns {Promise<PluginData[]>}
*/
...
...
@@ -1407,7 +1409,9 @@ ServerConnector.updatePlugin = function (params) {
var
content
=
{
plugin
:
{
hash
:
params
.
hash
,
isDefault
:
params
.
isDefault
isDefault
:
params
.
isDefault
,
version
:
params
.
version
,
name
:
params
.
name
}
};
return
self
.
sendPatchRequest
(
self
.
getPluginUrl
(
params
),
content
);
...
...
frontend-js/src/main/js/gui/admin/PluginAdminPanel.js
View file @
b6acc1ac
...
...
@@ -65,6 +65,8 @@ PluginAdminPanel.prototype._createGui = function () {
title
:
'
Url
'
},
{
title
:
'
Default
'
},
{
title
:
'
Re-Validate
'
},
{
title
:
'
Remove
'
,
orderable
:
false
...
...
@@ -91,10 +93,67 @@ PluginAdminPanel.prototype._createGui = function () {
}).
catch
(
GuiConnector
.
alert
);
});
$
(
pluginsTable
).
on
(
"
click
"
,
"
[name='re-validate-plugin']
"
,
function
()
{
var
button
=
this
;
var
hash
=
$
(
button
).
attr
(
"
data
"
);
var
error
=
false
;
var
plugin
;
return
self
.
getServerConnector
().
getPluginData
(
hash
).
then
(
function
(
response
)
{
plugin
=
response
;
return
self
.
getServerConnector
().
sendRequest
({
url
:
plugin
.
getUrls
()[
0
],
description
:
"
Loading plugin:
"
+
plugin
.
getUrls
()[
0
],
method
:
"
GET
"
});
}).
then
(
function
(
content
)
{
var
pluginRawData
=
undefined
;
// noinspection JSUnusedLocalSymbols
var
minervaDefine
=
function
(
pluginFunction
)
{
try
{
if
(
typeof
pluginFunction
===
"
function
"
)
{
pluginRawData
=
pluginFunction
();
}
else
{
pluginRawData
=
pluginFunction
;
}
}
catch
(
e
)
{
error
=
e
;
}
};
content
+=
"
//# sourceURL=
"
+
plugin
.
getUrls
()[
0
];
eval
(
content
);
if
(
error
)
{
return
self
.
askConfirmRemoval
({
title
:
"
INFO
"
,
content
:
"
Plugin source file does not exist. Do you want to remove this plugin?
"
,
input
:
false
}).
then
(
function
(
param
)
{
if
(
param
.
status
)
{
return
self
.
getServerConnector
().
removePlugin
({
hash
:
hash
}).
then
(
function
()
{
return
self
.
onRefreshClicked
();
});
}
});
}
else
{
return
self
.
getServerConnector
().
updatePlugin
({
hash
:
hash
,
version
:
pluginRawData
.
getVersion
(),
name
:
pluginRawData
.
getName
()
}).
then
(
function
()
{
return
self
.
onRefreshClicked
();
});
}
}).
catch
(
GuiConnector
.
alert
);
});
$
(
pluginsTable
).
on
(
"
click
"
,
"
[name='edit-default-plugin']
"
,
function
()
{
var
checkbox
=
this
;
var
hash
=
$
(
this
).
attr
(
"
data
"
);
return
self
.
getServerConnector
().
updatePlugin
({
hash
:
hash
,
isDefault
:
$
(
checkbox
).
is
(
'
:checked
'
)}).
then
(
function
()
{
return
self
.
getServerConnector
().
updatePlugin
({
hash
:
hash
,
isDefault
:
$
(
checkbox
).
is
(
'
:checked
'
)
}).
then
(
function
()
{
return
self
.
onRefreshClicked
();
}).
catch
(
GuiConnector
.
alert
);
});
...
...
@@ -212,8 +271,9 @@ PluginAdminPanel.prototype.pluginToTableRow = function (plugin) {
checked
=
"
checked
"
;
}
row
[
3
]
=
"
<input type='checkbox' name='edit-default-plugin'
"
+
checked
+
"
data='
"
+
plugin
.
getHash
()
+
"
' />
"
;
row
[
4
]
=
"
<button name='re-validate-plugin' data='
"
+
plugin
.
getHash
()
+
"
' ><i class='fa fa-check-circle'></button>
"
;
row
[
4
]
=
"
<button name='removePlugin' data='
"
+
plugin
.
getHash
()
+
"
' ><i class='fa fa-trash-alt'></button>
"
;
row
[
5
]
=
"
<button name='removePlugin' data='
"
+
plugin
.
getHash
()
+
"
' ><i class='fa fa-trash-alt'></button>
"
;
return
row
;
};
...
...
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