mobile_workflow 0.5.6 → 0.5.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843610afaa8207693d3f1be346698ca58e4022a3575b6953ef52c343781c649c
|
4
|
+
data.tar.gz: b787b24ab9fbf0f47910a889f23a59094d214db55c6eb0950609b674ba01ed64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 427d7c382ebc60cdf5ebd79f4257d2ec268cd0f52d7c7bd583afc1774c3adecaef910b163e06d1a754fa2340dfd352f23ae3c06056d97762e7b6fe878713b7cc
|
7
|
+
data.tar.gz: e98d3ebb68a12e42b3911d63fe16e4fe578ece0fc8e86814ac401d80a171fcd854d7a42f1a522fc535fc06d56eed1bb902e2a597b3d9d73a4c3c2b4603ce59a7
|
@@ -8,7 +8,7 @@ module MobileWorkflow
|
|
8
8
|
|
9
9
|
def mw_list_item(id: self.id, text:, detail_text: nil, sf_symbol_name: nil, image_attachment: nil)
|
10
10
|
mw_list_item = {id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name}
|
11
|
-
mw_list_item[:imageURL] = preview_url(image_attachment,
|
11
|
+
mw_list_item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [100, 100] }) if image_attachment
|
12
12
|
mw_list_item.compact
|
13
13
|
end
|
14
14
|
|
@@ -16,8 +16,8 @@ module MobileWorkflow
|
|
16
16
|
{type: :text, label: label, text: text.to_s}.compact
|
17
17
|
end
|
18
18
|
|
19
|
-
def mw_display_image(attachment)
|
20
|
-
{type: :image, previewURL: preview_url(attachment,
|
19
|
+
def mw_display_image(attachment, options: { resize_to_fill: [600, 1200] })
|
20
|
+
{type: :image, previewURL: preview_url(attachment, options: options), url: attachment_url(attachment)}
|
21
21
|
end
|
22
22
|
|
23
23
|
def mw_display_unsplash_image(image_url)
|
@@ -29,8 +29,8 @@ module MobileWorkflow
|
|
29
29
|
{type: :image, previewURL: image_url, url: image_url}
|
30
30
|
end
|
31
31
|
|
32
|
-
def mw_display_video(attachment)
|
33
|
-
{type: :video, previewURL: preview_url(attachment,
|
32
|
+
def mw_display_video(attachment, preview_options: { resize_to_fill: [600, 1200] })
|
33
|
+
{type: :video, previewURL: preview_url(attachment, options: preview_options), url: attachment_url(attachment)}
|
34
34
|
end
|
35
35
|
|
36
36
|
def mw_display_button(label:, style: :primary, on_success: :forward)
|
@@ -69,12 +69,12 @@ module MobileWorkflow
|
|
69
69
|
def validate_button_style!(style)
|
70
70
|
raise 'Unknown style' unless BUTTON_STYLES.include?(style)
|
71
71
|
end
|
72
|
-
|
73
|
-
def preview_url(attachment,
|
72
|
+
|
73
|
+
def preview_url(attachment, options:)
|
74
74
|
return nil unless attachment.attached?
|
75
75
|
|
76
76
|
if attachment.image?
|
77
|
-
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(
|
77
|
+
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(options), host: attachment_host)
|
78
78
|
elsif attachment.previewable?
|
79
79
|
Rails.application.routes.url_helpers.rails_representation_url(attachment.preview(options), host: attachment_host)
|
80
80
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobile_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.1.4
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: A Rails engine to provide API support for Mobile Workflow Apps.
|