diff --git a/src/common/variables.js b/src/common/variables.js index da9914053..a93d705a7 100644 --- a/src/common/variables.js +++ b/src/common/variables.js @@ -9,3 +9,7 @@ export const verificationStates = { AWAITING: 'Awaiting Verification', REJECTED: 'Rejected', }; +export const tokenizationStates = { + TOKENIZED: 'Tokenized', + NOT_TOKENIZED: 'Not Tokenized', +}; diff --git a/src/components/Filter.js b/src/components/Filter.js index 215f6c25f..bda5dc129 100644 --- a/src/components/Filter.js +++ b/src/components/Filter.js @@ -22,7 +22,7 @@ import { convertDateToDefaultSqlDate, } from '../common/locale'; -import { verificationStates } from '../common/variables'; +import { verificationStates, tokenizationStates } from '../common/variables'; export const FILTER_WIDTH = 330; @@ -72,6 +72,7 @@ function Filter(props) { filter.dateStart || dateStartDefault, ); const [dateEnd, setDateEnd] = useState(filter.dateEnd || dateEndDefault); + const [tokenId, setTokenId] = useState(filterOptionAll); const handleDateStartChange = (date) => { setDateStart(date); @@ -96,6 +97,7 @@ function Filter(props) { setDateEnd(dateEndDefault); setApproved(); setActive(); + setTokenId(filterOptionAll); props.onSubmit && props.onSubmit(filter); } @@ -110,6 +112,7 @@ function Filter(props) { filter.dateEnd = dateEnd ? formatDate(dateEnd) : undefined; filter.approved = approved; filter.active = active; + filter.tokenId = tokenId; props.onSubmit && props.onSubmit(filter); } @@ -251,6 +254,24 @@ function Filter(props) { ))} + + { + setTokenId(e.target.value); + }} + > + {[ + filterOptionAll, + tokenizationStates.NOT_TOKENIZED, + tokenizationStates.TOKENIZED, + ].map((name) => ( + + {name} + + ))} + { props.tagsDispatch.getTags(tagSearchString); @@ -132,6 +133,7 @@ function Filter(props) { filter.speciesId = speciesId; filter.tagId = tag ? tag.id : 0; filter.organizationId = organizationId; + filter.tokenId = tokenId; props.onSubmit && props.onSubmit(filter); } @@ -147,6 +149,7 @@ function Filter(props) { setOrganizationId(ALL_ORGANIZATIONS); setTag(null); setTagSearchString(''); + setTokenId(filterOptionAll); const filter = new FilterModel(); filter.approved = approved; // keeps last value set @@ -198,6 +201,24 @@ function Filter(props) { ))} + { + setTokenId(e.target.value); + }} + > + {[ + filterOptionAll, + tokenizationStates.NOT_TOKENIZED, + tokenizationStates.TOKENIZED, + ].map((name) => ( + + {name} + + ))} +