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
503d2b67
Commit
503d2b67
authored
5 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
sort of protein type fixed
parent
99910708
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!805
Merge 13.1.0 beta.1
,
!791
Resolve "Sort the lists of annotators in Select annotators and Select valid annotators"
Pipeline
#10505
failed
5 years ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
frontend-js/src/main/js/Configuration.js
+11
-0
11 additions, 0 deletions
frontend-js/src/main/js/Configuration.js
frontend-js/src/test/js/Configuration-test.js
+32
-8
32 additions, 8 deletions
frontend-js/src/test/js/Configuration-test.js
with
45 additions
and
8 deletions
CHANGELOG
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/main/js/Configuration.js
+
11
−
0
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
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/test/js/Configuration-test.js
+
32
−
8
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
);
})
});
});
...
...
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