pageflow-panorama 2.1.0 → 2.2.0
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/.travis.yml +3 -0
- data/CHANGELOG.md +10 -10
- data/app/assets/javascripts/pageflow/panorama/editor/models/package.js +1 -1
- data/app/assets/stylesheets/pageflow/panorama/editor.scss +1 -1
- data/app/helpers/pageflow/panorama/packages_helper.rb +3 -1
- data/app/models/pageflow/panorama/package.rb +12 -3
- data/lib/pageflow/panorama/page_type.rb +15 -7
- data/lib/pageflow/panorama/version.rb +1 -1
- data/pageflow-panorama.gemspec +2 -2
- data/spec/factories/panorama_package.rb +11 -0
- data/spec/helpers/pageflow/panorama/packages_helper_spec.rb +44 -0
- data/spec/integration/file_type_spec.rb +10 -0
- data/spec/support/config/factory_bot.rb +14 -0
- metadata +14 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3db4ed7e2dac5aadca40c3177669f4c6640577eb9f941f568a8156890e7d3dd0
|
4
|
+
data.tar.gz: 5048ed5d21482edb03f99b9feca34518a35689864d8962af14031dcc6933de45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13c02586c8b56f9c40137bdfb917d16fb3e58ddb2737ffb648fc813e0daa7c6fc7ae2f243afb559ff8671a36e6d693092697e9d14c0761e00dd476923fd52c6c
|
7
|
+
data.tar.gz: 80fe4b7abf2332853ba64c46bec403dc8f50b1b4d5855a1f2c6157e33b5f49eba1feb15fa01f66ca1e87f8652dd67ce94c52768ea2aa7897949da1d7447255db
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
### Version 2.
|
3
|
+
### Version 2.2.0
|
4
4
|
|
5
|
-
2019-04
|
5
|
+
2019-11-04
|
6
6
|
|
7
|
-
[Compare changes](https://github.com/codevise/pageflow-panorama/compare/2-
|
7
|
+
[Compare changes](https://github.com/codevise/pageflow-panorama/compare/2-1-stable...v2.2.0)
|
8
8
|
|
9
|
-
-
|
10
|
-
([#
|
11
|
-
-
|
12
|
-
([#
|
13
|
-
-
|
14
|
-
([#
|
9
|
+
- Add importer for Packages
|
10
|
+
([#35](https://github.com/codevise/pageflow-panorama/pull/35))
|
11
|
+
- Fix Travis CI
|
12
|
+
([#34](https://github.com/codevise/pageflow-panorama/pull/34))
|
13
|
+
- Always lookup files by revisions usage scope
|
14
|
+
([#32](https://github.com/codevise/pageflow-panorama/pull/32))
|
15
15
|
|
16
16
|
See
|
17
|
-
[2-
|
17
|
+
[2-1-stable branch](https://github.com/codevise/pageflow-panorama/blob/2-1-stable/CHANGELOG.md)
|
18
18
|
for previous changes.
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module Pageflow
|
2
2
|
module Panorama
|
3
3
|
module PackagesHelper
|
4
|
+
include RevisionFileHelper
|
5
|
+
|
4
6
|
def panorama_url(configuration)
|
5
7
|
if configuration['panorama_source'] == 'url'
|
6
8
|
configuration['panorama_url']
|
7
9
|
else
|
8
|
-
package = Package
|
10
|
+
package = find_file_in_entry(Package, configuration['panorama_package_id'])
|
9
11
|
package ? package.index_document_path : nil
|
10
12
|
end
|
11
13
|
end
|
@@ -3,7 +3,7 @@ require 'zip'
|
|
3
3
|
module Pageflow
|
4
4
|
module Panorama
|
5
5
|
class Package < ActiveRecord::Base
|
6
|
-
include
|
6
|
+
include UploadableFile
|
7
7
|
|
8
8
|
processing_state_machine do
|
9
9
|
state 'unpacking'
|
@@ -14,11 +14,11 @@ module Pageflow
|
|
14
14
|
transition any => 'unpacking'
|
15
15
|
end
|
16
16
|
|
17
|
-
event :
|
17
|
+
event :retry_unpacking do
|
18
18
|
transition 'unpacking_failed' => 'unpacking'
|
19
19
|
end
|
20
20
|
|
21
|
-
before_transition on: :
|
21
|
+
before_transition on: :retry_unpacking do |package|
|
22
22
|
JobStatusAttributes.reset(package, stage: :unpacking)
|
23
23
|
end
|
24
24
|
|
@@ -47,6 +47,15 @@ module Pageflow
|
|
47
47
|
def unpack_base_path
|
48
48
|
attachment_on_s3.present? ? File.dirname(attachment_on_s3.path(:unpacked)) : nil
|
49
49
|
end
|
50
|
+
|
51
|
+
# UploadableFile-overrides
|
52
|
+
def retry!
|
53
|
+
retry_unpacking!
|
54
|
+
end
|
55
|
+
|
56
|
+
def ready?
|
57
|
+
unpacked?
|
58
|
+
end
|
50
59
|
end
|
51
60
|
end
|
52
61
|
end
|
@@ -10,11 +10,7 @@ module Pageflow
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def file_types
|
13
|
-
[
|
14
|
-
FileType.new(model: Package,
|
15
|
-
editor_partial: 'pageflow/panorama/editor/packages/package',
|
16
|
-
top_level_type: true)
|
17
|
-
]
|
13
|
+
[Panorama.package_file_type]
|
18
14
|
end
|
19
15
|
|
20
16
|
def json_seed_template
|
@@ -23,10 +19,22 @@ module Pageflow
|
|
23
19
|
|
24
20
|
def thumbnail_candidates
|
25
21
|
[
|
26
|
-
{
|
27
|
-
|
22
|
+
{
|
23
|
+
attribute: 'thumbnail_image_id',
|
24
|
+
file_collection: 'image_files'
|
25
|
+
},
|
26
|
+
{
|
27
|
+
attribute: 'panorama_package_id',
|
28
|
+
file_collection: 'pageflow_panorama_packages'
|
29
|
+
}
|
28
30
|
]
|
29
31
|
end
|
30
32
|
end
|
33
|
+
|
34
|
+
def self.package_file_type
|
35
|
+
FileType.new(model: Package,
|
36
|
+
editor_partial: 'pageflow/panorama/editor/packages/package',
|
37
|
+
top_level_type: true)
|
38
|
+
end
|
31
39
|
end
|
32
40
|
end
|
data/pageflow-panorama.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
spec.required_ruby_version = '~> 2.1'
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'pageflow', '~>
|
21
|
+
spec.add_runtime_dependency 'pageflow', '~> 15.x'
|
22
22
|
spec.add_runtime_dependency 'rubyzip', '~> 1.1'
|
23
23
|
spec.add_runtime_dependency 'aws-sdk-s3', '~> 1.17'
|
24
24
|
spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.0'
|
25
25
|
|
26
|
-
spec.add_development_dependency 'pageflow-support', '~>
|
26
|
+
spec.add_development_dependency 'pageflow-support', '~> 15.x'
|
27
27
|
spec.add_development_dependency 'bundler', ['>= 1.0', '< 3']
|
28
28
|
spec.add_development_dependency 'rake', '~> 12.0'
|
29
29
|
spec.add_development_dependency 'rspec-rails', '~> 3.7'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pageflow/used_file_test_helper'
|
3
|
+
|
4
|
+
module Pageflow
|
5
|
+
module Panorama
|
6
|
+
describe PackagesHelper do
|
7
|
+
include UsedFileTestHelper
|
8
|
+
|
9
|
+
describe '#panorama_url' do
|
10
|
+
context 'URL panorama source' do
|
11
|
+
it 'should return specified panorama url when panorama source is URL' do
|
12
|
+
@entry = PublishedEntry.new(create(:entry, :published))
|
13
|
+
configuration = {
|
14
|
+
'panorama_source' => 'url',
|
15
|
+
'panorama_url' => 'S3-url'
|
16
|
+
}
|
17
|
+
|
18
|
+
url = helper.panorama_url(configuration)
|
19
|
+
expect(url).to eq('S3-url')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should return nil if no package can be found' do
|
24
|
+
@entry = PublishedEntry.new(create(:entry, :published))
|
25
|
+
configuration = {
|
26
|
+
'panorama_package_id' => 500
|
27
|
+
}
|
28
|
+
|
29
|
+
expect(helper.panorama_url(configuration)).to be_nil
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should return the packages index document path' do
|
33
|
+
panorama_package_file = create_used_file(:package)
|
34
|
+
configuration = {
|
35
|
+
'panorama_package_id' => panorama_package_file.perma_id
|
36
|
+
}
|
37
|
+
|
38
|
+
url = helper.panorama_url(configuration)
|
39
|
+
expect(url).to match(/#{panorama_package_file.id}\/unpacked\/#{panorama_package_file.perma_id}/)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'factory_bot_rails'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
# Allow to use build and create methods without FactoryBot prefix.
|
5
|
+
config.include FactoryBot::Syntax::Methods
|
6
|
+
|
7
|
+
# Make sure factories are up to date when using spring. Skip in CI
|
8
|
+
# since reloading causes factories to be excluded in test coverage.
|
9
|
+
unless ENV['CI']
|
10
|
+
config.before(:all) do
|
11
|
+
FactoryBot.reload
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageflow-panorama
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Codevise Solutions
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pageflow
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 15.x
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 15.x
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubyzip
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 15.x
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 15.x
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -216,10 +216,13 @@ files:
|
|
216
216
|
- lib/pageflow/panorama/version.rb
|
217
217
|
- lib/pageflow/panorama/zip_entry_paperclip_io_adapter.rb
|
218
218
|
- pageflow-panorama.gemspec
|
219
|
+
- spec/factories/panorama_package.rb
|
219
220
|
- spec/fixtures/dir_some.txt.zip
|
220
221
|
- spec/fixtures/krpano.zip
|
221
222
|
- spec/fixtures/krpano_with_unprocessable_thumbnail.zip
|
222
223
|
- spec/fixtures/some.txt.zip
|
224
|
+
- spec/helpers/pageflow/panorama/packages_helper_spec.rb
|
225
|
+
- spec/integration/file_type_spec.rb
|
223
226
|
- spec/integration/page_type_spec.rb
|
224
227
|
- spec/models/pageflow/panorama/package_spec.rb
|
225
228
|
- spec/pageflow/panorama/job_status_attributes_spec.rb
|
@@ -227,6 +230,7 @@ files:
|
|
227
230
|
- spec/pageflow/panorama/validation/kr_pano_spec.rb
|
228
231
|
- spec/spec_helper.rb
|
229
232
|
- spec/support/config/active_job.rb
|
233
|
+
- spec/support/config/factory_bot.rb
|
230
234
|
- spec/support/config/pageflow_panorama.rb
|
231
235
|
- spec/support/helpers/doubles.rb
|
232
236
|
homepage: https://github.com/codevise/pageflow-panorama
|
@@ -254,10 +258,13 @@ signing_key:
|
|
254
258
|
specification_version: 4
|
255
259
|
summary: Pagetype for iframe embedded 360° panoramas
|
256
260
|
test_files:
|
261
|
+
- spec/factories/panorama_package.rb
|
257
262
|
- spec/fixtures/dir_some.txt.zip
|
258
263
|
- spec/fixtures/krpano.zip
|
259
264
|
- spec/fixtures/krpano_with_unprocessable_thumbnail.zip
|
260
265
|
- spec/fixtures/some.txt.zip
|
266
|
+
- spec/helpers/pageflow/panorama/packages_helper_spec.rb
|
267
|
+
- spec/integration/file_type_spec.rb
|
261
268
|
- spec/integration/page_type_spec.rb
|
262
269
|
- spec/models/pageflow/panorama/package_spec.rb
|
263
270
|
- spec/pageflow/panorama/job_status_attributes_spec.rb
|
@@ -265,5 +272,6 @@ test_files:
|
|
265
272
|
- spec/pageflow/panorama/validation/kr_pano_spec.rb
|
266
273
|
- spec/spec_helper.rb
|
267
274
|
- spec/support/config/active_job.rb
|
275
|
+
- spec/support/config/factory_bot.rb
|
268
276
|
- spec/support/config/pageflow_panorama.rb
|
269
277
|
- spec/support/helpers/doubles.rb
|