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
503d2b67
Commit
503d2b67
authored
Jun 05, 2019
by
Piotr Gawron
Browse files
sort of protein type fixed
parent
99910708
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
503d2b67
...
...
@@ -5,6 +5,8 @@ minerva (12.3.1~beta.1) unstable; urgency=low
that introduced second line for tab selection (#758)
* Bug fix: invisible layer shouldn'
t
be
shown
in
the
on
th
map
(#
813
)
*
Bug
fix
:
list
of
availbale
annotators
is
sorted
alphabetically
(#
815
)
*
Bug
fix
:
protein
types
are
sorted
properly
in
"Select valid annotations"
dialog
(#
815
)
minerva
(
13.1.0
~
beta
.0
)
unstable
;
urgency
=
low
*
Feature
:
annotators
are
more
flexible
-
you
can
define
set
of
input
and
...
...
frontend-js/src/main/js/Configuration.js
View file @
503d2b67
...
...
@@ -704,6 +704,16 @@ Configuration.prototype.getElementTypeTree = function () {
};
}
var
sortFunction
=
function
(
entryA
,
entryB
)
{
if
(
entryA
.
text
<
entryB
.
text
)
{
return
-
1
;
}
if
(
entryA
.
text
>
entryB
.
text
)
{
return
1
;
}
return
0
;
};
for
(
var
treeNodeName
in
treeNodes
)
{
if
(
treeNodes
.
hasOwnProperty
(
treeNodeName
))
{
var
treeNode
=
treeNodes
[
treeNodeName
];
...
...
@@ -712,6 +722,7 @@ Configuration.prototype.getElementTypeTree = function () {
//prevent compartment subclass specific nodes and reaction subclass specific nodes
if
(
parentNode
.
data
===
undefined
||
(
parentNode
.
data
.
name
!==
"
Compartment
"
&&
parentNode
.
data
.
name
!==
"
Generic Reaction
"
))
{
parentNode
.
children
.
push
(
treeNode
);
parentNode
.
children
.
sort
(
sortFunction
);
}
}
}
...
...
frontend-js/src/test/js/Configuration-test.js
View file @
503d2b67
...
...
@@ -155,16 +155,40 @@ describe('Configuration', function () {
});
});
it
(
'
getElementTypeTree
'
,
function
()
{
describe
(
'
getElementTypeTree
'
,
function
()
{
it
(
'
default
'
,
function
()
{
return
ServerConnector
.
getConfiguration
().
then
(
function
(
configuration
)
{
var
treeData
=
configuration
.
getElementTypeTree
();
return
ServerConnector
.
getConfiguration
().
then
(
function
(
configuration
)
{
var
treeData
=
configuration
.
getElementTypeTree
();
assert
.
ok
(
treeData
);
assert
.
ok
(
treeData
.
text
);
assert
.
ok
(
treeData
.
children
);
assert
.
equal
(
2
,
treeData
.
children
.
length
);
})
assert
.
ok
(
treeData
);
assert
.
ok
(
treeData
.
text
);
assert
.
ok
(
treeData
.
children
);
assert
.
equal
(
2
,
treeData
.
children
.
length
);
})
});
it
(
'
check sorting
'
,
function
()
{
/**
*
* @param {BioEntityTypeTreeNode[]} children
*/
function
checkChildrenSorted
(
children
)
{
var
i
;
for
(
i
=
1
;
i
<
children
.
length
;
i
++
)
{
assert
.
ok
(
children
[
i
-
1
].
text
<
children
[
i
].
text
,
"
children are not sorted:
"
+
children
[
i
-
1
].
text
+
"
;
"
+
children
[
i
].
text
);
}
for
(
i
=
0
;
i
<
children
.
length
;
i
++
)
{
if
(
children
[
i
].
children
!=
null
)
{
checkChildrenSorted
(
children
[
i
].
children
);
}
}
}
return
ServerConnector
.
getConfiguration
().
then
(
function
(
configuration
)
{
var
treeData
=
configuration
.
getElementTypeTree
();
checkChildrenSorted
(
treeData
.
children
);
})
});
});
...
...
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