Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Fix bug on adding skills to new tasks

Aperta
#1,161 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia individuando task.new skill-typeahead-result e il componente projectSkillsList, quindi segui come viene verificata la raccolta delle skills selezionate. Verifica che la project skill esistente venga mostrata come selezionata nei risultati di ricerca e che facendo clic su di essa venga rimossa senza creare un duplicato; esamina i servizi x-SkillsList correlati se il flusso del componente lo richiede.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
120
Fork
75
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di code-corps/code-corps-ember

Tutte le issue di code-corps/code-corps-ember

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.