Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 1171_iiif_manifes…
Browse files Browse the repository at this point in the history
…t_images_only
  • Loading branch information
Julie Allinson committed Jul 13, 2017
2 parents a7831c1 + 05f19ec commit 7383e2a
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end

gem 'blacklight', '~> 6.7'

gem 'hyrax', git: 'https://github.com/projecthydra-labs/hyrax.git', ref: '5bd285ed56fba95f4f414724fc00d5dcd657b3fe'
gem 'hyrax', git: 'https://github.com/projecthydra-labs/hyrax.git', branch: 'extra_logging'
gem 'rsolr', '~> 2.0'

gem 'devise'
Expand Down
53 changes: 26 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/projecthydra-labs/hyrax.git
revision: 5bd285ed56fba95f4f414724fc00d5dcd657b3fe
ref: 5bd285ed56fba95f4f414724fc00d5dcd657b3fe
revision: 2d806a06362173b3434cc6b888ba063b308f9dac
branch: extra_logging
specs:
hyrax (2.0.0.alpha)
active-fedora (>= 11.3.1)
Expand Down Expand Up @@ -42,7 +42,6 @@ GIT
rdf-rdfxml
redis-namespace (~> 1.5.2)
redlock (>= 0.1.2)
retriable (>= 2.9, < 4.0)
select2-rails (~> 3.5.9)
signet
tinymce-rails (~> 4.1)
Expand Down Expand Up @@ -73,7 +72,7 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active-fedora (11.3.1)
active-fedora (11.4.0)
active-triples (~> 0.11.0)
activemodel (>= 4.2, < 6)
activesupport (>= 4.2.4, < 6)
Expand Down Expand Up @@ -124,18 +123,18 @@ GEM
arel (8.0.0)
ast (2.3.0)
atomic (1.1.99)
autoprefixer-rails (7.1.1.2)
autoprefixer-rails (7.1.2.2)
execjs
awesome_nested_set (3.1.3)
activerecord (>= 4.0.0, < 5.2)
aws-sdk (2.10.3)
aws-sdk-resources (= 2.10.3)
aws-sdk-core (2.10.3)
aws-sdk (2.10.10)
aws-sdk-resources (= 2.10.10)
aws-sdk-core (2.10.10)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.10.3)
aws-sdk-core (= 2.10.3)
aws-sigv4 (1.0.0)
aws-sdk-resources (2.10.10)
aws-sdk-core (= 2.10.10)
aws-sigv4 (1.0.1)
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
Expand Down Expand Up @@ -166,7 +165,7 @@ GEM
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
breadcrumbs_on_rails (3.0.1)
browse-everything (0.13.1)
browse-everything (0.14.0)
addressable (~> 2.5)
aws-sdk
bootstrap-sass
Expand Down Expand Up @@ -256,33 +255,33 @@ GEM
dry-container (~> 0.2, >= 0.2.6)
dry-core (~> 0.2)
dry-equalizer (~> 0.2)
dry-struct (0.3.0)
dry-struct (0.3.1)
dry-configurable (~> 0.1)
dry-core (~> 0.3)
dry-equalizer (~> 0.2)
dry-types (~> 0.9, >= 0.9.0)
ice_nine (~> 0.11)
dry-types (0.10.3)
dry-types (0.11.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1)
dry-container (~> 0.3)
dry-core (~> 0.2, >= 0.2.1)
dry-equalizer (~> 0.2)
dry-logic (~> 0.4, >= 0.4.0)
inflecto (~> 0.0.0, >= 0.0.2)
dry-validation (0.10.7)
dry-validation (0.11.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (~> 0.2, >= 0.2.1)
dry-equalizer (~> 0.2)
dry-logic (~> 0.4, >= 0.4.0)
dry-types (~> 0.9, >= 0.9.0)
dry-types (~> 0.11.0)
easy_translate (0.5.0)
json
thread
thread_safe
ebnf (1.1.0)
rdf (~> 2.0)
ebnf (1.1.1)
rdf (~> 2.2)
sxp (~> 1.0)
equivalent-xml (0.6.0)
nokogiri (>= 1.4.3)
Expand Down Expand Up @@ -387,7 +386,7 @@ GEM
hydra-file_characterization (~> 0.3, >= 0.3.3)
hydra-pcdm (>= 0.9)
om (~> 3.1)
i18n (0.8.4)
i18n (0.8.6)
i18n-debug (1.1.0)
i18n (< 1)
i18n-tasks (0.9.15)
Expand Down Expand Up @@ -427,7 +426,7 @@ GEM
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
json (2.1.0)
json-ld (2.1.4)
json-ld (2.1.5)
multi_json (~> 1.12)
rdf (~> 2.2)
json-schema (2.8.0)
Expand Down Expand Up @@ -514,7 +513,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_magick (4.7.2)
mini_magick (4.8.0)
mini_portile2 (2.2.0)
minitest (5.10.2)
mods (2.1.0)
Expand Down Expand Up @@ -685,7 +684,7 @@ GEM
rdf-turtle (2.2.0)
ebnf (~> 1.1)
rdf (~> 2.2)
rdf-vocab (2.2.2)
rdf-vocab (2.2.3)
rdf (~> 2.2)
rdf-xsd (2.2.0)
rdf (~> 2.1)
Expand Down Expand Up @@ -748,7 +747,7 @@ GEM
ruby_dep (1.5.0)
rubyzip (1.2.1)
safe_yaml (1.0.4)
sass (3.4.24)
sass (3.4.25)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
Expand Down Expand Up @@ -797,13 +796,13 @@ GEM
nokogiri
stomp
xml-simple
sparql (2.2.0)
sparql (2.2.1)
builder (~> 3.2)
ebnf (~> 1.1)
rdf (~> 2.1)
rdf-aggregate-repo (~> 2.0)
rdf (~> 2.2)
rdf-aggregate-repo (~> 2.2)
rdf-xsd (~> 2.1)
sparql-client (~> 2.0)
sparql-client (~> 2.1)
sxp (~> 1.0)
sparql-client (2.1.0)
net-http-persistent (~> 2.9)
Expand Down
10 changes: 10 additions & 0 deletions app/models/nil_endpoint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @abstract
class NilEndpoint
def ping
false
end

def persisted?
false
end
end
10 changes: 7 additions & 3 deletions app/models/nil_fcrepo_endpoint.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
class NilFcrepoEndpoint
class NilFcrepoEndpoint < NilEndpoint
def switch!
ActiveFedora::Fedora.register(options)
end

def ping
false
def url
'Fcrepo not initialized'
end

def base_path
'Fcrepo not initialized'
end

private
Expand Down
6 changes: 3 additions & 3 deletions app/models/nil_solr_endpoint.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class NilSolrEndpoint
class NilSolrEndpoint < NilEndpoint
def switch!
ActiveFedora::SolrService.instance.conn = connection
Blacklight.connection_config = connection_options
Blacklight.default_index = nil
end

def ping
false
def url
'Solr not initialized'
end

private
Expand Down
16 changes: 16 additions & 0 deletions db/migrate/20170712172828_create_job_io_wrappers.hyrax.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This migration comes from hyrax (originally 20170621201939)
class CreateJobIoWrappers < ActiveRecord::Migration[5.0]
def change
create_table :job_io_wrappers do |t|
t.references :user
t.references :uploaded_file
t.string :file_set_id
t.string :mime_type
t.string :original_name
t.string :path
t.string :relation

t.timestamps
end
end
end
26 changes: 20 additions & 6 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170605152346) do
ActiveRecord::Schema.define(version: 20170712172828) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -151,6 +151,20 @@
t.datetime "updated_at", null: false
end

