Commit bf9ca78e authored by Matija Obreza's avatar Matija Obreza

Merge branch '197-pretty-filters-translations' into 'master'

Resolve "Pretty filters translations"

Closes #197

See merge request genesys-pgr/genesys-ui!202
parents 0800bfef 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 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]",
"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]",
"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",
......
......@@ -78,25 +78,25 @@
"map": "Map"
},
"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]",
"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]",
"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",
......
......@@ -41,6 +41,7 @@ import Authorize from 'ui/common/authorized/Authorize';
import TemperatureChart from './c/TemperatureChart';
import PrecipitationChart from './c/PrecipitationChart';
import ClimateTable from './c/ClimateTable';
import ActionButton from 'ui/common/buttons/ActionButton';
const styles = (theme) => ({
pageSection: {
......@@ -124,6 +125,65 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
applyFilters(filter);
}
private makeRange = (variable: number, diff: number) => {
return {
ge: Math.round(variable - diff),
le: Math.round(variable + diff),
};
}
private applyClimateFilters = () => {
const { accession: {details: accession}, applyFilters } = this.props;
// BIO1 = Annual Mean Temperature !!
// 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
// BIO6 = Min Temperature of Coldest Month
// BIO7 = Temperature Annual Range (BIO5-BIO6)
// BIO8 = Mean Temperature of Wettest Quarter
// BIO9 = Mean Temperature of Driest Quarter
// BIO10 = Mean Temperature of Warmest Quarter
// BIO11 = Mean Temperature of Coldest Quarter
// BIO12 = Annual Precipitation
// BIO13 = Precipitation of Wettest Month
// BIO14 = Precipitation of Driest Month
// BIO15 = Precipitation Seasonality (Coefficient of Variation)
// BIO16 = Precipitation of Wettest Quarter
// BIO17 = Precipitation of Driest Quarter
// BIO18 = Precipitation of Warmest Quarter !!
// BIO19 = Precipitation of Coldest Quarter !!
const tempDiff = 2;
const filter = {
taxa: {
genus: [ accession.taxonomy.genus ],
// species: [ accession.taxonomy.species ],
},
geo: {
climate: {
// temperature
bio1: this.makeRange(accession.geo.climate.bio1, tempDiff),
// bio2: this.makeRange(accession.geo.climate.bio2, tempDiff),
bio4: this.makeRange(accession.geo.climate.bio4, accession.geo.climate.bio4 * .50),
// bio7: this.makeRange(accession.geo.climate.bio7, tempDiff),
// bio8: this.makeRange(accession.geo.climate.bio8, tempDiff),
// bio9: this.makeRange(accession.geo.climate.bio9, tempDiff),
// bio10: this.makeRange(accession.geo.climate.bio10, tempDiff),
// bio11: this.makeRange(accession.geo.climate.bio11, tempDiff),
// precipitation
bio12: this.makeRange(accession.geo.climate.bio12, accession.geo.climate.bio12 * .25),
// bio13: this.makeRange(accession.geo.climate.bio13, precDif),
// bio14: this.makeRange(accession.geo.climate.bio14, precDif),
// bio15: this.makeRange(accession.geo.climate.bio15, accession.geo.climate.bio15 * .25),
bio18: this.makeRange(accession.geo.climate.bio18, accession.geo.climate.bio18 * .25),
bio19: this.makeRange(accession.geo.climate.bio19, accession.geo.climate.bio19 * .25),
},
},
};
applyFilters(filter);
}
public render() {
const { t, error, uuid, doi, accessions, auditLog, classes } = this.props;
......@@ -355,6 +415,9 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
</PropertiesItem>
)) }
</Properties>
<div>
<ActionButton action={ this.applyClimateFilters } title="View accessions with similar climate" />
</div>
</PageSection>
}
......
......@@ -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>
......
......@@ -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>
);
}
......
......@@ -22,6 +22,10 @@ class TileClimate {
public bio13: number;
public bio14: number;
public bio15: number;
public bio16: number;
public bio17: number;
public bio18: number;
public bio19: number;
public prec1: number;
public prec2: number;
......
......@@ -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",
......
......@@ -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> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment