Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
urgi-is
FAIDARE
Commits
0def31cc
Commit
0def31cc
authored
Mar 18, 2019
by
Jérémy Destin
Committed by
Célia Michotey
Mar 19, 2019
Browse files
refactor: Rebase from master to add xref. Minor fixes.
GNP-5490
parent
9bf1df03
Changes
7
Hide whitespace changes
Inline
Side-by-side
frontend/package-lock.json
View file @
0def31cc
...
...
@@ -1189,6 +1189,11 @@
"integrity"
:
"sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
,
"dev"
:
true
},
"angular-mocks"
:
{
"version"
:
"1.7.8"
,
"resolved"
:
"https://registry.npmjs.org/angular-mocks/-/angular-mocks-1.7.8.tgz"
,
"integrity"
:
"sha512-LB13ESBT0eJrhQhfPXyLR9qm4LI9g44hyBFwUqZKEHEA4DpfxVTu0ONipiNoN0zWtmEAezA8u2gjcoaO2TStig=="
},
"ansi-colors"
:
{
"version"
:
"3.2.3"
,
"resolved"
:
"https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz"
,
...
...
@@ -1258,6 +1263,7 @@
"resolved"
:
"https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz"
,
"integrity"
:
"sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"delegates"
:
"^1.0.0"
,
"readable-stream"
:
"^2.0.6"
...
...
@@ -2458,7 +2464,8 @@
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz"
,
"integrity"
:
"sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"constants-browserify"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -2854,7 +2861,8 @@
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
,
"integrity"
:
"sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"depd"
:
{
"version"
:
"1.1.2"
,
...
...
@@ -3821,7 +3829,8 @@
"ansi-regex"
:
{
"version"
:
"2.1.1"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"aproba"
:
{
"version"
:
"1.2.0"
,
...
...
@@ -3842,12 +3851,14 @@
"balanced-match"
:
{
"version"
:
"1.0.0"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"brace-expansion"
:
{
"version"
:
"1.1.11"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"balanced-match"
:
"^1.0.0"
,
"concat-map"
:
"0.0.1"
...
...
@@ -3862,17 +3873,20 @@
"code-point-at"
:
{
"version"
:
"1.1.0"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"concat-map"
:
{
"version"
:
"0.0.1"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"console-control-strings"
:
{
"version"
:
"1.1.0"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"core-util-is"
:
{
"version"
:
"1.0.2"
,
...
...
@@ -3989,7 +4003,8 @@
"inherits"
:
{
"version"
:
"2.0.3"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"ini"
:
{
"version"
:
"1.3.5"
,
...
...
@@ -4001,6 +4016,7 @@
"version"
:
"1.0.0"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"number-is-nan"
:
"^1.0.0"
}
...
...
@@ -4015,6 +4031,7 @@
"version"
:
"3.0.4"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"brace-expansion"
:
"^1.1.7"
}
...
...
@@ -4022,12 +4039,14 @@
"minimist"
:
{
"version"
:
"0.0.8"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"minipass"
:
{
"version"
:
"2.3.5"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"safe-buffer"
:
"^5.1.2"
,
"yallist"
:
"^3.0.0"
...
...
@@ -4046,6 +4065,7 @@
"version"
:
"0.5.1"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"minimist"
:
"0.0.8"
}
...
...
@@ -4126,7 +4146,8 @@
"number-is-nan"
:
{
"version"
:
"1.0.1"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
...
...
@@ -4138,6 +4159,7 @@
"version"
:
"1.4.0"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"wrappy"
:
"1"
}
...
...
@@ -4223,7 +4245,8 @@
"safe-buffer"
:
{
"version"
:
"5.1.2"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"safer-buffer"
:
{
"version"
:
"2.1.2"
,
...
...
@@ -4259,6 +4282,7 @@
"version"
:
"1.0.2"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"code-point-at"
:
"^1.0.0"
,
"is-fullwidth-code-point"
:
"^1.0.0"
,
...
...
@@ -4278,6 +4302,7 @@
"version"
:
"3.0.1"
,
"bundled"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-regex"
:
"^2.0.0"
}
...
...
@@ -4321,12 +4346,14 @@
"wrappy"
:
{
"version"
:
"1.0.2"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"yallist"
:
{
"version"
:
"3.0.3"
,
"bundled"
:
true
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
}
}
},
...
...
@@ -4335,6 +4362,7 @@
"resolved"
:
"https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz"
,
"integrity"
:
"sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"graceful-fs"
:
"^4.1.2"
,
"inherits"
:
"~2.0.0"
,
...
...
@@ -4347,6 +4375,7 @@
"resolved"
:
"https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz"
,
"integrity"
:
"sha1-LANAXHU4w51+s3sxcCLjJfsBi/c="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"aproba"
:
"^1.0.3"
,
"console-control-strings"
:
"^1.0.0"
,
...
...
@@ -4384,7 +4413,8 @@
"version"
:
"4.0.1"
,
"resolved"
:
"https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
,
"integrity"
:
"sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"get-stream"
:
{
"version"
:
"3.0.0"
,
...
...
@@ -4564,7 +4594,8 @@
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz"
,
"integrity"
:
"sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"has-value"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -5284,7 +5315,8 @@
"version"
:
"0.2.1"
,
"resolved"
:
"https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz"
,
"integrity"
:
"sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"is-windows"
:
{
"version"
:
"1.0.2"
,
...
...
@@ -5927,6 +5959,7 @@
"resolved"
:
"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz"
,
"integrity"
:
"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"graceful-fs"
:
"^4.1.2"
,
"parse-json"
:
"^2.2.0"
,
...
...
@@ -5939,7 +5972,8 @@
"version"
:
"2.3.0"
,
"resolved"
:
"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
,
"integrity"
:
"sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
}
}
},
...
...
@@ -6214,7 +6248,8 @@
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz"
,
"integrity"
:
"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
},
"map-visit"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -6862,6 +6897,7 @@
"resolved"
:
"https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz"
,
"integrity"
:
"sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"are-we-there-yet"
:
"~1.1.2"
,
"console-control-strings"
:
"~1.1.0"
,
...
...
@@ -7868,6 +7904,7 @@
"resolved"
:
"https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz"
,
"integrity"
:
"sha1-9f+qXs0pyzHAR0vKfXVra7KePyg="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"load-json-file"
:
"^1.0.0"
,
"normalize-package-data"
:
"^2.3.2"
,
...
...
@@ -7879,6 +7916,7 @@
"resolved"
:
"https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz"
,
"integrity"
:
"sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"graceful-fs"
:
"^4.1.2"
,
"pify"
:
"^2.0.0"
,
...
...
@@ -7889,7 +7927,8 @@
"version"
:
"2.3.0"
,
"resolved"
:
"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
,
"integrity"
:
"sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
,
"dev"
:
true
"dev"
:
true
,
"optional"
:
true
}
}
},
...
...
@@ -7898,6 +7937,7 @@
"resolved"
:
"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz"
,
"integrity"
:
"sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"find-up"
:
"^1.0.0"
,
"read-pkg"
:
"^1.0.0"
...
...
@@ -7908,6 +7948,7 @@
"resolved"
:
"https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz"
,
"integrity"
:
"sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"path-exists"
:
"^2.0.0"
,
"pinkie-promise"
:
"^2.0.0"
...
...
@@ -7918,6 +7959,7 @@
"resolved"
:
"https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz"
,
"integrity"
:
"sha1-D+tsZPD8UY2adU3V77YscCJ2H0s="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"pinkie-promise"
:
"^2.0.0"
}
...
...
@@ -9192,6 +9234,7 @@
"resolved"
:
"https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz"
,
"integrity"
:
"sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"is-utf8"
:
"^0.2.0"
}
...
...
@@ -10548,6 +10591,7 @@
"resolved"
:
"https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz"
,
"integrity"
:
"sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"string-width"
:
"^1.0.2 || 2"
}
...
...
frontend/package.json
View file @
0def31cc
...
...
@@ -24,6 +24,7 @@
"@ng-bootstrap/ng-bootstrap"
:
"4.0.0"
,
"@types/leaflet"
:
"1.2.14"
,
"@types/leaflet.markercluster"
:
"1.0.3"
,
"angular-mocks"
:
"1.7.8"
,
"bootstrap"
:
"4.1.3"
,
"core-js"
:
"2.5.7"
,
"font-awesome"
:
"4.7.0"
,
...
...
frontend/src/app/card-section/card-section.component.scss
View file @
0def31cc
...
...
@@ -12,6 +12,6 @@ a {
font-size
:
large
;
font-weight
:
bold
;
color
:
#f5f5f5
;
background-
color
:
#0f6191
;
background-
image
:repeating-linear-gradient
(
#0f96cd
,
#0f6191
,
#0f76a5
)
;
}
frontend/src/app/germplasm-card/germplasm-card.component.html
View file @
0def31cc
...
...
@@ -849,10 +849,6 @@
</ng-template>
</gpds-card-section>
</div>
<!--XRefs part -->
<gpds-xrefs
[xrefId]=
"germplasmGnpis.germplasmPUI"
></gpds-xrefs>
</ng-container>
...
...
frontend/src/app/germplasm-card/germplasm-card.component.spec.ts
View file @
0def31cc
...
...
@@ -17,13 +17,6 @@ import { MapComponent } from '../map/map.component';
import
{
BrapiGermplasmAttributes
,
BrapiGermplasmPedigree
,
BrapiResult
,
BrapiSibling
}
from
'
../models/brapi.model
'
;
import
{
Donor
,
Germplasm
,
GermplasmInstitute
,
GermplasmSet
,
Institute
,
Site
}
from
'
../models/gnpis.model
'
;
import
{
DataDiscoverySource
}
from
'
../models/data-discovery.model
'
;
import
{
BrapiGermplasmAttributes
,
BrapiGermplasmPedigree
,
BrapiResult
,
BrapiSibling
}
from
"
../models/brapi.model
"
;
import
{
Donor
,
Germplasm
,
GermplasmInstitute
,
GermplasmSet
,
Institute
,
Site
}
from
"
../models/gnpis.model
"
;
import
{
MockComponent
}
from
'
ng-mocks
'
;
import
{
XrefsComponent
}
from
'
../xrefs/xrefs.component
'
;
...
...
@@ -215,8 +208,7 @@ describe('GermplasmCardComponent', () => {
TestBed
.
configureTestingModule
({
imports
:
[
RouterTestingModule
,
NgbPopoverModule
,
MomentModule
],
declarations
:
[
GermplasmCardComponent
,
LoadingSpinnerComponent
,
MockComponent
(
XrefsComponent
)
GermplasmCardComponent
,
CardSectionComponent
,
GermplasmCardComponent
,
LoadingSpinnerComponent
,
MockComponent
(
XrefsComponent
),
CardSectionComponent
,
CardRowComponent
,
LoadingSpinnerComponent
,
CardTableComponent
,
MapComponent
],
providers
:
[
...
...
frontend/src/app/gnpis.service.spec.ts
View file @
0def31cc
import
{
BASE_URL
,
BASE_URL_GERMPLASM
,
GnpisService
}
from
'
./gnpis.service
'
;
import
{
BASE_URL
,
GnpisService
}
from
'
./gnpis.service
'
;
import
{
BrapiMetaData
,
BrapiResults
}
from
'
./models/brapi.model
'
;
import
{
DataDiscoveryCriteria
,
DataDiscoverySource
}
from
'
./models/data-discovery.model
'
;
import
{
HttpClientTestingModule
,
HttpTestingController
}
from
'
@angular/common/http/testing
'
;
...
...
@@ -134,7 +134,7 @@ describe('GnpisService', () => {
const
req
=
http
.
expectOne
({
method
:
'
GET
'
,
url
:
`
${
BASE_URL
}
/sources`
url
:
`
${
BASE_URL
}
/
datadiscovery/
sources`
});
req
.
flush
(
sources
);
...
...
@@ -157,7 +157,7 @@ describe('GnpisService', () => {
});
const
req
=
http
.
expectOne
({
url
:
`
${
BASE_URL
}
/suggest?field=
${
field
}
&text=
${
text
}
&fetchSize=
${
fetchSize
}
`
,
url
:
`
${
BASE_URL
}
/
datadiscovery/
suggest?field=
${
field
}
&text=
${
text
}
&fetchSize=
${
fetchSize
}
`
,
method
:
'
POST
'
});
req
.
flush
(
expectedSuggestions
);
...
...
@@ -173,7 +173,7 @@ describe('GnpisService', () => {
gnpisService
.
germplasm
(
germplasmDbId
).
subscribe
(
response
=>
{
fetchedGermplasm
=
response
;
});
http
.
expectOne
(
`
${
BASE_URL
_GERMPLASM
}
/germplasm?id=
${
germplasmDbId
}
`
)
http
.
expectOne
(
`
${
BASE_URL
}
/germplasm?id=
${
germplasmDbId
}
`
)
.
flush
(
germplasmTest
);
expect
(
fetchedGermplasm
).
toEqual
(
germplasmTest
);
...
...
@@ -213,7 +213,7 @@ describe('GnpisService', () => {
});
const
req
=
http
.
expectOne
({
url
:
`
${
BASE_URL
}
/search`
,
url
:
`
${
BASE_URL
}
/
datadiscovery/
search`
,
method
:
'
POST
'
});
req
.
flush
(
rawResult
);
...
...
frontend/src/app/gnpis.service.ts
View file @
0def31cc
...
...
@@ -8,8 +8,7 @@ import { Germplasm } from './models/gnpis.model';
import
{
XrefResponse
}
from
'
./models/xref.model
'
;
export
const
BASE_URL
=
'
gnpis/v1/datadiscovery
'
;
export
const
BASE_URL_GERMPLASM
=
'
gnpis/v1
'
;
export
const
BASE_URL
=
'
gnpis/v1
'
;
@
Injectable
({
providedIn
:
'
root
'
...
...
@@ -22,7 +21,7 @@ export class GnpisService {
}
private
fetchSources
():
void
{
this
.
http
.
get
(
`
${
BASE_URL
}
/sources`
).
subscribe
(
this
.
http
.
get
(
`
${
BASE_URL
}
/
datadiscovery/
sources`
).
subscribe
(
(
response
:
BrapiResults
<
DataDiscoverySource
>
)
=>
{
const
sourceByURI
=
{};
for
(
const
source
of
response
.
result
.
data
)
{
...
...
@@ -49,7 +48,7 @@ export class GnpisService {
):
Observable
<
string
[]
>
{
const
params
=
{
field
,
text
,
fetchSize
:
fetchSize
.
toString
()
};
return
this
.
http
.
post
<
string
[]
>
(
`
${
BASE_URL
}
/suggest`
,
criteria
,
{
params
}
`
${
BASE_URL
}
/
datadiscovery/
suggest`
,
criteria
,
{
params
}
);
}
...
...
@@ -65,7 +64,7 @@ export class GnpisService {
// Get source by URI
this
.
sourceByURI$
,
// Get documents by criteria
this
.
http
.
post
<
any
>
(
`
${
BASE_URL
}
/search`
,
criteria
)
this
.
http
.
post
<
any
>
(
`
${
BASE_URL
}
/
datadiscovery/
search`
,
criteria
)
).
pipe
(
map
(([
sourceByURI
,
response
])
=>
{
// Extract BrAPI documents from result
const
documents
=
response
.
result
.
data
;
...
...
@@ -94,11 +93,11 @@ export class GnpisService {
}
germplasm
(
germplasmDbId
:
string
):
Observable
<
Germplasm
>
{
return
this
.
http
.
get
<
Germplasm
>
(
`
${
BASE_URL
_GERMPLASM
}
/germplasm?id=
${
germplasmDbId
}
`
);
return
this
.
http
.
get
<
Germplasm
>
(
`
${
BASE_URL
}
/germplasm?id=
${
germplasmDbId
}
`
);
}
germplasmByPuid
(
pui
:
string
):
Observable
<
Germplasm
>
{
return
this
.
http
.
get
<
Germplasm
>
(
`
${
BASE_URL
_GERMPLASM
}
/germplasm?pui=
${
pui
}
`
);
return
this
.
http
.
get
<
Germplasm
>
(
`
${
BASE_URL
}
/germplasm?pui=
${
pui
}
`
);
}
/**
...
...
@@ -109,7 +108,7 @@ export class GnpisService {
}
xref
(
xrefId
:
string
):
Observable
<
XrefResponse
>
{
return
this
.
http
.
get
<
XrefResponse
>
(
`
gnpis/v1
/xref/documentbyfulltextid?linkedRessourcesID=
${
xrefId
}
`
);
return
this
.
http
.
get
<
XrefResponse
>
(
`
${
BASE_URL
}
/xref/documentbyfulltextid?linkedRessourcesID=
${
xrefId
}
`
);
}
}
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