mobile_workflow 0.6.23 → 0.6.28
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 +37 -10
- 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: 3ebd476d336102741c56aada580542d8018ce2bea577b0f86710bff27db18806
|
4
|
+
data.tar.gz: 35261702940609232814b3ddc03a1a11461c5e7f1c2eac30f6e6e207a6fd3e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f169638dd406817f73aa82330cbaacd1204a2f2bdf78b8d7e2ea164e611fd139567cd016f07e99c5143102f8bfb6b17eb30095f783bd77c9aede9dde66952d2d
|
7
|
+
data.tar.gz: 2c439d4415e9ae24b0a403aedc9c5fa8d99a5229081cdee88c9e67a3fb14b9491b5ac585cc66bbdbc7423ce4da67138516fd703c840a6527a2a3e952b1715ece
|
@@ -14,8 +14,12 @@ module MobileWorkflow
|
|
14
14
|
mw_list_item.compact
|
15
15
|
end
|
16
16
|
|
17
|
+
def mw_list_search_suggestion(id:, text:, section_name:, sf_symbol_name: nil)
|
18
|
+
{id: id, 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:)
|
@@ -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
|
|
@@ -91,6 +95,29 @@ module MobileWorkflow
|
|
91
95
|
text_choices_a = text_choices.map{|k, v| {_class: "ORKTextChoice", exclusive: false, text: k, value: v} }.to_a
|
92
96
|
{ question: question, answerFormat: { _class: "ORKTextChoiceAnswerFormat", style: style.to_s.camelize(:lower), textChoices: text_choices_a}}
|
93
97
|
end
|
98
|
+
|
99
|
+
def mw_grid_large_section(id:, text:)
|
100
|
+
raise 'Missing id' if id.nil?
|
101
|
+
raise 'Missing text' if text.nil?
|
102
|
+
|
103
|
+
{ id: id, text: text, type: :largeSection }
|
104
|
+
end
|
105
|
+
|
106
|
+
def mw_grid_small_section(id:, text:)
|
107
|
+
raise 'Missing id' if id.nil?
|
108
|
+
raise 'Missing text' if text.nil?
|
109
|
+
|
110
|
+
{ id: id, text: text, type: :smallSection }
|
111
|
+
end
|
112
|
+
|
113
|
+
def mw_grid_item(id: self.id, text:, image_attachment: nil)
|
114
|
+
raise 'Missing id' if id.nil?
|
115
|
+
raise 'Missing text' if text.nil?
|
116
|
+
|
117
|
+
item = { id: id, text: text, type: :item }
|
118
|
+
item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [1224, 760] }) if image_attachment
|
119
|
+
item
|
120
|
+
end
|
94
121
|
|
95
122
|
private
|
96
123
|
def validate_on_success!(on_success)
|
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.28
|
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-05-10 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.
|