effective_resources 2.2.5 → 2.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: 90e5bf3fd1991d755505ba17c9ec917279bed6ed92e8b336005ccbcf4568ac01
4
- data.tar.gz: 84a1301995e457d5ac7250528ca7dafb6ac3d043d41c8dec65a200f452217c11
3
+ metadata.gz: 6819b26bada9a724fa3389143b46e3d39988040cc58430440679672d8a437114
4
+ data.tar.gz: 604f9712d29693fd48ea06d357ac7f84a0ff07b717316f6378b3822db5fbdc87
5
5
  SHA512:
6
- metadata.gz: 481fd4b475b39f2c048288831ae0929b86062dbb63edb49ada6b4652a7c33953a172bb9f3ec5f2c4d9cf2d1653bf3a6625b692d8d776ae6b11281ca30bc57b73
7
- data.tar.gz: eab64d1fa9fb21caa68e028943ea22bd4ced563a7ca9fb08d35e23dd5ae325c00918a1485273297ef46311c047eef4790631d60022a9eea5eed1bc4504d74bdd
6
+ metadata.gz: 756414efa78b9f5517699e5cb61de0ea62de0f0180efadb24ee7ffb065985441e17f389de7b2452346946024da12f1131cd3fee3766d633a6b2956ba705f9bb1
7
+ data.tar.gz: a5d1dd0200866bfd0b7b1970d599203a72b5c9f3d08f57931e7679d8b0eb61f3f769921d3c7c634a9d250c73210f544468a9845aba368e60e0ad00f0be03cbce
@@ -47,8 +47,9 @@ module Effective
47
47
  return if resource.try(:done?)
48
48
  return unless resource_scope.respond_to?(:in_progress)
49
49
 
50
- existing = resource_scope.in_progress.where.not(id: resource).first
50
+ existing = resource_scope.in_progress.order(:id).where.not(id: resource).first
51
51
  return unless existing.present?
52
+ return if (existing.id > resource.id) # Otherwise we get an infinite loop
52
53
 
53
54
  flash[:success] = "You have been redirected to your in-progress wizard"
54
55
  redirect_to resource_wizard_path(existing, existing.next_step)
@@ -280,7 +280,7 @@ module EffectiveResourcesHelper
280
280
  end
281
281
 
282
282
  content_tag(:div, class: 'card') do
283
- content_tag(:div, class: 'card-body yo') do
283
+ content_tag(:div, class: 'card-body') do
284
284
  content_tag(:div, class: 'row') do
285
285
  content_tag(:div, class: 'col-sm') do
286
286
  content_tag(:h5, title, class: 'card-title')
@@ -2,12 +2,17 @@
2
2
 
3
3
  module EffectiveResourcesWizardHelper
4
4
 
5
- def render_wizard_sidebar(resource, numbers: true, horizontal: false, &block)
5
+ def render_wizard_sidebar(resource, numbers: true, path: nil, horizontal: false, &block)
6
+ if path.present?
7
+ raise('expected path to be a string with /build/ in it ') unless path.to_s.include?('/build/')
8
+ path = path.split('/build/').first + '/build/'
9
+ end
10
+
6
11
  klasses = ['wizard-sidebar', 'list-group', ('list-group-horizontal' if horizontal)].compact.join(' ')
7
12
 
8
13
  sidebar = content_tag(:div, class: klasses) do
9
14
  resource.sidebar_steps.map.with_index do |nav_step, index|
10
- render_wizard_sidebar_item(resource, nav_step, (index + 1 if numbers))
15
+ render_wizard_sidebar_item(resource, nav_step: nav_step, index: (index + 1 if numbers), path: (path + nav_step.to_s if path))
11
16
  end.join.html_safe
12
17
  end
13
18
 
@@ -19,7 +24,7 @@ module EffectiveResourcesWizardHelper
19
24
  end
20
25
  end
21
26
 
22
- def render_wizard_sidebar_item(resource, nav_step, index = nil)
27
+ def render_wizard_sidebar_item(resource, nav_step:, path: nil, index: nil)
23
28
  # From Controller
24
29
  current = (nav_step == step)
25
30
  title = resource_wizard_step_title(resource, nav_step)
@@ -33,7 +38,7 @@ module EffectiveResourcesWizardHelper
33
38
  if (current || disabled)
34
39
  content_tag(:a, label, class: klass)
35
40
  else
36
- link_to(label, wizard_path(nav_step), class: klass)
41
+ link_to(label, path || wizard_path(nav_step), class: klass)
37
42
  end
38
43
  end
39
44
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.2.5'.freeze
2
+ VERSION = '2.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails