ECP-206 Delete the 3 info boxes for each sub-category on the Browse page

main
rebuilt 1 month ago
parent aa39303dfc
commit b6675c2516

@ -54,6 +54,7 @@ group :development do
gem 'rubocop-rspec', require: false gem 'rubocop-rspec', require: false
gem 'rubocop-rspec_rails' gem 'rubocop-rspec_rails'
gem 'seed_dump' gem 'seed_dump'
gem 'solargraph'
gem 'solargraph-reek' gem 'solargraph-reek'
gem 'spring' gem 'spring'
# gem "web-console" # gem "web-console"

@ -386,7 +386,7 @@ GEM
rb-fsevent (0.11.2) rb-fsevent (0.11.2)
rb-inotify (0.11.1) rb-inotify (0.11.1)
ffi (~> 1.0) ffi (~> 1.0)
rbs (3.9.4) rbs (3.9.5)
logger logger
rdoc (6.14.0) rdoc (6.14.0)
erb erb
@ -481,7 +481,7 @@ GEM
simplecov-html (0.13.1) simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4) simplecov_json_formatter (0.1.4)
smart_properties (1.17.0) smart_properties (1.17.0)
solargraph (0.55.1) solargraph (0.57.0)
backport (~> 1.2) backport (~> 1.2)
benchmark (~> 0.4) benchmark (~> 0.4)
bundler (~> 2.0) bundler (~> 2.0)
@ -493,12 +493,14 @@ GEM
observer (~> 0.1) observer (~> 0.1)
ostruct (~> 0.6) ostruct (~> 0.6)
parser (~> 3.0) parser (~> 3.0)
rbs (~> 3.3) prism (~> 1.4)
rbs (>= 3.6.1, <= 4.0.0.dev.4)
reverse_markdown (~> 3.0) reverse_markdown (~> 3.0)
rubocop (~> 1.38) rubocop (~> 1.76)
thor (~> 1.0) thor (~> 1.0)
tilt (~> 2.0) tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24) yard (~> 0.9, >= 0.9.24)
yard-activesupport-concern (~> 0.0)
yard-solargraph (~> 0.1) yard-solargraph (~> 0.1)
solargraph-reek (0.1.1) solargraph-reek (0.1.1)
reek (>= 5.0) reek (>= 5.0)
@ -517,7 +519,7 @@ GEM
railties (>= 6.0.0) railties (>= 6.0.0)
stringio (3.1.7) stringio (3.1.7)
thor (1.3.2) thor (1.3.2)
tilt (2.6.0) tilt (2.6.1)
timeout (0.4.3) timeout (0.4.3)
trollop (2.9.10) trollop (2.9.10)
turbo-rails (2.0.16) turbo-rails (2.0.16)
@ -545,6 +547,8 @@ GEM
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
yard (0.9.37) yard (0.9.37)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
yard-solargraph (0.1.0) yard-solargraph (0.1.0)
yard (~> 0.9) yard (~> 0.9)
zeitwerk (2.7.3) zeitwerk (2.7.3)
@ -607,6 +611,7 @@ DEPENDENCIES
rubocop-rspec_rails rubocop-rspec_rails
seed_dump seed_dump
simplecov simplecov
solargraph
solargraph-reek solargraph-reek
spring spring
sprockets-rails sprockets-rails

@ -69,6 +69,6 @@ module AnalyzeHelper
def base_url def base_url
analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @presenter.category,
subcategory: @presenter.subcategory) subcategory: @presenter.subcategory)
end end
end end

@ -2,7 +2,7 @@ class Benefit < ApplicationRecord
scope :by_designation, -> { all.map { |benefits| [benefits.designation, benefits] }.to_h } scope :by_designation, -> { all.map { |benefits| [benefits.designation, benefits] }.to_h }
def self.to_designation(benefits) def self.to_designation(benefits)
return "Unknown" if benefits.blank? or benefits.nil? return "Unknown" if benefits.blank? || benefits.nil?
case benefits case benefits
in /^1$/i in /^1$/i

@ -2,7 +2,7 @@ class Education < ApplicationRecord
scope :by_designation, -> { all.map { |education| [education.designation, education] }.to_h } scope :by_designation, -> { all.map { |education| [education.designation, education] }.to_h }
def self.to_designation(education) def self.to_designation(education)
return "Unknown" if education.blank? or education.nil? return "Unknown" if education.blank? || education.nil?
case education case education
in /^1$/i in /^1$/i

@ -2,7 +2,7 @@ class Employment < ApplicationRecord
scope :by_designation, -> { all.map { |employment| [employment.designation, employment] }.to_h } scope :by_designation, -> { all.map { |employment| [employment.designation, employment] }.to_h }
def self.to_designation(employment) def self.to_designation(employment)
return "Unknown" if employment.blank? or employment.nil? return "Unknown" if employment.blank? || employment.nil?
case employment case employment
in /^1$|^1100$/i in /^1$|^1100$/i

@ -11,7 +11,7 @@ module Analyze
end end
def label def label
["#{ell.designation}"] [ell.designation.to_s]
end end
def basis def basis

@ -11,7 +11,7 @@ module Analyze
end end
def label def label
["#{gender.designation}"] [gender.designation.to_s]
end end
def basis def basis

@ -11,7 +11,7 @@ module Analyze
end end
def label def label
["#{grade}"] [grade.to_s]
end end
def basis def basis

@ -11,7 +11,7 @@ module Analyze
end end
def label def label
["#{sped.designation}"] [sped.designation.to_s]
end end
def basis def basis

