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
33e4a35c
Commit
33e4a35c
authored
Aug 28, 2019
by
Piotr Gawron
Browse files
Merge branch '917-overlay-type' into 'devel_13.2.x'
Resolve "MINERVANET - Error Report 106" See merge request
minerva/core!921
parents
a1e42577
52d9ef3c
Pipeline
#13332
passed with stage
in 9 minutes and 5 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
33e4a35c
minerva
(
13.2.0
)
stable
;
urgency
=
medium
*
Bug
fix
:
search
by
drugs
didn
't check synonyms in chembl database
*
Bug
fix
:
search
by
drugs
didn
't check synonyms in chembl database
* Bug fix: verification of overlay type added (#917)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 21 Aug 2019 17:00:00 +0200
...
...
frontend-js/src/main/js/gui/AddOverlayDialog.js
View file @
33e4a35c
...
...
@@ -163,6 +163,9 @@ AddOverlayDialog.prototype.processFile = function (file) {
descriptionInput
.
value
=
overlay
.
getDescription
();
}
if
(
overlay
.
getType
()
!==
undefined
)
{
if
(
$
(
"
option[value='
"
+
overlay
.
getType
()
+
"
']
"
,
typeSelect
).
length
===
0
)
{
GuiConnector
.
warn
(
"
Invalid type:
"
+
overlay
.
getType
());
}
typeSelect
.
val
(
overlay
.
getType
());
}
if
(
overlayParser
.
containsMixedNewLineCharacters
(
evt
.
target
.
result
))
{
...
...
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
View file @
33e4a35c
...
...
@@ -104,7 +104,14 @@ public class ColorSchemaReader {
return
readGenericColorSchema
(
colorInputStream
);
}
}
else
{
ColorSchemaType
type
=
ColorSchemaType
.
valueOf
(
params
.
get
(
ZipEntryFileFactory
.
LAYOUT_HEADER_PARAM_TYPE
));
ColorSchemaType
type
=
null
;
try
{
type
=
ColorSchemaType
.
valueOf
(
params
.
get
(
ZipEntryFileFactory
.
LAYOUT_HEADER_PARAM_TYPE
));
}
catch
(
IllegalArgumentException
e
)
{
String
options
=
StringUtils
.
join
(
ColorSchemaType
.
values
(),
", "
);
throw
new
InvalidColorSchemaException
(
"Invalid overlay type: "
+
params
.
get
(
ZipEntryFileFactory
.
LAYOUT_HEADER_PARAM_TYPE
)
+
". Allowed options: "
+
options
);
}
if
(
type
==
null
)
{
logger
.
warn
(
"Unknown type of layout file: "
+
params
.
get
(
ZipEntryFileFactory
.
LAYOUT_HEADER_PARAM_TYPE
));
return
readGenericColorSchema
(
colorInputStream
);
...
...
service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderTest.java
View file @
33e4a35c
...
...
@@ -480,5 +480,14 @@ public class ColorSchemaReaderTest extends ServiceTestFunctions {
}
}
@Test
(
expected
=
InvalidColorSchemaException
.
class
)
public
void
testReadColorSchemaWithInvalidType
()
throws
Exception
{
FileInputStream
fis
=
new
FileInputStream
(
"testFiles/coloring/invalidType.txt"
);
FileInputStream
fis2
=
new
FileInputStream
(
"testFiles/coloring/invalidType.txt"
);
ColorSchemaReader
reader
=
new
ColorSchemaReader
();
reader
.
readColorSchema
(
fis
,
TextFileUtils
.
getHeaderParametersFromFile
(
fis2
));
}
}
service/testFiles/coloring/invalidType.txt
0 → 100644
View file @
33e4a35c
#TYPE=gen
value identifier Chebi
-0,943978048 HGNC:11138
-0,941309505 CHEBI:15377
1 CHEBI:15376
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