effective_resources 2.8.8 → 2.8.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a38e2952ba5fef52c6aa082b18ef2d9261c32dcd89f629fa548b22b4c5f70b6
|
4
|
+
data.tar.gz: 0aebae2fb3691c17fcc6cbe84d3a153592cd0fd4c49aafdeadcf77d511bd5c30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da673d1b40fbdf5c6ddf6322619c4cf8e1641b3aa28a81395de8080f5220d371a272f9cca5541eae8f8206c5020418d1562f1db3f22117c0513eb9fd2df0bc72
|
7
|
+
data.tar.gz: b0167300f0a180b5f7bb4445aa70750b6a606a38633d9fcb4ba22ea68d5e290602cfc5b659638e4703bed29fb2df8863ce4a94cdc59def680fdeec1acfefdc0f
|
@@ -42,19 +42,32 @@ module EffectiveResourcesWizardHelper
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def render_wizard_resource_step(resource, step, as: nil, path: nil)
|
46
|
+
render_wizard_resource(resource, only: step, as: as, path: path)
|
47
|
+
end
|
48
|
+
|
49
|
+
def render_wizard_resource(resource, only: [], except: [], as: nil, path: nil)
|
46
50
|
effective_resource = Effective::Resource.new(resource)
|
47
51
|
|
52
|
+
# Render path
|
48
53
|
as ||= effective_resource.name
|
49
|
-
path ||= effective_resource.
|
54
|
+
path ||= effective_resource.wizard_file_path(resource)
|
50
55
|
raise('expected a path') unless path.present?
|
51
56
|
|
52
57
|
resource.render_path = path.to_s.chomp('/')
|
53
58
|
|
54
|
-
|
55
|
-
|
59
|
+
# Render steps
|
60
|
+
only = Array(only)
|
61
|
+
except = Array(except)
|
62
|
+
|
63
|
+
steps = resource.render_steps
|
64
|
+
steps = (steps - except) if except.present?
|
65
|
+
steps = (steps & only) if only.present?
|
66
|
+
|
67
|
+
steps.map do |step|
|
68
|
+
resource.render_step = step
|
56
69
|
|
57
|
-
render_if_exists("#{path}/#{
|
70
|
+
render_if_exists("#{path}/#{step}", as.to_sym => resource) || render('effective/acts_as_wizard/wizard_step', resource: resource, resource_path: path)
|
58
71
|
end.join.html_safe
|
59
72
|
end
|
60
73
|
|
@@ -35,6 +35,15 @@ module Effective
|
|
35
35
|
File.join(*[tenant_path, 'app/datatables', namespace, "effective_#{plural_name}_datatable.rb"].compact)
|
36
36
|
end
|
37
37
|
|
38
|
+
# Wizards are kinda weird, we need some help for effective_memberships
|
39
|
+
def wizard_file_path(resource)
|
40
|
+
if resource.class.try(:effective_memberships_applicant?) || resource.class.try(:effective_memberships_applicant_review?)
|
41
|
+
File.join(*['effective', plural_name].compact)
|
42
|
+
else
|
43
|
+
view_file_path(nil)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
38
47
|
# Views
|
39
48
|
def view_file(action = :index, partial: false)
|
40
49
|
File.join(*[tenant_path, 'app/views', class_path, namespace, plural_name, "#{'_' if partial}#{action}.html.haml"].compact)
|
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.8.
|
4
|
+
version: 2.8.9
|
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-08-
|
11
|
+
date: 2023-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|