From 32f103fe149451f31acdd0ff05f3280438835c23 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Cabral da Cunha Date: Fri, 13 Sep 2024 09:59:08 -0300 Subject: [PATCH 1/8] #498 adding observation field to academic_transcript pdf --- app/controllers/enrollments_controller.rb | 1 + app/helpers/enrollments_pdf_helper.rb | 26 +++++++++++++++++++ .../academic_transcript_pdf.pdf.prawn | 2 ++ config/locales/enrollment.pt-BR.yml | 2 ++ ...s_to_academic_transcript_to_enrollments.rb | 11 ++++++++ db/schema.rb | 3 ++- 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240912113419_add_obs_to_academic_transcript_to_enrollments.rb diff --git a/app/controllers/enrollments_controller.rb b/app/controllers/enrollments_controller.rb index b9e3fa90..4741ff59 100644 --- a/app/controllers/enrollments_controller.rb +++ b/app/controllers/enrollments_controller.rb @@ -126,6 +126,7 @@ class EnrollmentsController < ApplicationController :thesis_title, :thesis_defense_date, :obs, + :obs_to_academic_transcript, :advisements, :scholarship_durations, diff --git a/app/helpers/enrollments_pdf_helper.rb b/app/helpers/enrollments_pdf_helper.rb index b737bd8c..3cb0bd9c 100644 --- a/app/helpers/enrollments_pdf_helper.rb +++ b/app/helpers/enrollments_pdf_helper.rb @@ -710,6 +710,32 @@ def thesis_table(curr_pdf, options = {}) end end + def obs_table(pdf, options = {}) + if options[:enrollment]&.obs_to_academic_transcript.present? + data_table_rows = [[ + "#{I18n.t("pdf_content.enrollment.academic_transcript.obs_to_academic_transcript")} #{ + rescue_blank_text(options[:enrollment].obs_to_academic_transcript) + }" + ]] + + pdf.table( + data_table_rows, + cell_style: { + borders: [:left, :right, :bottom, :top], + border_bottom_width: 0.5, + border_top_width: 0.15, + width: 560, + padding_top: 5.5, + padding_bottom: 7.5, + inline_format: true, + font: "FreeMono", + size: 8, + border_color: "000080" + } + ) + end + end + def justification_grade_not_count_in_gpr_table(curr_pdf, options = {}) enrollment ||= options[:enrollment] diff --git a/app/views/enrollments/academic_transcript_pdf.pdf.prawn b/app/views/enrollments/academic_transcript_pdf.pdf.prawn index c0f7ac6e..716d4c38 100644 --- a/app/views/enrollments/academic_transcript_pdf.pdf.prawn +++ b/app/views/enrollments/academic_transcript_pdf.pdf.prawn @@ -23,5 +23,7 @@ new_document( thesis_table(pdf, enrollment: @enrollment) + obs_table(pdf, enrollment: @enrollment) + enrollment_holds_table(pdf, enrollment: @enrollment) end diff --git a/config/locales/enrollment.pt-BR.yml b/config/locales/enrollment.pt-BR.yml index c12d1c37..c7310bfc 100644 --- a/config/locales/enrollment.pt-BR.yml +++ b/config/locales/enrollment.pt-BR.yml @@ -41,6 +41,7 @@ pt-BR: thesis_defense_committee_participations: "Banca Avaliadora" thesis_defense_committee_professors: "Banca Avaliadora" accomplishment_conclusion_date_not_given: "---------/----" + obs_to_academic_transcript: "Observação para o Histórico" errors: models: @@ -101,6 +102,7 @@ pt-BR: title: "Histórico Escolar" total_credits: "Total" scholarships: "BOLSAS" + obs_to_academic_transcript: "OBSERVAÇÕES:" grade_list: title: "DISCIPLINAS CURSADAS COM APROVEITAMENTO" course_approved: "AP" diff --git a/db/migrate/20240912113419_add_obs_to_academic_transcript_to_enrollments.rb b/db/migrate/20240912113419_add_obs_to_academic_transcript_to_enrollments.rb new file mode 100644 index 00000000..b4f82fbd --- /dev/null +++ b/db/migrate/20240912113419_add_obs_to_academic_transcript_to_enrollments.rb @@ -0,0 +1,11 @@ +# Copyright (c) Universidade Federal Fluminense (UFF). +# This file is part of SAPOS. Please, consult the license terms in the LICENSE file. + +class AddObsToAcademicTranscriptToEnrollments < ActiveRecord::Migration[7.0] + def up + add_column :enrollments, :obs_to_academic_transcript, :text + end + def down + remove_column :enrollments, :obs_to_academic_transcript + end +end diff --git a/db/schema.rb b/db/schema.rb index 3fe86129..5bc81fc6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_06_10_001559) do +ActiveRecord::Schema[7.0].define(version: 2024_09_12_113419) do create_table "accomplishments", force: :cascade do |t| t.integer "enrollment_id" t.integer "phase_id" @@ -494,6 +494,7 @@ t.string "thesis_title", limit: 255 t.date "thesis_defense_date" t.integer "research_area_id" + t.text "obs_to_academic_transcript" t.index ["enrollment_number"], name: "index_enrollments_on_enrollment_number" t.index ["enrollment_status_id"], name: "index_enrollments_on_enrollment_status_id" t.index ["level_id"], name: "index_enrollments_on_level_id" From 9fdefa9d6d25babc924aab74717ee95bd5bf753b Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Cabral da Cunha Date: Sun, 15 Sep 2024 22:45:09 -0300 Subject: [PATCH 2/8] #498 adding observation field to grades_report pdf --- app/views/enrollments/grades_report_pdf.pdf.prawn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/enrollments/grades_report_pdf.pdf.prawn b/app/views/enrollments/grades_report_pdf.pdf.prawn index 67aec865..f2b5d38c 100644 --- a/app/views/enrollments/grades_report_pdf.pdf.prawn +++ b/app/views/enrollments/grades_report_pdf.pdf.prawn @@ -23,6 +23,8 @@ new_document( thesis_table(pdf, enrollment: @enrollment, show_advisors: true) + obs_table(pdf, enrollment: @enrollment) + accomplished_table(pdf, accomplished_phases: @accomplished_phases) deferrals_table(pdf, deferrals: @deferrals) From e24e5fa8b5f96d235b0784cb39832d3bc9abd880 Mon Sep 17 00:00:00 2001 From: IMonardez Date: Tue, 1 Oct 2024 08:00:28 -0300 Subject: [PATCH 3/8] Fix Vulnerability - Update puma --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 88a9a7fc..1ee59a99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -277,7 +277,7 @@ GEM timeout net-smtp (0.5.0) net-protocol - nio4r (2.5.9) + nio4r (2.7.3) nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -307,7 +307,7 @@ GEM psych (5.1.2) stringio public_suffix (6.0.1) - puma (6.4.2) + puma (6.4.3) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) From d96baf24e2d206f910122626569d83d4a4d3e504 Mon Sep 17 00:00:00 2001 From: IMonardez Date: Wed, 2 Oct 2024 13:50:42 -0300 Subject: [PATCH 4/8] Fix CodeScanner #8 - Remove skip verify_authenticity_token at preview --- app/controllers/report_configurations_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/report_configurations_controller.rb b/app/controllers/report_configurations_controller.rb index cee72e97..36a63823 100644 --- a/app/controllers/report_configurations_controller.rb +++ b/app/controllers/report_configurations_controller.rb @@ -5,7 +5,6 @@ class ReportConfigurationsController < ApplicationController authorize_resource - skip_before_action :verify_authenticity_token, only: [:preview] include ApplicationHelper active_scaffold :report_configuration do |config| From 63213249724e5938e18a760fa5726ebb3cd81d06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:37:44 +0000 Subject: [PATCH 5/8] Bump the bundler group across 1 directory with 2 updates Bumps the bundler group with 1 update in the / directory: [actionmailer](https://github.com/rails/rails). Updates `actionmailer` from 7.0.8.4 to 7.0.8.5 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.2.1.1/actionmailer/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.8.4...v7.0.8.5) Updates `actiontext` from 7.0.8.4 to 7.0.8.5 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.2.1.1/actiontext/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.8.4...v7.0.8.5) --- updated-dependencies: - dependency-name: actionmailer dependency-type: indirect dependency-group: bundler - dependency-name: actiontext dependency-type: indirect dependency-group: bundler ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 110 +++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ee59a99..5077f3e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,61 +29,61 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) + actioncable (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionmailbox (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.4) - actionpack (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionmailer (7.0.8.5) + actionpack (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.8.4) - actionview (= 7.0.8.4) - activesupport (= 7.0.8.4) + actionpack (7.0.8.5) + actionview (= 7.0.8.5) + activesupport (= 7.0.8.5) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.4) - actionpack (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + actiontext (7.0.8.5) + actionpack (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.4) - activesupport (= 7.0.8.4) + actionview (7.0.8.5) + activesupport (= 7.0.8.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_scaffold_duplicate (1.1.4) active_scaffold (>= 3.6.0.pre) - activejob (7.0.8.4) - activesupport (= 7.0.8.4) + activejob (7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.3.6) - activemodel (7.0.8.4) - activesupport (= 7.0.8.4) - activerecord (7.0.8.4) - activemodel (= 7.0.8.4) - activesupport (= 7.0.8.4) + activemodel (7.0.8.5) + activesupport (= 7.0.8.5) + activerecord (7.0.8.5) + activemodel (= 7.0.8.5) + activesupport (= 7.0.8.5) activerecord-session_store (2.1.0) actionpack (>= 6.1) activerecord (>= 6.1) @@ -91,14 +91,14 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 4) railties (>= 6.1) - activestorage (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activesupport (= 7.0.8.4) + activestorage (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activesupport (= 7.0.8.5) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.8.4) + activesupport (7.0.8.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -206,7 +206,7 @@ GEM globalid (1.2.1) activesupport (>= 6.1) htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) ice_nine (0.11.2) image_processing (1.12.2) @@ -262,7 +262,7 @@ GEM mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.25.0) + minitest (5.25.1) msgpack (1.7.2) multi_json (1.15.0) mysql2 (0.5.5) @@ -314,20 +314,20 @@ GEM rack (2.2.8.1) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.4) - actioncable (= 7.0.8.4) - actionmailbox (= 7.0.8.4) - actionmailer (= 7.0.8.4) - actionpack (= 7.0.8.4) - actiontext (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activemodel (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + rails (7.0.8.5) + actioncable (= 7.0.8.5) + actionmailbox (= 7.0.8.5) + actionmailer (= 7.0.8.5) + actionpack (= 7.0.8.5) + actiontext (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activemodel (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) bundler (>= 1.15.0) - railties (= 7.0.8.4) + railties (= 7.0.8.5) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -340,9 +340,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) + railties (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) method_source rake (>= 12.2) thor (~> 1.0) From bb1094a157e4205de905405696b26ab53f6bfd9a Mon Sep 17 00:00:00 2001 From: IMonardez Date: Tue, 22 Oct 2024 09:50:32 -0300 Subject: [PATCH 6/8] Vulnerability #85: Update actionpack --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ee59a99..37285756 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -206,7 +206,7 @@ GEM globalid (1.2.1) activesupport (>= 6.1) htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) ice_nine (0.11.2) image_processing (1.12.2) @@ -262,7 +262,7 @@ GEM mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.25.0) + minitest (5.25.1) msgpack (1.7.2) multi_json (1.15.0) mysql2 (0.5.5) From ed41c483b18d02cb0dda4742d774a46304402f81 Mon Sep 17 00:00:00 2001 From: Leonardo Gresta Paulino Murta Date: Tue, 22 Oct 2024 11:09:28 -0300 Subject: [PATCH 7/8] Updates Ruby to 3.2.5 --- .ruby-version | 2 +- Gemfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index e4604e3a..5ae69bd5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.1 +3.2.5 diff --git a/Gemfile b/Gemfile index 9126b81f..da20e15a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ -# ruby=3.2.1 +# ruby=3.2.5 # frozen_string_literal: true source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } # The following line is necessary to allow RVM choosing the correct ruby version. RVM 2.0 will probably be able to interpret the "~>" symbol and we will be able to safely remove the "#ruby=3.2.2" line. -ruby "~> 3.2.1" +ruby "~> 3.2.5" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.8.1" From 26f3566b3a7a30ca1a93821748cb7e7e15d194ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:52:04 +0000 Subject: [PATCH 8/8] Bump rexml from 3.3.6 to 3.3.9 in the bundler group across 1 directory Bumps the bundler group with 1 update in the / directory: [rexml](https://github.com/ruby/rexml). Updates `rexml` from 3.3.6 to 3.3.9 - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.6...v3.3.9) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect dependency-group: bundler ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5077f3e2..392dec3b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -363,8 +363,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.6) - strscan + rexml (3.3.9) rouge (4.2.0) rspec-collection_matchers (1.2.1) rspec-expectations (>= 2.99.0.beta1) @@ -464,7 +463,6 @@ GEM mini_portile2 (~> 2.8.0) ssrf_filter (1.1.2) stringio (3.1.1) - strscan (3.1.0) thor (1.3.1) tilt (2.3.0) timeliness (0.4.5)