app_rail-steps 0.2.10 → 0.2.13
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/app_rail/steps/background_location/regions.rb +19 -0
- data/lib/app_rail/steps/core/stack.rb +21 -11
- data/lib/app_rail/steps/core_forms/question.rb +23 -0
- data/lib/app_rail/steps/displayable.rb +2 -13
- data/lib/app_rail/steps/styled_content/stack.rb +15 -2
- data/lib/app_rail/steps/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37eaa53b308c4e7a4b06bc73be9409006f6f3a354e1075c1f8c89ec9ff631d9a
|
4
|
+
data.tar.gz: b8f9f5055a8e39f3e45588ac01074f2d6cb8bc5b194ebf12ba062070d4f7b9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3613ddaaab8d7329e9ebb44528447e4626c03a7a7b03b522243a62f804e430b689b5c2dffc0da5db388844d5758e5048bbae3790037fa0b23d3fb18701f0cad4
|
7
|
+
data.tar.gz: 4f85744e064a06f3ddc23211c7c6b795c2c92154e6afa7c67db250ff3de4c773b866860dc8fab5e942892b09fc2fccb826cf511031fa6c096347e2fb3655fbdd
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.11] - 2022-04-12
|
4
|
+
|
5
|
+
- Below change reverted because stack doesnt support patch yet
|
6
|
+
- Change default method on ar_core_stack_url_button from put to patch - more likely to match the kind of operation performed
|
7
|
+
|
3
8
|
## [0.1.0] - 2022-04-12
|
4
9
|
|
5
10
|
- Initial release
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppRail
|
4
|
+
module Steps
|
5
|
+
module BackgroundLocation
|
6
|
+
module Regions
|
7
|
+
def ar_background_location_region(id:, latitude:, longitude:, radius: 100, event: :entryAndExit)
|
8
|
+
{
|
9
|
+
id: id.to_s,
|
10
|
+
latitude: latitude,
|
11
|
+
longitude: longitude,
|
12
|
+
radius: radius,
|
13
|
+
event: event
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -6,6 +6,8 @@ module AppRail
|
|
6
6
|
module Stack
|
7
7
|
CONTENT_MODE_OPTIONS = %i[scale_aspect_fill scale_aspect_fit].freeze
|
8
8
|
IMAGE_STYLE_OPTIONS = %i[full_width profile].freeze
|
9
|
+
BUTTON_STYLES = %i[primary outline danger].freeze
|
10
|
+
ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
|
9
11
|
|
10
12
|
def ar_core_stack_text(text:, label: nil, sf_symbol_name: nil, material_icon_name: nil)
|
11
13
|
{
|
@@ -43,24 +45,24 @@ module AppRail
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def ar_core_stack_button(label:, style: :primary, on_success: :forward, sf_symbol_name: nil, material_icon_name: nil)
|
46
|
-
|
47
|
-
|
48
|
+
ar_core_stack_validate_on_success!(on_success)
|
49
|
+
ar_core_stack_validate_button_style!(style)
|
48
50
|
|
49
51
|
{ type: :button, label: label, style: style, onSuccess: on_success, sfSymbolName: sf_symbol_name,
|
50
52
|
materialIconName: material_icon_name }.compact
|
51
53
|
end
|
52
54
|
|
53
55
|
def ar_core_stack_delete_button(url:, label: "Delete", method: :delete, style: :danger, on_success: :backward)
|
54
|
-
|
55
|
-
|
56
|
+
ar_core_stack_validate_on_success!(on_success)
|
57
|
+
ar_core_stack_validate_button_style!(style)
|
56
58
|
|
57
59
|
{ type: :button, label: label, url: url, method: method, style: style, onSuccess: on_success,
|
58
60
|
sfSymbolName: "trash", materialIconName: "delete" }.compact
|
59
61
|
end
|
60
62
|
|
61
63
|
def ar_core_stack_url_button(url:, label:, method: :put, style: :primary, confirm_title: nil, confirm_text: nil, on_success: :reload, sf_symbol_name: nil, material_icon_name: nil)
|
62
|
-
|
63
|
-
|
64
|
+
ar_core_stack_validate_on_success!(on_success)
|
65
|
+
ar_core_stack_validate_button_style!(style)
|
64
66
|
|
65
67
|
{ type: :button, label: label, url: url, method: method, style: style, confirmTitle: confirm_title,
|
66
68
|
confirmText: confirm_text, onSuccess: on_success, sfSymbolName: sf_symbol_name, materialIconName: material_icon_name }.compact
|
@@ -68,7 +70,7 @@ module AppRail
|
|
68
70
|
alias ar_core_stack_button_for_url ar_core_stack_url_button
|
69
71
|
|
70
72
|
def ar_core_stack_system_url_button(label:, apple_system_url: nil, android_deep_link: nil, style: :primary, sf_symbol_name: nil, material_icon_name: nil)
|
71
|
-
|
73
|
+
ar_core_stack_validate_button_style!(style)
|
72
74
|
raise "Invalid android_deep_link" if android_deep_link && !android_deep_link.start_with?("http")
|
73
75
|
|
74
76
|
{ type: :button, label: label, appleSystemURL: apple_system_url, androidDeepLink: android_deep_link,
|
@@ -77,8 +79,8 @@ module AppRail
|
|
77
79
|
alias ar_core_stack_button_for_system_url ar_core_stack_system_url_button
|
78
80
|
|
79
81
|
def ar_core_stack_link_button(label:, link_id:, style: :primary, on_success: :none, sf_symbol_name: nil, material_icon_name: nil)
|
80
|
-
|
81
|
-
|
82
|
+
ar_core_stack_validate_on_success!(on_success)
|
83
|
+
ar_core_stack_validate_button_style!(style)
|
82
84
|
|
83
85
|
{ type: :button, label: label, linkId: link_id, style: style, onSuccess: on_success,
|
84
86
|
sfSymbolName: sf_symbol_name, materialIconName: material_icon_name }.compact
|
@@ -86,8 +88,8 @@ module AppRail
|
|
86
88
|
|
87
89
|
# Remove this method once V1 is no longer being used
|
88
90
|
def ar_core_stack_modal_workflow_button(label:, modal_workflow_name:, style: :primary, on_success: :none, sf_symbol_name: nil, material_icon_name: nil)
|
89
|
-
|
90
|
-
|
91
|
+
ar_core_stack_validate_on_success!(on_success)
|
92
|
+
ar_core_stack_validate_button_style!(style)
|
91
93
|
|
92
94
|
{ type: :button, label: label, modalWorkflow: modal_workflow_name, style: style, onSuccess: on_success,
|
93
95
|
sfSymbolName: sf_symbol_name, materialIconName: material_icon_name }.compact
|
@@ -103,6 +105,14 @@ module AppRail
|
|
103
105
|
def validate_image_style!(image_style)
|
104
106
|
raise "Unknown image_style" unless IMAGE_STYLE_OPTIONS.include?(image_style)
|
105
107
|
end
|
108
|
+
|
109
|
+
def ar_core_stack_validate_on_success!(on_success)
|
110
|
+
raise "Unknown on_success action" unless ON_SUCCESS_OPTIONS.include?(on_success)
|
111
|
+
end
|
112
|
+
|
113
|
+
def ar_core_stack_validate_button_style!(style)
|
114
|
+
raise "Unknown style" unless BUTTON_STYLES.include?(style)
|
115
|
+
end
|
106
116
|
end
|
107
117
|
end
|
108
118
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppRail
|
4
|
+
module Steps
|
5
|
+
module CoreForms
|
6
|
+
module Question
|
7
|
+
def ar_core_forms_question_multiple_selection(label:, multiple_selection_options:, selection_type: :single, optional: false, show_other_option: false)
|
8
|
+
raise "Missing label" if label.nil?
|
9
|
+
raise "Missing multiple_selection_options" if multiple_selection_options.nil?
|
10
|
+
|
11
|
+
{
|
12
|
+
item_type: :multiple_selection,
|
13
|
+
label: label,
|
14
|
+
multiple_selection_options: multiple_selection_options,
|
15
|
+
selection_type: selection_type,
|
16
|
+
optional: optional,
|
17
|
+
show_other_option: show_other_option
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative "core/list"
|
4
4
|
require_relative "core/stack"
|
5
5
|
require_relative "core_forms/form"
|
6
|
+
require_relative "core_forms/question"
|
6
7
|
require_relative "maps/map"
|
7
8
|
require_relative "styled_content/grid"
|
8
9
|
require_relative "styled_content/stack"
|
@@ -14,24 +15,12 @@ module AppRail
|
|
14
15
|
include Steps::Core::List
|
15
16
|
include Steps::Core::Stack
|
16
17
|
include Steps::CoreForms::Form
|
18
|
+
include Steps::CoreForms::Question
|
17
19
|
include Steps::Maps::Map
|
18
20
|
include Steps::StyledContent::Grid
|
19
21
|
include Steps::StyledContent::Stack
|
20
22
|
include Steps::Charts::Dashboard
|
21
23
|
|
22
|
-
BUTTON_STYLES = %i[primary outline danger textOnly].freeze
|
23
|
-
ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def validate_on_success!(on_success)
|
28
|
-
raise "Unknown on_success action" unless ON_SUCCESS_OPTIONS.include?(on_success)
|
29
|
-
end
|
30
|
-
|
31
|
-
def validate_button_style!(style)
|
32
|
-
raise "Unknown style" unless BUTTON_STYLES.include?(style)
|
33
|
-
end
|
34
|
-
|
35
24
|
def camelcase_converter(string, first_letter: :upper)
|
36
25
|
string = string.split("_").map(&:capitalize).join
|
37
26
|
return string unless first_letter == :lower
|
@@ -4,6 +4,9 @@ module AppRail
|
|
4
4
|
module Steps
|
5
5
|
module StyledContent
|
6
6
|
module Stack
|
7
|
+
BUTTON_STYLES = %i[primary outline danger textOnly].freeze
|
8
|
+
ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
|
9
|
+
|
7
10
|
def ar_styled_content_stack_title(title:)
|
8
11
|
raise "Missing title" if title.nil?
|
9
12
|
|
@@ -26,12 +29,22 @@ module AppRail
|
|
26
29
|
def ar_styled_content_stack_button(label:, url: nil, method: :nil, on_success: :none, style: :primary, modal_workflow_name: nil, link_id: nil, link_url: nil, sf_symbol_name: nil, apple_system_url: nil, android_deep_link: nil, confirm_title: nil, confirm_text: nil, share_text: nil, share_image_url: nil)
|
27
30
|
raise "Missing label" if label.nil?
|
28
31
|
|
29
|
-
|
30
|
-
|
32
|
+
ar_styled_content_stack_validate_on_success!(on_success)
|
33
|
+
ar_styled_content_stack_validate_button_style!(style)
|
31
34
|
|
32
35
|
{ type: :button, label: label, url: url, method: method, onSuccess: on_success, style: style,
|
33
36
|
modalWorkflow: modal_workflow_name, linkId: link_id, linkURL: link_url, sfSymbolName: sf_symbol_name, appleSystemURL: apple_system_url, androidDeepLink: android_deep_link, confirmTitle: confirm_title, confirmText: confirm_text, shareText: share_text, shareImageURL: share_image_url }.compact
|
34
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def ar_styled_content_stack_validate_on_success!(on_success)
|
42
|
+
raise "Unknown on_success action" unless ON_SUCCESS_OPTIONS.include?(on_success)
|
43
|
+
end
|
44
|
+
|
45
|
+
def ar_styled_content_stack_validate_button_style!(style)
|
46
|
+
raise "Unknown style" unless BUTTON_STYLES.include?(style)
|
47
|
+
end
|
35
48
|
end
|
36
49
|
end
|
37
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_rail-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -27,10 +27,12 @@ files:
|
|
27
27
|
- Rakefile
|
28
28
|
- app_rail-steps.gemspec
|
29
29
|
- lib/app_rail/steps.rb
|
30
|
+
- lib/app_rail/steps/background_location/regions.rb
|
30
31
|
- lib/app_rail/steps/charts/dashboard.rb
|
31
32
|
- lib/app_rail/steps/core/list.rb
|
32
33
|
- lib/app_rail/steps/core/stack.rb
|
33
34
|
- lib/app_rail/steps/core_forms/form.rb
|
35
|
+
- lib/app_rail/steps/core_forms/question.rb
|
34
36
|
- lib/app_rail/steps/displayable.rb
|
35
37
|
- lib/app_rail/steps/maps/map.rb
|
36
38
|
- lib/app_rail/steps/styled_content/grid.rb
|
@@ -57,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
59
|
- !ruby/object:Gem::Version
|
58
60
|
version: '0'
|
59
61
|
requirements: []
|
60
|
-
rubygems_version: 3.
|
62
|
+
rubygems_version: 3.3.7
|
61
63
|
signing_key:
|
62
64
|
specification_version: 4
|
63
65
|
summary: Utilities to generate JSON for expected step responses.
|