Skip to content

Commit

Permalink
🧹 Get assets to precompile
Browse files Browse the repository at this point in the history
This commit has a lot in it, but of note:

- We forked apartment gem to expand activerecord version support
- Used the Hyrax upgrade guide to update assets
- Replaced bootstrap 3 variables with hard coded values
- Commented out blacklight_helper_behavior.rb because Blacklight 7
  removed it, we'll have to figure out how to get the same functionality
  in the new version
  • Loading branch information
kirkkwang committed Dec 12, 2023
1 parent da162d4 commit 0840f98
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 49 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ gem 'active-fedora', '~> 14.0'
gem 'active_elastic_job', github: 'active-elastic-job/active-elastic-job', ref: 'ec51c5d9dedc4a1b47f2db41f26d5fceb251e979', group: %i[aws]
gem 'activerecord-nulldb-adapter'
gem 'addressable', '2.8.1' # remove once https://github.com/postrank-labs/postrank-uri/issues/49 is fixed
gem 'apartment'
gem 'apartment', github: 'scientist-softserv/apartment', branch: 'development'
gem 'aws-sdk-sqs', group: %i[aws]
gem 'blacklight', '~> 7.29'
gem 'blacklight_oai_provider', '~> 7.0'
gem 'bolognese', '>= 1.9.10'
gem 'bootstrap', '~> 4.6'
gem 'bootstrap-datepicker-rails'
gem 'bulkrax', '~> 5.3'
gem 'byebug', group: %i[development test]
Expand All @@ -28,12 +29,13 @@ gem 'database_cleaner', group: %i[test]
gem 'devise'
gem 'devise-guests', '~> 0.3'
gem 'devise-i18n'
gem 'devise_invitable', '~> 1.6'
gem 'devise_invitable', '~> 2.0'
gem 'dry-monads', '~> 1.5'
gem 'easy_translate', group: %i[development]
gem 'factory_bot_rails', group: %i[test]
gem 'fcrepo_wrapper', '~> 0.4', group: %i[development test]
gem 'flutie'
gem 'googleauth', '= 1.8.1' # 1.9.0 got yanked from rubygems, hard pinning until we can upgrade
gem 'hyrax', github: 'samvera/hyrax', tag: 'hyrax-v5.0.0.rc2'
gem 'hyrax-doi', github: 'samvera-labs/hyrax-doi', branch: 'rails_hyrax_upgrade'
gem 'hyrax-iiif_av', github: 'samvera-labs/hyrax-iiif_av', branch: 'rails_hyrax_upgrade'
Expand Down
40 changes: 27 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ GIT
valkyrie (~> 3.1.1)
view_component (~> 2.74.1)

GIT
remote: https://github.com/scientist-softserv/apartment.git
revision: e1a24b5574dca7116f69e99f140372c42b75e041
branch: development
specs:
apartment (2.2.1)
activerecord (>= 3.1.2, < 7.0)
parallel (>= 0.7.1)
public_suffix (>= 2)
rack (>= 1.3.6)

