arclight 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +29 -0
- data/README.md +3 -3
- data/app/assets/javascripts/arclight/context_navigation.js +12 -47
- data/app/assets/stylesheets/arclight/modules/layout.scss +5 -6
- data/app/views/catalog/_index_collection_context_default.html.erb +1 -1
- data/arclight.gemspec +1 -1
- data/lib/arclight/version.rb +1 -1
- data/lib/generators/arclight/templates/catalog_controller.rb +2 -0
- metadata +5 -5
- data/.travis.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f51a3a7025a39a90504bd7a9fe679f84a88b1ebc14c3497d16b4a3f0f7919c36
|
4
|
+
data.tar.gz: c39d93f039a1ac4bd05373353d121268801c2eabb097ff16e142b08f155a518d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd10ff42c38f9a1c8c408279182adc4c2c6af1a77ed2d1996435efb43a46d2398064de8e878a552be062cc94c77407734cb5db7992f266baaba77931eab031e7
|
7
|
+
data.tar.gz: 2fea971f65494fccbb43d1bf42ff5ae3da35fd03e13425b1480a7064411ff9dd3cc4bbc8f7cdd2355e58dab2930822e74434732ceab7792ea2112f9d5877bb57
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
rails_version: [5.2.4.3, 6.0.3.2, 6.1.0]
|
15
|
+
ruby: [2.6, 2.7]
|
16
|
+
env:
|
17
|
+
RAILS_VERSION: ${{ matrix.rails_version }}
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
- name: Install dependencies with Rails ${{ matrix.rails_version }}
|
25
|
+
run: bundle install
|
26
|
+
- name: Install dependencies with yarn
|
27
|
+
run: yarn install
|
28
|
+
- name: Run tests
|
29
|
+
run: bundle exec rake
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
![Build Status](https://github.com/projectblacklight/arclight/workflows/CI/badge.svg)
|
2
2
|
[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](CONTRIBUTORS.md)
|
3
3
|
[![Code Climate Test Coverage](https://codeclimate.com/github/projectblacklight/arclight/badges/coverage.svg)](https://codeclimate.com/github/projectblacklight/arclight/coverage)
|
4
4
|
|
@@ -10,8 +10,8 @@ A Rails engine supporting discovery of archival materials, based on [Blacklight]
|
|
10
10
|
|
11
11
|
## Requirements
|
12
12
|
|
13
|
-
* [Ruby](https://www.ruby-lang.org/en/) 2.
|
14
|
-
* [Rails](http://rubyonrails.org) 5.
|
13
|
+
* [Ruby](https://www.ruby-lang.org/en/) 2.6 or later
|
14
|
+
* [Rails](http://rubyonrails.org) 5.2 or later
|
15
15
|
* Solr 8.1 or later
|
16
16
|
|
17
17
|
## Installation
|
@@ -11,6 +11,10 @@ class NavigationDocument {
|
|
11
11
|
this.el.find('li.al-collection-context').addClass('al-hierarchy-highlight');
|
12
12
|
}
|
13
13
|
|
14
|
+
makeCollapsible() {
|
15
|
+
this.el.find('li.al-collection-context').addClass('collapsible');
|
16
|
+
}
|
17
|
+
|
14
18
|
collapse() {
|
15
19
|
this.el.find('li.al-collection-context').addClass('collapsed');
|
16
20
|
}
|
@@ -32,9 +36,9 @@ class ExpandButton {
|
|
32
36
|
* @param {jQuery} $li - the <button> element
|
33
37
|
* @return {jQuery} - a jQuery object containing the targeted <li>
|
34
38
|
*/
|
35
|
-
|
36
|
-
const $siblings = this.$el.parent().children('li');
|
37
|
-
return $siblings
|
39
|
+
findCollapsibleSiblings() {
|
40
|
+
const $siblings = this.$el.parent().children('li.collapsible');
|
41
|
+
return $siblings;
|
38
42
|
}
|
39
43
|
|
40
44
|
/**
|
@@ -44,7 +48,7 @@ class ExpandButton {
|
|
44
48
|
* <button> element
|
45
49
|
*/
|
46
50
|
handleClick() {
|
47
|
-
const $targeted = this.
|
51
|
+
const $targeted = this.findCollapsibleSiblings();
|
48
52
|
|
49
53
|
$targeted.toggleClass('collapsed');
|
50
54
|
this.$el.toggleClass('collapsed');
|
@@ -66,25 +70,6 @@ class ExpandButton {
|
|
66
70
|
}
|
67
71
|
}
|
68
72
|
|
69
|
-
/**
|
70
|
-
* Modeling <button> Elements which hide or retrieve <li> elements for sibling
|
71
|
-
* documents nested within the <li> elements of the <ul> tree
|
72
|
-
* @class
|
73
|
-
*/
|
74
|
-
class NestedExpandButton extends ExpandButton {
|
75
|
-
/**
|
76
|
-
* This retrieves the <li> elements which are hidden/rendered in response to
|
77
|
-
* clicking the <button> element
|
78
|
-
* @param {jQuery} $li - the <button> element
|
79
|
-
* @return {jQuery} - a jQuery object containing the targeted <li>
|
80
|
-
*/
|
81
|
-
findSiblings() {
|
82
|
-
const highlighted = this.$el.siblings('.al-hierarchy-highlight');
|
83
|
-
const $siblings = highlighted.prevAll('.al-collection-context');
|
84
|
-
return $siblings.slice(0, -1);
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
73
|
/**
|
89
74
|
* Models the placeholder display elements for content loading from AJAX
|
90
75
|
* requests
|
@@ -198,6 +183,7 @@ class ContextNavigation {
|
|
198
183
|
if (prevSiblingDocs.length > 1 && originalDocumentIndex > 0) {
|
199
184
|
const hiddenPrevSiblingDocs = prevSiblingDocs.slice(0, -1);
|
200
185
|
hiddenPrevSiblingDocs.forEach(siblingDoc => {
|
186
|
+
siblingDoc.makeCollapsible();
|
201
187
|
siblingDoc.collapse();
|
202
188
|
});
|
203
189
|
|
@@ -245,6 +231,7 @@ class ContextNavigation {
|
|
245
231
|
let renderedBeforeDocs;
|
246
232
|
if (beforeDocs.length > 1) {
|
247
233
|
beforeDocs.forEach(function (parentDoc) {
|
234
|
+
parentDoc.makeCollapsible();
|
248
235
|
parentDoc.collapse();
|
249
236
|
});
|
250
237
|
renderedBeforeDocs = beforeDocs.map(newDoc => newDoc.render()).join('');
|
@@ -281,28 +268,6 @@ class ContextNavigation {
|
|
281
268
|
});
|
282
269
|
}
|
283
270
|
|
284
|
-
|
285
|
-
/**
|
286
|
-
* Update the ancestors for <li> elements
|
287
|
-
* @param {jQuery} $li - the <li> element for the current, highlighted
|
288
|
-
* Document in the <ul> context list of collections, components, and
|
289
|
-
* containers
|
290
|
-
*/
|
291
|
-
/* eslint-disable class-methods-use-this */
|
292
|
-
updateListSiblings($li) {
|
293
|
-
const prevSiblings = $li.prevAll('.al-collection-context');
|
294
|
-
if (prevSiblings.length > 1) {
|
295
|
-
const hiddenNextSiblings = prevSiblings.slice(0, -1);
|
296
|
-
hiddenNextSiblings.toggleClass('collapsed');
|
297
|
-
|
298
|
-
const button = new NestedExpandButton();
|
299
|
-
|
300
|
-
const lastHiddenNextSibling = hiddenNextSiblings[hiddenNextSiblings.length - 1];
|
301
|
-
button.$el.insertAfter(lastHiddenNextSibling);
|
302
|
-
}
|
303
|
-
}
|
304
|
-
/* eslint-enable class-methods-use-this */
|
305
|
-
|
306
271
|
/**
|
307
272
|
* This updates the elements in the View DOM using an AJAX response containing
|
308
273
|
* the HTML of a server-rendered View template.
|
@@ -356,8 +321,8 @@ class ContextNavigation {
|
|
356
321
|
const that = this;
|
357
322
|
this.ul.find('.al-toggle-view-children').on('click', (e) => {
|
358
323
|
e.preventDefault();
|
359
|
-
const targetArea = $($(e.
|
360
|
-
if (!targetArea.data(
|
324
|
+
const targetArea = $($(e.currentTarget).attr('href'));
|
325
|
+
if (!targetArea.data('resolved') === true) {
|
361
326
|
targetArea.find('.context-navigator').each((i, ee) => {
|
362
327
|
const contextNavigation = new ContextNavigation(
|
363
328
|
// Send null for originalParents. We want to disregard the original
|
@@ -111,13 +111,12 @@
|
|
111
111
|
|
112
112
|
// Collapse +/- indicators
|
113
113
|
.al-toggle-view-children {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
114
|
+
&::after {
|
115
|
+
content: image-url('blacklight/plus.svg');
|
116
|
+
}
|
117
|
+
&:not(.collapsed)::after {
|
118
|
+
content: image-url('blacklight/minus.svg');
|
118
119
|
}
|
119
|
-
|
120
|
-
content: image-url('blacklight/plus.svg');
|
121
120
|
}
|
122
121
|
|
123
122
|
.al-toggle-children-container {
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% if document.children? %>
|
5
5
|
<div class="al-toggle-children-container">
|
6
6
|
<%= link_to(
|
7
|
-
|
7
|
+
'',
|
8
8
|
"##{document.id}-collapsible-hierarchy",
|
9
9
|
class: "al-toggle-view-children #{!show_expanded?(document) ? 'collapsed' : ''}",
|
10
10
|
'aria-label': t('arclight.hierarchy.view_all'),
|
data/arclight.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.add_dependency 'blacklight', '~> 7.2'
|
26
26
|
spec.add_dependency 'blacklight_range_limit', '~> 7.1'
|
27
|
-
spec.add_dependency 'rails', '>= 5.2.3', '< 6.
|
27
|
+
spec.add_dependency 'rails', '>= 5.2.3', '< 6.2'
|
28
28
|
spec.add_dependency 'sprockets-bumble_d'
|
29
29
|
spec.add_dependency 'traject', '~> 3.0'
|
30
30
|
spec.add_dependency 'traject_plus', '~> 1.2'
|
data/lib/arclight/version.rb
CHANGED
@@ -95,6 +95,8 @@ class CatalogController < ApplicationController
|
|
95
95
|
config.add_facet_field 'geogname_sim', label: 'Place', limit: 10
|
96
96
|
config.add_facet_field 'places_ssim', label: 'Places', show: false
|
97
97
|
config.add_facet_field 'access_subjects_ssim', label: 'Subject', limit: 10
|
98
|
+
config.add_facet_field 'component_level_isim', show: false
|
99
|
+
config.add_facet_field 'parent_ssim', show: false
|
98
100
|
|
99
101
|
# Have BL send all facet field names to Solr, which has been the default
|
100
102
|
# previously. Simply remove these lines if you'd rather use Solr request
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arclight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Hardy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: blacklight
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: 5.2.3
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '6.
|
53
|
+
version: '6.2'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
version: 5.2.3
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '6.
|
63
|
+
version: '6.2'
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: sprockets-bumble_d
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -285,12 +285,12 @@ files:
|
|
285
285
|
- ".babelrc"
|
286
286
|
- ".codeclimate.yml"
|
287
287
|
- ".eslintrc"
|
288
|
+
- ".github/workflows/ruby.yml"
|
288
289
|
- ".gitignore"
|
289
290
|
- ".rspec"
|
290
291
|
- ".rubocop.yml"
|
291
292
|
- ".rubocop_todo.yml"
|
292
293
|
- ".solr_wrapper"
|
293
|
-
- ".travis.yml"
|
294
294
|
- CONTRIBUTING.md
|
295
295
|
- CONTRIBUTORS.md
|
296
296
|
- Gemfile
|
data/.travis.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
notifications:
|
4
|
-
email: false
|
5
|
-
|
6
|
-
matrix:
|
7
|
-
include:
|
8
|
-
- rvm: 2.7.1
|
9
|
-
env: RAILS_VERSION=6.0.3.2
|
10
|
-
- rvm: 2.7.1
|
11
|
-
env: RAILS_VERSION=5.2.4.3
|
12
|
-
- rvm: 2.6.6
|
13
|
-
env: RAILS_VERSION=6.0.3.2
|
14
|
-
- rvm: 2.6.6
|
15
|
-
env: RAILS_VERSION=5.2.4.3
|
16
|
-
|
17
|
-
jdk:
|
18
|
-
- openjdk11
|
19
|
-
|
20
|
-
before_script:
|
21
|
-
- find spec/fixtures/ead -name '*.xml' | xargs xmllint --noout --schema spec/fixtures/xsd/ead.xsd
|
22
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
23
|
-
- chmod +x ./cc-test-reporter
|
24
|
-
- ./cc-test-reporter before-build
|
25
|
-
- yarn install
|
26
|
-
addons:
|
27
|
-
apt:
|
28
|
-
packages:
|
29
|
-
- libxml2-utils
|
30
|
-
chrome: stable
|
31
|
-
|
32
|
-
env:
|
33
|
-
global:
|
34
|
-
- CC_TEST_REPORTER_ID=0bbc7b5fd7f6bab0c0517183ae34a4d2f6010ca1ef2d1c7c3ccdec55ea823115
|
35
|
-
|
36
|
-
after_script:
|
37
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|