app_rail-steps 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5fba719c7fcaba7cf8b1e18177ce7ec359927de8827208939589d6c6edfb79b
4
- data.tar.gz: 4031c6d33e27f2644364dd8f89fdd4f1c396ad0e607afeaf9417bfa863a7f772
3
+ metadata.gz: 715b23d59a1f0186a3e9d5296492e64e0a165a788cd99191d745af88916591a7
4
+ data.tar.gz: 05f1aec93c0920517ddd4687ee10d8cff1fe183a9e61c118206f2a92077617d9
5
5
  SHA512:
6
- metadata.gz: 52574338b664bbd3e95607227fb0f3d215685debb49822f688bdd8e5cfef68ba3334b7d43093f554511467c935480d3b0aca6fd8aafaa547e7d8f43447d190e8
7
- data.tar.gz: 9ff0bd79331d79e5863d57b5729652f06e66b3ba45a3925c3905a99cb722221b25c6af8aac1afec2a9f094f7e9c6c040d177cdce9a61bee0216e104eade0a80b
6
+ metadata.gz: 28d0c73306645433d89267f53a3bd4d29243285ca18ef812034d1d580f90da2f2adc809dfcd77c289a3f19f3986f79f87bf86126dcca71d0ccf3fbd68b836d4a
7
+ data.tar.gz: e4471a05569414cc92efb3bdf16d8b918245a09c7e0cb168f3dfd1ec749bbe1b93b6e8913372de8778d286745cb22cfd2c472586f0cb9a06f731978cdd8ca340
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.10)
4
+ app_rail-steps (0.2.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- validate_on_success!(on_success)
47
- validate_button_style!(style)
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
- validate_on_success!(on_success)
55
- validate_button_style!(style)
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
- validate_on_success!(on_success)
63
- validate_button_style!(style)
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
- validate_button_style!(style)
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
- validate_on_success!(on_success)
81
- validate_button_style!(style)
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
- validate_on_success!(on_success)
90
- validate_button_style!(style)
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,25 @@
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(id:, label:, multiple_selection_options:, selection_type: :single, optional: false, show_other_option: false)
8
+ raise "Missing label" if label.nil?
9
+ raise "Missing id" if id.nil?
10
+ raise "Missing multiple_selection_options" if multiple_selection_options.nil?
11
+
12
+ {
13
+ item_type: :multiple_selection,
14
+ id: id,
15
+ label: label,
16
+ multiple_selection_options: multiple_selection_options,
17
+ selection_type: selection_type,
18
+ optional: optional,
19
+ show_other_option: show_other_option
20
+ }
21
+ end
22
+ end
23
+ end
24
+ end
25
+ 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
- validate_on_success!(on_success)
30
- validate_button_style!(style)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.10"
5
+ VERSION = "0.2.11"
6
6
  end
7
7
  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.10
4
+ version: 0.2.11
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-05-10 00:00:00.000000000 Z
11
+ date: 2022-06-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -31,6 +31,7 @@ files:
31
31
  - lib/app_rail/steps/core/list.rb
32
32
  - lib/app_rail/steps/core/stack.rb
33
33
  - lib/app_rail/steps/core_forms/form.rb
34
+ - lib/app_rail/steps/core_forms/question.rb
34
35
  - lib/app_rail/steps/displayable.rb
35
36
  - lib/app_rail/steps/maps/map.rb
36
37
  - lib/app_rail/steps/styled_content/grid.rb
@@ -57,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
58
  - !ruby/object:Gem::Version
58
59
  version: '0'
59
60
  requirements: []
60
- rubygems_version: 3.1.6
61
+ rubygems_version: 3.3.7
61
62
  signing_key:
62
63
  specification_version: 4
63
64
  summary: Utilities to generate JSON for expected step responses.