Handling undefined value in table columns?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 153
- Forks
- 46
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 7
Descripción
In the issue-pane, it is currently possible for a category to have an undefined value, which then means it doesn't show up in the table view.
This occurs because the filterFunction defined by renderEnumSelector in table.js will never return true for an undefined colValue
https://github.com/solid/solid-ui/blob/c2d0c8aed526db4e35640d9f3d543434a2c310ec/src/table.js#L1121-L1123
Possible solutions
It is possible this is simply a bug. searchValue defaults to {}, so !searchValue will always be false, even though a comment may or may not suggest the intended behaviour was to return true:
https://github.com/solid/solid-ui/blob/c2d0c8aed526db4e35640d9f3d543434a2c310ec/src/table.js#L1099-L1103
In this case, a solution would be to use:
return Object.keys(searchValue).length == 0 || colValue && searchValue[colValue.uri];
However, given that the default behaviour of table.js is to select all options, and on a desktop there is currently no way of unselecting all options, the UI would also need to change.
Instead of a new UI element or interaction to deselect all options (let's call that Solution 1), another solution would then be to add an option for undefined, which would have the advantage of being able to show only those options missing a category (Solution 2).
And rather than doing that automatically within table.js, another option is to simply not support undefined values (and perhaps to include some validation code, Solution 3). issue-pane would then need to make sure that a default value is always assigned for a category.
Not sure which of solution 1-3 would be preferred.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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.
Línea de trabajo
Comienza en src/table.js, líneas 1099-1123, y reproduce el comportamiento de la tabla del issue-pane con una categoría undefined. Compara los tres comportamientos propuestos —cambios en la selección, una opción explícita de undefined o validación/establecimiento de valores predeterminados— con la UI actual de la tabla y confirma que el comportamiento elegido cubre tanto la visualización de filas como su filtrado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100