app_rail-steps 0.2.4 → 0.2.7

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: 7eec3b376b102a4001550f293763e044c96cc0031cc42f5cefdbc960824be46a
4
- data.tar.gz: b1de751d8d17653b2c3d42d117325e8b3339b02374881c2dcd515eb7081a0dc6
3
+ metadata.gz: c2d5bad1ddf33cb2a28dd8fb15796f908b637f596e65ba339990abd6e023a37d
4
+ data.tar.gz: 1d8608a1a47a3dfae2ab1f2adb641fe91a1958adf1482097daa6519fd093f050
5
5
  SHA512:
6
- metadata.gz: dfbdce5969408464b564756c18c7f4603d9a23b926d884328f2184aa0e1ee7e4cbd4509121c35a34dd77eba1efce3a36d25dc2aadf9fd48238352d4956e9fe5e
7
- data.tar.gz: 8eef9412eec72784ea95026c94934f0744a70546e80662f6126c419817b17d09c7c8cbbbea66762a2e508729d093e92b032513998a25c07a5e90568ffc0f334d
6
+ metadata.gz: 8a5bc64794f64cbce9f8804d184562f8f05fccd54e68b4091521ca43955fb294c4fbb7f36e38ee47e92834df7ce204edfec01cd5aa3ab1c7ad1ca124450ba603
7
+ data.tar.gz: 4b5f215882c55f047d3fc6053846e70ab8414b86061a51e66afcbaf83015e72cb3680e8ec1a75d0e4b958e9a5f036f45ff50a6d29d642dafd8ee55e0dd58460d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.4)
4
+ app_rail-steps (0.2.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -22,7 +22,22 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ #require the gem in your script
27
+ require 'app_rail/steps'
28
+
29
+ ...
30
+ #inside your module/class include the displayable modile
31
+ include AppRail::Steps::Displayable
32
+
33
+ ...
34
+ #now you can use the methods from the gem for example:
35
+ def ar_list_item_as_json
36
+ ar_core_list_item(id: self.id, text: self.name, detail_text: self.detail_text)
37
+ end
38
+
39
+
40
+ ```
26
41
 
27
42
  ## Development
28
43
 
@@ -32,7 +47,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
47
 
33
48
  ## Contributing
34
49
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/app_rail-steps.
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/FutureWorkshops/app_rail-steps.
36
51
 
37
52
  ## License
38
53
 
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppRail
4
+ module Steps
5
+ module Charts
6
+ module Dashboard
7
+ def ar_charts_dashboard_statistic(id:, title:, text:)
8
+ {
9
+ id: id,
10
+ chartType: :none,
11
+ title: title,
12
+ text: text
13
+ }.compact
14
+ end
15
+
16
+ def ar_charts_dashboard_line_chart(id:, title:, values:, text: nil, footer: nil)
17
+ {
18
+ id: id,
19
+ chartType: :line,
20
+ title: title,
21
+ text: text,
22
+ footer: footer,
23
+ chartValues: values
24
+ }.compact
25
+ end
26
+
27
+ def ar_charts_dashboard_bar_chart(id:, title:, values:)
28
+ {
29
+ id: id,
30
+ chartType: :bar,
31
+ title: title,
32
+ chartValues: values
33
+ }.compact
34
+ end
35
+
36
+ def ar_charts_dashboard_bar_pie(id:, title:, values:, light_colors: nil, dark_colors: nil)
37
+ {
38
+ id: id,
39
+ chartType: :pie,
40
+ title: title,
41
+ chartValues: values,
42
+ chartColors: light_colors,
43
+ chartColorsDark: dark_colors
44
+ }.compact
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -4,9 +4,16 @@ module AppRail
4
4
  module Steps
5
5
  module Core
6
6
  module List
7
- def ar_core_list_item(text:, id: self.id, detail_text: nil, sf_symbol_name: nil, material_icon_name: nil, preview_url: nil)
8
- { id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name,
9
- materialIconName: material_icon_name, imageURL: preview_url }.compact
7
+ def ar_core_list_item(text:, id: self.id, detail_text: nil, section_name: nil, sf_symbol_name: nil, material_icon_name: nil, preview_url: nil)
8
+ {
9
+ id: id,
10
+ text: text,
11
+ detailText: detail_text,
12
+ sectionName: section_name,
13
+ sfSymbolName: sf_symbol_name,
14
+ materialIconName: material_icon_name,
15
+ imageURL: preview_url
16
+ }.compact
10
17
  end
11
18
 
12
19
  def ar_core_list_search_suggestion(text:, section_name:, id: self.id, sf_symbol_name: nil)
@@ -4,6 +4,9 @@ require_relative "core/list"
4
4
  require_relative "core/stack"
5
5
  require_relative "core_forms/form"
6
6
  require_relative "maps/map"
7
+ require_relative "styled_content/grid"
8
+ require_relative "styled_content/stack"
9
+ require_relative "charts/dashboard"
7
10
 
8
11
  module AppRail
9
12
  module Steps
@@ -12,6 +15,9 @@ module AppRail
12
15
  include Steps::Core::Stack
13
16
  include Steps::CoreForms::Form
14
17
  include Steps::Maps::Map
18
+ include Steps::StyledContent::Grid
19
+ include Steps::StyledContent::Stack
20
+ include Steps::Charts::Dashboard
15
21
 
16
22
  BUTTON_STYLES = %i[primary outline danger textOnly].freeze
17
23
  ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppRail
4
+ module Steps
5
+ module StyledContent
6
+ module Grid
7
+ def ar_styled_content_grid_large_section(id:, text:)
8
+ raise "Missing id" if id.nil?
9
+ raise "Missing text" if text.nil?
10
+
11
+ { id: id, text: text, type: :largeSection }
12
+ end
13
+
14
+ def ar_styled_content_grid_small_section(id:, text:)
15
+ raise "Missing id" if id.nil?
16
+ raise "Missing text" if text.nil?
17
+
18
+ { id: id, text: text, type: :smallSection }
19
+ end
20
+
21
+ def ar_styled_content_grid_item(text:, id: self.id, detail_text: nil, preview_url: nil)
22
+ raise "Missing id" if id.nil?
23
+ raise "Missing text" if text.nil?
24
+
25
+ { id: id, text: text, type: :item, detailText: detail_text, imageURL: preview_url }.compact
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppRail
4
+ module Steps
5
+ module StyledContent
6
+ module Stack
7
+ def ar_styled_content_stack_title(title:)
8
+ raise "Missing title" if title.nil?
9
+
10
+ { id: id, title: title, type: :title }
11
+ end
12
+
13
+ def ar_styled_content_stack_text(text:)
14
+ raise "Missing text" if text.nil?
15
+
16
+ { text: text, type: :text }
17
+ end
18
+
19
+ def ar_styled_content_stack_list_item(text:, detail_text: nil, preview_url: nil)
20
+ raise "Missing text" if text.nil?
21
+
22
+ { text: text, detailText: detail_text, type: :listItem, imageURL: preview_url }.compact
23
+ end
24
+
25
+ # Remove `modal_workflow_name` argument once V1 is no longer being used
26
+ 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
+ raise "Missing label" if label.nil?
28
+
29
+ validate_on_success!(on_success)
30
+ validate_button_style!(style)
31
+
32
+ { type: :button, label: label, url: url, method: method, onSuccess: on_success, style: style,
33
+ 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
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.7"
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.4
4
+ version: 0.2.7
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-04-18 00:00:00.000000000 Z
11
+ date: 2022-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -27,11 +27,14 @@ files:
27
27
  - Rakefile
28
28
  - app_rail-steps.gemspec
29
29
  - lib/app_rail/steps.rb
30
+ - lib/app_rail/steps/charts/dashboard.rb
30
31
  - lib/app_rail/steps/core/list.rb
31
32
  - lib/app_rail/steps/core/stack.rb
32
33
  - lib/app_rail/steps/core_forms/form.rb
33
34
  - lib/app_rail/steps/displayable.rb
34
35
  - lib/app_rail/steps/maps/map.rb
36
+ - lib/app_rail/steps/styled_content/grid.rb
37
+ - lib/app_rail/steps/styled_content/stack.rb
35
38
  - lib/app_rail/steps/version.rb
36
39
  homepage: https://github.com/FutureWorkshops/app_rail-steps
37
40
  licenses: