Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions public/locales/en/filterTombos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"labelIdentificador": "Identifier",
"labelColetor": "Collector",
"labelNumeroColeta": "Collection Number",
"placeholderIdentificador": "Type the identifier's name",
"placeholderColetor": "Type the collector's name",
"placeholderNumeroColeta": "Select a collector first",
"nenhumResultado": "No results",
"nenhumNumeroColeta": "No collection number available",
"adicionarFiltro": "Add Filter",
"remover": "Remove"
}
63 changes: 63 additions & 0 deletions public/locales/en/listaTombosScreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"titulo": "Records",
"colHcf": "HCF",
"colNomePopular": "Common name",
"colNomeCientifico": "Scientific name",
"colDataColeta": "Collection date",
"colColetor": "Collector",
"colAcao": "Action",
"buscarTombo": "Search record",
"labelHcf": "HCF:",
"labelTipo": "Type:",
"placeholderSelecione": "Select",
"tipoParatipo": "Paratype",
"tipoIsotipo": "Isotype",
"labelSituacao": "Status:",
"situacaoRegular": "Regular",
"situacaoPermutado": "Exchanged",
"situacaoEmprestado": "On loan",
"situacaoDoado": "Donated",
"labelNomeCientifico": "Scientific name:",
"placeholderNomeCientifico": "Passiflora edulis",
"labelNomePopular": "Common name:",
"placeholderNomePopular": "Passion fruit",
"labelCodigoBarraFoto": "Photo barcode:",
"placeholderCodigoBarraFoto": "Enter the barcode",
"notifExcluirTombo": "Delete record",
"tomboExcluido": "The record was deleted successfully.",
"erroExcluirTombo": "There was a problem deleting the record, please try again.",
"confirmExcluirTitulo": "Are you sure you want to delete this record?",
"confirmExcluirConteudo": "By clicking YES, the record will be deleted.",
"notifBuscarTombos": "Search records",
"erroBuscarTombos": "Error fetching the records.",
"erroBuscarTombosFalha": "Failed to fetch records.",
"alerta": "Alert",
"erroMinMaxColunas": "Select a minimum of 1 and a maximum of 5 columns to export.",
"erroInformePeriodo": "Enter a range, specific records or a date range to export",
"erroExportacaoUnica": "Data export must be done by a range, specific records or a date range, never using two or more",
"panelHeaderCampos": "Select the fields to be exported:",
"tagHcf": "HCF",
"tagDataColeta": "Collection Date",
"tagFamilia": "Family",
"tagSubfamilia": "Subfamily",
"tagGenero": "Genus",
"tagEspecie": "Species",
"tagSubespecie": "Subspecies",
"tagVariedade": "Variety",
"tagSequencia": "Record sequence",
"tagCodigoBarra": "Barcode",
"tagLatitude": "Latitude",
"tagLongitude": "Longitude",
"tagAltitude": "Altitude",
"tagNumeroColeta": "Collection No.",
"tagColetores": "Collectors",
"aPartirDe": "From:",
"ate": "To:",
"ou": "OR",
"numerosTombos": "Record numbers to be exported:",
"aPartirDataTombo": "From the record date:",
"placeholderDataInicial": "Select the initial record date",
"ateDataTombo": "To the record date:",
"placeholderDataFinal": "Select the final record date",
"exportar": "Export"
}
12 changes: 12 additions & 0 deletions public/locales/es/filterTombos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"labelIdentificador": "Identificador",
"labelColetor": "Colector",
"labelNumeroColeta": "Número de Colecta",
"placeholderIdentificador": "Escriba el nombre del identificador",
"placeholderColetor": "Escriba el nombre del colector",
"placeholderNumeroColeta": "Seleccione un colector primero",
"nenhumResultado": "Ningún resultado",
"nenhumNumeroColeta": "Ningún número de colecta disponible",
"adicionarFiltro": "Agregar Filtro",
"remover": "Eliminar"
}
63 changes: 63 additions & 0 deletions public/locales/es/listaTombosScreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"titulo": "Registros",
"colHcf": "HCF",
"colNomePopular": "Nombre popular",
"colNomeCientifico": "Nombre científico",
"colDataColeta": "Fecha de colecta",
"colColetor": "Colector",
"colAcao": "Acción",
"buscarTombo": "Buscar registro",
"labelHcf": "HCF:",
"labelTipo": "Tipo:",
"placeholderSelecione": "Seleccione",
"tipoParatipo": "Paratipo",
"tipoIsotipo": "Isotipo",
"labelSituacao": "Situación:",
"situacaoRegular": "Regular",
"situacaoPermutado": "Permutado",
"situacaoEmprestado": "Prestado",
"situacaoDoado": "Donado",
"labelNomeCientifico": "Nombre científico:",
"placeholderNomeCientifico": "Passiflora edulis",
"labelNomePopular": "Nombre popular:",
"placeholderNomePopular": "Maracuyá",
"labelCodigoBarraFoto": "Código de barras de la foto:",
"placeholderCodigoBarraFoto": "Escriba el código de barras",
"notifExcluirTombo": "Eliminar registro",
"tomboExcluido": "El registro fue eliminado con éxito.",
"erroExcluirTombo": "Hubo un problema al eliminar el registro, inténtelo de nuevo.",
"confirmExcluirTitulo": "¿Está seguro de que desea eliminar este registro?",
"confirmExcluirConteudo": "Al hacer clic en SÍ, el registro será eliminado.",
"notifBuscarTombos": "Buscar registros",
"erroBuscarTombos": "Error al buscar los registros.",
"erroBuscarTombosFalha": "Error al buscar registros.",
"alerta": "Alerta",
"erroMinMaxColunas": "Seleccione un mínimo de 1 y un máximo de 5 columnas para exportar.",
"erroInformePeriodo": "Indique un período, registros específicos o un intervalo de fechas para exportar",
"erroExportacaoUnica": "La exportación de los datos debe hacerse por un período, registros específicos o un intervalo de fechas, nunca utilizando dos o más",
"panelHeaderCampos": "Seleccione los campos a exportar:",
"tagHcf": "HCF",
"tagDataColeta": "Fecha de Colecta",
"tagFamilia": "Familia",
"tagSubfamilia": "Subfamilia",
"tagGenero": "Género",
"tagEspecie": "Especie",
"tagSubespecie": "Subespecie",
"tagVariedade": "Variedad",
"tagSequencia": "Secuencia del registro",
"tagCodigoBarra": "Código de barras",
"tagLatitude": "Latitud",
"tagLongitude": "Longitud",
"tagAltitude": "Altitud",
"tagNumeroColeta": "N.º Colecta",
"tagColetores": "Colectores",
"aPartirDe": "A partir de:",
"ate": "Hasta:",
"ou": "O",
"numerosTombos": "Números de los registros a exportar:",
"aPartirDataTombo": "A partir de la fecha de registro:",
"placeholderDataInicial": "Seleccione la fecha de registro inicial",
"ateDataTombo": "Hasta la fecha de registro:",
"placeholderDataFinal": "Seleccione la fecha de registro final",
"exportar": "Exportar"
}
12 changes: 12 additions & 0 deletions public/locales/pt-BR/filterTombos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"labelIdentificador": "Identificador",
"labelColetor": "Coletor",
"labelNumeroColeta": "Número de Coleta",
"placeholderIdentificador": "Digite o nome do identificador",
"placeholderColetor": "Digite o nome do coletor",
"placeholderNumeroColeta": "Selecione um coletor primeiro",
"nenhumResultado": "Nenhum resultado",
"nenhumNumeroColeta": "Nenhum número de coleta disponível",
"adicionarFiltro": "Adicionar Filtro",
"remover": "Remover"
}
63 changes: 63 additions & 0 deletions public/locales/pt-BR/listaTombosScreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"titulo": "Tombos",
"colHcf": "HCF",
"colNomePopular": "Nome popular",
"colNomeCientifico": "Nome científico",
"colDataColeta": "Data de coleta",
"colColetor": "Coletor",
"colAcao": "Ação",
"buscarTombo": "Buscar tombo",
"labelHcf": "HCF:",
"labelTipo": "Tipo:",
"placeholderSelecione": "Selecione",
"tipoParatipo": "Parátipo",
"tipoIsotipo": "Isótipo",
"labelSituacao": "Situação:",
"situacaoRegular": "Regular",
"situacaoPermutado": "Permutado",
"situacaoEmprestado": "Emprestado",
"situacaoDoado": "Doado",
"labelNomeCientifico": "Nome científico:",
"placeholderNomeCientifico": "Passiflora edulis",
"labelNomePopular": "Nome popular:",
"placeholderNomePopular": "Maracujá",
"labelCodigoBarraFoto": "Código de barras da foto:",
"placeholderCodigoBarraFoto": "Digite o código de barras",
"notifExcluirTombo": "Excluir tombo",
"tomboExcluido": "O tombo foi excluído com sucesso.",
"erroExcluirTombo": "Houve um problema ao excluir o tombo, tente novamente.",
"confirmExcluirTitulo": "Você tem certeza que deseja excluir este tombo?",
"confirmExcluirConteudo": "Ao clicar em SIM, o tombo será excluído.",
"notifBuscarTombos": "Buscar tombos",
"erroBuscarTombos": "Erro ao buscar os tombos.",
"erroBuscarTombosFalha": "Falha ao buscar tombos.",
"alerta": "Alerta",
"erroMinMaxColunas": "Selecione o mínimo de 1 e o máximo de 5 colunas para exportar.",
"erroInformePeriodo": "Informe um período, tombos específicos ou período de datas para exportar",
"erroExportacaoUnica": "A exportação dos dados deve ser feita por um período, tombos específicos ou período de datas, nunca utilizando dois ou mais",
"panelHeaderCampos": "Selecione os campos a serem exportados:",
"tagHcf": "HCF",
"tagDataColeta": "Data da Coleta",
"tagFamilia": "Família",
"tagSubfamilia": "Subfamília",
"tagGenero": "Gênero",
"tagEspecie": "Espécie",
"tagSubespecie": "Subespécie",
"tagVariedade": "Variedade",
"tagSequencia": "Sequencia do tombo",
"tagCodigoBarra": "Codigo de barra",
"tagLatitude": "Latitude",
"tagLongitude": "Longitude",
"tagAltitude": "Altitude",
"tagNumeroColeta": "Nº Coleta",
"tagColetores": "Coletores",
"aPartirDe": "A partir de:",
"ate": "Até:",
"ou": "OU",
"numerosTombos": "Numeros dos tombos a serem exportados:",
"aPartirDataTombo": "A partir da data de tombo:",
"placeholderDataInicial": "Seleciona a data de tombo inicial",
"ateDataTombo": "Até a data de tombo:",
"placeholderDataFinal": "Seleciona a data de tombo final",
"exportar": "Exportar"
}
29 changes: 14 additions & 15 deletions src/components/FilterTombos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import {
Spin
} from 'antd'
import axios from 'axios'
import { useTranslation } from 'react-i18next'
import { withTranslation } from 'react-i18next'

import { PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons'

const { Panel } = Collapse
const { Option } = Select

const FilterTombos = ({ onChange }) => {
const { t } = useTranslation('tombo')
const FilterTombos = ({ onChange, t}) => {
const [selectedFilters, setSelectedFilters] = useState([])
const [filterValues, setFilterValues] = useState({})

Expand Down Expand Up @@ -150,11 +149,11 @@ const FilterTombos = ({ onChange }) => {
const availableFilters = [
{
key: 'identificador_id',
label: t('identifierFilter'),
label: t('filterTombos:labelIdentificador'),
component: (
<Select
showSearch
placeholder={t('identifierPlaceholder')}
placeholder={t('filterTombos:placeholderIdentificador')}
filterOption={false}
onSearch={buscarIdentificadorPorNome}
onSelect={selecionarIdentificadorPorNome}
Expand All @@ -165,7 +164,7 @@ const FilterTombos = ({ onChange }) => {
notFoundContent={
loadingIdentificador
? <Spin size="small" />
: t('noResult')
: t('filterTombos:nenhumResultado')
}
style={{ width: '100%' }}
>
Expand All @@ -179,11 +178,11 @@ const FilterTombos = ({ onChange }) => {
},
{
key: 'coletor_id',
label: t('collectorFilter'),
label: t('filterTombos:labelColetor'),
component: (
<Select
showSearch
placeholder={t('collectorPlaceholder')}
placeholder={t('filterTombos:placeholderColetor')}
filterOption={false}
onSearch={buscarColetorPorNome}
onSelect={selecionarColetorPorNome}
Expand All @@ -194,7 +193,7 @@ const FilterTombos = ({ onChange }) => {
notFoundContent={
loadingColetor
? <Spin size="small" />
: t('noResult')
: t('filterTombos:nenhumResultado')
}
style={{ width: '100%' }}
>
Expand All @@ -208,20 +207,20 @@ const FilterTombos = ({ onChange }) => {
},
{
key: 'numero_coleta',
label: t('collectionNumberFilter'),
label: t('filterTombos:labelNumeroColeta'),
component: (
<Select
showSearch
optionFilterProp="children"
placeholder={t('selectCollectorFirst')}
placeholder={t('filterTombos:placeholderNumeroColeta')}
disabled={!filterValues.coletor_id}
onChange={value => handleFilterChange('numero_coleta', value || undefined)}
allowClear
loading={loadingNumeroColeta}
notFoundContent={
loadingNumeroColeta
? <Spin size="small" />
: t('noCollectionNumberAvailable')
: t('filterTombos:nenhumNumeroColeta')
}
style={{ width: '100%' }}
>
Expand Down Expand Up @@ -271,7 +270,7 @@ const FilterTombos = ({ onChange }) => {
trigger={['click']}
>
<Button icon={<PlusCircleOutlined />}>
{t('addFilter')}
{t('filterTombos:adicionarFiltro')}
</Button>
</Dropdown>

Expand All @@ -293,7 +292,7 @@ const FilterTombos = ({ onChange }) => {
}}
>
<MinusCircleOutlined style={{ marginRight: -3 }} />
{t('remove')}
{t('filterTombos:remover')}
</Button>
)}
>
Expand All @@ -308,4 +307,4 @@ const FilterTombos = ({ onChange }) => {
)
}

export default FilterTombos
export default withTranslation()(FilterTombos)
2 changes: 2 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ void i18n
'relatorioLocalColetaPeriodoScreen',
'relatorioQtdPeriodoScreen',
'relatorioTombosPorCidadeScreen',
'filterTombos',
'listaTombosScreen',
'estadoContainer',
'estadoComponent',
'rankingCard',
Expand Down
Loading
Loading