pageflow-support 15.0.0.beta2 → 15.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pageflow/dummy/rails_template.rb +3 -1
- data/pageflow/dummy/templates/create_test_multi_attachment_file.rb +26 -0
- data/pageflow/dummy/templates/create_test_revision_component.rb +1 -0
- data/pageflow/dummy/templates/create_test_uploadable_file.rb +1 -0
- data/pageflow/dummy/templates/database.yml +1 -1
- data/pageflow/lint/file_type.rb +16 -1
- data/pageflow/test_page_type.rb +34 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ac32782bfcee2bc72db29ee0b1af15ce91bb6b13cf5f5454fdbcd7396a70ea
|
4
|
+
data.tar.gz: 2467696934a558f8b83ce5711215793307455b10bbd5917782b63641d26144d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77e0bdd68deec024d75254c6b9fc6b38619c881cf6c96500976b544386959099241fb34f8cbc3d41d1ec2f2cb01e11ee41f6c70705287cd5f6ce3d7616631e97
|
7
|
+
data.tar.gz: ef34dfd1fe6b6deb45b4c2b2f25269b9b30eafc1909ae8cd292e2570dd94f5527b036a1cec0440456af0b3bfc9561ff1fe41bcd239193cdf5c77a37571c91db6
|
@@ -77,8 +77,10 @@ END
|
|
77
77
|
|
78
78
|
copy_file('create_test_uploadable_file.rb',
|
79
79
|
'db/migrate/00000000000000_create_test_uploadable_file.rb')
|
80
|
+
copy_file('create_test_multi_attachment_file.rb',
|
81
|
+
'db/migrate/00000000000001_create_test_multi_attachment_file.rb')
|
80
82
|
copy_file('create_test_revision_component.rb',
|
81
|
-
'db/migrate/
|
83
|
+
'db/migrate/00000000000002_create_test_revision_component.rb')
|
82
84
|
copy_file('add_custom_fields.rb',
|
83
85
|
'db/migrate/99990000000000_add_custom_fields.rb')
|
84
86
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateTestMultiAttachmentFile < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :test_multi_attachment_files do |t|
|
4
|
+
t.belongs_to(:entry, index: true)
|
5
|
+
t.belongs_to(:uploader, index: true)
|
6
|
+
|
7
|
+
t.integer(:parent_file_id)
|
8
|
+
t.string(:parent_file_model_type)
|
9
|
+
|
10
|
+
t.string(:state)
|
11
|
+
t.string(:rights)
|
12
|
+
|
13
|
+
t.string(:first_attachment_file_name)
|
14
|
+
t.string(:first_attachment_content_type)
|
15
|
+
t.integer(:first_attachment_file_size, limit: 8)
|
16
|
+
t.datetime(:first_attachment_updated_at)
|
17
|
+
|
18
|
+
t.string(:second_attachment_file_name)
|
19
|
+
t.string(:second_attachment_content_type)
|
20
|
+
t.integer(:second_attachment_file_size, limit: 8)
|
21
|
+
t.datetime(:second_attachment_updated_at)
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/pageflow/lint/file_type.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'pageflow/global_config_api_test_helper'
|
2
2
|
require 'pageflow/test_page_type'
|
3
|
+
require 'pageflow/entry_export_import'
|
3
4
|
|
4
5
|
module Pageflow
|
5
6
|
module Lint
|
@@ -15,7 +16,7 @@ module Pageflow
|
|
15
16
|
|
16
17
|
before do
|
17
18
|
pageflow_configure do |config|
|
18
|
-
page_type = TestPageType.new(name:
|
19
|
+
page_type = TestPageType.new(name: 'test',
|
19
20
|
file_types: [file_type])
|
20
21
|
config.page_types.clear
|
21
22
|
config.page_types.register(page_type)
|
@@ -51,6 +52,20 @@ module Pageflow
|
|
51
52
|
expect(result).to be_a(Hash)
|
52
53
|
end
|
53
54
|
end
|
55
|
+
|
56
|
+
it 'can be exported and imported without error' do
|
57
|
+
exported_entry = create(:entry)
|
58
|
+
create(:file_usage, file: file, revision: exported_entry.draft)
|
59
|
+
user = create(:user, :manager, on: create(:account))
|
60
|
+
|
61
|
+
Dir.mktmpdir do |dir|
|
62
|
+
archive_file_path = File.join(dir, 'export.zip')
|
63
|
+
EntryExportImport.export(exported_entry, archive_file_path)
|
64
|
+
imported_entry = EntryExportImport.import(archive_file_path, creator: user)
|
65
|
+
|
66
|
+
expect(imported_entry.draft.find_files(file_type.model)).to be_present
|
67
|
+
end
|
68
|
+
end
|
54
69
|
end
|
55
70
|
end
|
56
71
|
end
|
data/pageflow/test_page_type.rb
CHANGED
@@ -2,11 +2,43 @@ require 'pageflow/page_type'
|
|
2
2
|
|
3
3
|
module Pageflow
|
4
4
|
class TestPageType < PageType
|
5
|
-
attr_reader
|
5
|
+
attr_reader(:name,
|
6
|
+
:file_types,
|
7
|
+
:revision_components,
|
8
|
+
:export_version)
|
6
9
|
|
7
|
-
def initialize(name:,
|
10
|
+
def initialize(name:,
|
11
|
+
file_types: [],
|
12
|
+
revision_components: [],
|
13
|
+
template_path: nil,
|
14
|
+
json_seed_template: nil,
|
15
|
+
thumbnail_candidates: nil,
|
16
|
+
export_version: '1.2.0',
|
17
|
+
import_version_requirement: nil)
|
8
18
|
@name = name
|
9
19
|
@file_types = file_types
|
20
|
+
@revision_components = revision_components
|
21
|
+
@template_path = template_path
|
22
|
+
@json_seed_template = json_seed_template
|
23
|
+
@thumbnail_candidates = thumbnail_candidates
|
24
|
+
@export_version = export_version
|
25
|
+
@import_version_requirement = import_version_requirement
|
26
|
+
end
|
27
|
+
|
28
|
+
def template_path
|
29
|
+
@template_path || super
|
30
|
+
end
|
31
|
+
|
32
|
+
def json_seed_template
|
33
|
+
@json_seed_template || super
|
34
|
+
end
|
35
|
+
|
36
|
+
def thumbnail_candidates
|
37
|
+
@thumbnail_candidates || super
|
38
|
+
end
|
39
|
+
|
40
|
+
def import_version_requirement
|
41
|
+
@import_version_requirement || super
|
10
42
|
end
|
11
43
|
end
|
12
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageflow-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.0.0.
|
4
|
+
version: 15.0.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Codevise Solutions Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-24 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: 15.0.0.
|
19
|
+
version: 15.0.0.beta3
|
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: 15.0.0.
|
26
|
+
version: 15.0.0.beta3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mysql2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- pageflow/dummy/config/pageflow.rb
|
183
183
|
- pageflow/dummy/rails_template.rb
|
184
184
|
- pageflow/dummy/templates/add_custom_fields.rb
|
185
|
+
- pageflow/dummy/templates/create_test_multi_attachment_file.rb
|
185
186
|
- pageflow/dummy/templates/create_test_revision_component.rb
|
186
187
|
- pageflow/dummy/templates/create_test_uploadable_file.rb
|
187
188
|
- pageflow/dummy/templates/database.yml
|
@@ -215,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
216
|
version: 1.3.1
|
216
217
|
requirements: []
|
217
218
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.7.
|
219
|
+
rubygems_version: 2.7.5
|
219
220
|
signing_key:
|
220
221
|
specification_version: 4
|
221
222
|
summary: Spec support for Pageflow extensions.
|