Skip to content

Commit

Permalink
Merge branch 'release/0.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Sep 9, 2024
2 parents 6d1d70b + e6b569a commit 546fac1
Show file tree
Hide file tree
Showing 140 changed files with 3,928 additions and 1,102 deletions.
76 changes: 2 additions & 74 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,80 +10,8 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2.1
- name: Install dependencies
run: bundle install
- name: Run linter
run: bundle exec standardrb

test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.0.6']

services:
postgres:
image: postgres:latest
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_PORT: 5432
POSTGRES_DB: geoblacklight_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Solr - Create container
run: docker run -d -p 8983:8983 geoblacklight/solr:8.9-v1.0.0 server/scripts/ci-start.sh

- name: Bundler - Install
run: gem install bundler -v 2.4.13

- name: Bundler - Install dependencies
run: bundle _2.4.13_ install
env:
rails_version: 7.0.5

- name: Node - v14 (Yes... 14 avoids the digital envelope routines::unsupported error seen on 18)
uses: actions/setup-node@v2
with:
node-version: '14.18.1'

- name: Yarn - Setup
run: exec "yarnpkg"

- name: Solr - Load config into solr
run: |
cd solr/conf
zip -1 -r solr_config.zip ./*
curl -H "Content-type:application/octet-stream" --data-binary @solr_config.zip "http://solr:[email protected]:8983/solr/admin/configs?action=UPLOAD&name=blacklight"
curl -H 'Content-type: application/json' http://solr:[email protected]:8983/api/collections/ -d '{create: {name: blacklight-core, config: blacklight, numShards: 1}}'
- name: Rails - Run tests
run: bundle exec rake ci
env:
RAILS_ENV: test
rails_version: 6.1.7.4
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-coffee'
SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core

- name: Artifacts - Upload coverage
uses: actions/upload-artifact@v2
if: always()
with:
name: coverage
path: coverage/
run: bundle exec standardrb
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ yarn-debug.log*
.env.test
test/reports/*.xml
yarn.lock

# Vite Ruby
/public/vite*
/public/geoblacklight-admin*
node_modules
dist
# Vite uses dotenv and suggests to ignore local-only env files. See
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local

53 changes: 14 additions & 39 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,20 @@ else
gem "geoblacklight", ">= 4.0"
gem "statesman", ">= 3.4"

if ENV["RAILS_VERSION"]
if ENV["RAILS_VERSION"] == "edge"
gem "rails", github: "rails/rails"
ENV["ENGINE_CART_RAILS_OPTIONS"] = "--edge --skip-turbolinks"
else
gem "rails", ENV["RAILS_VERSION"]
end

case ENV["RAILS_VERSION"]
when /^6.0/
gem "sass-rails", ">= 6"
gem "webpacker", "~> 4.0"
when /^5.[12]/
gem "sass-rails", "~> 5.0"
gem "sprockets", "~> 3.7"
gem "thor", "~> 0.20"
end
end
end
# END ENGINE_CART BLOCK
# BEGIN ENGINE_CART BLOCK
# engine_cart: 2.5.0
# engine_cart stanza: 2.5.0
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
file = File.expand_path("Gemfile", ENV["ENGINE_CART_DESTINATION"] || ENV["RAILS_ROOT"] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
if File.exist?(file)
begin
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn "[EngineCart] Skipping Rails application dependencies:"
Bundler.ui.warn e.message
end
else
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
Bundler.ui.warn "[GBL‡ADMIN] Adding geoblacklight_admin dependencies"
# GBL‡ADMIN
gem "active_storage_validations"
gem "awesome_print"
gem "blacklight_advanced_search"
gem "devise-bootstrap-views", "~> 1.0"
gem "devise_invitable", "~> 2.0.0"
gem "dotenv-rails"
gem "haml"
gem "inline_svg"
gem "kithe", "~> 2.0"
gem "noticed"
gem "paper_trail"
gem "simple_form", "~> 5.0"

if ENV["RAILS_VERSION"]
if ENV["RAILS_VERSION"] == "edge"
Expand All @@ -87,11 +67,6 @@ else
case ENV["RAILS_VERSION"]
when /^6.0/
gem "sass-rails", ">= 6"
gem "webpacker", "~> 4.0"
when /^5.[12]/
gem "sass-rails", "~> 5.0"
gem "sprockets", "~> 3.7"
gem "thor", "~> 0.20"
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

vite: bin/vite dev
web: bin/rails s
65 changes: 10 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ GeoBlacklight Admin is a [GeoBlacklight](https://github.com/geoblacklight/geobla

## Requirements

* Rails v6.1 (not v7 yet)
* Rails v7
* Blacklight v7 (not v8)
* GeoBlacklight v4 (not v3)
* GeoBlacklight v4.4+ (Vite.js)
* @geoblacklight/frontend v4 (NPM package)
* Solr v8.4+
* PostgreSQL (not MySQL-based DBs)
* Redis (for Sidekiq)
Expand All @@ -27,10 +28,10 @@ You need a PostgreSQL database to use this project.

### Install Template

Use Ruby v3.2 and Rails v6.1.7.4 to bootstrap a new GeoBlacklight + GBL Admin application using the template script:
Use Ruby v3.3 and Rails v7.0.8.1 to bootstrap a new GeoBlacklight + GBL Admin application using the template script:

```bash
rails _6.1.7.4_ new gbl_admin -m https://raw.githubusercontent.com/geobtaa/geoblacklight_admin/develop/template.rb
rails _7.0.8.1_ new gbl_admin -m https://raw.githubusercontent.com/geobtaa/geoblacklight_admin/develop/template.rb
cd gbl_admin
bundle exec rake gbl_admin:server
```
Expand All @@ -47,62 +48,16 @@ You have now generated the .internal_test_app and populated the Elements / FormE

-----

## Run Project for Local Development
Drop and recreate databases (or engine_cart:generate will fail)
## Contributing

### Drop/Create application PG database
```bash
psql postgres
DROP DATABASE geoblacklight_development;
CREATE DATABASE geoblacklight_development;
```

```bash
cd project root
bundle install
bundle exec rake engine_cart:regenerate
```
For Developer documentation see [doc/developer.md](./docs/development.md)

### Run Solr
```bash
bin/rails geoblacklight:solr
```
## License
The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/license/apache-2-0).

### Run App
```bash
cd .internal_test_app
bundle exec rails server
```

### Lint App
```bash
standardrb .
standardrb --fix
```

### Test App
```bash
RAILS_ENV=test bundle exec rails test
```

## TODOs
* ~~SolrWrapper - Add persist option~~
* ~~BlacklightApi returns not auth'd message (not requiring auth for now (not sensitive data))~~
* ~~Facet links need /admin nesting~~
* ~~Imports#new -- undefined method `imports_path'~~
* ~~Elements#index -- undefined method `element_path'~~
* ~~Imports#new -- cannot upload files~~
* ~~Import#run -- doesn't fire~~
* ~~Documents - JS actions not working~~
* ~~GBL needs to honor publication state~~
* ~~Add GBL Admin link to nav~~
* ~~Routes - Get devise user~~
* ~~No route matches [GET] "/users/sign_out"~~
* ~~Bookmarks need to be Admin::Bookmarks~~
* ~~GitHub Actions / CI integration~~
* ~~Port the GEOMG test suite~~
* ~~Project gem dependency injection redundancy...~~
* ~~Send GBLADMIN JavaScript pack to NPM like Blacklight~~
* DRY up Engine routing
* Remove legacy GEOMG / B1G everywhere...
* Send GBLADMIN JavaScript pack to NPM like Blacklight
* Likely some more polish to be uncovered...
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ require "solr_wrapper/rake_task"
require "engine_cart/rake_task"
require "geoblacklight_admin/version"
require "rake/testtask"
require "geoblacklight_admin/rake_task"
require "simple_form"

# Searches for files ending in _test.rb in the test directory
Rake::TestTask.new do |t|
Expand All @@ -40,6 +42,7 @@ task default: :test
desc "Run test suite"
task ci: ["geoblacklight:generate"] do
within_test_app do
require "simple_form"
system "RAILS_ENV=test bin/rails db:migrate"
system "RAILS_ENV=test rake db:seed"
system "RAILS_ENV=test rails webpacker:compile"
Expand Down
5 changes: 1 addition & 4 deletions app/assets/javascripts/geoblacklight_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
// about supported directives.
//

//= require jquery3
//= require rails-ujs
// VENDOR
//= require @nathanvda/cocoon/cocoon.js
//= require chosen-jquery/lib/chosen.jquery.js

// VENDOR
//= require bootstrap-datepicker/js/bootstrap-datepicker.js
//= require inputmask/dist/jquery.inputmask
//= require shave/dist/jquery.shave.js
Expand Down
10 changes: 7 additions & 3 deletions app/assets/javascripts/geoblacklight_admin/chosen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// jQuery Ready
$(document).on('ready turbolinks:load', function() {
$('.chosen-select').chosen();
// VanillaJS Ready
document.addEventListener('DOMContentLoaded', function() {
var elements = document.querySelectorAll('.chosen-select');
Array.prototype.forEach.call(elements, function(el, i){
console.log("Vanilla JS Chosen Select");
$('.chosen-select').chosen();
});
});
4 changes: 2 additions & 2 deletions app/assets/javascripts/geoblacklight_admin/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// jQuery Ready
$(document).on('ready turbolinks:load', function() {
// VanillaJS Ready
document.addEventListener('DOMContentLoaded', function() {
// Datepickers - YYYY-MM-DD
if($("input[data-js='datepicker']").length > 0) {
$("input[data-js='datepicker']").datepicker({
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/geoblacklight_admin/inputmask.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// jQuery Ready
$(document).on('ready turbolinks:load', function() {
// VanillaJS Ready
document.addEventListener('DOMContentLoaded', function() {
$("input[data-inputmask]").inputmask();
});
4 changes: 2 additions & 2 deletions app/assets/javascripts/geoblacklight_admin/truncate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// jQuery Ready
$(document).on('ready turbolinks:load', function() {
// VanillaJS Ready
document.addEventListener('DOMContentLoaded', function() {
$('.js-truncate').shave(32);
});
4 changes: 3 additions & 1 deletion app/assets/stylesheets/geoblacklight_admin/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
@import "modules/elements";
@import "modules/forms";
@import "modules/icons";
@import "modules/images";
@import "modules/nav";
@import "modules/results";
@import "modules/tables";
@import "modules/toasts";
@import "modules/visibility";
Expand All @@ -43,7 +45,7 @@ footer.gbl-admin {
box-shadow: inset 0 0 0 50vw rgba(0, 0, 0, 0.8);
}

div.container-fluid {
main.container-fluid {
margin-top: 5rem;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.thumbnail {
max-height: 65px;
max-width: 65px;
}
4 changes: 4 additions & 0 deletions app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
.make-me-sticky {
top:8rem;
}

.navbar a {
text-decoration: none;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ol#results {
li {
margin-bottom: 1rem;
}
}
2 changes: 1 addition & 1 deletion app/controllers/admin/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Admin
class AdminController < ApplicationController
include Devise::Controllers::Helpers
include Pagy::Backend
include ::Pagy::Backend
layout "admin/layouts/application"

before_action :authenticate_admin!
Expand Down
1 change: 0 additions & 1 deletion app/controllers/admin/advanced_search_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "blacklight/catalog"
require "blacklight_range_limit/controller_override"

module Admin
Expand Down
Loading

0 comments on commit 546fac1

Please sign in to comment.