-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/litigation sides edit #9
Conversation
Pivotal story here |
<%= form.input :party_type, as: :select, collection: array_to_select_collection(LitigationSide::PARTY_TYPES) %> | ||
|
||
<li class="input"> | ||
<%= button_tag "Remove", type: 'button', class: 'button button--raised button--red', data: { action: "click->nested-list#removeRecord" } %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need double quotes around "click->nested-list#removeRecord"
(and in other actions)?
@@ -31,6 +31,7 @@ group :development, :test do | |||
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] | |||
gem 'capybara' | |||
gem 'factory_bot_rails' | |||
gem 'rails-controller-testing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used anywhere? I can't see any assigns
or assert_template
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I've been debugging failed test and I needed assigns
. Maybe it can stay for debugging.
} | ||
|
||
_setDefaults() { | ||
const selectedOption = this.connectedWithSelect.selectedOptions && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd extract this.getSelectedOption()
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
app/models/litigation_side.rb
Outdated
end | ||
|
||
def self.available_connections | ||
(Company.all + Location.all).map { |c| [c.name, "#{c.class}-#{c.id}"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Company.all.select(:id, :name) + Location.all.select(:id, :name)).map { .. }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
app/services/import_litigations.rb
Outdated
@@ -16,6 +16,10 @@ def import | |||
import_each_with_logging(csv, FILEPATH) do |row| | |||
l = Litigation.find_or_initialize_by(title: row[:title]) | |||
l.update!(litigation_attributes(row)) | |||
get_litigation_sides(row).each do |side| | |||
side.litigation_id = l.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side.update(litigation_id: l.id)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, sure
Thanks for the review @kowal PR Ready again. Please mind that I also changed the menu structure a little bit. |
Adding Edit for litigation sides and also the ability to connect to system entities like Location or Company through polymorphic association.
Reimport litigations