@ -49,7 +49,7 @@ class SurveyResponsesDataLoader
workers = pool_size.times.map do workers = pool_size.times.map do
Thread.new do Thread.new do
while slice = jobs.pop(true) while (slice = jobs.pop(true))
slice.each do |line| slice.each do |line|
survey_item_responses = [] survey_item_responses = []

@ -13,32 +13,6 @@
<div class="d-flex flex-column mx-7"> <div class="d-flex flex-column mx-7">
<p class="body-large "><%= subcategory.description %></p> <p class="body-large "><%= subcategory.description %></p>
<div class="d-flex justify-content-start">
<div
class="body-large text-center response-rate"
data-bs-toggle="popover"
data-bs-trigger="hover focus"
data-bs-content="The number of publicly available school data sources, often collected from the MA Department of Elementary and Secondary Education."
data-bs-placement="bottom"
>
<p class="response-rate-percentage"><%= subcategory.admin_collection_rate.first %> / <%= subcategory.admin_collection_rate.last %></p>
<p>school data sources</p>
</div>
<div
class="body-large mx-3 text-center response-rate"
data-bs-toggle="popover"
data-bs-trigger="hover focus"
data-bs-content="The student survey response rate for this sub-category. This number differs from the overall response rate because each individual student receives 44 of 67 total questions, in order to avoid survey fatigue. This number is also adjusted to reflect any instances where a student has decided to skip a survey question."
data-bs-placement="bottom"
>
<p class="response-rate-percentage"><%= subcategory.student_response_rate %></p>
<p>of students responded</p>
</div>
<div class="body-large text-center response-rate" >
<p class="response-rate-percentage"><%= subcategory.teacher_response_rate %></p>
<p>of teachers responded</p>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -39,14 +39,14 @@ namespace :upload do
upload_filename = filename.split('sqm-dashboards')[1][1..] upload_filename = filename.split('sqm-dashboards')[1][1..]
upload_directory = upload_filename.rpartition('/').first upload_directory = upload_filename.rpartition('/').first
tmp_dir = upload_directory + '/' tmp_dir = "#{upload_directory}/"
parent_dir = "/" parent_dir = "/"
while tmp_dir.include?('/') while tmp_dir.include?('/')
first_dir = tmp_dir.split('/').first first_dir = tmp_dir.split('/').first
sftp.mkdir!("#{parent_dir}#{first_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir) sftp.mkdir!("#{parent_dir}#{first_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir)
parent_dir += first_dir + '/' parent_dir += "#{first_dir}/"
tmp_dir = tmp_dir.split('/')[1..].join('/') tmp_dir = tmp_dir.split('/')[1..].join('/')
end end
sftp.mkdir!("#{parent_dir}#{tmp_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir) sftp.mkdir!("#{parent_dir}#{tmp_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir)

@ -462,7 +462,7 @@ RSpec.describe SurveyItemValues, type: :model do
it "returns an unknown race" do it "returns an unknown race" do
row = {"Race-1" => ""} row = {"Race-1" => ""}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
@ -475,7 +475,7 @@ RSpec.describe SurveyItemValues, type: :model do
it "returns an unknown race" do it "returns an unknown race" do
row = {"Race-1" => "99", "Race-2" => "99", "Race-3" => "", "Race-4" => "nil"} row = {"Race-1" => "99", "Race-2" => "99", "Race-3" => "", "Race-4" => "nil"}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
@ -488,15 +488,15 @@ RSpec.describe SurveyItemValues, type: :model do
context "for defined races" do context "for defined races" do
it "returns the qualtrics code of that race" do it "returns the qualtrics code of that race" do
[1,2,3,4,5,8].each do |i| [1, 2, 3, 4, 5, 8].each do |i|
row = {"Race-1" => "#{i}"} row = {"Race-1" => i.to_s}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:) values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [i] expect(values.races_of_children).to eq [i]
end end
end end
end end
@ -506,7 +506,7 @@ RSpec.describe SurveyItemValues, type: :model do
row = {"Race-1" => "6"} row = {"Race-1" => "6"}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
@ -515,7 +515,7 @@ RSpec.describe SurveyItemValues, type: :model do
row = {"Race-1" => "7"} row = {"Race-1" => "7"}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
@ -530,14 +530,14 @@ RSpec.describe SurveyItemValues, type: :model do
context "when there is more than one race defined" do context "when there is more than one race defined" do
it "returns the qualtrics code for the two races and the designation for multiracial(100)" do it "returns the qualtrics code for the two races and the designation for multiracial(100)" do
row = {"Race-1" => "1", "Race-2" => "2","Race-3" => "3"} row = {"Race-1" => "1", "Race-2" => "2", "Race-3" => "3"}
row.keys.each do |key| row.each_key do |key|
headers << key headers << key
end end
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:) values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [1,2,3,100] expect(values.races_of_children).to eq [1, 2, 3, 100]
end end
end end

@ -368,16 +368,16 @@ describe SurveyResponsesDataLoader do
it "returns -1 when any aspect of the data is unknown" do it "returns -1 when any aspect of the data is unknown" do
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "Unknown"), [Employment.new(designation: "Two adults with full-time employment")]) score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "Unknown"), [Employment.new(designation: "Two adults with full-time employment")])
expect(score).to eq -1 expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "No"), [Employment.new(designation: "Unknown")]) score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "No"), [Employment.new(designation: "Unknown")])
expect(score).to eq -1 expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), [Employment.new(designation: "No full-time or part-time employment")]) score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), [Employment.new(designation: "No full-time or part-time employment")])
expect(score).to eq -1 expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), []) score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), [])
expect(score).to eq -1 expect(score).to eq(-1)
end end
end end
end end

Loading…
Cancel
Save