create_table "job_io_wrappers", id: :serial, force: :cascade do |t|
t.integer "user_id"
t.integer "uploaded_file_id"
t.string "file_set_id"
t.string "mime_type"
t.string "original_name"
t.string "path"
t.string "relation"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["uploaded_file_id"], name: "index_job_io_wrappers_on_uploaded_file_id"
t.index ["user_id"], name: "index_job_io_wrappers_on_user_id"
end

create_table "local_authorities", id: :serial, force: :cascade do |t|
t.string "name"
end
Expand All @@ -164,8 +178,8 @@
end

create_table "mailboxer_conversation_opt_outs", id: :serial, force: :cascade do |t|
t.integer "unsubscriber_id"
t.string "unsubscriber_type"
t.integer "unsubscriber_id"
t.integer "conversation_id"
t.index ["conversation_id"], name: "index_mailboxer_conversation_opt_outs_on_conversation_id"
t.index ["unsubscriber_id", "unsubscriber_type"], name: "index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type"
Expand All @@ -181,13 +195,13 @@
t.string "type"
t.text "body"
t.string "subject", default: ""
t.integer "sender_id"
t.string "sender_type"
t.integer "sender_id"
t.integer "conversation_id"
t.boolean "draft", default: false
t.string "notification_code"
t.integer "notified_object_id"
t.string "notified_object_type"
t.integer "notified_object_id"
t.string "attachment"
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
Expand All @@ -200,8 +214,8 @@
end

