Skip to content

Add categories and sub categories to skills to rate #886

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions app/views/people/people_skills/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@
= ti("new_skills_to_rate")
= "(#{not_rated_default_skills(@person).count})"
= close_action_link person_people_skills_path(@person, no_default_skill_prompt: "")
- not_rated_default_skills(@person).each do |person_skill|
= form_with model: person_skill, url: person_people_skills_path(@person, rating: params["rating"]) do |form|
= render "people/people_skills/edit_form", ff: form
- not_rated_default_skills = not_rated_default_skills(@person)
- Category.all_parents.each do |category|
- if not_rated_default_skills.filter {|skill| skill.skill.category.parent === category}.count > 0
%div{id: "#{category.title.parameterize}-skills-container"}
%div.profile-header.mw-100.border-bottom.mt-4
= category.title
- ([category] + category.children.to_a).each do |category_child|
- not_rated_default_skills_of_category = not_rated_default_skills.filter {|skill| skill.skill.category === category_child}
- if not_rated_default_skills_of_category.count > 0
%div.white-header.mw-100.border-bottom.text-gray
= category_child.title + " (#{not_rated_default_skills_of_category.count})"
- not_rated_default_skills_of_category.each do |person_skill|
- @person_skill = person_skill
= form_with model: person_skill, url: person_people_skills_path(@person, rating: params["rating"]) do |form|
= render "people/people_skills/edit_form", ff: form, show_category: true
%div.align-items-center.mt-3
= cancel_action_link person_people_skills_path(@person, no_default_skill_prompt: "")
%div#person-skill-overview
Expand Down
6 changes: 5 additions & 1 deletion spec/features/edit_people_skills_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def not_rated_default_skills(person)

within '#default-skills' do
not_rated_default_skills.each do |person_skill|
expect(page).to have_content(person_skill.skill.title)
within "##{person_skill.skill.category.parent.title.parameterize}-skills-container" do
expect(page).to have_content(person_skill.skill.category.parent.title)
expect(page).to have_content(person_skill.skill.category.title)
expect(page).to have_content(person_skill.skill.title)
end
end

expect(page).to have_content('Azubi', count: not_rated_default_skills.count)
Expand Down