mobile_workflow 0.5.2 → 0.5.7
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/controllers/mobile_workflow/sns_notifications_controller.rb +1 -1
- data/app/models/concerns/mobile_workflow/displayable.rb +8 -8
- data/lib/generators/mobile_workflow/install/install_generator.rb +1 -1
- data/lib/generators/mobile_workflow/install/templates/Gemfile.erb +3 -2
- data/lib/mobile_workflow/cli/app_builder.rb +4 -2
- data/lib/mobile_workflow/cli/app_server_generator.rb +6 -4
- data/lib/mobile_workflow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843610afaa8207693d3f1be346698ca58e4022a3575b6953ef52c343781c649c
|
4
|
+
data.tar.gz: b787b24ab9fbf0f47910a889f23a59094d214db55c6eb0950609b674ba01ed64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 427d7c382ebc60cdf5ebd79f4257d2ec268cd0f52d7c7bd583afc1774c3adecaef910b163e06d1a754fa2340dfd352f23ae3c06056d97762e7b6fe878713b7cc
|
7
|
+
data.tar.gz: e98d3ebb68a12e42b3911d63fe16e4fe578ece0fc8e86814ac401d80a171fcd854d7a42f1a522fc535fc06d56eed1bb902e2a597b3d9d73a4c3c2b4603ce59a7
|
@@ -8,7 +8,7 @@ module MobileWorkflow
|
|
8
8
|
|
9
9
|
def mw_list_item(id: self.id, text:, detail_text: nil, sf_symbol_name: nil, image_attachment: nil)
|
10
10
|
mw_list_item = {id: id, text: text, detailText: detail_text, sfSymbolName: sf_symbol_name}
|
11
|
-
mw_list_item[:imageURL] = preview_url(image_attachment,
|
11
|
+
mw_list_item[:imageURL] = preview_url(image_attachment, options: { resize_to_fill: [100, 100] }) if image_attachment
|
12
12
|
mw_list_item.compact
|
13
13
|
end
|
14
14
|
|
@@ -16,8 +16,8 @@ module MobileWorkflow
|
|
16
16
|
{type: :text, label: label, text: text.to_s}.compact
|
17
17
|
end
|
18
18
|
|
19
|
-
def mw_display_image(attachment)
|
20
|
-
{type: :image, previewURL: preview_url(attachment,
|
19
|
+
def mw_display_image(attachment, options: { resize_to_fill: [600, 1200] })
|
20
|
+
{type: :image, previewURL: preview_url(attachment, options: options), url: attachment_url(attachment)}
|
21
21
|
end
|
22
22
|
|
23
23
|
def mw_display_unsplash_image(image_url)
|
@@ -29,8 +29,8 @@ module MobileWorkflow
|
|
29
29
|
{type: :image, previewURL: image_url, url: image_url}
|
30
30
|
end
|
31
31
|
|
32
|
-
def mw_display_video(attachment)
|
33
|
-
{type: :video, previewURL: preview_url(attachment,
|
32
|
+
def mw_display_video(attachment, preview_options: { resize_to_fill: [600, 1200] })
|
33
|
+
{type: :video, previewURL: preview_url(attachment, options: preview_options), url: attachment_url(attachment)}
|
34
34
|
end
|
35
35
|
|
36
36
|
def mw_display_button(label:, style: :primary, on_success: :forward)
|
@@ -69,12 +69,12 @@ module MobileWorkflow
|
|
69
69
|
def validate_button_style!(style)
|
70
70
|
raise 'Unknown style' unless BUTTON_STYLES.include?(style)
|
71
71
|
end
|
72
|
-
|
73
|
-
def preview_url(attachment,
|
72
|
+
|
73
|
+
def preview_url(attachment, options:)
|
74
74
|
return nil unless attachment.attached?
|
75
75
|
|
76
76
|
if attachment.image?
|
77
|
-
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(
|
77
|
+
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(options), host: attachment_host)
|
78
78
|
elsif attachment.previewable?
|
79
79
|
Rails.application.routes.url_helpers.rails_representation_url(attachment.preview(options), host: attachment_host)
|
80
80
|
else
|
@@ -78,7 +78,7 @@ module MobileWorkflow
|
|
78
78
|
|
79
79
|
def read_openapi_spec
|
80
80
|
say "Loading OpenAPI Spec: #{open_api_spec_path}"
|
81
|
-
return JSON.parse(File.read(
|
81
|
+
return JSON.parse(File.read(open_api_spec_path)).with_indifferent_access
|
82
82
|
end
|
83
83
|
|
84
84
|
def open_api_spec_path
|
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
3
|
|
4
|
-
ruby '2.
|
4
|
+
ruby '2.7.2'
|
5
5
|
|
6
6
|
# Core Gems
|
7
7
|
gem 'rails', '~> 6.1.0'
|
@@ -11,7 +11,8 @@ gem 'turbolinks', '~> 5'
|
|
11
11
|
|
12
12
|
# Mobile Workflow
|
13
13
|
#gem 'mobile_workflow', path: '../mobile_workflow'
|
14
|
-
gem 'mobile_workflow', github: 'FutureWorkshops/mobile_workflow'
|
14
|
+
#gem 'mobile_workflow', github: 'FutureWorkshops/mobile_workflow'
|
15
|
+
gem 'mobile_workflow', '0.5.5'
|
15
16
|
|
16
17
|
# Authorisation / Authentication
|
17
18
|
<%- if options[:doorkeeper_oauth] %>
|
@@ -18,7 +18,8 @@ module MobileWorkflow::Cli
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def administrate_generator
|
21
|
-
|
21
|
+
Bundler.with_unbundled_env { generate 'administrate:install' }
|
22
|
+
|
22
23
|
file 'app/assets/config/manifest.js', <<-CODE
|
23
24
|
//= link administrate/application.css
|
24
25
|
//= link administrate/application.js
|
@@ -31,7 +32,8 @@ module Admin
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
CODE
|
34
|
-
|
35
|
+
|
36
|
+
Bundler.with_unbundled_env { generate 'administrate:routes' }
|
35
37
|
end
|
36
38
|
|
37
39
|
def ability_generator
|
@@ -51,16 +51,18 @@ module MobileWorkflow::Cli
|
|
51
51
|
protected
|
52
52
|
|
53
53
|
def get_builder_class
|
54
|
-
MobileWorkflow::Cli::AppBuilder
|
54
|
+
::MobileWorkflow::Cli::AppBuilder
|
55
55
|
end
|
56
56
|
|
57
57
|
# Todo: MBS - move these methods to the builder class
|
58
58
|
# Ideally override RailsBuilder methods
|
59
59
|
private
|
60
60
|
def setup_db
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
Bundler.with_unbundled_env do
|
62
|
+
rails_command("db:drop")
|
63
|
+
rails_command("db:create")
|
64
|
+
rails_command("db:migrate")
|
65
|
+
end
|
64
66
|
end
|
65
67
|
|
66
68
|
def initial_git_commit
|
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.5.
|
4
|
+
version: 0.5.7
|
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:
|
11
|
+
date: 2021-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.1.4
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: A Rails engine to provide API support for Mobile Workflow Apps.
|