mobile_workflow 0.5.6 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2a4d13fe23a8f256052b54fa14424c54d847bb327bf57128159b9dd8ffd334a
4
- data.tar.gz: 0aa96388f99ac5f8ae69a1e6a06559c58c9eab58c355f877b259137472a3b176
3
+ metadata.gz: 843610afaa8207693d3f1be346698ca58e4022a3575b6953ef52c343781c649c
4
+ data.tar.gz: b787b24ab9fbf0f47910a889f23a59094d214db55c6eb0950609b674ba01ed64
5
5
  SHA512:
6
- metadata.gz: 7f5890bf8381f177530fe3607e5ec4fe276258638f4a28213665c7c2dab5724ed14fb4a9f3ea3027581c41499c4fb995701e4b08138d0d31466f4781aa8f279e
7
- data.tar.gz: 7b5c52f4a9b754078eb0c1a70b6213bf5b33f9825f1c67ce0325199b5c2bc1038cde0044b951baccdb6120c7fa2b46546349258c444cca4db7b438a96dbd5b3f
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, height: 100, width: 100) if 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, height: 600, width: 1200), url: attachment_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, height: 600, width: 1200), url: attachment_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, height:, width:, options: { resize_to_fill: [height, width]} )
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(combine_options: options), host: attachment_host)
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
@@ -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.6.6'
4
+ ruby '2.7.2'
5
5
 
6
6
  # Core Gems
7
7
  gem 'rails', '~> 6.1.0'
@@ -1,5 +1,5 @@
1
1
  module MobileWorkflow
2
- VERSION = '0.5.6'
2
+ VERSION = '0.5.7'
3
3
  RUBY_VERSION = '2.5.5'
4
4
  RAILS_VERSION = '6.1.0'
5
5
  end
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.6
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: 2020-12-30 00:00:00.000000000 Z
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.0.8
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.