Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Website
Commits
8839204a
Commit
8839204a
authored
Jan 29, 2019
by
Matija Obreza
Browse files
Pretty filters translations improved
parent
4c03e623
Changes
6
Hide whitespace changes
Inline
Side-by-side
locales/en/translations.json
View file @
8839204a
...
...
@@ -30,6 +30,10 @@
},
"prettyF"
:
{
"NOT"
:
"Excluding {{what}}"
,
"le"
:
"{{what}} ≤"
,
"ge"
:
"{{what}} ≥"
,
"lt"
:
"{{what}} <"
,
"gt"
:
"{{what}} >"
,
"accessions"
:
{
"crop"
:
"Crop"
,
"acceNumb"
:
"Accession number"
,
...
...
@@ -39,7 +43,14 @@
"geo"
:
{
"latitude"
:
"Latitude"
,
"longitude"
:
"Longitude"
,
"elevation"
:
"Elevation"
"elevation"
:
"Elevation"
,
"climate"
:
{
"bio2"
:
"Mean diurnal range"
,
"bio3"
:
"Isothermality"
,
"bio4"
:
"Temperature seasonality"
,
"bio7"
:
"Temperature annual range [°c]"
,
"bio15"
:
"Precipitation seasonality"
}
},
"holder"
:
{
"code"
:
"Holder"
,
...
...
@@ -48,11 +59,6 @@
"region"
:
"Holder region"
}
},
"lastModifiedDate"
:
{
""
:
"Last updated"
,
"ge"
:
"Updated after"
,
"le"
:
"Updated before"
},
"taxa"
:
{
"genus"
:
"Genus"
,
"species"
:
"Species"
,
...
...
@@ -415,25 +421,25 @@
"map"
:
"Map"
},
"climate"
:
{
"bio1"
:
"Annual
M
ean
T
emperature [°
C
]"
,
"bio2"
:
"Mean
D
iurnal
R
ange (
M
ean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (
BIO2/BIO
7) (* 100)"
,
"bio4"
:
"Temperature
S
easonality (standard deviation *100)"
,
"bio5"
:
"Max
T
emperature of
W
armest
M
onth [°
C
]"
,
"bio6"
:
"Min
T
emperature of
C
oldest
M
onth [°
C
]"
,
"bio7"
:
"Temperature
A
nnual
R
ange (
BIO5-BIO
6) [°
C
]"
,
"bio8"
:
"Mean
T
emperature of
W
ettest
Q
uarter [°
C
]"
,
"bio9"
:
"Mean
T
emperature of
D
riest
Q
uarter [°
C
]"
,
"bio10"
:
"Mean
T
emperature of
W
armest
Q
uarter [°
C
]"
,
"bio11"
:
"Mean
T
emperature of
C
oldest
Q
uarter [°
C
]"
,
"bio12"
:
"Annual
P
recipitation [mm]"
,
"bio13"
:
"Precipitation of
W
ettest
M
onth [mm]"
,
"bio14"
:
"Precipitation of
D
riest
M
onth [mm]"
,
"bio15"
:
"Precipitation
S
easonality (
C
oefficient of
V
ariation)"
,
"bio16"
:
"Precipitation of
W
ettest
Q
uarter [mm]"
,
"bio17"
:
"Precipitation of
D
riest
Q
uarter [mm]"
,
"bio18"
:
"Precipitation of
W
armest
Q
uarter [mm]"
,
"bio19"
:
"Precipitation of
C
oldest
Q
uarter [mm]"
,
"bio1"
:
"Annual
m
ean
t
emperature [°
c
]"
,
"bio2"
:
"Mean
d
iurnal
r
ange (
m
ean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (
bio2/bio
7) (* 100)"
,
"bio4"
:
"Temperature
s
easonality (standard deviation *100)"
,
"bio5"
:
"Max
t
emperature of
w
armest
m
onth [°
c
]"
,
"bio6"
:
"Min
t
emperature of
c
oldest
m
onth [°
c
]"
,
"bio7"
:
"Temperature
a
nnual
r
ange (
bio5-bio
6) [°
c
]"
,
"bio8"
:
"Mean
t
emperature of
w
ettest
q
uarter [°
c
]"
,
"bio9"
:
"Mean
t
emperature of
d
riest
q
uarter [°
c
]"
,
"bio10"
:
"Mean
t
emperature of
w
armest
q
uarter [°
c
]"
,
"bio11"
:
"Mean
t
emperature of
c
oldest
q
uarter [°
c
]"
,
"bio12"
:
"Annual
p
recipitation [mm]"
,
"bio13"
:
"Precipitation of
w
ettest
m
onth [mm]"
,
"bio14"
:
"Precipitation of
d
riest
m
onth [mm]"
,
"bio15"
:
"Precipitation
s
easonality (
c
oefficient of
v
ariation)"
,
"bio16"
:
"Precipitation of
w
ettest
q
uarter [mm]"
,
"bio17"
:
"Precipitation of
d
riest
q
uarter [mm]"
,
"bio18"
:
"Precipitation of
w
armest
q
uarter [mm]"
,
"bio19"
:
"Precipitation of
c
oldest
q
uarter [mm]"
,
"monthlyPrecipitation"
:
"Monthly precipitation"
,
"precipitation"
:
"Precipitation"
,
"monthlyTemp"
:
"Monthly temperature"
,
...
...
@@ -461,7 +467,7 @@
"12"
:
"Dec"
}
},
"
common
"
:
{
"
model
"
:
{
"modelName"
:
"Accession"
,
"modelName_plural"
:
"Accessions"
,
"menu"
:
"Accessions"
,
...
...
@@ -476,7 +482,148 @@
"doi"
:
"DOI"
,
"sampStat"
:
"Biological status of accession"
,
"storageType"
:
"Type of germplasm storage"
,
"lastModifiedDate"
:
"Last updated"
,
"createdDate"
:
"First uploaded"
,
"alias"
:
{
"OTHERNUMB"
:
"Other identifier"
,
"ACCENAME"
:
"Accession name"
,
"DONORNUMB"
:
"Donor accession number"
,
"COLLNUMB"
:
"Collecting number"
},
"available"
:
{
"true"
:
"Available for distribution"
,
"false"
:
"Not available for distribution"
,
"1"
:
"Available for distribution"
,
"0"
:
"Not available for distribution"
,
"null"
:
"Availability not provided"
},
"sgsv"
:
{
"true"
:
"Backed up in SGSV"
,
"false"
:
"Not in SGSV"
,
"1"
:
"Backed up in SGSV"
,
"0"
:
"Not in SGSV"
},
"mlsStatus"
:
{
"true"
:
"Accession is part of the Multi-lateral system of ITPGRFA"
,
"false"
:
"Not declared in the Multi-lateral system of ITPGRFA"
,
"1"
:
"Accession is part of the Multi-lateral system of ITPGRFA"
,
"0"
:
"Not declared in the Multi-lateral system of ITPGRFA"
,
"null"
:
"Status not provided"
},
"coll"
:
{
"collCode"
:
"Collecting institute code"
,
"collNumb"
:
"Collecting number"
,
"collDate"
:
"Collecting date of sample"
,
"collMissId"
:
"Collecting mission identifier"
,
"collName"
:
"Collecting institute name"
,
"collSite"
:
"Location of collecting site"
,
"collSrc"
:
"Collecting source"
},
"geo"
:
{
"latitude"
:
"Latitude of collecting site"
,
"longitude"
:
"Longitude of collecting site"
,
"uncertainty"
:
"Coordinate uncertainty"
,
"datum"
:
"Geodetic datum"
,
"method"
:
"Georeferencing method"
,
"elevation"
:
"Elevation of collecting site"
,
"climate"
:
{
"bio1"
:
"Annual mean temperature [°c]"
,
"bio2"
:
"Mean diurnal range (mean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (bio2/bio7) (* 100)"
,
"bio4"
:
"Temperature seasonality (standard deviation *100)"
,
"bio5"
:
"Max temperature of warmest month [°c]"
,
"bio6"
:
"Min temperature of coldest month [°c]"
,
"bio7"
:
"Temperature annual range (bio5-bio6) [°c]"
,
"bio8"
:
"Mean temperature of wettest quarter [°c]"
,
"bio9"
:
"Mean temperature of driest quarter [°c]"
,
"bio10"
:
"Mean temperature of warmest quarter [°c]"
,
"bio11"
:
"Mean temperature of coldest quarter [°c]"
,
"bio12"
:
"Annual precipitation [mm]"
,
"bio13"
:
"Precipitation of wettest month [mm]"
,
"bio14"
:
"Precipitation of driest month [mm]"
,
"bio15"
:
"Precipitation seasonality (coefficient of variation)"
,
"bio16"
:
"Precipitation of wettest quarter [mm]"
,
"bio17"
:
"Precipitation of driest quarter [mm]"
,
"bio18"
:
"Precipitation of warmest quarter [mm]"
,
"bio19"
:
"Precipitation of coldest quarter [mm]"
}
},
"storage"
:
{
"10"
:
"Seed collection"
,
"11"
:
"Short term seed collection"
,
"12"
:
"Medium term seed collection"
,
"13"
:
"Long term seed collection"
,
"20"
:
"Field collection"
,
"30"
:
"In vitro collection"
,
"40"
:
"Cryopreserved collection"
,
"50"
:
"DNA collection"
,
"99"
:
"Other"
},
"sampleStatus"
:
{
"100"
:
"Wild"
,
"110"
:
"Natural"
,
"120"
:
"Semi-natural/wild"
,
"130"
:
"Semi-natural/sown"
,
"200"
:
"Weedy"
,
"300"
:
"Traditional cultivar/Landrace"
,
"400"
:
"Breeding/Research Material"
,
"410"
:
"Breeders Line"
,
"411"
:
"Synthetic population"
,
"412"
:
"Hybrid"
,
"413"
:
"Founder stock/base population"
,
"414"
:
"Inbred line"
,
"415"
:
"Segregating population"
,
"416"
:
"Clonal selection"
,
"420"
:
"Genetic stock"
,
"421"
:
"Mutant"
,
"422"
:
"Cytogenetic stocks"
,
"423"
:
"Other genetic stocks"
,
"500"
:
"Advanced/improved cultivar"
,
"600"
:
"GMO"
,
"999"
:
"Other"
},
"collectingSource"
:
{
"10"
:
"Wild habitat"
,
"11"
:
"Forest or woodland"
,
"12"
:
"Shrubland"
,
"13"
:
"Grassland"
,
"14"
:
"Desert or tundra"
,
"15"
:
"Aquatic habitat"
,
"20"
:
"Field or cultivated habitat"
,
"21"
:
"Field"
,
"22"
:
"Orchard"
,
"23"
:
"Backyard, kitchen or home garden (urban, peri-urban or rural)"
,
"24"
:
"Fallow land"
,
"25"
:
"Pasture"
,
"26"
:
"Farm store"
,
"27"
:
"Threshing floor"
,
"28"
:
"Park"
,
"30"
:
"Market or shop"
,
"40"
:
"Institute, Experimental station, Research organization, Genebank"
,
"50"
:
"Seed company"
,
"60"
:
"Weedy, disturbed or ruderal habitat"
,
"61"
:
"Roadside"
,
"62"
:
"Field margin"
,
"99"
:
"Other"
}
},
"common"
:
{
"modelName"
:
"Accession"
,
"modelName_plural"
:
"Accessions"
,
"menu"
:
"Accessions"
,
"stats"
:
"Accession record"
,
"stats_plural"
:
"Accession records"
,
"acceNumb"
:
"Accession number"
,
"countryOfOrigin"
:
"Country of origin"
,
"instituteCode"
:
"Institute code"
,
"taxonomy"
:
"Taxonomy"
,
"genus"
:
"Genus"
,
"species"
:
"Species"
,
"doi"
:
"DOI"
,
"sampStat"
:
"Biological status of accession"
,
"storageType"
:
"Type of germplasm storage"
,
"alias"
:
{
"OTHERNUMB"
:
"Other identifier"
,
"ACCENAME"
:
"Accession name"
,
...
...
src/accessions/translations.json
View file @
8839204a
...
...
@@ -78,25 +78,25 @@
"map"
:
"Map"
},
"climate"
:
{
"bio1"
:
"Annual
M
ean
T
emperature [°
C
]"
,
"bio2"
:
"Mean
D
iurnal
R
ange (
M
ean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (
BIO2/BIO
7) (* 100)"
,
"bio4"
:
"Temperature
S
easonality (standard deviation *100)"
,
"bio5"
:
"Max
T
emperature of
W
armest
M
onth [°
C
]"
,
"bio6"
:
"Min
T
emperature of
C
oldest
M
onth [°
C
]"
,
"bio7"
:
"Temperature
A
nnual
R
ange (
BIO5-BIO
6) [°
C
]"
,
"bio8"
:
"Mean
T
emperature of
W
ettest
Q
uarter [°
C
]"
,
"bio9"
:
"Mean
T
emperature of
D
riest
Q
uarter [°
C
]"
,
"bio10"
:
"Mean
T
emperature of
W
armest
Q
uarter [°
C
]"
,
"bio11"
:
"Mean
T
emperature of
C
oldest
Q
uarter [°
C
]"
,
"bio12"
:
"Annual
P
recipitation [mm]"
,
"bio13"
:
"Precipitation of
W
ettest
M
onth [mm]"
,
"bio14"
:
"Precipitation of
D
riest
M
onth [mm]"
,
"bio15"
:
"Precipitation
S
easonality (
C
oefficient of
V
ariation)"
,
"bio16"
:
"Precipitation of
W
ettest
Q
uarter [mm]"
,
"bio17"
:
"Precipitation of
D
riest
Q
uarter [mm]"
,
"bio18"
:
"Precipitation of
W
armest
Q
uarter [mm]"
,
"bio19"
:
"Precipitation of
C
oldest
Q
uarter [mm]"
,
"bio1"
:
"Annual
m
ean
t
emperature [°
c
]"
,
"bio2"
:
"Mean
d
iurnal
r
ange (
m
ean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (
bio2/bio
7) (* 100)"
,
"bio4"
:
"Temperature
s
easonality (standard deviation *100)"
,
"bio5"
:
"Max
t
emperature of
w
armest
m
onth [°
c
]"
,
"bio6"
:
"Min
t
emperature of
c
oldest
m
onth [°
c
]"
,
"bio7"
:
"Temperature
a
nnual
r
ange (
bio5-bio
6) [°
c
]"
,
"bio8"
:
"Mean
t
emperature of
w
ettest
q
uarter [°
c
]"
,
"bio9"
:
"Mean
t
emperature of
d
riest
q
uarter [°
c
]"
,
"bio10"
:
"Mean
t
emperature of
w
armest
q
uarter [°
c
]"
,
"bio11"
:
"Mean
t
emperature of
c
oldest
q
uarter [°
c
]"
,
"bio12"
:
"Annual
p
recipitation [mm]"
,
"bio13"
:
"Precipitation of
w
ettest
m
onth [mm]"
,
"bio14"
:
"Precipitation of
d
riest
m
onth [mm]"
,
"bio15"
:
"Precipitation
s
easonality (
c
oefficient of
v
ariation)"
,
"bio16"
:
"Precipitation of
w
ettest
q
uarter [mm]"
,
"bio17"
:
"Precipitation of
d
riest
q
uarter [mm]"
,
"bio18"
:
"Precipitation of
w
armest
q
uarter [mm]"
,
"bio19"
:
"Precipitation of
c
oldest
q
uarter [mm]"
,
"monthlyPrecipitation"
:
"Monthly precipitation"
,
"precipitation"
:
"Precipitation"
,
"monthlyTemp"
:
"Monthly temperature"
,
...
...
@@ -124,7 +124,7 @@
"12"
:
"Dec"
}
},
"
common
"
:
{
"
model
"
:
{
"modelName"
:
"Accession"
,
"modelName_plural"
:
"Accessions"
,
"menu"
:
"Accessions"
,
...
...
@@ -139,7 +139,148 @@
"doi"
:
"DOI"
,
"sampStat"
:
"Biological status of accession"
,
"storageType"
:
"Type of germplasm storage"
,
"lastModifiedDate"
:
"Last updated"
,
"createdDate"
:
"First uploaded"
,
"alias"
:
{
"OTHERNUMB"
:
"Other identifier"
,
"ACCENAME"
:
"Accession name"
,
"DONORNUMB"
:
"Donor accession number"
,
"COLLNUMB"
:
"Collecting number"
},
"available"
:
{
"true"
:
"Available for distribution"
,
"false"
:
"Not available for distribution"
,
"1"
:
"Available for distribution"
,
"0"
:
"Not available for distribution"
,
"null"
:
"Availability not provided"
},
"sgsv"
:
{
"true"
:
"Backed up in SGSV"
,
"false"
:
"Not in SGSV"
,
"1"
:
"Backed up in SGSV"
,
"0"
:
"Not in SGSV"
},
"mlsStatus"
:
{
"true"
:
"Accession is part of the Multi-lateral system of ITPGRFA"
,
"false"
:
"Not declared in the Multi-lateral system of ITPGRFA"
,
"1"
:
"Accession is part of the Multi-lateral system of ITPGRFA"
,
"0"
:
"Not declared in the Multi-lateral system of ITPGRFA"
,
"null"
:
"Status not provided"
},
"coll"
:
{
"collCode"
:
"Collecting institute code"
,
"collNumb"
:
"Collecting number"
,
"collDate"
:
"Collecting date of sample"
,
"collMissId"
:
"Collecting mission identifier"
,
"collName"
:
"Collecting institute name"
,
"collSite"
:
"Location of collecting site"
,
"collSrc"
:
"Collecting source"
},
"geo"
:
{
"latitude"
:
"Latitude of collecting site"
,
"longitude"
:
"Longitude of collecting site"
,
"uncertainty"
:
"Coordinate uncertainty"
,
"datum"
:
"Geodetic datum"
,
"method"
:
"Georeferencing method"
,
"elevation"
:
"Elevation of collecting site"
,
"climate"
:
{
"bio1"
:
"Annual mean temperature [°c]"
,
"bio2"
:
"Mean diurnal range (mean of monthly (max temp - min temp))"
,
"bio3"
:
"Isothermality (bio2/bio7) (* 100)"
,
"bio4"
:
"Temperature seasonality (standard deviation *100)"
,
"bio5"
:
"Max temperature of warmest month [°c]"
,
"bio6"
:
"Min temperature of coldest month [°c]"
,
"bio7"
:
"Temperature annual range (bio5-bio6) [°c]"
,
"bio8"
:
"Mean temperature of wettest quarter [°c]"
,
"bio9"
:
"Mean temperature of driest quarter [°c]"
,
"bio10"
:
"Mean temperature of warmest quarter [°c]"
,
"bio11"
:
"Mean temperature of coldest quarter [°c]"
,
"bio12"
:
"Annual precipitation [mm]"
,
"bio13"
:
"Precipitation of wettest month [mm]"
,
"bio14"
:
"Precipitation of driest month [mm]"
,
"bio15"
:
"Precipitation seasonality (coefficient of variation)"
,
"bio16"
:
"Precipitation of wettest quarter [mm]"
,
"bio17"
:
"Precipitation of driest quarter [mm]"
,
"bio18"
:
"Precipitation of warmest quarter [mm]"
,
"bio19"
:
"Precipitation of coldest quarter [mm]"
}
},
"storage"
:
{
"10"
:
"Seed collection"
,
"11"
:
"Short term seed collection"
,
"12"
:
"Medium term seed collection"
,
"13"
:
"Long term seed collection"
,
"20"
:
"Field collection"
,
"30"
:
"In vitro collection"
,
"40"
:
"Cryopreserved collection"
,
"50"
:
"DNA collection"
,
"99"
:
"Other"
},
"sampleStatus"
:
{
"100"
:
"Wild"
,
"110"
:
"Natural"
,
"120"
:
"Semi-natural/wild"
,
"130"
:
"Semi-natural/sown"
,
"200"
:
"Weedy"
,
"300"
:
"Traditional cultivar/Landrace"
,
"400"
:
"Breeding/Research Material"
,
"410"
:
"Breeders Line"
,
"411"
:
"Synthetic population"
,
"412"
:
"Hybrid"
,
"413"
:
"Founder stock/base population"
,
"414"
:
"Inbred line"
,
"415"
:
"Segregating population"
,
"416"
:
"Clonal selection"
,
"420"
:
"Genetic stock"
,
"421"
:
"Mutant"
,
"422"
:
"Cytogenetic stocks"
,
"423"
:
"Other genetic stocks"
,
"500"
:
"Advanced/improved cultivar"
,
"600"
:
"GMO"
,
"999"
:
"Other"
},
"collectingSource"
:
{
"10"
:
"Wild habitat"
,
"11"
:
"Forest or woodland"
,
"12"
:
"Shrubland"
,
"13"
:
"Grassland"
,
"14"
:
"Desert or tundra"
,
"15"
:
"Aquatic habitat"
,
"20"
:
"Field or cultivated habitat"
,
"21"
:
"Field"
,
"22"
:
"Orchard"
,
"23"
:
"Backyard, kitchen or home garden (urban, peri-urban or rural)"
,
"24"
:
"Fallow land"
,
"25"
:
"Pasture"
,
"26"
:
"Farm store"
,
"27"
:
"Threshing floor"
,
"28"
:
"Park"
,
"30"
:
"Market or shop"
,
"40"
:
"Institute, Experimental station, Research organization, Genebank"
,
"50"
:
"Seed company"
,
"60"
:
"Weedy, disturbed or ruderal habitat"
,
"61"
:
"Roadside"
,
"62"
:
"Field margin"
,
"99"
:
"Other"
}
},
"common"
:
{
"modelName"
:
"Accession"
,
"modelName_plural"
:
"Accessions"
,
"menu"
:
"Accessions"
,
"stats"
:
"Accession record"
,
"stats_plural"
:
"Accession records"
,
"acceNumb"
:
"Accession number"
,
"countryOfOrigin"
:
"Country of origin"
,
"instituteCode"
:
"Institute code"
,
"taxonomy"
:
"Taxonomy"
,
"genus"
:
"Genus"
,
"species"
:
"Species"
,
"doi"
:
"DOI"
,
"sampStat"
:
"Biological status of accession"
,
"storageType"
:
"Type of germplasm storage"
,
"alias"
:
{
"OTHERNUMB"
:
"Other identifier"
,
"ACCENAME"
:
"Accession name"
,
...
...
src/accessions/ui/MapPage.tsx
View file @
8839204a
...
...
@@ -209,7 +209,7 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
>
<
Popup
open
>
<
div
>
{
geoData
.
map
((
feature
)
=>
(<
div
><
Link
to
=
{
`/a/
${
feature
.
properties
.
uuid
}
`
}
>
{
`
${
feature
.
properties
.
accessionNumber
}
${
feature
.
properties
.
instCode
}
`
}
</
Link
></
div
>))
}
{
geoData
.
map
((
feature
,
idx
)
=>
(<
div
key
=
{
idx
}
><
Link
to
=
{
`/a/
${
feature
.
properties
.
uuid
}
`
}
>
{
`
${
feature
.
properties
.
accessionNumber
}
${
feature
.
properties
.
instCode
}
`
}
</
Link
></
div
>))
}
{
otherCount
>
0
&&
<
div
>
{
t
(
'
accessions.public.p.map.andMore
'
,
{
otherMore
:
otherCount
})
}
</
div
>
}
</
div
>
</
Popup
>
...
...
src/accessions/ui/c/MapConfigSection.tsx
View file @
8839204a
...
...
@@ -37,7 +37,7 @@ class MapConfigSection extends React.Component<IMapConfigSectionProps> {
<
ExpandFiltersComponent
title
=
"Configure map"
/>
<
span
className
=
{
classes
.
layersTitle
}
>
Layers
</
span
>
<
Divider
/>
{
mapLayers
.
map
((
layer
)
=>
<
MapLayerConfig
layer
=
{
layer
}
/>)
}
{
mapLayers
.
map
((
layer
,
idx
)
=>
<
MapLayerConfig
key
=
{
idx
}
layer
=
{
layer
}
/>)
}
</
div
>
);
}
...
...
src/translations.json
View file @
8839204a
...
...
@@ -29,6 +29,10 @@
},
"prettyF"
:
{
"NOT"
:
"Excluding {{what}}"
,
"le"
:
"{{what}} ≤"
,
"ge"
:
"{{what}} ≥"
,
"lt"
:
"{{what}} <"
,
"gt"
:
"{{what}} >"
,
"accessions"
:
{
"crop"
:
"Crop"
,
"acceNumb"
:
"Accession number"
,
...
...
@@ -38,7 +42,14 @@
"geo"
:
{
"latitude"
:
"Latitude"
,
"longitude"
:
"Longitude"
,
"elevation"
:
"Elevation"
"elevation"
:
"Elevation"
,
"climate"
:
{
"bio2"
:
"Mean diurnal range"
,
"bio3"
:
"Isothermality"
,
"bio4"
:
"Temperature seasonality"
,
"bio7"
:
"Temperature annual range [°c]"
,
"bio15"
:
"Precipitation seasonality"
}
},
"holder"
:
{
"code"
:
"Holder"
,
...
...
@@ -47,11 +58,6 @@
"region"
:
"Holder region"
}
},
"lastModifiedDate"
:
{
""
:
"Last updated"
,
"ge"
:
"Updated after"
,
"le"
:
"Updated before"
},
"taxa"
:
{
"genus"
:
"Genus"
,
"species"
:
"Species"
,
...
...
src/ui/common/filter/PrettyFilters.tsx
View file @
8839204a
...
...
@@ -80,6 +80,39 @@ function handleFilterObj(filterObj, path) {
return
_
.
omit
(
clone
,
[
path
]);
}
function
translatePath
(
t
,
prefix
:
string
,
prettyPath
:
string
)
{
const
isNot
=
prettyPath
.
startsWith
(
'
NOT.
'
);
const
isLe
=
prettyPath
.
endsWith
(
'
.le
'
);
const
isGe
=
prettyPath
.
endsWith
(
'
.ge
'
);
// console.log(`translating not=${isNot} le=${isLe} ge=${isGe} ${prefix}.${prettyPath}`);
if
(
isNot
)
{
prettyPath
=
prettyPath
.
replace
(
/^NOT
\.
/
,
''
);
}
if
(
isLe
)
{
prettyPath
=
prettyPath
.
replace
(
/
\.
le$/
,
''
);
}
if
(
isGe
)
{
prettyPath
=
prettyPath
.
replace
(
/
\.
ge$/
,
''
);
}
// console.log(`Translating ${[ `public.prettyF.${prefix}.${prettyPath}`, `${prefix}.model.${prettyPath}` ]}`);
let
trans
=
t
([
`public.prettyF.
${
prefix
}
.
${
prettyPath
}
`
,
`
${
prefix
}
.model.
${
prettyPath
}
`
],
prettyPath
);
if
(
isGe
)
{
trans
=
t
(
'
public.prettyF.ge
'
,
{
what
:
trans
});
}
else
if
(
isLe
)
{
trans
=
t
(
'
public.prettyF.le
'
,
{
what
:
trans
});
}
else
{
trans
=
`
${
trans
}
:`
;
}
if
(
isNot
)
{
return
t
(
'
public.prettyF.NOT
'
,
{
what
:
trans
});
}
else
{
return
trans
;
}
}
/**
* Return pretty name.
* For example we have path crop[0] and value banana, will return 'crop Banana'.
...
...
@@ -114,15 +147,13 @@ function getLabelName(path, value, lookups, prefix, t, labels) {
if
(
typeof
name
===
'
boolean
'
)
{
if
(
name
)
{
return
t
(
`public.prettyF.
${
prefix
}
.
${
prettyPath
}
`
);
return
t
(
[
`public.prettyF.
${
prefix
}
.
${
prettyPath
}
`
,
`public.
${
prefix
}
.
${
prettyPath
}
`
]
);
}
return
t
(
'
public.prettyF.NOT
'
,
{
what
:
t
(
`public.prettyF.
${
prefix
}
.
${
prettyPath
.
replace
(
/^NOT
\.
/
,
''
)}
`
)
});
return
t
(
'
public.prettyF.NOT
'
,
{
what
:
t
(
[
`public.prettyF.
${
prefix
}
.
${
prettyPath
.
replace
(
/^NOT
\.
/
,
''
)}
`
,
`public.
${
prefix
}
.
${
prettyPath
.
replace
(
/^NOT
\.
/
,
''
)}
`
]
)
});
}
const
translatedPrettyPath
=
prettyPath
.
startsWith
(
'
NOT
'
)
?
t
(
'
public.prettyF.NOT
'
,
{
what
:
t
(
`public.prettyF.
${
prefix
}
.
${
prettyPath
.
replace
(
/^NOT
\.
/
,
''
)}
`
)
})
:
t
(
`public.prettyF.
${
prefix
}
.
${
prettyPath
}
`
);
const
translatedPrettyPath
=
translatePath
(
t
,
prefix
,
prettyPath
);
// console.log(`${prettyPath} = ${translatedPrettyPath}`);
if
(
labels
&&
!
_
.
isEmpty
(
labels
)
&&
prettyPath
.
includes
(
'
uuid
'
))
{
name
=
labels
.
get
(
name
);
...
...
@@ -131,10 +162,10 @@ function getLabelName(path, value, lookups, prefix, t, labels) {
if
(
prettyPath
.
includes
(
'
Date
'
))
{
return
<
span
>
{
translatedPrettyPath
}
:
<
PrettyDate
value
=
{
new
Date
(
name
)
}
/></
span
>;
return
<
span
>
{
translatedPrettyPath
}
<
PrettyDate
value
=
{
new
Date
(
name
)
}
/></
span
>;
}
return
`
${
translatedPrettyPath
}
:
${
translatedPrettyName
}
`
;
return
`
${
translatedPrettyPath
}
${
translatedPrettyName
}
`
;
}
class
PrettyFilters
extends
React
.
Component
<
IPrettyFiltersProps
,
any
>
{
...
...
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