diff --git a/.circleci/config.yml b/.circleci/config.yml
index fbb43443..e16ab459 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -8,19 +8,19 @@ executors:
environment:
IMAGE_NAME: treatment-database-app
docker:
- - image: docker:20.10.7-git
+ - image: docker:20.10.14-git
orbs:
- ruby: circleci/ruby@2.0.0
+ ruby: circleci/ruby@2.1.1
node: circleci/node@5.0.2
- browser-tools: circleci/browser-tools@1.3.0
+ browser-tools: circleci/browser-tools@1.4.7
coveralls: coveralls/coveralls@1.0.6
jobs:
build:
docker:
# specify the version you desire here
- - image: cimg/ruby:3.0.5-browsers
+ - image: cimg/ruby:3.3.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
@@ -44,8 +44,7 @@ jobs:
steps:
- checkout
- - browser-tools/install-chrome
- - browser-tools/install-chromedriver
+ - browser-tools/install-browser-tools
- restore_cache:
keys:
diff --git a/.rubocop.yml b/.rubocop.yml
index 7d91c0df..9ce5ddb4 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -8,6 +8,7 @@ AllCops:
Exclude:
- 'db/**/*'
- 'vendor/bundle/**/*'
+ - 'scripts/add-data.rb'
Metrics/ClassLength:
Exclude:
diff --git a/.ruby-version b/.ruby-version
index 316881c9..03463f3c 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-ruby-3.0.5
+ruby-3.3.0
diff --git a/Gemfile b/Gemfile
index 66ba3138..39763926 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,10 +3,10 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
-ruby '3.0.5'
+ruby '3.3.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
-gem 'rails', '~> 6.1'
+gem 'rails', '~> 6.1.7.7'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
@@ -80,8 +80,7 @@ group :development, :test do
gem 'rspec_junit_formatter'
gem 'rspec-rails', '~> 4.1.0'
gem 'rubocop-rails'
- gem 'selenium-webdriver'
- gem 'webdrivers'
+ gem 'selenium-webdriver', '~> 4.18.1'
end
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 1fa396d3..d1f2a8b4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -8,88 +8,89 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actioncable (6.1.7.6)
- actionpack (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ actioncable (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.1.7.6)
- actionpack (= 6.1.7.6)
- activejob (= 6.1.7.6)
- activerecord (= 6.1.7.6)
- activestorage (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ actionmailbox (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
mail (>= 2.7.1)
- actionmailer (6.1.7.6)
- actionpack (= 6.1.7.6)
- actionview (= 6.1.7.6)
- activejob (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ actionmailer (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ actionview (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.1.7.6)
- actionview (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ actionpack (6.1.7.7)
+ actionview (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.1.7.6)
- actionpack (= 6.1.7.6)
- activerecord (= 6.1.7.6)
- activestorage (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ actiontext (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
nokogiri (>= 1.8.5)
- actionview (6.1.7.6)
- activesupport (= 6.1.7.6)
+ actionview (6.1.7.7)
+ activesupport (= 6.1.7.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
- activejob (6.1.7.6)
- activesupport (= 6.1.7.6)
+ activejob (6.1.7.7)
+ activesupport (= 6.1.7.7)
globalid (>= 0.3.6)
- activemodel (6.1.7.6)
- activesupport (= 6.1.7.6)
- activerecord (6.1.7.6)
- activemodel (= 6.1.7.6)
- activesupport (= 6.1.7.6)
- activestorage (6.1.7.6)
- actionpack (= 6.1.7.6)
- activejob (= 6.1.7.6)
- activerecord (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ activemodel (6.1.7.7)
+ activesupport (= 6.1.7.7)
+ activerecord (6.1.7.7)
+ activemodel (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
+ activestorage (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
- activesupport (6.1.7.6)
+ activesupport (6.1.7.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
- addressable (2.8.1)
+ addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
- airbrussh (1.4.1)
+ airbrussh (1.5.1)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
- autoprefixer-rails (10.4.7.0)
+ autoprefixer-rails (10.4.16.0)
execjs (~> 2)
- bcrypt (3.1.18)
+ base64 (0.2.0)
+ bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
bindex (0.8.1)
- bootsnap (1.16.0)
+ bootsnap (1.18.3)
msgpack (~> 1.2)
bootstrap (4.3.1)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
- brakeman (5.4.0)
+ brakeman (5.4.1)
builder (3.2.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
byebug (11.1.3)
- cancancan (3.4.0)
+ cancancan (3.5.0)
capistrano (3.17.1)
airbrussh (>= 1.0.0)
i18n
@@ -97,17 +98,17 @@ GEM
sshkit (>= 1.9.0)
capistrano-bundler (1.6.0)
capistrano (~> 3.1)
- capistrano-rails (1.6.2)
+ capistrano-rails (1.6.3)
capistrano (~> 3.1)
capistrano-bundler (>= 1.1, < 3)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capybara (3.38.0)
+ capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
- nokogiri (~> 1.8)
+ nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
@@ -119,57 +120,59 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
- concurrent-ruby (1.2.2)
- coveralls_reborn (0.26.0)
+ concurrent-ruby (1.2.3)
+ coveralls_reborn (0.28.0)
simplecov (~> 0.22.0)
term-ansicolor (~> 1.7)
thor (~> 1.2)
tins (~> 1.32)
crass (1.0.6)
- database_cleaner (2.0.1)
- database_cleaner-active_record (~> 2.0.0)
- database_cleaner-active_record (2.0.1)
+ database_cleaner (2.0.2)
+ database_cleaner-active_record (>= 2, < 3)
+ database_cleaner-active_record (2.1.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
- date (3.3.3)
- devise (4.8.1)
+ date (3.3.4)
+ devise (4.9.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
- diff-lcs (1.5.0)
+ diff-lcs (1.5.1)
docile (1.4.0)
- dotenv (2.8.1)
- dotenv-rails (2.8.1)
- dotenv (= 2.8.1)
- railties (>= 3.2)
+ dotenv (3.1.0)
+ dotenv-rails (3.1.0)
+ dotenv (= 3.1.0)
+ railties (>= 6.1)
ed25519 (1.3.0)
erubi (1.12.0)
- execjs (2.8.1)
- factory_bot (6.2.1)
+ execjs (2.9.1)
+ factory_bot (6.4.6)
activesupport (>= 5.0.0)
- factory_bot_rails (6.2.0)
- factory_bot (~> 6.2.0)
+ factory_bot_rails (6.4.3)
+ factory_bot (~> 6.4)
railties (>= 5.0.0)
- ffi (1.15.5)
- globalid (1.1.0)
- activesupport (>= 5.0)
- i18n (1.14.1)
+ ffi (1.16.3)
+ globalid (1.2.1)
+ activesupport (>= 6.1)
+ i18n (1.14.3)
concurrent-ruby (~> 1.0)
+ racc (~> 1.7)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
- jquery-rails (4.5.1)
+ jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- json (2.6.3)
- listen (3.8.0)
+ json (2.7.1)
+ language_server-protocol (3.17.0.3)
+ listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
- loofah (2.21.3)
+ loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
@@ -177,61 +180,73 @@ GEM
net-imap
net-pop
net-smtp
- marcel (1.0.2)
+ marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.5)
- minitest (5.19.0)
- msgpack (1.6.0)
- mysql2 (0.5.5)
- net-imap (0.3.7)
+ minitest (5.22.2)
+ msgpack (1.7.2)
+ mutex_m (0.2.0)
+ mysql2 (0.5.6)
+ net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
- net-protocol (0.2.1)
+ net-protocol (0.2.2)
timeout
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
- net-smtp (0.3.3)
+ net-sftp (4.0.0)
+ net-ssh (>= 5.0.0, < 8.0.0)
+ net-smtp (0.4.0.1)
net-protocol
- net-ssh (7.0.1)
- nio4r (2.5.9)
- nokogiri (1.15.4-x86_64-darwin)
+ net-ssh (7.2.1)
+ nio4r (2.7.0)
+ nokogiri (1.16.2-aarch64-linux)
+ racc (~> 1.4)
+ nokogiri (1.16.2-arm-linux)
+ racc (~> 1.4)
+ nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.15.4-x86_64-linux)
+ nokogiri (1.16.2-x86-linux)
+ racc (~> 1.4)
+ nokogiri (1.16.2-x86_64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
- pagy (6.0.1)
- paper_trail (14.0.0)
- activerecord (>= 6.0)
+ pagy (7.0.9)
+ paper_trail (15.1.0)
+ activerecord (>= 6.1)
request_store (~> 1.4)
- parallel (1.22.1)
- parser (3.2.0.0)
+ parallel (1.24.0)
+ parser (3.3.0.5)
ast (~> 2.4.1)
- pdfkit (0.8.7.2)
+ racc
+ pdfkit (0.8.7.3)
popper_js (1.16.1)
- public_suffix (5.0.1)
- puma (6.3.1)
+ public_suffix (5.0.4)
+ puma (6.4.2)
nio4r (~> 2.0)
- racc (1.7.1)
- rack (2.2.8)
+ racc (1.7.3)
+ rack (2.2.8.1)
rack-test (2.1.0)
rack (>= 1.3)
- rails (6.1.7.6)
- actioncable (= 6.1.7.6)
- actionmailbox (= 6.1.7.6)
- actionmailer (= 6.1.7.6)
- actionpack (= 6.1.7.6)
- actiontext (= 6.1.7.6)
- actionview (= 6.1.7.6)
- activejob (= 6.1.7.6)
- activemodel (= 6.1.7.6)
- activerecord (= 6.1.7.6)
- activestorage (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ rails (6.1.7.7)
+ actioncable (= 6.1.7.7)
+ actionmailbox (= 6.1.7.7)
+ actionmailer (= 6.1.7.7)
+ actionpack (= 6.1.7.7)
+ actiontext (= 6.1.7.7)
+ actionview (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activemodel (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
bundler (>= 1.15.0)
- railties (= 6.1.7.6)
+ railties (= 6.1.7.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -244,33 +259,33 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
- railties (6.1.7.6)
- actionpack (= 6.1.7.6)
- activesupport (= 6.1.7.6)
+ railties (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
- rake (13.0.6)
+ rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-readline (0.5.5)
- regexp_parser (2.6.2)
- request_store (1.5.1)
+ regexp_parser (2.9.0)
+ request_store (1.6.0)
rack (>= 1.4)
- responders (3.0.1)
- actionpack (>= 5.0)
- railties (>= 5.0)
- rexml (3.2.5)
- rspec-core (3.12.0)
- rspec-support (~> 3.12.0)
- rspec-expectations (3.12.2)
+ responders (3.1.1)
+ actionpack (>= 5.2)
+ railties (>= 5.2)
+ rexml (3.2.6)
+ rspec-core (3.13.0)
+ rspec-support (~> 3.13.0)
+ rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.12.0)
- rspec-mocks (3.12.3)
+ rspec-support (~> 3.13.0)
+ rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.12.0)
+ rspec-support (~> 3.13.0)
rspec-rails (4.1.2)
actionpack (>= 4.2)
activesupport (>= 4.2)
@@ -279,26 +294,28 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
- rspec-support (3.12.0)
+ rspec-support (3.13.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
- rubocop (1.44.1)
+ rubocop (1.62.0)
json (~> 2.3)
+ language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
- parser (>= 3.2.0.0)
+ parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
- rubocop-ast (>= 1.24.1, < 2.0)
+ rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
- rubocop-ast (1.24.1)
- parser (>= 3.1.1.0)
- rubocop-rails (2.17.4)
+ rubocop-ast (1.31.1)
+ parser (>= 3.3.0.4)
+ rubocop-rails (2.24.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
- ruby-progressbar (1.11.0)
+ rubocop-ast (>= 1.31.1, < 2.0)
+ ruby-progressbar (1.13.0)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
@@ -319,7 +336,8 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
- selenium-webdriver (4.8.0)
+ selenium-webdriver (4.18.1)
+ base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
@@ -341,17 +359,23 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
- sqlite3 (1.6.0-x86_64-darwin)
- sqlite3 (1.6.0-x86_64-linux)
- sshkit (1.21.3)
+ sqlite3 (1.7.2-aarch64-linux)
+ sqlite3 (1.7.2-arm-linux)
+ sqlite3 (1.7.2-arm64-darwin)
+ sqlite3 (1.7.2-x86-linux)
+ sqlite3 (1.7.2-x86_64-darwin)
+ sqlite3 (1.7.2-x86_64-linux)
+ sshkit (1.22.0)
+ mutex_m
net-scp (>= 1.1.2)
+ net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
- thor (1.2.2)
- tilt (2.0.11)
- timeout (0.4.0)
+ thor (1.3.1)
+ tilt (2.3.0)
+ timeout (0.4.1)
tins (1.32.1)
sync
turbolinks (5.2.1)
@@ -361,28 +385,28 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
- unicode-display_width (2.4.2)
+ unicode-display_width (2.5.0)
warden (1.2.9)
rack (>= 2.0.9)
- web-console (4.2.0)
+ web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
- webdrivers (5.2.0)
- nokogiri (~> 1.6)
- rubyzip (>= 1.3.0)
- selenium-webdriver (~> 4.0)
- websocket (1.2.9)
+ websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
- zeitwerk (2.6.11)
+ zeitwerk (2.6.13)
PLATFORMS
- x86_64-darwin-21
+ aarch64-linux
+ arm-linux
+ arm64-darwin
+ x86-linux
+ x86_64-darwin
x86_64-linux
DEPENDENCIES
@@ -414,7 +438,7 @@ DEPENDENCIES
paper_trail
pdfkit
puma
- rails (~> 6.1)
+ rails (~> 6.1.7.7)
rails-controller-testing
rb-readline
rspec-rails (~> 4.1.0)
@@ -422,7 +446,7 @@ DEPENDENCIES
rubocop
rubocop-rails
sass-rails (~> 5.0)
- selenium-webdriver
+ selenium-webdriver (~> 4.18.1)
simplecov
simplecov-lcov
spring
@@ -432,11 +456,10 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
- webdrivers
wkhtmltopdf-binary!
RUBY VERSION
- ruby 3.0.5p211
+ ruby 3.3.0p0
BUNDLED WITH
- 2.2.33
+ 2.5.6
diff --git a/app/assets/images/worksheet_form_image.png b/app/assets/images/worksheet_form_image.png
deleted file mode 100644
index e2b72d14..00000000
Binary files a/app/assets/images/worksheet_form_image.png and /dev/null differ
diff --git a/app/controllers/activity_controller.rb b/app/controllers/activity_controller.rb
index 71fc2848..0b8b224a 100644
--- a/app/controllers/activity_controller.rb
+++ b/app/controllers/activity_controller.rb
@@ -1,6 +1,9 @@
# frozen_string_literal: true
class ActivityController < ApplicationController
+ before_action :authenticate_user!
+ authorize_resource class: false
+
def index
@pagy, @versions = pagy(PaperTrail::Version.all, items: 50)
end
diff --git a/app/controllers/con_tech_records_controller.rb b/app/controllers/con_tech_records_controller.rb
index ca2bafdc..ba211db9 100644
--- a/app/controllers/con_tech_records_controller.rb
+++ b/app/controllers/con_tech_records_controller.rb
@@ -9,9 +9,9 @@ def create
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@con_tech_record = @conservation_record.con_tech_records.create(create_params)
if @con_tech_record.valid?
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians"
else
- redirect_to conservation_record_path(@conservation_record),
+ redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians",
notice: "Conservator/Technician record not saved: #{@con_tech_record.errors.full_messages[0]}"
end
end
@@ -20,7 +20,7 @@ def destroy
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@con_tech_record = @conservation_record.con_tech_records.find(params[:id])
@con_tech_record.destroy
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians"
end
private
diff --git a/app/controllers/conservation_records_controller.rb b/app/controllers/conservation_records_controller.rb
index a68b7336..d575b7ac 100644
--- a/app/controllers/conservation_records_controller.rb
+++ b/app/controllers/conservation_records_controller.rb
@@ -17,9 +17,9 @@ def index
# GET /conservation_records/1.json
def show
@users = User.all
- @repair_types = ControlledVocabulary.where(vocabulary: 'repair_type', active: true)
- @contract_conservators = ControlledVocabulary.where(vocabulary: 'contract_conservator', active: true)
- @housing = ControlledVocabulary.where(vocabulary: 'housing', active: true)
+ @repair_types = ControlledVocabulary.where(vocabulary: 'repair_type', active: true).order(favorite: :desc)
+ @contract_conservators = ControlledVocabulary.where(vocabulary: 'contract_conservator', active: true).order(favorite: :desc)
+ @housing = ControlledVocabulary.where(vocabulary: 'housing', active: true).order(favorite: :desc)
@in_house_repairs = @conservation_record.in_house_repair_records
@external_repairs = @conservation_record.external_repair_records
@con_tech_records = @conservation_record.con_tech_records
@@ -125,7 +125,7 @@ def set_cost_return_report
end
def set_departments
- @departments = ControlledVocabulary.where(vocabulary: 'department', active: true)
+ @departments = ControlledVocabulary.where(vocabulary: 'department', active: true).order(favorite: :desc)
end
# Never trust parameters from the scary internet, only allow the white list through.
diff --git a/app/controllers/controlled_vocabularies_controller.rb b/app/controllers/controlled_vocabularies_controller.rb
index 4b9f6f63..31940268 100644
--- a/app/controllers/controlled_vocabularies_controller.rb
+++ b/app/controllers/controlled_vocabularies_controller.rb
@@ -62,6 +62,6 @@ def set_controlled_vocabulary
# Never trust parameters from the scary internet, only allow the white list through.
def controlled_vocabulary_params
- params.require(:controlled_vocabulary).permit(:vocabulary, :key, :active)
+ params.require(:controlled_vocabulary).permit(:vocabulary, :key, :active, :favorite)
end
end
diff --git a/app/controllers/cost_return_reports_controller.rb b/app/controllers/cost_return_reports_controller.rb
index c410bfad..412dab70 100644
--- a/app/controllers/cost_return_reports_controller.rb
+++ b/app/controllers/cost_return_reports_controller.rb
@@ -8,20 +8,20 @@ class CostReturnReportsController < ApplicationController
def create
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
CostReturnReport.create(cost_return_report_params)
- redirect_to conservation_record_path(@conservation_record), notice: 'Treatment record saved successfully'
+ redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information", notice: 'Treatment record saved successfully'
end
def update
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@cost_return_report = @conservation_record.cost_return_report.update(cost_return_report_params)
- redirect_to conservation_record_path(@conservation_record), notice: 'Treatment record updated'
+ redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information", notice: 'Treatment record updated'
end
def destroy
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@cost_return_report = @conservation_record.cost_return_report
@cost_return_report.destroy
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information"
end
private
diff --git a/app/controllers/external_repair_records_controller.rb b/app/controllers/external_repair_records_controller.rb
index b314941b..d7ff8f6d 100644
--- a/app/controllers/external_repair_records_controller.rb
+++ b/app/controllers/external_repair_records_controller.rb
@@ -10,9 +10,10 @@ def create
@repair_record = @conservation_record.external_repair_records.create(create_params)
if @repair_record.valid?
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs"
else
- redirect_to conservation_record_path(@conservation_record), notice: "External repair not saved: #{@repair_record.errors.full_messages[0]}"
+ redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs",
+ notice: "External repair not saved: #{@repair_record.errors.full_messages[0]}"
end
end
@@ -20,7 +21,7 @@ def destroy
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@repair_record = @conservation_record.external_repair_records.find(params[:id])
@repair_record.destroy
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs"
end
private
diff --git a/app/controllers/in_house_repair_records_controller.rb b/app/controllers/in_house_repair_records_controller.rb
index a0bde367..f2c63321 100644
--- a/app/controllers/in_house_repair_records_controller.rb
+++ b/app/controllers/in_house_repair_records_controller.rb
@@ -9,9 +9,10 @@ def create
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@repair_record = @conservation_record.in_house_repair_records.create(create_params)
if @repair_record.valid?
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs"
else
- redirect_to conservation_record_path(@conservation_record), notice: "In house repair not saved: #{@repair_record.errors.full_messages[0]}"
+ redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs",
+ notice: "In house repair not saved: #{@repair_record.errors.full_messages[0]}"
end
end
@@ -19,7 +20,7 @@ def destroy
@conservation_record = ConservationRecord.find(params[:conservation_record_id])
@repair_record = @conservation_record.in_house_repair_records.find(params[:id])
@repair_record.destroy
- redirect_to conservation_record_path(@conservation_record)
+ redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs"
end
private
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index f486748e..3957e421 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -6,7 +6,7 @@ class SearchController < ApplicationController
def results
@search_string = params[:search]
@records = case @search_string
- when /^i\d{1,}/
+ when /^[a-zA-Z]+\d{1,}/
ConservationRecord.where(item_record_number: @search_string)
when /^\d+$/
ConservationRecord.where(id: @search_string)
diff --git a/app/controllers/treatment_reports_controller.rb b/app/controllers/treatment_reports_controller.rb
index 1bbb11dd..b42fdf75 100644
--- a/app/controllers/treatment_reports_controller.rb
+++ b/app/controllers/treatment_reports_controller.rb
@@ -7,14 +7,15 @@ def create
@treatment_report.save
flash
- redirect_to conservation_record_path(@treatment_report.conservation_record), notice: 'Treatment record saved successfully!'
+ redirect_to "#{conservation_record_path(@treatment_report.conservation_record)}#treatment-report-tab", notice: 'Treatment record saved successfully!'
end
def update
@treatment_report = TreatmentReport.find(params[:id])
@treatment_report.update(treatment_report_params)
- redirect_to conservation_record_path(@treatment_report.conservation_record), notice: 'Treatment Record updated successfully!'
+ redirect_to "#{conservation_record_path(@treatment_report.conservation_record)}#treatment-report-tab",
+ notice: 'Treatment Record updated successfully!'
end
private
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 333b0894..df64cd91 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -38,11 +38,9 @@ def initialize(user)
case user.role
when 'admin'
can :manage, :all
- can :assign_roles, User
- can :crud, [ControlledVocabulary, StaffCode]
when 'standard'
can :view_pdfs, ConservationRecord
- can :crud, [ConservationRecord, ExternalRepairRecord, InHouseRepairRecord, ConTechRecord, StaffCode, CostReturnReport, Report]
+ can :crud, [ConservationRecord, ExternalRepairRecord, InHouseRepairRecord, ConTechRecord, StaffCode, CostReturnReport, Report, :activity]
when 'read_only'
can :view_pdfs, ConservationRecord
can :read, ConservationRecord
diff --git a/app/models/con_tech_record.rb b/app/models/con_tech_record.rb
index 303c0078..700e4bf1 100644
--- a/app/models/con_tech_record.rb
+++ b/app/models/con_tech_record.rb
@@ -3,4 +3,6 @@
class ConTechRecord < ApplicationRecord
belongs_to :conservation_record
validates :performed_by_user_id, presence: true
+
+ has_paper_trail
end
diff --git a/app/views/conservation_records/abbreviated_treatment_report_pdf.html.erb b/app/views/conservation_records/abbreviated_treatment_report_pdf.html.erb
index 7b9c9650..660535d0 100644
--- a/app/views/conservation_records/abbreviated_treatment_report_pdf.html.erb
+++ b/app/views/conservation_records/abbreviated_treatment_report_pdf.html.erb
@@ -11,20 +11,20 @@
}
table {
- font-family: Calibri;
+ font-family: "Times New Roman";
text-align: left;
display: block;
}
.a4 {
- font-family: Calibri;
+ font-family: "Times New Roman";
width: 800px;
margin: 0 auto;
padding-left: 0;
display: table;
}
th{
- font-family: Calibri;
+ font-family: "Times New Roman";
font-weight: normal;
}
td {
diff --git a/app/views/conservation_records/conservation_worksheet.html.erb b/app/views/conservation_records/conservation_worksheet.html.erb
index 542d77c8..a3600edf 100644
--- a/app/views/conservation_records/conservation_worksheet.html.erb
+++ b/app/views/conservation_records/conservation_worksheet.html.erb
@@ -12,8 +12,7 @@
table {
text-align: left;
- font-size: 4vh;
- font-size: 12px;
+ font-size: 12pt;
display: inline;
}
@@ -24,10 +23,10 @@ table {
}
.image img {
- width: 100%;
+ width: 98%;
object-fit: contain;
position:fixed;
- left:0px;
+ left:10px;
bottom:0px;
}
@@ -53,22 +52,25 @@ table {
<%= @conservation_record.id %> |
<%= controlled_vocabulary_lookup(@conservation_record.department) %> |
<%= @conservation_record.call_number %> |
- <%= @conservation_record.date_received_in_preservation_services %> |
- <%= date_returned(@conservation_record) %> |
+ <%= @conservation_record&.date_received_in_preservation_services&.strftime('%m/%d/%Y') %> |
+ <%= date_returned(@conservation_record)&.strftime('%m/%d/%Y') %> |
+
Title |
<%= @conservation_record.title %> |
+
+
Imprint |
- Author |
+ Author |
- <%= @conservation_record.imprint %> |
- <%= @conservation_record.author %> |
+ <%= @conservation_record.imprint %> |
+ <%= @conservation_record.author %> |
diff --git a/app/views/conservation_records/show.html.erb b/app/views/conservation_records/show.html.erb
index e0c59e70..172a7851 100644
--- a/app/views/conservation_records/show.html.erb
+++ b/app/views/conservation_records/show.html.erb
@@ -63,7 +63,7 @@