Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(combobox): some old procedure still have options with trailing white spaces. ensure to trim selected value as well as options.value for better comparison #9896

Merged

Conversation

mfo
Copy link
Contributor

@mfo mfo commented Jan 8, 2024

…ite spaces. ensure to trim selected value as well as options.value for better comparison
Copy link

what-the-diff bot commented Jan 8, 2024

PR Summary

  • Enhancements to Combobox Class
    The code for the Combobox feature was adjusted to guarantee better accuracy when comparing options. Now, it disregards extra spaces at the beginning or end of the values to prevent incorrect comparisons.

Copy link
Member

@LeSim LeSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bien joué pour le debug.

Est ce que tu nous coderas pas une ptite migration pour cleaner la base ? et peut etre rajouter des validateurs cleaner pour éviter que ca arrive a nouveau ?

@mfo
Copy link
Contributor Author

mfo commented Jan 8, 2024

J'avais écarté cette option de migration de donnée car ça me semblait un peu 'too much'... en gros d'une part il faut repasser tous les TDCs de type dropdown (200k) & et d'autre part faut repasser sur tous les champs de type dropdown (35M) [pour que ca match]...

Pour ce qui est du validateur, il y en a déjà : https://github.com/demarches-simplifiees/demarches-simplifiees.fr/blob/main/app/models/type_de_champ.rb#L663 (date de 2020) ; par contre je sais pas comment c'est arrivé ds la base de donnée car la procédure date de 2021 [idem pour les parent_procedure].

bref, ça me semblait too much a la vue du micro fix qu'est apporté par cette PR. Tu penses que ca vaut le coup de reprendre la data même si c'est un peu lourd ?

@mfo mfo added this pull request to the merge queue Jan 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2024
@LeSim
Copy link
Member

LeSim commented Jan 8, 2024

Ah oui, j avais pas vu l'ampleur de la tache. Peut être qu'on peut la remettre au moment ou on refera l'ui de l'éditeur de select.

@mfo mfo added this pull request to the merge queue Jan 11, 2024
Merged via the queue into demarches-simplifiees:main with commit e2cb833 Jan 11, 2024
15 checks passed
@mfo mfo deleted the US/fix-combobox-with-not-trimmed-option branch January 11, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants