Skip to content

District dropdown#8394

Merged
breville merged 27 commits into
stagingfrom
district-dropdown
May 18, 2016
Merged

District dropdown#8394
breville merged 27 commits into
stagingfrom
district-dropdown

Conversation

@breville

@breville breville commented May 13, 2016

Copy link
Copy Markdown
Member

Builds upon work by @tanyaparker to have a district dropdown selector, used first in the workshop enrollment page.

tanyaparker and others added 6 commits April 19, 2016 13:04
This adds a .tsv file generated from our 18,000-long gsheet of US districts.  It's imported into the database.

The district dropdown then retrieves the appropriate set of per-state entries when a state is selected in the preceding dropdown, from which the user can select their district.

Definitely work in progress, but wanted to get this saved.
Conflicts:
	dashboard/db/schema.rb
Comment thread dashboard/test/factories.rb Outdated
@@ -1,4 +1,10 @@
FactoryGirl.define do
FactoryGirl.define do factory :school_district do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/MultilineBlockLayout: Block body expression is on the same line as the block start.

def self.find_or_create_all_from_tsv!(filename)
created = []
CSV.read(filename, CSV_IMPORT_OPTIONS).each do |row|
created << self.first_or_create_from_tsv_row!(row)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: prefer map. Can this code be de-duped against the similar code in callout.rb?

@aoby aoby May 17, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also nit: prefer newer ruby hash syntax (no unnecessary hash rocket)

{
  id: 'LEAID',
  name: 'NAME',
  ...

breville added 3 commits May 13, 2016 22:36
The small district dropdown widget actually involves a bunch of state transitions, as the various options are explored.  This change hopefully takes care of all of them, getting the right information fed into the form, and clearing out any entries that shouldn't make it through based on what the user ultimately chooses.
<br/>
<iframe src="https://www.google.com/maps/d/u/0/embed?mid=z3jxShb6X1IM.khZ1NwyRM_3Y" width="640" height="480"></iframe>

<%= view :district_dropdown %>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tanyaparker is this page live yet? if so, i should just leave the map in place for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, this page is live and we should leave in the map. For spectators, we shouldn't change it to the dropdown until we save the info in a pegasus form and know where to redirect each district (application, waitlist, exception).

Conflicts:
	dashboard/db/schema.rb
	dashboard/db/schema_cache.dump
Comment thread dashboard/app/models/school_district.rb Outdated
end

def self.first_or_create_from_tsv_row!(row_data)
params = {id: row_data[CSV_HEADERS[:id]],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, start items on a new line for cleaner indentation:

params = {
  id: row_data[...],
  name: ...
  ...
}

@breville breville merged commit ca99c04 into staging May 18, 2016
@breville breville deleted the district-dropdown branch May 18, 2016 22:07
aoby pushed a commit that referenced this pull request Jul 14, 2016
missing) and provided optional enrollment.district_name which was accidentally
removed in #8394.
@aoby aoby mentioned this pull request Jul 14, 2016
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.

6 participants