mobile_workflow 0.6.13 → 0.6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/mobile_workflow/displayable.rb +11 -4
- data/lib/mobile_workflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 799110824fce9c1897c4418e504215c23e19a29107dc3833d3b44ef633ffd695
|
4
|
+
data.tar.gz: a8606dc9b5b382ffff495fb7eecd20b17b737f4c5234821318402222f677c419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611d110892aa6a03b97c6aa7d0ce9ba3e7aaa810eaf05b313ca7db18b8260b76cadfb3ac64f9af972b8f12759eb10ce21cc65258b8047226155e2238da14cc3d
|
7
|
+
data.tar.gz: fa196418587eae7166549b881cfea04b89b9539738c39c0f6c159e4de450c480d5a8d14c88530c0527ec4b135fd0c803622ae367a235299314d2826da084bddd
|
@@ -5,6 +5,7 @@ module MobileWorkflow
|
|
5
5
|
|
6
6
|
ON_SUCCESS_OPTIONS = [:none, :reload, :backward, :forward]
|
7
7
|
BUTTON_STYLES = [:primary, :outline, :danger]
|
8
|
+
CONTENT_MODE_OPTIONS = [:scale_aspect_fill, :scale_aspect_fit]
|
8
9
|
|
9
10
|
def mw_list_item(id: self.id, text:, detail_text: nil, sf_symbol_name: nil, image_attachment: nil)
|
10
11
|
mw_list_item = {id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name}
|
@@ -20,8 +21,10 @@ module MobileWorkflow
|
|
20
21
|
{type: :text, label: label, text: text.to_s}.compact
|
21
22
|
end
|
22
23
|
|
23
|
-
def mw_display_image(attachment, options: { resize_to_fill: [600, 1200] })
|
24
|
-
|
24
|
+
def mw_display_image(attachment, content_mode: :scale_aspect_fill, options: { resize_to_fill: [600, 1200] })
|
25
|
+
validate_content_mode!(content_mode)
|
26
|
+
|
27
|
+
{type: :image, contentMode: content_mode.to_s.camelize(:lower), previewURL: preview_url(attachment, options: options), url: attachment_url(attachment)}
|
25
28
|
end
|
26
29
|
|
27
30
|
def mw_display_unsplash_image(image_url)
|
@@ -58,11 +61,11 @@ module MobileWorkflow
|
|
58
61
|
{type: :button, label: label, url: url, method: method, style: style, onSuccess: on_success}
|
59
62
|
end
|
60
63
|
|
61
|
-
def mw_display_button_for_system_url(label:, apple_system_url:,
|
64
|
+
def mw_display_button_for_system_url(label:, apple_system_url:, method: :put, style: :primary, on_success: :none)
|
62
65
|
validate_on_success!(on_success)
|
63
66
|
validate_button_style!(style)
|
64
67
|
|
65
|
-
{type: :button, label: label, appleSystemURL: apple_system_url,
|
68
|
+
{type: :button, label: label, appleSystemURL: apple_system_url, method: method, style: style, onSuccess: on_success}
|
66
69
|
end
|
67
70
|
|
68
71
|
def mw_display_button_for_modal_workflow(label:, modal_workflow_name:, style: :primary, on_success: :none)
|
@@ -77,6 +80,10 @@ module MobileWorkflow
|
|
77
80
|
raise 'Unknown on_success action' unless ON_SUCCESS_OPTIONS.include?(on_success)
|
78
81
|
end
|
79
82
|
|
83
|
+
def validate_content_mode!(on_success)
|
84
|
+
raise 'Unknown content_mode' unless CONTENT_MODE_OPTIONS.include?(on_success)
|
85
|
+
end
|
86
|
+
|
80
87
|
def validate_button_style!(style)
|
81
88
|
raise 'Unknown style' unless BUTTON_STYLES.include?(style)
|
82
89
|
end
|
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.6.
|
4
|
+
version: 0.6.14
|
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: 2021-03-
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|