Commit 9b05bf4f authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza

Support for negative filters in the UI

parent e2534b45
......@@ -105,6 +105,7 @@
}
},
"f": {
"NOT": "Excluding {{what}}",
"accessions": {
"crops": "Crop name",
"acceNumb": "Accession number",
......
......@@ -33,7 +33,7 @@ class AccessionFilter {
public uuid: string[];
public version: number[];
public NOT: AccessionFilter;
}
export default AccessionFilter;
......@@ -10,6 +10,8 @@ class FaoInstituteFilter {
public accessions: boolean;
public name: StringFilter;
public country: CountryFilter;
public NOT: FaoInstituteFilter;
}
export default FaoInstituteFilter;
......@@ -17,7 +17,7 @@ class MaterialRequestFilter {
public uuid: string[];
public version: number[];
public NOT: MaterialRequestFilter;
}
export default MaterialRequestFilter;
......@@ -17,7 +17,7 @@ class MaterialSubRequestFilter {
public uuid: string[];
public version: number[];
public NOT: MaterialSubRequestFilter;
}
export default MaterialSubRequestFilter;
......@@ -21,7 +21,7 @@ class SubsetFilter {
public uuid: string[];
public version: number[];
public NOT: SubsetFilter;
}
export default SubsetFilter;
......@@ -103,9 +103,14 @@ function getLabelName(path, value, lookups, prefix, t) {
// join
.join('.');
const translatedPrettyPath = t(`f.${prefix}.${prettyPath}`);
const translatedPrettyPath = prettyPath.startsWith('NOT') ?
t('f.NOT', {what: t(`f.${prefix}.${prettyPath.replace(/^NOT\./, '')}`)})
:
t(`f.${prefix}.${prettyPath}`);
const translatedPrettyName = t(`${name}`);
if (prettyPath.includes('Date')) {
return <span>{ translatedPrettyPath }: <PrettyDate value={ new Date(name) }/></span>;
}
......
This diff is collapsed.
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