blacklight-hierarchy 5.4.0 → 6.0.2
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 +7 -20
- data/README.md +16 -6
- data/app/assets/javascripts/blacklight/hierarchy/blacklight_hierarchy_controller.js +1 -1
- data/app/assets/stylesheets/blacklight/hierarchy/hierarchy.scss +21 -2
- data/app/helpers/blacklight/hierarchy_helper.rb +2 -2
- data/blacklight-hierarchy.gemspec +1 -1
- data/lib/blacklight/hierarchy/engine.rb +0 -2
- data/lib/blacklight/hierarchy/version.rb +1 -1
- data/lib/generators/blacklight_hierarchy/templates/blacklight_hierarchy.js +1 -1
- data/package.json +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3415fa86520ce7eabf392993b65a8897e22af37496dc97c75d7ecde676e4a626
|
4
|
+
data.tar.gz: 5573391147e54e00060f28d0c2b5e4eb152f520640648e009a84e6e0a0302669
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79df7ced8f2612552179ced087766cc682ef54c6adba01ebea38c31a404f43f7641c7937261f196377ec54253dac9651e96c980f0c435bcc58700b3983996785
|
7
|
+
data.tar.gz: 43eb2002ce53bf3d697c317ed9d0ace1a0c352cbe9a1cc8751779d4a2dada8b6bface7505c7fee18551118c9de45186fe4e887e3b9e9153b0f5417d5cf1d7fc0
|
data/.github/workflows/ruby.yml
CHANGED
@@ -18,24 +18,11 @@ jobs:
|
|
18
18
|
runs-on: ubuntu-latest
|
19
19
|
strategy:
|
20
20
|
matrix:
|
21
|
-
ruby: [2.7, 3.0]
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
with:
|
27
|
-
ruby-version: ${{ matrix.ruby }}
|
28
|
-
- name: Install dependencies
|
29
|
-
run: bundle install
|
30
|
-
- name: Run tests
|
31
|
-
run: bundle exec rake ci
|
32
|
-
env:
|
33
|
-
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
34
|
-
test_rails5:
|
35
|
-
runs-on: ubuntu-latest
|
36
|
-
strategy:
|
37
|
-
matrix:
|
38
|
-
ruby: [2.7, 2.6]
|
21
|
+
ruby: [2.7, '3.0']
|
22
|
+
rails_version: ['7.0.2.2', '6.1.4.6']
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
rails_version: '5.2.4.2'
|
39
26
|
steps:
|
40
27
|
- uses: actions/checkout@v2
|
41
28
|
- name: Set up Ruby
|
@@ -45,9 +32,9 @@ jobs:
|
|
45
32
|
- name: Install dependencies
|
46
33
|
run: bundle install
|
47
34
|
env:
|
48
|
-
RAILS_VERSION:
|
35
|
+
RAILS_VERSION: ${{ matrix.rails_version }}
|
49
36
|
- name: Run tests
|
50
37
|
run: bundle exec rake ci
|
51
38
|
env:
|
52
|
-
RAILS_VERSION:
|
39
|
+
RAILS_VERSION: ${{ matrix.rails_version }}
|
53
40
|
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
data/README.md
CHANGED
@@ -83,15 +83,17 @@ Facet fields should be added for each permutation of hierarchy key and term valu
|
|
83
83
|
config.facet_display[:hierarchy].each{ |k,v| puts "#{k}_#{v}" }
|
84
84
|
```
|
85
85
|
|
86
|
-
###
|
87
|
-
|
86
|
+
### Changing the icons
|
87
|
+
We store our closed/open icons as the SASS variables `$b-h-closed-icon` and `$b-h-closed-icon` in `hierarchy.scss`. By default we use SVGs provided by the [Font Awesome](https://github.com/FortAwesome/Font-Awesome) library. To change the icon, reassign these SASS variables with new SVG code.
|
88
88
|
|
89
|
-
```
|
90
|
-
|
91
|
-
Blacklight::Hierarchy::Engine.config.opened_icon = '➖'
|
89
|
+
```scss
|
90
|
+
/* app/assets/stylesheets/blacklight/hierarchy/hierarchy.scss */
|
92
91
|
|
92
|
+
// plus sign
|
93
|
+
$b-h-closed-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
|
93
94
|
```
|
94
95
|
|
96
|
+
|
95
97
|
### Aria Labels
|
96
98
|
For screen reader purposes we have used "Toggle subgroup" as the aria-label attribute of the button. This is internationalized using rails' i18n feature.
|
97
99
|
|
@@ -114,9 +116,17 @@ The javascript in this project requires jquery, but it's up to you to provide it
|
|
114
116
|
|
115
117
|
This code was ripped out of another project, and is still quite immature as a standalone project. Every effort has been made to make it as plug-and-play as possible, but it may stomp on Blacklight in unintended ways (e.g., ways that made sense in context of its former host app, but which aren't compatible with generic Blacklight). Proceed with caution, and report issues.
|
116
118
|
|
119
|
+
## Release
|
120
|
+
|
121
|
+
In order to cut a new release you will need to publish simultaneously to NPM and RubyGems. Before you do that ensure that versions in `lib/blacklight/hierarchy/version.rb` and `package.json` match. Assuming you have the credentials to do it you can then:
|
122
|
+
|
123
|
+
```
|
124
|
+
$ gem push blacklight-hiearchy-0.1.0.gem
|
125
|
+
$ npm publish
|
126
|
+
```
|
127
|
+
|
117
128
|
## TODO
|
118
129
|
|
119
130
|
- WRITE TESTS
|
120
131
|
- Switch internal facet management from hack-y Hash to `Blacklight::Hierarchy::FacetGroup` class (already implemented, but not plumbed up)
|
121
|
-
- Add configuration support for hierarchy delimiters other than `/\s*:\s*/` (baked into `Blacklight::Hierarchy::FacetGroup`, but again, requiring additional plumbing)
|
122
132
|
- Clarify when suffix is applied/required/etc.
|
@@ -1,3 +1,8 @@
|
|
1
|
+
// plus sign
|
2
|
+
$b-h-closed-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M200 344V280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H200V168C200 154.7 210.7 144 224 144C237.3 144 248 154.7 248 168V232H312C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H248V344C248 357.3 237.3 368 224 368C210.7 368 200 357.3 200 344zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
|
3
|
+
// minus sign
|
4
|
+
$b-h-opened-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d='M312 232C325.3 232 336 242.7 336 256C336 269.3 325.3 280 312 280H136C122.7 280 112 269.3 112 256C112 242.7 122.7 232 136 232H312zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z'/></svg>") !default;
|
5
|
+
|
1
6
|
$text-muted: #777 !default;
|
2
7
|
|
3
8
|
.facet-hierarchy {
|
@@ -34,8 +39,21 @@ $text-muted: #777 !default;
|
|
34
39
|
}
|
35
40
|
}
|
36
41
|
|
42
|
+
.twiddle>.toggle-handle {
|
43
|
+
background-color: transparent;
|
44
|
+
}
|
45
|
+
|
46
|
+
.twiddle>.toggle-handle .toggle-icon {
|
47
|
+
background-position: center;
|
48
|
+
background-repeat: no-repeat;
|
49
|
+
margin-top: 3px;
|
50
|
+
min-height: 20px;
|
51
|
+
min-width: 20px;
|
52
|
+
}
|
53
|
+
|
37
54
|
.twiddle>.toggle-handle .closed {
|
38
|
-
|
55
|
+
background-image: escape-svg($b-h-closed-icon);
|
56
|
+
display: inline-block;
|
39
57
|
}
|
40
58
|
|
41
59
|
.twiddle>.toggle-handle .opened {
|
@@ -47,7 +65,8 @@ $text-muted: #777 !default;
|
|
47
65
|
}
|
48
66
|
|
49
67
|
.twiddle-open>.toggle-handle .opened {
|
50
|
-
|
68
|
+
background-image: escape-svg($b-h-opened-icon);
|
69
|
+
display: inline-block;
|
51
70
|
}
|
52
71
|
|
53
72
|
.h-leaf {
|
@@ -22,8 +22,8 @@ module Blacklight::HierarchyHelper
|
|
22
22
|
bs_target: "##{controls}"
|
23
23
|
},
|
24
24
|
class: 'toggle-handle') do
|
25
|
-
tag.
|
26
|
-
tag.
|
25
|
+
tag.div( :'aria-hidden' => 'true', class: 'closed toggle-icon') +
|
26
|
+
tag.div( :'aria-hidden' => 'true', class: 'opened toggle-icon')
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ['lib']
|
20
20
|
|
21
21
|
s.add_dependency 'blacklight', '~> 7.18'
|
22
|
-
s.add_dependency 'rails', '>= 5.1', '< 7'
|
22
|
+
s.add_dependency 'rails', '>= 5.1', '< 7.1'
|
23
23
|
s.add_dependency 'deprecation'
|
24
24
|
|
25
25
|
s.add_development_dependency 'rsolr'
|
@@ -4,6 +4,6 @@
|
|
4
4
|
// blacklight_hierarchy_controller instead:
|
5
5
|
//
|
6
6
|
// import BlacklightHierarchyController from 'blacklight-hierarchy/app/assets/javascripts/blacklight/hierarchy/blacklight_hierarchy_controller'
|
7
|
-
// import { Application } from 'stimulus'
|
7
|
+
// import { Application } from '@hotwired/stimulus'
|
8
8
|
// const application = Application.start()
|
9
9
|
// application.register("b-h-collapsible", BlacklightHierarchyController)
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "blacklight-hierarchy",
|
3
|
-
"version": "
|
3
|
+
"version": "6.0.2",
|
4
4
|
"description": "[![Build Status](https://github.com/sul-dlss/blacklight-hierarchy/workflows/CI/badge.svg)](https://github.com/sul-dlss/blacklight-hierarchy/actions?query=branch%3Amain)",
|
5
5
|
"main": "app/assets/javascripts/blacklight/hierarchy/hierarchy.js",
|
6
6
|
"files": [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-hierarchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael B. Klein
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '5.1'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7'
|
36
|
+
version: '7.1'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '5.1'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7'
|
46
|
+
version: '7.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: deprecation
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,7 +194,7 @@ files:
|
|
194
194
|
homepage: https://github.com/sul-dlss/blacklight-hierarchy
|
195
195
|
licenses: []
|
196
196
|
metadata: {}
|
197
|
-
post_install_message:
|
197
|
+
post_install_message:
|
198
198
|
rdoc_options: []
|
199
199
|
require_paths:
|
200
200
|
- lib
|
@@ -209,8 +209,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
213
|
-
signing_key:
|
212
|
+
rubygems_version: 3.2.32
|
213
|
+
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: Hierarchical Facets for Blacklight
|
216
216
|
test_files:
|