Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
194782f8
Commit
194782f8
authored
Sep 17, 2019
by
Piotr Gawron
Browse files
list of copy entity types in annotators and validators is unified
parent
86d7e896
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
194782f8
...
...
@@ -3,6 +3,8 @@ minerva (14.0.0~beta.2) unstable; urgency=low
*
Bug
fix
:
allow
user
to
remove
own
comments
(#
931
)
*
Bug
fix
:
validation
of
project
name
length
is
provided
(#
950
)
*
Bug
fix
:
after
reducing
privileges
on
himself
interface
is
refreshed
(#
948
)
*
Bug
fix
:
list
of
"Copy from"
elements
in
"Select valid annotations"
dialog
is
shortened
to
used
bio
entity
typrd
(#
911
)
*
Bug
fix
:
removing
overlays
as
curator
in
admin
panel
fixed
(#
944
)
*
Bug
fix
:
information
about
deprecated
column
is
more
clear
about
column
names
(#
838
)
...
...
frontend-js/src/main/js/gui/admin/AbstractAnnotatorsDialog.js
View file @
194782f8
...
...
@@ -51,4 +51,32 @@ AbstractAnnotatorsDialog.prototype.getAllChildrenTypesIfNeeded = function (eleme
return
result
;
};
/**
*
* @return {BioEntityTypeTreeNode[]}
*/
AbstractAnnotatorsDialog
.
prototype
.
getTypeNodeList
=
function
()
{
var
types
=
[];
var
treeData
=
this
.
getConfiguration
().
getElementTypeTree
();
var
queue
=
[
treeData
];
while
(
queue
.
length
>
0
)
{
var
node
=
queue
.
shift
();
if
(
node
.
children
!==
undefined
&&
node
.
children
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
node
.
children
.
length
;
i
++
)
{
queue
.
push
(
node
.
children
[
i
]);
}
}
else
{
types
.
push
(
node
);
}
}
types
.
sort
(
function
(
a
,
b
)
{
return
a
.
text
.
localeCompare
(
b
.
text
);
});
return
types
;
};
module
.
exports
=
AbstractAnnotatorsDialog
;
frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js
View file @
194782f8
...
...
@@ -416,33 +416,6 @@ ChooseAnnotatorsDialog.prototype.createAnnotatorsParams = function (selectedAnno
};
/**
*
* @return {BioEntityTypeTreeNode[]}
*/
ChooseAnnotatorsDialog
.
prototype
.
getTypeNodeList
=
function
()
{
var
types
=
[];
var
treeData
=
this
.
getConfiguration
().
getElementTypeTree
();
var
queue
=
[
treeData
];
while
(
queue
.
length
>
0
)
{
var
node
=
queue
.
shift
();
if
(
node
.
children
!==
undefined
&&
node
.
children
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
node
.
children
.
length
;
i
++
)
{
queue
.
push
(
node
.
children
[
i
]);
}
}
else
{
types
.
push
(
node
);
}
}
types
.
sort
(
function
(
a
,
b
)
{
return
a
.
text
.
localeCompare
(
b
.
text
);
});
return
types
;
};
/**
*
* @returns {Promise}
...
...
frontend-js/src/main/js/gui/admin/ChooseValidatorsDialog.js
View file @
194782f8
...
...
@@ -21,7 +21,7 @@ var logger = require('../../logger');
* @param {Object} params
* @param {HTMLElement} params.element
* @param {CustomMap} params.customMap
* @param {Configuration}
[
params.configuration
]
* @param {Configuration} params.configuration
* @param {ServerConnector} [params.serverConnector]
*
* @constructor
...
...
@@ -125,16 +125,13 @@ ChooseValidatorsDialog.prototype.setElementType = function (elementType) {
var
copyFromSelect
=
Functions
.
createElement
({
type
:
"
select
"
,
style
:
"
margin:5px
"
});
element
.
appendChild
(
copyFromSelect
);
var
options
=
[],
i
;
for
(
i
=
0
;
i
<
configuration
.
getElementTypes
().
length
;
i
++
)
{
var
type
=
configuration
.
getElementTypes
()[
i
];
var
name
=
type
.
className
;
if
(
name
.
indexOf
(
"
.
"
)
>
0
)
{
name
=
name
.
substr
(
name
.
lastIndexOf
(
"
.
"
)
+
1
);
}
var
nodeList
=
self
.
getTypeNodeList
();
for
(
i
=
0
;
i
<
nodeList
.
length
;
i
++
)
{
var
type
=
nodeList
[
i
];
options
.
push
(
Functions
.
createElement
({
type
:
"
option
"
,
value
:
type
.
className
,
content
:
name
value
:
type
.
data
.
className
,
content
:
type
.
text
}));
}
options
.
sort
(
function
(
a
,
b
)
{
...
...
@@ -143,6 +140,7 @@ ChooseValidatorsDialog.prototype.setElementType = function (elementType) {
for
(
i
=
0
;
i
<
options
.
length
;
i
++
)
{
copyFromSelect
.
appendChild
(
options
[
i
]);
}
element
.
appendChild
(
includeChildrenCheckbox
);
element
.
appendChild
(
Functions
.
createElement
({
type
:
"
span
"
,
content
:
"
Apply to all in subtree
"
}));
...
...
frontend-js/src/test/js/gui/admin/ChooseValidatorsDialog-test.js
View file @
194782f8
...
...
@@ -11,34 +11,31 @@ var Promise = require('bluebird');
var
chai
=
require
(
'
chai
'
);
var
assert
=
chai
.
assert
;
function
createDialog
()
{
return
new
ChooseValidatorsDialog
({
element
:
testDiv
,
customMap
:
null
,
serverConnector
:
ServerConnector
,
configuration
:
helper
.
getConfiguration
()
});
}
describe
(
'
ChooseValidatorsDialog
'
,
function
()
{
it
(
'
init
'
,
function
()
{
var
dialog
=
new
ChooseValidatorsDialog
({
element
:
testDiv
,
customMap
:
null
,
serverConnector
:
ServerConnector
});
var
dialog
=
createDialog
();
assert
.
equal
(
0
,
logger
.
getWarnings
().
length
);
return
dialog
.
init
();
});
it
(
'
setElementType
'
,
function
()
{
var
dialog
=
new
ChooseValidatorsDialog
({
element
:
testDiv
,
customMap
:
null
,
serverConnector
:
ServerConnector
});
var
dialog
=
createDialog
();
return
ServerConnector
.
getConfiguration
().
then
(
function
(
configuration
)
{
return
dialog
.
setElementType
(
configuration
.
getReactionTypes
()[
0
]);
})
});
it
(
'
open
'
,
function
()
{
var
dialog
=
new
ChooseValidatorsDialog
({
element
:
testDiv
,
customMap
:
null
,
serverConnector
:
ServerConnector
});
var
dialog
=
createDialog
();
return
dialog
.
init
().
then
(
function
()
{
return
dialog
.
open
();
}).
then
(
function
()
{
...
...
@@ -52,11 +49,7 @@ describe('ChooseValidatorsDialog', function () {
helper
.
loginAsAdmin
();
var
originalFunction
=
ServerConnector
.
updateUserPreferences
;
var
functionCalled
=
false
;
var
dialog
=
new
ChooseValidatorsDialog
({
element
:
testDiv
,
customMap
:
null
,
serverConnector
:
ServerConnector
});
var
dialog
=
createDialog
();
return
dialog
.
init
().
then
(
function
()
{
return
dialog
.
open
();
}).
then
(
function
()
{
...
...
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