workarea-blog 3.4.8 → 3.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +54 -0
- data/.rubocop.yml +3 -0
- data/.stylelintrc.json +8 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +1 -0
- data/app/models/workarea/search/storefront/content.decorator +12 -0
- data/lib/workarea/blog/version.rb +1 -1
- data/test/models/workarea/search/storefront/blog_content_test.rb +37 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05dd002e82b59940b44ec0428f8b851bf67df28ba9e927cedafd4c567e509386
|
4
|
+
data.tar.gz: d65ee90babfb6388d41c1b4ad3e43ad6474ac51a58f23ed3e0a634eee6c3a336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc739ac4a5aec8e70a6326d0ac43a6d1a45b80cae2ff827d39f5e4fcd5a4c3ced652c0faca28616ea02d9b49c65ccd330ab880fa3d5892afd179d038c98ef564
|
7
|
+
data.tar.gz: dcaec863fb1f1d7da54a4ee2ea96664fce82f355fa6782b8084887f03b2b06b85525198afc3715a310ecca2f405a248f07c892e91ea9af988abd432d38e093ef
|
@@ -0,0 +1,54 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
static_analysis:
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- uses: actions/checkout@v1
|
9
|
+
- uses: workarea-commerce/ci/bundler-audit@v1
|
10
|
+
- uses: workarea-commerce/ci/rubocop@v1
|
11
|
+
|
12
|
+
admin_tests:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v1
|
16
|
+
- uses: actions/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 2.6.x
|
19
|
+
- uses: workarea-commerce/ci/test@v1
|
20
|
+
with:
|
21
|
+
command: bin/rails app:workarea:test:admin
|
22
|
+
|
23
|
+
core_tests:
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v1
|
27
|
+
- uses: actions/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: 2.6.x
|
30
|
+
- uses: workarea-commerce/ci/test@v1
|
31
|
+
with:
|
32
|
+
command: bin/rails app:workarea:test:core
|
33
|
+
|
34
|
+
storefront_tests:
|
35
|
+
runs-on: ubuntu-latest
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v1
|
38
|
+
- uses: actions/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: 2.6.x
|
41
|
+
- uses: workarea-commerce/ci/test@v1
|
42
|
+
with:
|
43
|
+
command: bin/rails app:workarea:test:storefront
|
44
|
+
|
45
|
+
plugins_tests:
|
46
|
+
runs-on: ubuntu-latest
|
47
|
+
steps:
|
48
|
+
- uses: actions/checkout@v1
|
49
|
+
- uses: actions/setup-ruby@v1
|
50
|
+
with:
|
51
|
+
ruby-version: 2.6.x
|
52
|
+
- uses: workarea-commerce/ci/test@v1
|
53
|
+
with:
|
54
|
+
command: bin/rails app:workarea:test:plugins
|
data/.rubocop.yml
ADDED
data/.stylelintrc.json
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
Workarea Blog 3.4.9 (2019-10-16)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Fix Content Search Text for Blog Entries
|
5
|
+
|
6
|
+
Since workarea-commerce/workarea-content-search#1 seems to be on the
|
7
|
+
back burner for now, and regardless of this blogs will have to handle
|
8
|
+
their search summary text on their own anyway. Update
|
9
|
+
`Search::Storefront::Content` to use the blog entry summary if it
|
10
|
+
exists, falling back to whatever the content-search gem uses to generate
|
11
|
+
its text. At the moment, this involves extracting text from content
|
12
|
+
blocks that have more than 5 words in them, but this may change in the
|
13
|
+
next major.
|
14
|
+
|
15
|
+
(#6)
|
16
|
+
Tom Scott
|
17
|
+
|
18
|
+
|
19
|
+
|
1
20
|
Workarea Blog 3.4.8 (2019-10-01)
|
2
21
|
--------------------------------------------------------------------------------
|
3
22
|
|
data/Gemfile
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Workarea
|
2
|
+
if Plugin.installed?(:content_search)
|
3
|
+
decorate Search::Storefront::Content, with: :blog do
|
4
|
+
# Always use the summary
|
5
|
+
def text
|
6
|
+
return super unless model.contentable.try(:summary).present?
|
7
|
+
|
8
|
+
model.contentable.summary
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Workarea
|
4
|
+
if Plugin.installed?(:content_search)
|
5
|
+
module Search
|
6
|
+
class Storefront
|
7
|
+
class BlogContentTest < Workarea::TestCase
|
8
|
+
include TestCase::SearchIndexing
|
9
|
+
|
10
|
+
setup :setup_models
|
11
|
+
|
12
|
+
def setup_models
|
13
|
+
@entry = create_blog_entry(blog: create_blog)
|
14
|
+
@content = Workarea::Content.for(@entry)
|
15
|
+
@content.blocks.create!(
|
16
|
+
type: :html,
|
17
|
+
data: { 'html' => '<p>lorem ipsum dolor sit amet</p</p>' }
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_use_summary_for_text_when_available
|
22
|
+
@entry.update!(summary: 'foo bar baz')
|
23
|
+
indexed = Content.new(@content)
|
24
|
+
|
25
|
+
assert_equal('foo bar baz', indexed.text)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_fall_back_to_default_block_text_extraction
|
29
|
+
indexed = Content.new(@content)
|
30
|
+
|
31
|
+
assert_equal('lorem ipsum dolor sit amet', indexed.text)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bcrouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea
|
@@ -43,9 +43,12 @@ files:
|
|
43
43
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
44
44
|
- ".github/ISSUE_TEMPLATE/documentation-request.md"
|
45
45
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
46
|
+
- ".github/workflows/ci.yml"
|
46
47
|
- ".gitignore"
|
47
48
|
- ".rspec"
|
49
|
+
- ".rubocop.yml"
|
48
50
|
- ".scss-lint.yml"
|
51
|
+
- ".stylelintrc.json"
|
49
52
|
- ".tailor"
|
50
53
|
- ".yardopts"
|
51
54
|
- CHANGELOG.md
|
@@ -80,6 +83,7 @@ files:
|
|
80
83
|
- app/models/workarea/content/fields/blog_id.rb
|
81
84
|
- app/models/workarea/search/admin/content_blog.rb
|
82
85
|
- app/models/workarea/search/admin/content_blog_entry.rb
|
86
|
+
- app/models/workarea/search/storefront/content.decorator
|
83
87
|
- app/queries/workarea/metadata/content_blog.rb
|
84
88
|
- app/queries/workarea/metadata/content_blog_entry.rb
|
85
89
|
- app/queries/workarea/search/admin_blog_entries.rb
|
@@ -231,6 +235,7 @@ files:
|
|
231
235
|
- test/lib/workarea/blog/import/wordpress/page_test.rb
|
232
236
|
- test/models/workarea/content/blog_comment_test.rb
|
233
237
|
- test/models/workarea/content/blog_entry_test.rb
|
238
|
+
- test/models/workarea/search/storefront/blog_content_test.rb
|
234
239
|
- test/queries/workarea/metadata/content_blog_entry_test.rb
|
235
240
|
- test/queries/workarea/metadata/content_blog_test.rb
|
236
241
|
- test/support/workarea/blog/stub_wordpress_assets.rb
|