Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
urgi-is
FAIDARE
Commits
702203b0
Verified
Commit
702203b0
authored
Nov 24, 2020
by
Raphaël Flores
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ahead on xref fields renaming.
GNP-5564
.
parent
58e7c9b9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
34 additions
and
34 deletions
+34
-34
backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java
...a/urgi/faidare/api/faidare/v1/XRefDocumentController.java
+3
-3
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java
...java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java
+1
-1
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java
.../urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java
+7
-7
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java
...java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java
+4
-4
backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java
...rgi/faidare/repository/es/XRefDocumentRepositoryTest.java
+4
-4
backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/xref_mapping.json
.../urgi/faidare/repository/es/setup/index/xref_mapping.json
+3
-3
frontend/src/app/gnpis.service.ts
frontend/src/app/gnpis.service.ts
+2
-2
frontend/src/app/models/xref.model.ts
frontend/src/app/models/xref.model.ts
+3
-3
frontend/src/app/xrefs/xrefs.component.html
frontend/src/app/xrefs/xrefs.component.html
+2
-2
frontend/src/app/xrefs/xrefs.component.spec.ts
frontend/src/app/xrefs/xrefs.component.spec.ts
+5
-5
No files found.
backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java
View file @
702203b0
...
...
@@ -31,12 +31,12 @@ public class XRefDocumentController {
@ApiOperation
(
"Find xref documents"
)
@GetMapping
(
value
=
"/faidare/v1/xref/documentbyfulltextid"
)
public
PaginatedList
<
XRefDocumentVO
>
documentByFullTextId
(
@RequestParam
(
required
=
false
,
value
=
"entry
_t
ype"
)
String
entryType
,
@RequestParam
(
required
=
false
)
List
<
String
>
linkedRes
s
ourcesID
@RequestParam
(
required
=
false
,
value
=
"entry
T
ype"
)
String
entryType
,
@RequestParam
(
required
=
false
)
List
<
String
>
linkedResourcesID
)
{
XRefDocumentSearchCriteria
criteria
=
new
XRefDocumentSearchCriteria
();
criteria
.
setEntryType
(
entryType
);
criteria
.
setLinkedRes
s
ourcesID
(
linkedRes
s
ourcesID
);
criteria
.
setLinkedResourcesID
(
linkedResourcesID
);
return
repository
.
find
(
criteria
);
}
...
...
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java
View file @
702203b0
...
...
@@ -5,7 +5,7 @@ package fr.inra.urgi.faidare.domain.xref;
*/
public
enum
DocumentFields
{
ENTRY_TYPE
(
"entry
_t
ype"
),
LINKEDRES
S
OURCESID
(
"linkedRes
s
ourcesID"
);
ENTRY_TYPE
(
"entry
T
ype"
),
LINKED
_
RESOURCES
_
ID
(
"linkedResourcesID"
);
private
String
field
;
...
...
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java
View file @
702203b0
...
...
@@ -12,11 +12,11 @@ import java.util.List;
@CriteriaForDocument
(
XRefDocumentVO
.
class
)
public
class
XRefDocumentSearchCriteria
extends
PaginationCriteriaImpl
{
@DocumentPath
(
"entry
_t
ype"
)
@DocumentPath
(
"entry
T
ype"
)
private
String
entryType
;
@DocumentPath
(
"linkedRes
s
ourcesID"
)
private
List
<
String
>
linkedRes
s
ourcesID
;
@DocumentPath
(
"linkedResourcesID"
)
// pragma: allowlist secret
private
List
<
String
>
linkedResourcesID
;
public
String
getEntryType
()
{
return
entryType
;
...
...
@@ -26,11 +26,11 @@ public class XRefDocumentSearchCriteria extends PaginationCriteriaImpl {
this
.
entryType
=
entryType
;
}
public
List
<
String
>
getLinkedRes
s
ourcesID
()
{
return
linkedRes
s
ourcesID
;
public
List
<
String
>
getLinkedResourcesID
()
{
return
linkedResourcesID
;
}
public
void
setLinkedRes
s
ourcesID
(
List
<
String
>
linkedRes
s
ourcesID
)
{
this
.
linkedRes
s
ourcesID
=
linkedRes
s
ourcesID
;
public
void
setLinkedResourcesID
(
List
<
String
>
linkedResourcesID
)
{
this
.
linkedResourcesID
=
linkedResourcesID
;
}
}
backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java
View file @
702203b0
...
...
@@ -24,7 +24,7 @@ public class XRefDocumentVO {
private
String
databaseName
;
@JsonProperty
(
"identifier"
)
private
String
dbId
;
private
String
identifier
;
@JsonProperty
(
"name"
)
private
String
name
;
...
...
@@ -65,11 +65,11 @@ public class XRefDocumentVO {
}
public
String
getIdentifier
()
{
return
dbId
;
return
identifier
;
}
public
void
setIdentifier
(
String
dbId
)
{
this
.
dbId
=
dbId
;
public
void
setIdentifier
(
String
identifier
)
{
this
.
identifier
=
identifier
;
}
public
String
getName
()
{
...
...
backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java
View file @
702203b0
...
...
@@ -61,13 +61,13 @@ class XRefDocumentRepositoryTest {
@Test
void
should_Find_By_Linked_Id
()
{
String
id
=
"ID2"
;
List
<
String
>
linkedRes
s
ourcesID
=
Collections
.
singletonList
(
id
);
String
id
=
"ID2"
;
List
<
String
>
linkedResourcesID
=
Collections
.
singletonList
(
id
);
XRefDocumentSearchCriteria
criteria
=
new
XRefDocumentSearchCriteria
();
criteria
.
setLinkedRes
s
ourcesID
(
linkedRes
s
ourcesID
);
criteria
.
setLinkedResourcesID
(
linkedResourcesID
);
PaginatedList
<
XRefDocumentVO
>
documents
=
repository
.
find
(
criteria
);
assertThat
(
documents
).
isNotNull
().
hasSize
(
2
)
.
flatExtracting
(
"linkedRes
s
ourcesID"
)
.
flatExtracting
(
"linkedResourcesID"
)
.
contains
(
id
);
}
...
...
backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/
transplant
_mapping.json
→
backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/
xref
_mapping.json
View file @
702203b0
{
"
transplant
"
:
{
"
xref
"
:
{
"dynamic"
:
"true"
,
"properties"
:
{
"entry
_t
ype"
:
{
"entry
T
ype"
:
{
"type"
:
"keyword"
},
"linkedRes
s
ourcesID"
:
{
"linkedResourcesID"
:
{
"type"
:
"keyword"
}
}
...
...
frontend/src/app/gnpis.service.ts
View file @
702203b0
...
...
@@ -24,7 +24,7 @@ export const BASE_URL = 'faidare/v1';
providedIn
:
'
root
'
})
export
class
GnpisService
{
static
URGI_SOURCE_URI
=
'
https://urgi.versailles.inra.fr
'
;
static
URGI_SOURCE_URI
=
'
https://urgi.versailles.inra
e
.fr
'
;
sourceByURI$
=
new
ReplaySubject
<
Record
<
string
,
DataDiscoverySource
>>
(
1
);
sources$
=
new
ReplaySubject
<
DataDiscoverySource
[]
>
(
1
);
...
...
@@ -136,7 +136,7 @@ export class GnpisService {
}
xref
(
xrefId
:
string
):
Observable
<
XrefResponse
>
{
return
this
.
http
.
get
<
XrefResponse
>
(
`
${
BASE_URL
}
/xref/documentbyfulltextid?linkedRes
s
ourcesID=
${
xrefId
}
`
);
return
this
.
http
.
get
<
XrefResponse
>
(
`
${
BASE_URL
}
/xref/documentbyfulltextid?linkedResourcesID=
${
xrefId
}
`
);
}
// TODO Change the service's response to return an object with the number of results and handle here if the number is over the limit
...
...
frontend/src/app/models/xref.model.ts
View file @
702203b0
...
...
@@ -2,9 +2,9 @@ export interface XrefModel {
url
:
string
;
description
:
string
;
database
_n
ame
:
string
;
entry
_t
ype
:
string
;
db_version
:
string
;
database
N
ame
:
string
;
entry
T
ype
:
string
;
identifier
:
string
;
name
:
string
;
}
...
...
frontend/src/app/xrefs/xrefs.component.html
View file @
702203b0
...
...
@@ -13,8 +13,8 @@
<ng-template
let-crossRef
>
<tr>
<td><a
[href]=
"crossRef.url"
target=
"_blank"
>
{{ crossRef.name }}
</a></td>
<td>
{{ crossRef.database
_n
ame }}
</td>
<td>
{{ crossRef.entry
_t
ype }}
</td>
<td>
{{ crossRef.database
N
ame }}
</td>
<td>
{{ crossRef.entry
T
ype }}
</td>
<td>
{{ crossRef.description | slice:0:120 }}...
</td>
</tr>
</ng-template>
...
...
frontend/src/app/xrefs/xrefs.component.spec.ts
View file @
702203b0
...
...
@@ -35,9 +35,9 @@ describe('XrefsComponent', () => {
url
:
'
https://urgi.versailles.inra.fr/association/association/viewer.do#results/analysisIds=1808038
'
,
description
:
'
Col-Fa-b*_MLM+Q+K is a GWASd anté paneCol-Fa-b*_MLM+Q+K is aGAS anlysis involving CC_Qualité
'
+
'
djs dsqdsq djsqpodsjqodsqdsqkpdqpdWOLOLOLOOOOOOOsqpkdsqkdsqkdsqdsdsqdsqdsqddsqffjùsodfusjùfsfsd
'
,
database
_n
ame
:
'
GnpIS
'
,
entry
_t
ype
:
'
GWAS analysis
'
,
db_version
:
'
GWAS_ANALYSIS_1808038_1
'
,
database
N
ame
:
'
GnpIS
'
,
entry
T
ype
:
'
GWAS analysis
'
,
identifier
:
'
GWAS_ANALYSIS_1808038_1
'
,
name
:
'
Col-Fa-b*_MLM+Q+K
'
}];
...
...
@@ -64,8 +64,8 @@ describe('XrefsComponent', () => {
expect
(
tester
.
cardHeader
).
toContainText
(
'
Cross References
'
);
expect
(
tester
.
columns
[
0
]).
toContainText
(
xref
[
0
].
name
);
expect
(
tester
.
columns
[
1
]).
toContainText
(
xref
[
0
].
database
_n
ame
);
expect
(
tester
.
columns
[
2
]).
toContainText
(
xref
[
0
].
entry
_t
ype
);
expect
(
tester
.
columns
[
1
]).
toContainText
(
xref
[
0
].
database
N
ame
);
expect
(
tester
.
columns
[
2
]).
toContainText
(
xref
[
0
].
entry
T
ype
);
expect
(
tester
.
columns
[
3
].
textContent
.
length
).
toBeLessThanOrEqual
(
124
);
}));
...
...
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