Validating the number of clauses in DataSearch component
I maintainer di solito rispondono entro 1 giorno
@bietkul ci sta già lavorando.
Dal 31/7/2020.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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;
}
- Lingua principale
- JavaScript
- Stelle
- 4.9k
- Fork
- 479
- Merge medio
- 4g 10h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di appbaseio/reactivesearch
-
ci: add Node.js version matrix, caching, and lint step to test workflowForse già presa @Talha12Shiekh l’ha presa 74 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
appbaseio/reactivesearch#2322 ·
I maintainer di solito rispondono entro 1 giorno
-
chore: add Dependabot config for automated dependency updatesForse già presa @Talha12Shiekh l’ha presa 74 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
appbaseio/reactivesearch#2321 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
security: user-controlled URL params injected directly into Redux store via JSON.parseForse già presa @Talha12Shiekh l’ha presa 74 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
appbaseio/reactivesearch#2319 ·
I maintainer di solito rispondono entro 1 giorno
-
refactor: consolidate 12 near-identical SVG icon components into one patternForse già presa @Talha12Shiekh l’ha presa 76 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
appbaseio/reactivesearch#2324 ·
I maintainer di solito rispondono entro 1 giorno
-
refactor: SearchBox.js is 2692 lines — extract subcomponents for maintainabilityForse già presa @Talha12Shiekh l’ha presa 74 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
appbaseio/reactivesearch#2323 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di appbaseio/reactivesearch
Issue simili
-
Language MVP task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
saayam-for-all/webapp#1914 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Dev image build fails: `npm install` in the root Dockerfile runs out of memory (exit 134)Forse già presa @andest01 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue hacktoberfest help wanted
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 76/100
pacocartones/free-llm-api-hub#262 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-task risk:low
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
guyellis/http-status-check#512 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/playwright#43327 ·
I maintainer di solito rispondono entro 1 giorno