rails_workflow 0.4.2 → 0.4.3
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/rails_workflow/operation_templates_controller.rb +1 -0
- data/app/decorators/rails_workflow/operation_helper_decorator.rb +10 -3
- data/app/decorators/rails_workflow/operation_template_decorator.rb +4 -4
- data/app/models/rails_workflow/operation.rb +4 -0
- data/app/views/rails_workflow/operation_templates/_user_form.html.slim +58 -0
- data/lib/rails_workflow/config.rb +4 -0
- data/lib/rails_workflow/version.rb +1 -1
- data/spec/dummy/log/test.log +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d85d2776fc4b5bc25da7f7555318ad088641307
|
4
|
+
data.tar.gz: 3f7d947d513ec8f4431829329432ca38ec97296d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8c2b93714080e1ccdf5d687aa4fde94b42d0cca08eac931217d44971439793c421b5d52787a81b46aed66b60e672400be7993aa987ec74d47acbf82494237ef
|
7
|
+
data.tar.gz: 2871b11611017711cfefba38526fefb1dee5bfe06eaa4a269aa333b8bab6824ed9196d8760b71d90c8808ab71a6bf6331e5d3c5c96284287c23f3c347c7617cd
|
@@ -3,17 +3,24 @@
|
|
3
3
|
module RailsWorkflow
|
4
4
|
class OperationHelperDecorator < Decorator
|
5
5
|
include StatusDecorator
|
6
|
-
delegate :id, :title, :instruction, :complete
|
6
|
+
delegate :id, :title, :tag, :instruction, :complete, :data
|
7
7
|
|
8
8
|
def assigned_to
|
9
9
|
object.assignment.try(:email) || begin
|
10
10
|
[
|
11
|
-
|
12
|
-
::User.group_text(object.group)
|
11
|
+
assignment_by_role, assignment_by_group
|
13
12
|
].compact.join(', ')
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
16
|
+
def assignment_by_role
|
17
|
+
::User.role_text(object.role) if object.role
|
18
|
+
end
|
19
|
+
|
20
|
+
def assignment_by_group
|
21
|
+
::User.group_text(object.group) if object.group
|
22
|
+
end
|
23
|
+
|
17
24
|
def created_at
|
18
25
|
object.created_at.strftime('%m/%d/%Y %H:%M')
|
19
26
|
end
|
@@ -42,15 +42,15 @@ module RailsWorkflow
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def assignment
|
45
|
-
[assignment_by_role,
|
45
|
+
[assignment_by_role, assignment_by_group].compact.join(', ')
|
46
46
|
end
|
47
47
|
|
48
48
|
def assignment_by_role
|
49
|
-
User.role_text(object.role) if object.role
|
49
|
+
::User.role_text(object.role) if object.role
|
50
50
|
end
|
51
51
|
|
52
|
-
def
|
53
|
-
User.group_text(object.group) if object.group
|
52
|
+
def assignment_by_group
|
53
|
+
::User.group_text(object.group) if object.group
|
54
54
|
end
|
55
55
|
|
56
56
|
def show_dependencies
|
@@ -0,0 +1,58 @@
|
|
1
|
+
- if @operation_template.errors.any?
|
2
|
+
#error_explanation
|
3
|
+
h2 = "#{pluralize(@operation_template.errors.count, "error")} prohibited this wf_operation_template from being saved:"
|
4
|
+
ul
|
5
|
+
- @operation_template.errors.full_messages.each do |message|
|
6
|
+
li = message
|
7
|
+
|
8
|
+
= hidden_field_tag 'operation_template[kind]', @operation_template.kind
|
9
|
+
|
10
|
+
.form-group
|
11
|
+
= f.label :title, class: "control-label col-sm-2"
|
12
|
+
.col-sm-10
|
13
|
+
= f.text_field :title, class: "form-control"
|
14
|
+
|
15
|
+
|
16
|
+
.form-group
|
17
|
+
= f.label :operation_class, class: "control-label col-sm-2"
|
18
|
+
.col-sm-10
|
19
|
+
= f.text_field :operation_class, class: "form-control", placeholder: f.object.default_class
|
20
|
+
|
21
|
+
.form-group
|
22
|
+
= f.label :type, "Template Class", class: "control-label col-sm-2"
|
23
|
+
.col-sm-10
|
24
|
+
= f.text_field :type, class: "form-control", placeholder: f.object.default_type
|
25
|
+
|
26
|
+
.form-group
|
27
|
+
= f.label :partial_name, "Context Partial", class: "control-label col-sm-2"
|
28
|
+
.col-sm-10
|
29
|
+
= f.text_field :partial_name, class: "form-control", placeholder: "Default"
|
30
|
+
|
31
|
+
.form-group
|
32
|
+
= f.label :tag, "Operation Tag", class: "control-label col-sm-2"
|
33
|
+
.col-sm-10
|
34
|
+
= f.text_field :tag, class: "form-control"
|
35
|
+
|
36
|
+
|
37
|
+
.form-group
|
38
|
+
= f.label :child_process, class: "control-label col-sm-2"
|
39
|
+
.col-sm-10
|
40
|
+
= f.collection_select(:child_process_id, @process_template.other_processes, :id, :title, {include_blank: true}, { class: "form-control" })
|
41
|
+
|
42
|
+
.checkbox
|
43
|
+
.col-sm-2
|
44
|
+
.col-sm-10
|
45
|
+
label
|
46
|
+
= f.check_box :async
|
47
|
+
| Asynchronous
|
48
|
+
br
|
49
|
+
br
|
50
|
+
|
51
|
+
.checkbox
|
52
|
+
.col-sm-2
|
53
|
+
.col-sm-10
|
54
|
+
label
|
55
|
+
= f.check_box :is_background
|
56
|
+
| Run in background
|
57
|
+
br
|
58
|
+
br
|
@@ -128,9 +128,13 @@ module RailsWorkflow
|
|
128
128
|
private
|
129
129
|
|
130
130
|
def init_default_operation_types
|
131
|
+
# TODO: it should allow user_role and user_group operations
|
132
|
+
# only if user responds to necessary methods.
|
131
133
|
@default_operation_types = {
|
132
134
|
default: { title: 'Default Operation',
|
133
135
|
class: 'RailsWorkflow::Operation' },
|
136
|
+
user: { title: 'User Operation',
|
137
|
+
class: 'RailsWorkflow::UserOperation' },
|
134
138
|
user_role: { title: 'Operation for User By Role',
|
135
139
|
class: 'RailsWorkflow::UserByRoleOperation' },
|
136
140
|
user_group: { title: 'Operation by User Group',
|
data/spec/dummy/log/test.log
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Madzhuga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- app/views/application/_flash.html.slim
|
234
234
|
- app/views/layouts/rails_workflow/application.html.slim
|
235
235
|
- app/views/rails_workflow/operation_templates/_default_form.html.slim
|
236
|
+
- app/views/rails_workflow/operation_templates/_user_form.html.slim
|
236
237
|
- app/views/rails_workflow/operation_templates/_user_group_form.html.slim
|
237
238
|
- app/views/rails_workflow/operation_templates/_user_role_form.html.slim
|
238
239
|
- app/views/rails_workflow/operation_templates/edit.html.slim
|