From bb6f6306c421a79aa83dc7738a28402508388d5d Mon Sep 17 00:00:00 2001 From: rebuilt Date: Sat, 16 Oct 2021 12:54:31 +0200 Subject: [PATCH] fix dependabot alerts by upgrading puma and nokogiri --- Gemfile | 4 ++- Gemfile.lock | 6 +++-- app/javascript/application.js | 14 +++++----- app/javascript/dashboard.js | 22 +++++++++------- app/javascript/home.js | 49 +++++++++++++++++++---------------- 5 files changed, 54 insertions(+), 41 deletions(-) diff --git a/Gemfile b/Gemfile index a3aa8d81..23162cf0 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'rails', '~> 6.1.4.1' gem 'pg' # Use Puma as the app server -gem 'puma', '~> 3.0' +gem "puma", ">= 5.5.2" # Use SCSS for stylesheets gem 'sassc-rails' # Use Uglifier as compressor for JavaScript assets @@ -34,6 +34,8 @@ gem 'jbuilder', '~> 2.5' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +gem "nokogiri", ">= 1.12.5" + gem 'bootsnap', require: false gem 'haml' diff --git a/Gemfile.lock b/Gemfile.lock index e2266cbf..1147f7de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,7 +164,8 @@ GEM pg (1.2.3) popper_js (2.9.3) public_suffix (4.0.6) - puma (3.12.6) + puma (5.5.2) + nio4r (~> 2.0) racc (1.5.2) rack (2.2.3) rack-protection (2.1.0) @@ -299,9 +300,10 @@ DEPENDENCIES listen (~> 3.0.5) nested_scaffold newrelic_rpm + nokogiri (>= 1.12.5) omniauth pg - puma (~> 3.0) + puma (>= 5.5.2) rails (~> 6.1.4.1) rails-controller-testing rspec-rails (~> 4.1.2) diff --git a/app/javascript/application.js b/app/javascript/application.js index 018d4f16..43a400f7 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,13 +1,13 @@ // Entry point for the build script in your package.json - import Rails from "@rails/ujs"; - import Turbolinks from "turbolinks"; - import * as ActiveStorage from "@rails/activestorage"; - // import "channels"; +import Rails from "@rails/ujs"; +import Turbolinks from "turbolinks"; +import * as ActiveStorage from "@rails/activestorage"; +// import "channels"; - Rails.start(); - Turbolinks.start(); - ActiveStorage.start(); +Rails.start(); +Turbolinks.start(); +ActiveStorage.start(); import { initializeListenersForNavDropdowns } from "./dashboard.js"; import { initializeListenersForHomeDropdowns } from "./home.js"; diff --git a/app/javascript/dashboard.js b/app/javascript/dashboard.js index 74aad336..5b2cc90c 100644 --- a/app/javascript/dashboard.js +++ b/app/javascript/dashboard.js @@ -1,14 +1,18 @@ -export function initializeListenersForNavDropdowns(){ - document.addEventListener("turbolinks:load", function() { - const schoolDropdown = document.querySelector('#select-school'); +export function initializeListenersForNavDropdowns() { + document.addEventListener("turbolinks:load", function () { + const schoolDropdown = document.querySelector("#select-school"); if (schoolDropdown) { - document.querySelector('#select-school').addEventListener('change', (event) => { - window.location = event.target.value; - }); + document + .querySelector("#select-school") + .addEventListener("change", (event) => { + window.location = event.target.value; + }); - document.querySelector('#select-district').addEventListener('change', (event) => { - window.location = event.target.value; - }); + document + .querySelector("#select-district") + .addEventListener("change", (event) => { + window.location = event.target.value; + }); } }); } diff --git a/app/javascript/home.js b/app/javascript/home.js index bbc1476e..e0c1fe48 100644 --- a/app/javascript/home.js +++ b/app/javascript/home.js @@ -1,28 +1,33 @@ -export function initializeListenersForHomeDropdowns(){ -document.addEventListener('turbolinks:load', () => { - const districtDropdown = document.querySelector('#district-dropdown'); - if (districtDropdown) { - districtDropdown.addEventListener('change', event => { - const schoolDropdown = document.querySelector('#school-dropdown'); +export function initializeListenersForHomeDropdowns() { + document.addEventListener("turbolinks:load", () => { + const districtDropdown = document.querySelector("#district-dropdown"); + if (districtDropdown) { + districtDropdown.addEventListener("change", (event) => { + const schoolDropdown = document.querySelector("#school-dropdown"); - const districtId = Number(event.target.value); + const districtId = Number(event.target.value); - const schoolsInDistrict = window.schools.filter(school => school.district_id === districtId); + const schoolsInDistrict = window.schools.filter( + (school) => school.district_id === districtId + ); - schoolsInDistrict.forEach(school => { - const optionElem = document.createElement('option'); - optionElem.setAttribute('value', school.url); - const schoolNameNode = document.createTextNode(school.name); - optionElem.appendChild(schoolNameNode); - schoolDropdown.appendChild(optionElem); + schoolsInDistrict.forEach((school) => { + const optionElem = document.createElement("option"); + optionElem.setAttribute("value", school.url); + const schoolNameNode = document.createTextNode(school.name); + optionElem.appendChild(schoolNameNode); + schoolDropdown.appendChild(optionElem); + }); }); - }); - document.querySelector('button[data-id="go-to-school"]').addEventListener('click', event => { - const selectedSchoolURL = document.querySelector('#school-dropdown').value; - window.location = selectedSchoolURL; - }); - } -}); -return true; + document + .querySelector('button[data-id="go-to-school"]') + .addEventListener("click", (event) => { + const selectedSchoolURL = + document.querySelector("#school-dropdown").value; + window.location = selectedSchoolURL; + }); + } + }); + return true; }