From 130b69ca1a4104e98955214d399e028912963ff4 Mon Sep 17 00:00:00 2001 From: "Erin E. Sullivan" Date: Tue, 5 Sep 2023 07:33:27 -0400 Subject: [PATCH 1/5] September 2023 dependency updates. --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index a639007..5a4e343 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "devDependencies": { "cssnano": "^6.0.1", - "postcss": "^8.4.27", + "postcss": "^8.4.29", "postcss-cli": "^10.1.0", "postcss-import": "^15.1.0" } @@ -168,9 +168,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001519", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz", - "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==", + "version": "1.0.30001527", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001527.tgz", + "integrity": "sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ==", "dev": true, "funding": [ { @@ -511,9 +511,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.485", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.485.tgz", - "integrity": "sha512-1ndQ5IBNEnFirPwvyud69GHL+31FkE09gH/CJ6m3KCbkx3i0EVOrjwz4UNxRmN9H8OVHbC6vMRZGN1yCvjSs9w==", + "version": "1.4.508", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz", + "integrity": "sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==", "dev": true }, "node_modules/emoji-regex": { @@ -595,9 +595,9 @@ } }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -917,9 +917,9 @@ } }, "node_modules/postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.29", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", + "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", "dev": true, "funding": [ { @@ -1763,9 +1763,9 @@ } }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.2.tgz", + "integrity": "sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index 61f9bc1..ed1f963 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "homepage": "https://github.com/mlibrary/catalog-browse#readme", "devDependencies": { "cssnano": "^6.0.1", - "postcss": "^8.4.27", + "postcss": "^8.4.29", "postcss-cli": "^10.1.0", "postcss-import": "^15.1.0" } From 5889526f02458c421e17b9a4a4bdaf1bde6c3ccc Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Mon, 11 Sep 2023 11:21:36 -0400 Subject: [PATCH 2/5] updates dockerfile; updates gems --- Dockerfile | 11 ++++++++--- Gemfile.lock | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 614e644..860092a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,18 +3,23 @@ FROM ruby:3.2 AS development ARG UNAME=app ARG UID=1000 ARG GID=1000 +ARG NODE_MAJOR=20 -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ + ca-certificates \ + gnupg \ apt-transport-https \ - nodejs \ vim-tiny +RUN mkdir -p /etc/apt/keyrings +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends nodejs + RUN gem install bundler RUN npm install -g npm - RUN groupadd -g ${GID} -o ${UNAME} RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME} RUN mkdir -p /gems && chown ${UID}:${GID} /gems diff --git a/Gemfile.lock b/Gemfile.lock index 554c01c..b51e959 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - anyway_config (2.5.1) + anyway_config (2.5.2) ruby-next-core (>= 0.14.0) ast (2.4.2) base64 (0.1.1) @@ -72,7 +72,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.1) - rubocop (1.56.1) + rubocop (1.56.3) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -109,10 +109,10 @@ GEM rack-protection (= 3.1.0) sinatra (= 3.1.0) tilt (~> 2.0) - standard (1.31.0) + standard (1.31.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.56.0) + rubocop (~> 1.56.2) standard-custom (~> 1.0.0) standard-performance (~> 1.2) standard-custom (1.0.2) @@ -123,7 +123,7 @@ GEM rubocop-performance (~> 1.19.0) tilt (2.2.0) unicode-display_width (2.4.2) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -161,4 +161,4 @@ DEPENDENCIES yabeda-puma-plugin BUNDLED WITH - 2.4.13 + 2.4.19 From a74c2682eb6a0646ff0372bddeae13a7037fddc6 Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Mon, 11 Sep 2023 11:28:19 -0400 Subject: [PATCH 3/5] removes author and subject feature gates --- README.md | 2 -- catalog-browse.rb | 41 +++++++++++++++++-------------------- env.example | 2 -- views/layout/search_box.erb | 6 ------ 4 files changed, 19 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index a40a575..36c1e75 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,3 @@ If you are working on features, set up a gate so that the feature can be turned In this project we create an environment variable for the feature. If it is true the feature is enabled. If it is false then it is turned off. Current Features: -* `AUTHOR_ON='true'` for enabling Browse By Author -* `SUBJECT_ON='true'` for enabling Browse By Subject diff --git a/catalog-browse.rb b/catalog-browse.rb index 43d59d5..cf98b1f 100644 --- a/catalog-browse.rb +++ b/catalog-browse.rb @@ -22,31 +22,28 @@ config.solr_url = ENV.fetch("BIBLIO_SOLR") end -if ENV.fetch("SUBJECT_ON") == "true" - get "/subject" do - subject = StringCleaner.clean_browse_string(params[:query]) - reference_id = params[:reference_id] || subject - begin - list = SubjectList.for(direction: params[:direction], reference_id: reference_id, num_rows_to_display: 20, original_reference: subject, banner_reference: params[:banner_reference]) - rescue => e - logger.error(e.message) - list = SubjectList::Error.new(reference_id) - end - erb :subject, locals: {list: list} +get "/subject" do + subject = StringCleaner.clean_browse_string(params[:query]) + reference_id = params[:reference_id] || subject + begin + list = SubjectList.for(direction: params[:direction], reference_id: reference_id, num_rows_to_display: 20, original_reference: subject, banner_reference: params[:banner_reference]) + rescue => e + logger.error(e.message) + list = SubjectList::Error.new(reference_id) end + erb :subject, locals: {list: list} end -if ENV.fetch("AUTHOR_ON") == "true" - get "/author" do - author = StringCleaner.clean_browse_string(params[:query]) - reference_id = params[:reference_id] || author - begin - list = AuthorList.for(direction: params[:direction], reference_id: reference_id, num_rows_to_display: 20, original_reference: author, banner_reference: params[:banner_reference]) - rescue => e - logger.error(e.message) - list = AuthorList::Error.new(reference_id) - end - erb :authors, locals: {list: list} + +get "/author" do + author = StringCleaner.clean_browse_string(params[:query]) + reference_id = params[:reference_id] || author + begin + list = AuthorList.for(direction: params[:direction], reference_id: reference_id, num_rows_to_display: 20, original_reference: author, banner_reference: params[:banner_reference]) + rescue => e + logger.error(e.message) + list = AuthorList::Error.new(reference_id) end + erb :authors, locals: {list: list} end get "/callnumber" do callnumber = params[:query] diff --git a/env.example b/env.example index f1cac2f..9c73f9e 100644 --- a/env.example +++ b/env.example @@ -2,5 +2,3 @@ BIBLIO_SOLR='http://biblio-server/solr' CATALOG_SOLR='http://catalog-solr-server/solr' CALLNUMBERS_CORE='callnumbers' AUTHORS_CORE='authors' -AUTHOR_ON='true' -SUBJECT_ON='true' diff --git a/views/layout/search_box.erb b/views/layout/search_box.erb index 070efd2..3abc076 100644 --- a/views/layout/search_box.erb +++ b/views/layout/search_box.erb @@ -1,12 +1,6 @@ <% fields = YAML.load_file("./config/search_dropdown.yml") active_browse_option = 'browse_by_' + request.path_info[1..-1] - if ENV.fetch("SUBJECT_ON") == "false" - browse_by = fields.find{|x| x[:label] == "Browse by [BETA]"} - browse_by_subject = browse_by[:options].find{|x| x[:label] == "Browse by subject"} - browse_by_subject[:label] = "Browse by subject (coming soon)" - browse_by_subject[:disabled] = "disabled" - end %>