Fix bug on adding skills to new tasks
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start by locating the task.new skill-typeahead-result and the projectSkillsList component, then trace how the selected skills collection is checked. Verify the existing project skill is shown as selected in search results and that clicking it removes it without creating a duplicate; review the related x-SkillsList services if the component flow requires it.
Written by the indexing model from the issue text.
Description
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:

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-resultusually usesservice: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, theskill-typeahead-resultinstead uses just anarray.includes(skill), but this no longer works when we add project skills into the mix, because those areDS.PromiseObjectrecords, notDS.Modelrecords. This happened to work because the method was named the same, but the proper method to use here isarray.isAny('id', skillId)so it works with bothDS.ModelandDS.PromiseObjectrecords -
monkeypatch the
includesmethod 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
projectSkillsListcomponent added here. make it an extremely simpleskills-item-listcomponent 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
contentproperty 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.
- Dominant language
- JavaScript
- Stars
- 120
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-corps/code-corps-ember
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
code-corps/code-corps-ember#1616 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
code-corps/code-corps-ember#1613 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
code-corps/code-corps-ember#1612 ·
-
Difficulty: Medium Skill: ember-cli-page-object
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
code-corps/code-corps-ember#1063 · 1 reaction ·
-
greenkeeper
Difficulty 3/5 1-2 days Newbie friendliness 25/100
code-corps/code-corps-ember#1765 · 1 comment ·
All issues in code-corps/code-corps-ember
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Add: BuyPass TV Openchannels:add check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
S: triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100