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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdceaf61577d25aa9f96f6ecb137b324b4285e9f
4
- data.tar.gz: c8d565433000b1e4865c779ed916dc2d55b29bc2
3
+ metadata.gz: 1d85d2776fc4b5bc25da7f7555318ad088641307
4
+ data.tar.gz: 3f7d947d513ec8f4431829329432ca38ec97296d
5
5
  SHA512:
6
- metadata.gz: 88dd3bf227a6548932d3c0fd623e987739bea36070a04ff95361e7763e274e24ed12c0cab520b3986df45a5c220eb0c821c39e178754a3104b230f58f26b7ddf
7
- data.tar.gz: fac3080b6f6d846f8d48a8bd2cd4f6ab514352c87469b7d1423c2646378d013b79341e6ed7f18a6edf01799bba1904fecc894c8349804461dff44e375769a8eb
6
+ metadata.gz: c8c2b93714080e1ccdf5d687aa4fde94b42d0cca08eac931217d44971439793c421b5d52787a81b46aed66b60e672400be7993aa987ec74d47acbf82494237ef
7
+ data.tar.gz: 2871b11611017711cfefba38526fefb1dee5bfe06eaa4a269aa333b8bab6824ed9196d8760b71d90c8808ab71a6bf6331e5d3c5c96284287c23f3c347c7617cd
@@ -44,6 +44,7 @@ module RailsWorkflow
44
44
  operation_template: [
45
45
  :kind,
46
46
  :type,
47
+ :tag,
47
48
  :instruction,
48
49
  :title, :source,
49
50
  :child_process_id,
@@ -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
- ::User.role_text(object.role),
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, assignemt_by_group].compact.join(', ')
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 assignemt_by_group
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
@@ -28,6 +28,10 @@ module RailsWorkflow
28
28
  template.instruction
29
29
  end
30
30
 
31
+ def tag
32
+ read_attribute(:tag) || template.tag
33
+ end
34
+
31
35
  def manager
32
36
  @manager ||= process.manager
33
37
  end
@@ -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',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsWorkflow
4
- VERSION = '0.4.2'
4
+ VERSION = '0.4.3'
5
5
  end
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.2
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-02 00:00:00.000000000 Z
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