create_table "mailboxer_receipts", id: :serial, force: :cascade do |t|
t.integer "receiver_id"
t.string "receiver_type"
t.integer "receiver_id"
t.integer "notification_id", null: false
t.boolean "is_read", default: false
t.boolean "trashed", default: false
Expand Down Expand Up @@ -285,8 +299,8 @@

create_table "roles", id: :serial, force: :cascade do |t|
t.string "name"
t.integer "resource_id"
t.string "resource_type"
t.integer "resource_id"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ docReady(function() {
}

// only load jQuery if not already included in page.
if (!(j = window.jQuery) || compareVersionNumbers(version, j.fn.jquery) || callback(j, scriptUri, absScriptUri, loaded)) {
if (!(j = window.jQuery) || compareVersionNumbers(version, j.fn.jquery) > 0 || callback(j, scriptUri, absScriptUri, loaded)) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "//cdnjs.cloudflare.com/ajax/libs/jquery/" + version + "/jquery.min.js";
Expand All @@ -167,7 +167,7 @@ docReady(function() {
};
document.getElementsByTagName("head")[0].appendChild(script);
}
})(window, document, "3.2.1", function ($, scriptUri, absScriptUri, jqueryLoaded) {
})(window, document, "1.10.2", function ($, scriptUri, absScriptUri, jqueryLoaded) {

$.support.cors = true;

Expand Down
Binary file not shown.
14 changes: 14 additions & 0 deletions spec/models/nil_fcrepo_endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,18 @@
subject { instance.ping }
it { is_expected.to be false }
end

describe "#persisted?" do
it { is_expected.not_to be_persisted }
end

describe "#url" do
subject { instance.url }
it { is_expected.to eq 'Fcrepo not initialized' }
end

describe "#base_path" do
subject { instance.base_path }
it { is_expected.to eq 'Fcrepo not initialized' }
end
end
9 changes: 9 additions & 0 deletions spec/models/nil_solr_endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@
subject { instance.ping }
it { is_expected.to be false }
end

describe "#persisted?" do
it { is_expected.not_to be_persisted }
end

describe "#url" do
subject { instance.url }
it { is_expected.to eq 'Solr not initialized' }
end
end
25 changes: 17 additions & 8 deletions spec/views/proprietor/accounts/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
RSpec.describe "proprietor/accounts/edit", type: :view do
let(:account) { FactoryGirl.create(:account) }

before do
assign(:account, account)
end

it "renders the edit account form" do
render
end

assert_select "form[action=?][method=?]", proprietor_account_path(account), "post" do
assert_select "input#account_tenant[name=?]", "account[tenant]"
context "with connections" do
let(:account) { create(:account) }
it "renders the edit account form" do
assert_select "form[action=?][method=?]", proprietor_account_path(account), "post" do
assert_select "input#account_tenant[name=?]", "account[tenant]"
assert_select "input#account_cname[name=?]", "account[cname]"
end
end
end

assert_select "input#account_cname[name=?]", "account[cname]"
context "without connections" do
let(:account) { create(:account, solr_endpoint: nil, fcrepo_endpoint: nil) }
it "renders the edit account form" do
assert_select "form[action=?][method=?]", proprietor_account_path(account), "post" do
assert_select "input#account_tenant[name=?]", "account[tenant]"
assert_select "input#account_cname[name=?]", "account[cname]"
end
end
end
end

0 comments on commit 7383e2a

Please sign in to comment.