-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement redirect to modal after edit button has been clicked * use yarn as manager * try to add modal * revert back to npm * clean up * clean up * clean up * use new crud controller * Add create functionality * start implementing show error * implement showing error messages when submiting invalid data * ingore unnecessary test for this feature * correct rubocop offenses * style modal * fix bug of reopening modal when cancel button was clicked * adjust styling of modal * only include children in category dropdown and change label of options * adjust styling of danger alerts * sort category options by the title of their parent * beginn with implementation of edit skillset * edit table row with stimulus instead of raw javascript * use different approach to make table row editable * use turbo-frame to edit row instead of bootstrap property * implement selection change when category parent was selected * finish form to edit skills * decrease default bootstrap padding of select * give style to other dropdown too * fix error of not defined option values * insert error tag below edit of row if form is invalid * begin with testing * finish test implementation * increase width of content * fix tests after changing category of skill * change bootstrap classes on divs * try using retry mechanism to fix test on pipeline * use sleep method to resolve timing problem * revert changes on yarn lock file * replace sleep with capybara expectation * refactor edit functionality by reloading whole row after dropdown change * use CRUD controller impelementation as approach instead of custom update action * fix error of wrong rerender by using requestSubmit method instead of submit * fix text by adjusting name of query parameter and rework styles * adjust ids of selects * delete unnecessary within command in test * rework tests by using different way to select option and adjusting ids * refactor code after pullrequest review * revert changes of capybara configuration * resolve rubocop offenses * remove unnecessary method and fix error by assigning update variable again * fix tests by including authorization step * resolve merge errors --------- Co-authored-by: Yanick Minder <[email protected]>
- Loading branch information
1 parent
69f4f08
commit 2f03d3b
Showing
22 changed files
with
1,957 additions
and
77 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
@import 'bootstrap/scss/bootstrap'; | ||
@import 'bootstrap-icons/font/bootstrap-icons'; | ||
|
||
.portfolio-select, .radar-select { | ||
width: 100% !important; | ||
padding-right: 0 !important; | ||
padding-left: 0 !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
= form_with(model: @skill) do |f| | ||
.row.border.border-top.table-light.table-hover.table-row | ||
.col-2.d-flex.align-items-center | ||
= f.text_field :title, class: "form-control", value: @skill.title | ||
.col-1.bg-light.d-flex.align-items-center | ||
=@skill.people.count | ||
.col-3.d-flex.align-items-center | ||
= f.collection_select :category_parent, Category.all_parents { |category| category.title}, :id, :title, {:selected => @skill.category.parent.id}, class: "form-select w-100", onchange: "this.form.action = this.form.action + '?validate_only=true'; this.form.requestSubmit()" | ||
.col-2.bg-light.d-flex.align-items-center | ||
= f.collection_select :category_id, entry.category.parent.children, :id, :title, {:selected => entry.category.id}, class: "form-select w-100" | ||
.col-1.d-flex.align-items-center | ||
=f.check_box :default_set, class: "form-check-input", checked: entry.default_set | ||
.col-1.bg-light.d-flex.align-items-center | ||
= f.select :radar, Settings.radar, {:selected => entry.radar}, class: "form-select radar-select" | ||
.col-1.d-flex.align-items-center | ||
= f.select :portfolio, Settings.portfolio, {:selected => entry.portfolio}, class: "form-select portfolio-select" | ||
.col-1 | ||
%div.h-100.d-flex.justify-content-center.align-items-center | ||
= image_submit_tag("/assets/floppy2-fill.svg") | ||
= link_to skills_path, class: "ms-3" do | ||
%img.pointer{:src=> "/assets/x.svg",:height=>"16"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
%div | ||
%h1.font-bold.text-2xl.mb-3 Editing Skill | ||
%turbo-frame{id: "#{dom_id @skill}"} | ||
= render "skills/row", skill: @skill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= turbo_stream.update "#{dom_id @skill}" do %> | ||
<%= render "row", skill: @skill %> | ||
<% if @skill.errors.any? %> | ||
<div class="alert alert-danger mt-2"> | ||
<ul class="mb-0"> | ||
<% @skill.errors.full_messages.each do |error| %> | ||
<li><%= error %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
%div.d-flex.justify-content-end | ||
=link_to image_tag("plus-lg.svg", class: "text-primary")+ "Neuer Skill", new_skill_path, class: "btn text-primary", data: { turbo_frame: "remote_modal" } | ||
|
||
%table.table.table-hover | ||
%thead.table-light | ||
%tr | ||
%th{scope: "col"}= t "skills.table.skill" | ||
%th.table-secondary{scope: "col"}= t "skills.table.members" | ||
%th{scope: "col"}= t "skills.table.category" | ||
%th.table-secondary{scope: "col"}= t "skills.table.subcategory" | ||
%th{scope: "col"}= t "skills.table.default_set" | ||
%th.table-secondary{scope: "col"}= t "skills.table.radar" | ||
%th{scope: "col"}= t "skills.table.modify" | ||
%tbody | ||
- @skills.each_with_index do |skill| | ||
%tr | ||
%td= skill.title | ||
%td.table-light= skill.people.count | ||
%td= skill.category.title | ||
%td.table-light= skill.category.parent&.title | ||
%td= skill.default_set.nil? ? "Neu" : (skill.default_set? ? "Ja" : "Nein") | ||
%td.table-light= skill.radar | ||
%td | ||
%img{:src=> "/assets/pencil-square.svg",:height=>"16"} | ||
.row.bg-light-subtle.border.border-top.border-5.border-secondary.border-top-0.border-start-0.border-end-0 | ||
.col-2.d-flex.align-items-center | ||
%strong= t "skills.table.skill" | ||
.col-1.bg-secondary-subtle.d-flex.align-items-center | ||
%strong= t "skills.table.members" | ||
.col-3.d-flex.align-items-center | ||
%strong= t "skills.table.category" | ||
.col-2.bg-secondary-subtle.d-flex.align-items-center | ||
%strong= t "skills.table.subcategory" | ||
.col-1.d-flex.align-items-center | ||
%strong= t "skills.table.default_set" | ||
.col-1.bg-secondary-subtle.d-flex.align-items-center | ||
%strong= t "skills.table.radar" | ||
.col-1.d-flex.align-items-center | ||
%strong= t "skills.table.portfolio" | ||
.col-1.bg-secondary-subtle.d-flex.align-items-center | ||
%strong= t "skills.table.modify" | ||
- @skills.each do |skill| | ||
%turbo-frame{id: "#{dom_id skill}"} | ||
.row.border.border-top.table-light.tableform-hover.table-row | ||
.col-2.d-flex.align-items-center | ||
=skill.title | ||
.col-1.bg-light.d-flex.align-items-center | ||
=skill.people.count | ||
.col-3.d-flex.align-items-center | ||
=skill.category.parent.title | ||
.col-2.bg-light.d-flex.align-items-center | ||
=skill.category.title | ||
.col-1.d-flex.align-items-center | ||
=skill.default_set.nil? ? "Neu" : (skill.default_set? ? "Ja" : "Nein") | ||
.col-1.bg-light.d-flex.align-items-center | ||
=skill.radar | ||
.col-1.d-flex.align-items-center | ||
=skill.portfolio | ||
.col-1.bg-light | ||
%div.h-100.d-flex.justify-content-center.align-items-center | ||
=link_to edit_skill_path(skill), class: "btn bg-gray-100" do | ||
%img.pointer.edit-button{:src=> "/assets/pencil-square.svg",:height=>"16"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
%div | ||
%h1 | ||
= @skill.title | ||
%div | ||
%h5 | ||
= link_to "Skill bearbeiten", edit_skill_path(@skill) | ||
= link_to "Alle Skills ansehen", skills_path | ||
%turbo-frame{id: "#{dom_id @skill}"} | ||
.row.border.border-top.table-light.tableform-hover.table-row | ||
.col-2.d-flex.align-items-center | ||
=@skill.title | ||
.col-1.bg-light.d-flex.align-items-center | ||
=@skill.people.count | ||
.col-3.d-flex.align-items-center | ||
=@skill.category.parent.title | ||
.col-2.bg-light.d-flex.align-items-center | ||
=@skill.category.title | ||
.col-1.d-flex.align-items-center | ||
=@skill.default_set.nil? ? "Neu" : (@skill.default_set? ? "Ja" : "Nein") | ||
.col-1.bg-light.d-flex.align-items-center | ||
=@skill.radar | ||
.col-1.bg-light.d-flex.align-items-center | ||
=@skill.portfolio | ||
.col-1 | ||
%div.h-100.d-flex.justify-content-center.align-items-center | ||
=link_to edit_skill_path(@skill), class: "btn bg-gray-100" do | ||
%img.pointer.edit-button{:src=> "/assets/pencil-square.svg",:height=>"16"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.