Skip to content

Commit

Permalink
GBL Admin: init
Browse files Browse the repository at this point in the history
Working locally now. Will deploy and see what breaks.
  • Loading branch information
ewlarson committed Sep 7, 2023
1 parent c04a51c commit 144d937
Show file tree
Hide file tree
Showing 69 changed files with 5,528 additions and 1,285 deletions.
38 changes: 34 additions & 4 deletions .env.development.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
# Using dotenv-rails to set development environment variables
# Example use below:
SOLR_VERSION = 6.2.1
SOLR_URL: http://127.0.0.1:8983/solr/geoportal-core-development
GEOBLACKLIGHT_DB_HOST=localhost
GEOBLACKLIGHT_DB_DATABASE=geoportal_admin
GEOBLACKLIGHT_DB_USER=
GEOBLACKLIGHT_DB_PASSWORD=

SOLR_VERSION=8.11.1

# Solr - Local development
SOLR_URL=http://127.0.0.1:8983/solr/blacklight-core

# Solr - Remote development
# SOLR_URL=https://remote_server/solr/core
# SOLR_BASIC_AUTH_USER=user
# SOLR_BASIC_AUTH_PASSWORD=password

# BL API
BLACKLIGHT_URL=/
BLACKLIGHT_JSON_API=/admin/api.json
BLACKLIGHT_JSON_API_IDS=/admin/api/ids.json
BLACKLIGHT_JSON_API_FACETS=/admin/advanced_search/facets.json

# BL IDS
BLACKLIGHT_JSON_IDS=/admin/ids.json

GEOMG_DB_DATABASE=geoblacklight_development
GEOMG_DB_USER=
GEOMG_DB_PASSWORD=

GEOMG_DEVISE_SECRET_KEY=generated-by-rake-secret

# Blazer
BLAZER_UPLOADS_URL=postgresql://127.0.0.1:5432/geoblacklight_development
MAPBOX_ACCESS_TOKEN=your-key-here

7 changes: 7 additions & 0 deletions .solr_wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
validate: false
instance_dir: tmp/solr
download_dir: tmp/solr
collection:
dir: solr/conf/
name: blacklight-core
persist: true
15 changes: 13 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ gem 'blacklight', '~> 7.33.0'
gem "blacklight_advanced_search", git: "https://github.com/ewlarson/blacklight_advanced_search.git", branch: "bl7-fix-gentle-hands"

gem 'blacklight_range_limit', '~> 7.0.0'
gem 'chosen-rails' # jquery multiselect plugin for advanced search
gem 'chosen-rails', '~> 1.10' # jquery multiselect plugin for advanced search
gem 'bootstrap', '~> 4.0'
gem 'popper_js'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
Expand All @@ -82,6 +82,17 @@ gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"

# GBL Admin dependencies _not_ automatically loading...
gem 'active_storage_validations'
gem 'awesome_print'
# gem 'blacklight_advanced_search'
gem 'dotenv-rails'
gem 'haml'
gem 'inline_svg'
gem 'kithe', '~> 2.0'
gem 'noticed'
gem 'paper_trail'

# Image migration
gem 'geoblacklight_sidecar_images', git: "https://github.com/geoblacklight/geoblacklight_sidecar_images.git", branch: "feature/statesman-update"
gem 'carrierwave', '~> 1.2'
Expand All @@ -98,7 +109,7 @@ gem 'solr_wrapper', git: 'https://github.com/cbeer/solr_wrapper.git', branch: 'm

gem 'rsolr', '>= 1.0'
gem 'jquery-rails'
gem "devise", ">= 4.7.1"
gem "devise", "4.7.3"
gem 'devise-guests', '~> 0.6'

gem 'haml'
Expand Down
34 changes: 15 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GIT

GIT
remote: https://github.com/geobtaa/geoblacklight_admin.git
revision: 4ba60f00301067a11cb7ca083a67220fe75e79be
revision: aba36748fcdf5e89037ff59e1fe88d442b4ea001
branch: feature/statesman-update
specs:
geoblacklight_admin (0.2.1)
Expand All @@ -51,7 +51,7 @@ GIT
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (= 1.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
Expand Down Expand Up @@ -158,7 +158,7 @@ GEM
rack
attr_json (2.1.0)
activerecord (>= 6.0.0, < 7.1)
autoprefixer-rails (10.4.13.0)
autoprefixer-rails (10.4.15.0)
execjs (~> 2)
awesome_print (1.9.2)
axe-core-api (4.7.0)
Expand Down Expand Up @@ -214,13 +214,11 @@ GEM
activesupport (>= 4.0.0)
mime-types (>= 1.16)
ssrf_filter (~> 1.0, < 1.1.0)
chosen-rails (1.0.0)
chosen-rails (1.10.0)
coffee-rails (>= 3.2)
compass-rails (>= 1.0)
railties (>= 3.0)
sass-rails (>= 3.2)
sassc-rails (>= 2.1.2)
chronic (0.10.2)
chunky_png (1.4.0)
cocoon (1.2.15)
coderay (1.1.3)
coercible (1.0.0)
Expand All @@ -232,12 +230,6 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (2.0.0)
compass (>= 0.12.2)
concurrent-ruby (1.2.2)
config (4.2.1)
deep_merge (~> 1.2, >= 1.2.1)
Expand All @@ -257,7 +249,7 @@ GEM
activesupport
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.9.2)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
Expand Down Expand Up @@ -339,7 +331,6 @@ GEM
rake
flamegraph (0.9.5)
foreman (0.87.2)
fssm (0.2.10)
fx (0.8.0)
activerecord (>= 6.0.0)
railties (>= 6.0.0)
Expand Down Expand Up @@ -482,7 +473,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitar (0.9)
minitest (5.19.0)
minitest (5.20.0)
minitest-ci (3.4.0)
minitest (>= 5.0.6)
minitest-reporters (1.6.1)
Expand Down Expand Up @@ -738,7 +729,7 @@ GEM
descendants_tracker (~> 0.0, >= 0.0.3)
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)
Expand All @@ -762,6 +753,7 @@ PLATFORMS
ruby

DEPENDENCIES
active_storage_validations
addressable (~> 2.5.0)
appsignal
awesome_print
Expand All @@ -776,11 +768,11 @@ DEPENDENCIES
capybara-screenshot
capybara-selenium
carrierwave (~> 1.2)
chosen-rails
chosen-rails (~> 1.10)
chronic
coffee-rails (~> 4.2)
database_cleaner
devise (>= 4.7.1)
devise (= 4.7.3)
devise-guests (~> 0.6)
dotenv-rails
down (~> 5.0)
Expand All @@ -794,8 +786,10 @@ DEPENDENCIES
geoblacklight_sidecar_images!
haml
handlebars_assets (~> 0.23.0)
inline_svg
jbuilder (~> 2.5)
jquery-rails
kithe (~> 2.0)
letter_opener
listen (~> 3.0)
m (~> 1.5.0)
Expand All @@ -804,6 +798,8 @@ DEPENDENCIES
minitest
minitest-ci (~> 3.4.0)
minitest-reporters
noticed
paper_trail
pg
pointless_feedback
popper_js
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@
//= require js-cookie/src/js.cookie.js

//= require geoportal

// Required by GBL Admin
//= require activestorage
17 changes: 17 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@
@import 'bootstrap';
@import 'blacklight';
@import 'geoblacklight';
@import 'geoblacklight_admin/core';
@import 'geoportal';
@import 'gblsci';

// GBL Admin - override defaults
div.container-fluid {
margin-top: 0 !important;
}

footer {
border-top: none;
margin-top: 4rem;
background: none;
box-shadow: none;

background-color: rgb(204, 204, 204);
padding-top: 2rem;
padding-bottom: 2rem;
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/geoportal/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $radius: 4px;
}
}

main {
main.homepage {
background:lighten($black, 12%) asset_url('aerial_photo_dark.jpg') repeat;
padding:0px;

Expand Down
6 changes: 6 additions & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
23 changes: 23 additions & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module ApplicationCable
# Connect!
class Connection < ActionCable::Connection::Base
identified_by :current_user

def connect
self.current_user = find_verified_user
end

private

# check for authenticated user via devise
def find_verified_user
if verified_user = env['warden'].user
verified_user
else
reject_unauthorized_connection
end
end
end
end
12 changes: 12 additions & 0 deletions app/channels/export_channel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

# ExportChannel
class ExportChannel < ApplicationCable::Channel
def subscribed
stream_from 'export_channel'
end

def unsubscribed
# Any cleanup needed when channel is unsubscribed
end
end
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ApplicationController < ActionController::Base
include Pagy::Backend
# Adds a few additional behaviors into the application controller
include Blacklight::Controller
layout :determine_layout if respond_to? :layout
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/channels/consumer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.

import { createConsumer } from "@rails/actioncable"

export default createConsumer()
30 changes: 30 additions & 0 deletions app/javascript/channels/export_channel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import consumer from "./consumer"

consumer.subscriptions.create({ channel: "ExportChannel" }, {
connected() {
// Called when the subscription is ready for use on the server
console.log('Export Channel Connected');
},

disconnected() {
// Called when the subscription has been terminated by the server
console.log('Export Channel Disconnected');
},

received(data) {
console.log('Export Channel Received');
console.log(data);

if (data['progress']) {
console.log(data['progress']);
}

if (data['actions']) {
for (let index = 0; index < data.actions.length; ++index) {
var fnstring = data.actions[index].method;
var fn = window["GBLADMIN"][fnstring];
if (typeof fn === "function") fn(data.actions[index].payload);
}
}
}
});
5 changes: 5 additions & 0 deletions app/javascript/channels/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Load all the channels within this directory and all subdirectories.
// Channel files must be named *_channel.js.

const channels = require.context('.', true, /_channel\.js$/)
channels.keys().forEach(channels)
19 changes: 19 additions & 0 deletions app/javascript/controllers/application_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Controller } from 'stimulus'

/* This is your application's ApplicationController.
* All StimulusReflex controllers should inherit from this class.
*
* Example:
*
* import ApplicationController from './application_controller'
*
* export default class extends ApplicationController { ... }
*
* Learn more at: https://docs.stimulusreflex.com
*/

// Adding a comment here
export default class extends Controller {
connect () {
}
}
26 changes: 26 additions & 0 deletions app/javascript/controllers/document_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Visit The Stimulus Handbook for more details
// https://stimulusjs.org/handbook/introduction
//
// This example controller works with specially annotated HTML like:
//
// <div data-controller="results">
// <h1 data-target="results.selectAll"></h1>
// </div>

import { Application } from "stimulus"
import ScrollTo from "stimulus-scroll-to"

export default class extends ScrollTo {
connect() {
}

// You can set default options in this getter for all your anchors.
get defaultOptions () {
return {
behavior: 'smooth'
}
}
}

const application = Application.start()
application.register("scroll-to", ScrollTo)
Loading

0 comments on commit 144d937

Please sign in to comment.