Skip to content
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

Merged
merged 15 commits into from
Jul 26, 2019
Merged

Conversation

tsubik
Copy link
Contributor

@tsubik tsubik commented Jul 25, 2019

Adding Edit for litigation sides and also the ability to connect to system entities like Location or Company through polymorphic association.

litigation_sides

Reimport litigations

be rake import:litigations

@tsubik tsubik requested review from kowal and simaob July 25, 2019 14:20
@tsubik
Copy link
Contributor Author

tsubik commented Jul 25, 2019

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" } %>
Copy link
Contributor

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'
Copy link
Contributor

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.

Copy link
Contributor Author

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 &&
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

end

def self.available_connections
(Company.all + Location.all).map { |c| [c.name, "#{c.class}-#{c.id}"] }
Copy link
Contributor

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 { .. }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@@ -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
Copy link
Contributor

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) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, sure

@tsubik
Copy link
Contributor Author

tsubik commented Jul 26, 2019

Thanks for the review @kowal

PR Ready again. Please mind that I also changed the menu structure a little bit.

image

@tsubik tsubik merged commit fe48b92 into develop Jul 26, 2019
@tsubik tsubik deleted the feature/litigation-sides-edit branch July 26, 2019 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants