app_rail-steps 0.2.5 → 0.2.8
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/Gemfile.lock +1 -1
- data/README.md +17 -2
- data/lib/app_rail/steps/charts/dashboard.rb +49 -0
- data/lib/app_rail/steps/core/list.rb +10 -3
- data/lib/app_rail/steps/displayable.rb +2 -0
- data/lib/app_rail/steps/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d0a2c468bb3b453ff93e93ac803fe9324bf980cc163bd8414671da9a13555b2
|
4
|
+
data.tar.gz: 92466c77d31fc18967683165cfed515f4dafcb5fe223fd1b12e13978b1bb89ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5dc6f5f0cd3dde62e3f75bced4e6f89898979f7e866ded7480393bf38e09eaebe618c6ab4012b49c205b5b8e1abd8f371cb3bd5320a0b4281727974cb532b69
|
7
|
+
data.tar.gz: cc025b7a0775e2c4eeedeb46242f243a24146129a08e6d0edf65712037859983a35b0253301b85418742e8edf42ced5df45b6da712e897f4fa8d48a8a52e98a3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,22 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
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/
|
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.to_s,
|
10
|
+
chartType: :statistic,
|
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.to_s,
|
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.to_s,
|
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.to_s,
|
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
|
-
{
|
9
|
-
|
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)
|
@@ -6,6 +6,7 @@ require_relative "core_forms/form"
|
|
6
6
|
require_relative "maps/map"
|
7
7
|
require_relative "styled_content/grid"
|
8
8
|
require_relative "styled_content/stack"
|
9
|
+
require_relative "charts/dashboard"
|
9
10
|
|
10
11
|
module AppRail
|
11
12
|
module Steps
|
@@ -16,6 +17,7 @@ module AppRail
|
|
16
17
|
include Steps::Maps::Map
|
17
18
|
include Steps::StyledContent::Grid
|
18
19
|
include Steps::StyledContent::Stack
|
20
|
+
include Steps::Charts::Dashboard
|
19
21
|
|
20
22
|
BUTTON_STYLES = %i[primary outline danger textOnly].freeze
|
21
23
|
ON_SUCCESS_OPTIONS = %i[none reload backward forward].freeze
|
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.8
|
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-
|
11
|
+
date: 2022-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -27,6 +27,7 @@ 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
|