Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Fix bug on adding skills to new tasks

Abierto
#1,161 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
frontend

Línea de trabajo

Comienza localizando task.new skill-typeahead-result y el componente projectSkillsList; después, sigue cómo se comprueba la colección de skills seleccionadas. Verifica que el project skill existente aparezca como seleccionado en los resultados de búsqueda y que al hacer clic en él se elimine sin crear un duplicado; revisa los servicios x-SkillsList relacionados si el flujo del componente lo requiere.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug Difficulty: Medium needs clarification needs estimate

Problem

From @begedin:

If I add a skill using the project skill list, then try to search for the same skill in the dropdown, it will appear "uncrossed", as if not yet added, in the results:

image

Even though it looks incorrect, clicking it will still remove it, not add a duplicate, so at least the background logic works.

Basically,

  • skill-typeahead-result usually uses service:x-skills.includes(skill) to determine if skill has already been added. this method is NOT easily rewritten into something else

  • In the case of task.new, the skill-typeahead-result instead uses just an array.includes(skill), but this no longer works when we add project skills into the mix, because those are DS.PromiseObject records, not DS.Model records. This happened to work because the method was named the same, but the proper method to use here is array.isAny('id', skillId) so it works with both DS.Model and DS.PromiseObject records

  • monkeypatch the includes method in this specific case - quick and dirty, definitely against it

  • wrap the unsaved skills collection into another service, which makes it work - clean, but makes thing worse in the long run, I think. Another complex service, difficult to follow.

  • rethink the projectSkillsList component added here. make it an extremely simple skills-item-list component which just receives and renders a list of skills. let the controller handle the exclusion of already added skills, etc. - clean and doesn't make things worse; a good compromise.

  • rewrite the services, rethink them, really. now that I got back into them, I found them extremely difficult to follow and, especially with "sometimes" accessing the content property of proxy objects, ex:

return records.any((found) => {
  let targetId = get(target, 'id');
  let targetModelName = 
     get(target, 'constructor.modelName') || get(target, 'content.constructor.modelName');
  let foundId = found.belongsTo(targetModelName).id();

  return (foundId === targetId);
});

I think, with proper controller usage, the whole x-SkillsList collection of services could be almost if not completely eliminated.

Lenguaje dominante
JavaScript
Estrellas
120
Forks
75
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de code-corps/code-corps-ember

Todos los issues de code-corps/code-corps-ember

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.