Validating the number of clauses in DataSearch component
Los mantenedores suelen responder en 1 día
@bietkul ya está trabajando en esto.
Desde el 31/7/2020.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
React
There's a default ElasticSearch limit of 1024 clauses within a query. Users may reach this limit when pasting a long list of values to search against within the DataSearch component. In my case it crashes ElasticSearch and returns the error "caused_by":{"type":"too_many_clauses","reason":"maxClauseCount is set to 1024"}.
It would be great if there was a way of setting a limit/validating entries once this limit is reached to prevent ElasticSearch from crashing. I'm trying to solve this by using beforeValueChange to reject the entry if it's greater than 1024. But I need to be able to reset the promise and the value the user has entered so they can start again. With the code below, the promise is rejected and the user can no longer edit the input. Any suggestions? Thanks
beforeValueChange={
(value) => {
return new Promise((resolve, reject) => {
if (withinElasticSearchMaxClauseLimit(value)) {
resolve();
} else {
// how do I clear the user entered value and reset the promise here?
reject();
}
})
}
}
function withinElasticSearchMaxClauseLimit(str) {
str = str.replace(/(^\s*)|(\s*$)/gi, "");
str = str.replace(/[ ]{2,}/gi, " ");
str = str.replace(/\n /, "\n");
return str.split(' ').length <= 1024;
}
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.9k
- Forks
- 479
- Merge medio
- 4 d 10 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de appbaseio/reactivesearch
-
ci: add Node.js version matrix, caching, and lint step to test workflowPosiblemente ocupada @Talha12Shiekh la tomó hace 71 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
appbaseio/reactivesearch#2322 ·
Los mantenedores suelen responder en 1 día
-
chore: add Dependabot config for automated dependency updatesPosiblemente ocupada @Talha12Shiekh la tomó hace 71 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
appbaseio/reactivesearch#2321 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
security: user-controlled URL params injected directly into Redux store via JSON.parsePosiblemente ocupada @Talha12Shiekh la tomó hace 71 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
appbaseio/reactivesearch#2319 ·
Los mantenedores suelen responder en 1 día
-
refactor: consolidate 12 near-identical SVG icon components into one patternPosiblemente ocupada @Talha12Shiekh la tomó hace 73 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
appbaseio/reactivesearch#2324 ·
Los mantenedores suelen responder en 1 día
-
refactor: SearchBox.js is 2692 lines — extract subcomponents for maintainabilityPosiblemente ocupada @Talha12Shiekh la tomó hace 71 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
appbaseio/reactivesearch#2323 ·
Los mantenedores suelen responder en 1 día
Todos los issues de appbaseio/reactivesearch
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
no-human-ai/no_human#659 ·
Los mantenedores suelen responder en 1 día
-
[BUG] Multi-day events show "Ended" while still in progressPosiblemente ocupada @tarunagnihotri534 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
data-umbrella/du-event-board#231 · 2 comentarios ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
-
IO.get_env on Node truncates names at embedded NULPosiblemente ocupada @Yi-111-a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
HigherOrderCO/Bend#1449 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
cryptpad/documentation#162 ·