GIT
remote: https://github.com/scientist-softserv/iiif_print.git
revision: e476998ab453afabf1bcb8afa059b4416af9b705
Expand Down Expand Up @@ -214,11 +225,10 @@ GEM
aes_key_wrap (1.1.0)
almond-rails (0.3.0)
rails (>= 4.2)
apartment (0.24.3)
activerecord (>= 3.1.2)
rack (>= 1.3.6)
ast (2.4.2)
attr_required (1.0.1)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
awesome_nested_set (3.6.0)
activerecord (>= 4.0.0, < 7.2)
aws-eventstream (1.3.0)
Expand Down Expand Up @@ -314,6 +324,10 @@ GEM
rdf-rdfxml (~> 3.1)
rdf-turtle (~> 3.1)
thor (>= 0.19)
bootstrap (4.6.2)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.16.1, < 2)
sassc-rails (>= 2.0.0)
bootstrap-datepicker-rails (1.10.0.1)
railties (>= 3.0)
breadcrumbs_on_rails (3.0.1)
Expand Down Expand Up @@ -420,9 +434,9 @@ GEM
devise
devise-i18n (1.12.0)
devise (>= 4.9.0)
devise_invitable (1.7.5)
actionmailer (>= 4.1.0)
devise (>= 4.0.0)
devise_invitable (2.0.9)
actionmailer (>= 5.0)
devise (>= 4.6)
diff-lcs (1.5.0)
disposable (0.6.3)
declarative (>= 0.0.9, < 1.0.0)
Expand Down Expand Up @@ -551,11 +565,8 @@ GEM
webrick
google-apis-drive_v3 (0.46.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-env (2.0.1)
faraday (>= 1.0, < 3.a)
googleauth (1.9.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.0, >= 2.0.1)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
Expand Down Expand Up @@ -887,6 +898,7 @@ GEM
ast (~> 2.4.0)
parslet (2.0.0)
pg (1.5.4)
popper_js (1.16.1)
posix-spawn (0.3.15)
postrank-uri (1.1)
addressable (>= 2.4.0)
Expand Down Expand Up @@ -1319,11 +1331,12 @@ DEPENDENCIES
active_elastic_job!
activerecord-nulldb-adapter
addressable (= 2.8.1)
apartment
apartment!
aws-sdk-sqs
blacklight (~> 7.29)
blacklight_oai_provider (~> 7.0)
bolognese (>= 1.9.10)
bootstrap (~> 4.6)
bootstrap-datepicker-rails
bulkrax (~> 5.3)
byebug
Expand All @@ -1337,12 +1350,13 @@ DEPENDENCIES
devise
devise-guests (~> 0.3)
devise-i18n
devise_invitable (~> 1.6)
devise_invitable (~> 2.0)
dry-monads (~> 1.5)
easy_translate
factory_bot_rails
fcrepo_wrapper (~> 0.4)
flutie
googleauth (= 1.8.1)
hyku_knapsack!
hyrax!
hyrax-doi!
Expand Down
9 changes: 6 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@
//= require codemirror-autorefresh
//= require codemirror/modes/css
//= require jquery3
//= require jquery_ujs
//= require rails-ujs
//= require popper
//= require bootstrap
//= require jquery.fontselect
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require jquery.dataTables
//= require dataTables.bootstrap4
//= require stat_slider
//= require turbolinks
//= require cocoon

//= require tether
// Required by Blacklight
//= require blacklight/blacklight
//= require blacklight_gallery

// Moved the Hyku JS *above* the Hyrax JS to resolve #1187 (following
// a pattern found in ScholarSphere)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*= require codemirror
*= require codemirror-theme
*= require hyrax
*= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
*= require dataTables.bootstrap4
*= require bootstrap-datepicker
*= require single_signon
*= require_self
Expand Down
14 changes: 7 additions & 7 deletions app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
}

