mobile_workflow 0.6.24 → 0.6.29
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/app/models/concerns/mobile_workflow/displayable.rb +20 -16
- data/lib/mobile_workflow/version.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95b8a4e615993e80a85d0440c2a2d0233ac72a6c0b08ccf28b2b09ffd1113815
|
4
|
+
data.tar.gz: 63540e27a1e5cfcfcf85acec5d256750806e13b49ac2588b038ff422d42a4e76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad51b31fe398ca8197007d1f917469e2ccce6337e4700982ce2b5c37a94361f787a2ba8b9b668e4fecc6845000418b4c2b3fa2214a7840d1ee9e95b3df55e968
|
7
|
+
data.tar.gz: 0a4ef7514e5d137ac2c6e7017bc3f0fb87b09fe9884732b42700d9f9eb3f7b4af8e6ee474a3b24210e52e89ec4d3c76028e953da1feaaf28f62adf1e4a1531d0
|
@@ -8,14 +8,18 @@ module MobileWorkflow
|
|
8
8
|
CONTENT_MODE_OPTIONS = [:scale_aspect_fill, :scale_aspect_fit]
|
9
9
|
QUESTION_STYLES = [:single_choice, :multiple_choice]
|
10
10
|
|
11
|
-
def mw_list_item(id: self.id, text:, detail_text: nil, sf_symbol_name: nil, image_attachment: nil)
|
12
|
-
mw_list_item = {id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name}
|
13
|
-
mw_list_item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [
|
11
|
+
def mw_list_item(id: self.id, text:, detail_text: nil, sf_symbol_name: nil, material_icon_name: nil, image_attachment: nil)
|
12
|
+
mw_list_item = {id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name}
|
13
|
+
mw_list_item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [200, 200] }) if image_attachment
|
14
14
|
mw_list_item.compact
|
15
15
|
end
|
16
16
|
|
17
|
+
def mw_list_search_suggestion(id: self.id, text:, section_name:, sf_symbol_name: nil)
|
18
|
+
{id: id.to_s, text: text, sectionName: section_name, sfSymbolName: sf_symbol_name}.compact
|
19
|
+
end
|
20
|
+
|
17
21
|
def mw_map_item(id: self.id, text:, detail_text: nil, latitude:, longitude:)
|
18
|
-
{id: id, text: text, detailText: detail_text, latitude: latitude, longitude: longitude}.compact
|
22
|
+
{id: id.to_s, text: text, detailText: detail_text, latitude: latitude, longitude: longitude}.compact
|
19
23
|
end
|
20
24
|
|
21
25
|
def mw_pie_chart_item(id: self.id, label:, value:)
|
@@ -26,7 +30,7 @@ module MobileWorkflow
|
|
26
30
|
{type: :text, label: label, text: text.to_s}.compact
|
27
31
|
end
|
28
32
|
|
29
|
-
def mw_display_image(attachment, content_mode: :scale_aspect_fill, options: { resize_to_fill: [
|
33
|
+
def mw_display_image(attachment, content_mode: :scale_aspect_fill, options: { resize_to_fill: [1200, 600] })
|
30
34
|
validate_content_mode!(content_mode)
|
31
35
|
|
32
36
|
{type: :image, contentMode: content_mode.to_s.camelize(:lower), previewURL: preview_url(attachment, options: options), url: attachment_url(attachment)}
|
@@ -45,41 +49,41 @@ module MobileWorkflow
|
|
45
49
|
{type: :video, previewURL: preview_url(attachment, options: preview_options), url: attachment_url(attachment)}
|
46
50
|
end
|
47
51
|
|
48
|
-
def mw_display_button(label:, style: :primary, on_success: :forward)
|
52
|
+
def mw_display_button(label:, style: :primary, on_success: :forward, sf_symbol_name: nil, material_icon_name: nil)
|
49
53
|
validate_on_success!(on_success)
|
50
54
|
validate_button_style!(style)
|
51
55
|
|
52
|
-
{type: :button, label: label, style: style, onSuccess: on_success}.compact
|
56
|
+
{type: :button, label: label, style: style, onSuccess: on_success, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name}.compact
|
53
57
|
end
|
54
58
|
|
55
59
|
def mw_display_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward)
|
56
60
|
validate_on_success!(on_success)
|
57
61
|
validate_button_style!(style)
|
58
62
|
|
59
|
-
{type: :button, label: label, url: url, method: method, style: style, onSuccess: on_success}.compact
|
63
|
+
{type: :button, label: label, url: url, method: method, style: style, onSuccess: on_success, sfSymbolName: 'trash', materialIconName: 'delete'}.compact
|
60
64
|
end
|
61
65
|
|
62
|
-
def mw_display_url_button(label:, url:, method: :put, style: :primary, confirm_title: nil, confirm_text: nil, on_success: :reload)
|
66
|
+
def mw_display_url_button(label:, url:, method: :put, style: :primary, confirm_title: nil, confirm_text: nil, on_success: :reload, sf_symbol_name: nil, material_icon_name: nil)
|
63
67
|
validate_on_success!(on_success)
|
64
68
|
validate_button_style!(style)
|
65
69
|
|
66
|
-
{type: :button, label: label, url: url, method: method, style: style, confirmTitle: confirm_title, confirmText: confirm_text, onSuccess: on_success}.compact
|
70
|
+
{type: :button, label: label, url: url, method: method, style: style, confirmTitle: confirm_title, confirmText: confirm_text, onSuccess: on_success, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name}.compact
|
67
71
|
end
|
68
72
|
alias_method :mw_display_button_for_url, :mw_display_url_button
|
69
73
|
|
70
|
-
def mw_display_system_url_button(label:, apple_system_url: nil, android_deep_link: nil, style: :primary)
|
74
|
+
def mw_display_system_url_button(label:, apple_system_url: nil, android_deep_link: nil, style: :primary, sf_symbol_name: nil, material_icon_name: nil)
|
71
75
|
validate_button_style!(style)
|
72
76
|
raise 'Invalid android_deep_link' unless android_deep_link.start_with?('http')
|
73
77
|
|
74
|
-
{type: :button, label: label, appleSystemURL: apple_system_url, androidDeepLink: android_deep_link, style: style}.compact
|
78
|
+
{type: :button, label: label, appleSystemURL: apple_system_url, androidDeepLink: android_deep_link, style: style, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name}.compact
|
75
79
|
end
|
76
80
|
alias_method :mw_display_button_for_system_url, :mw_display_system_url_button
|
77
81
|
|
78
|
-
def mw_display_modal_workflow_button(label:, modal_workflow_name:, style: :primary, on_success: :none)
|
82
|
+
def mw_display_modal_workflow_button(label:, modal_workflow_name:, style: :primary, on_success: :none, sf_symbol_name: nil, material_icon_name: nil)
|
79
83
|
validate_on_success!(on_success)
|
80
84
|
validate_button_style!(style)
|
81
85
|
|
82
|
-
{type: :button, label: label, modalWorkflow: modal_workflow_name, style: style, onSuccess: on_success}.compact
|
86
|
+
{type: :button, label: label, modalWorkflow: modal_workflow_name, style: style, onSuccess: on_success, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name}.compact
|
83
87
|
end
|
84
88
|
alias_method :mw_display_button_for_modal_workflow, :mw_display_modal_workflow_button
|
85
89
|
|
@@ -106,12 +110,12 @@ module MobileWorkflow
|
|
106
110
|
{ id: id, text: text, type: :smallSection }
|
107
111
|
end
|
108
112
|
|
109
|
-
def mw_grid_item(id
|
113
|
+
def mw_grid_item(id: self.id, text:, image_attachment: nil)
|
110
114
|
raise 'Missing id' if id.nil?
|
111
115
|
raise 'Missing text' if text.nil?
|
112
116
|
|
113
117
|
item = { id: id, text: text, type: :item }
|
114
|
-
item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [
|
118
|
+
item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [1224, 760] }) if image_attachment
|
115
119
|
item
|
116
120
|
end
|
117
121
|
|
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.29
|
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-
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -152,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
152
|
requirements:
|
153
153
|
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version: 2.7.
|
155
|
+
version: 2.7.3
|
156
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.1.
|
162
|
+
rubygems_version: 3.1.6
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: A Rails engine to provide API support for Mobile Workflow Apps.
|