@media (min-width: $screen-sm-min) {
@media (min-width: 768px) {
.logo-set {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -131,7 +131,7 @@ footer.navbar {

.sidebar {
.h5 {
padding: $nav-link-padding;
padding: 10px 15px;
}

&.maximized {
Expand Down Expand Up @@ -275,7 +275,7 @@ footer.navbar {
}

.callout-danger {
background-color: $well-bg;
background-color: #f5f5f5;
border-color: $brand-danger;

h1,
Expand Down Expand Up @@ -374,7 +374,7 @@ a.btn.btn-default.restore-default-color.with-color-hint {
height: auto;
}

@media (min-width: $screen-lg-min) {
@media (min-width: 1200px) {
a.restore-default-color {
margin-top: 2em;
}
Expand All @@ -388,15 +388,15 @@ a.btn.btn-default.restore-default-color.with-color-hint {
display: inline-block;
}

@media (max-width: $screen-md-min) {
@media (max-width: 992px) {
.product-features {
.grid-item {
width: 50%;
}
}
}

@media (max-width: $screen-sm-min) {
@media (max-width: 768px) {
.product-features {
.grid-item {
width: 100%;
Expand Down Expand Up @@ -433,7 +433,7 @@ body.public-facing {
}

// FEATURED COLLECTIONS
@media (max-width: $screen-sm-min) {
@media (max-width: 768px) {
.admin-show-page
.collection-title-row-wrapper
.collection-title-row-content
Expand Down
11 changes: 5 additions & 6 deletions app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
*/
@import "variables";
@import "bootstrap-default-overrides";
@import "bootstrap-sprockets";
@import "bootstrap";
@import "blacklight/blacklight";
@import "blacklight_gallery/gallery";
@import "blacklight_gallery/masonry";
@import "blacklight_gallery/slideshow";
@import "blacklight_gallery/osd_viewer";
@import "hyrax/blacklight_gallery";
@import "font-awesome";
@import "hyrax/hyrax";
@import "hyku";
@import "accounts";
@import "viewer";

@import "blacklight_gallery/gallery";
@import "blacklight_gallery/masonry";
@import "blacklight_gallery/slideshow";
@import "blacklight_gallery/osd_viewer";

@import "themes/*";
10 changes: 5 additions & 5 deletions app/assets/stylesheets/themes/cultural_repository.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body.dashboard {
padding-top: 100px !important;

@media (max-width: $screen-md-min) {
@media (max-width: 992px) {
padding-top: 0 !important;
}

Expand Down Expand Up @@ -162,7 +162,7 @@
.facet-panel-background-color {
background-color: #ffffff;

@media (max-width: $screen-md-min) {
@media (max-width: 992px) {
background-color: transparent;
}

Expand Down Expand Up @@ -240,22 +240,22 @@

////// Media Queries //////

@media (min-width: $screen-xs-min) and (max-width: $screen-md-max) {
@media (min-width: 480px) and (max-width: 1199px) {
.mt-reverse-mb {
margin-bottom: 40px;
margin-top: 0;
}
}

@media (max-width: $screen-sm-max) {
@media (max-width: 991px) {
div.home_page_text.homepage-text-container {
height: 0;
margin-bottom: 30px;
margin-top: 30px;
}
}

@media screen and (max-width: $screen-md-min) {
@media screen and (max-width: 992px) {
div.recently-uploaded:nth-of-type(2n+3),
div.featured-works-6-column-layout:nth-of-type(2n+3),
div.featured-works-4-column-layout:nth-of-type(2n+3) {
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/themes/neutral_repository.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@

////// Media Queries //////

@media (max-width: $screen-md-min) {
@media (max-width: 992px) {
div.neutral-repository-collections:nth-of-type(2n+3) {
clear: left;
}
}

@media (min-width: $screen-md-min) {
@media (min-width: 992px) {
div.neutral-repository-collections:nth-of-type(3n+4) {
clear: left;
}
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception, prepend: true

force_ssl if: :ssl_configured?

helper Openseadragon::OpenseadragonHelper
# Adds a few additional behaviors into the application controller
include Blacklight::Controller
Expand All @@ -24,7 +22,6 @@ class ApplicationController < ActionController::Base
before_action :require_active_account!, if: :multitenant?
before_action :set_account_specific_connections!
before_action :elevate_single_tenant!, if: :singletenant?
skip_after_action :discard_flash_if_xhr

rescue_from Apartment::TenantNotFound do
raise ActionController::RoutingError, 'Not Found'
Expand Down Expand Up @@ -131,8 +128,4 @@ def append_info_to_payload(payload)
payload[:user_id] = current_user.id if current_user
payload[:account_id] = current_account.cname if current_account
end

def ssl_configured?
ActiveRecord::Type::Boolean.new.cast(current_account.ssl_configured)
end
end
1 change: 0 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class User < ApplicationRecord
include Hyrax::User
include Hyrax::UserUsageStats

attr_accessible :email, :password, :password_confirmation if Blacklight::Utils.needs_attr_accessible?
# Connects this user object to Blacklights Bookmarks.
include Blacklight::User
# Include default devise modules. Others available are:
Expand Down
4 changes: 4 additions & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
# privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
# privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
# client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
# matomo:
# base_url: <%= ENV['MATOMO_BASE_URL'] %>
# site_id: <%= ENV['MATOMO_SITE_ID'] %>
# auth_token: <%= ENV['MATOMO_AUTH_TOKEN'] %>
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker

config.hosts << "hyku.test"
end
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
config.force_ssl = true

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
Expand Down
1 change: 0 additions & 1 deletion config/initializers/hyrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

# Specify a Google Analytics tracking ID to gather usage statistics
# This is set by account settings
# config.google_analytics_id = 'UA-99999999-1'

# Specify a date you wish to start collecting Google Analytic statistics for.
# config.analytic_start_date = DateTime.new(2014,9,10)
Expand Down

0 comments on commit 0840f98

Please sign in to comment.