meta_workflows 0.9.37 → 0.9.39
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/assets/javascripts/meta_workflows/controllers/redirect_controller.js +2 -0
- data/app/controllers/meta_workflows/meta_controller.rb +1 -0
- data/app/helpers/meta_workflows/meta_workflows_helper.rb +1 -64
- data/app/helpers/meta_workflows/partial_paths_helper.rb +4 -0
- data/app/helpers/meta_workflows/ui_state_helper.rb +25 -0
- data/app/helpers/meta_workflows/workflow_data_helper.rb +38 -0
- data/lib/meta_workflows/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9dcbbe3d51f7d04b9cc30e51ac03bd14ce20ab09bba9cef9b93a656d4d4fa9b
|
4
|
+
data.tar.gz: 5c4e5dc6c5b1c1d28bdc0734b875186afe5c5159cb7555019ec062d5ad25f222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1475f4f88078104b17acf9f22f7c82f05fb7709a444549c2806e8df69a76adcb3d5de74b1822a85cbf16b0b2583e4523aea8a693255d8ecf272682e61ae13f35
|
7
|
+
data.tar.gz: c9e68591906bce70ba2fd9b64f1c89d28ed2b8dd143d8a52ef13baf105f7604f77e01249ed0596fd0e6e21bf78b8cdecb98ded2216ec0f6f0aa5e3c341cfb670
|
@@ -5,69 +5,6 @@ module MetaWorkflows
|
|
5
5
|
include MetaWorkflows::FrameIdHelper
|
6
6
|
include MetaWorkflows::PartialPathsHelper
|
7
7
|
include MetaWorkflows::UiStateHelper
|
8
|
-
|
9
|
-
def current_step_has_repetitions?(workflow_execution)
|
10
|
-
workflow_execution.step_repetitions(workflow_execution.current_step).present?
|
11
|
-
end
|
12
|
-
|
13
|
-
def show_next_button?(workflow_execution)
|
14
|
-
return false if current_step_has_repetitions?(workflow_execution)
|
15
|
-
|
16
|
-
workflow_execution.step_advanceable?(workflow_execution.current_step)
|
17
|
-
end
|
18
|
-
|
19
|
-
def show_skip_button?(workflow_execution)
|
20
|
-
return false if current_step_has_repetitions?(workflow_execution)
|
21
|
-
|
22
|
-
workflow_execution.step_skippable?(workflow_execution.current_step)
|
23
|
-
end
|
24
|
-
|
25
|
-
def default_step_progress
|
26
|
-
['Thinking']
|
27
|
-
end
|
28
|
-
|
29
|
-
def show_structured_input?(local_assigns, structured_input_config)
|
30
|
-
current_step = local_assigns[:current_step]
|
31
|
-
|
32
|
-
(structured_input_config.present? && !local_assigns[:initial_load]) ||
|
33
|
-
(local_assigns[:initial_load] && !current_step&.initial_execution?)
|
34
|
-
end
|
35
|
-
|
36
|
-
def current_step_and_config(active_execution, step_structured_input_config)
|
37
|
-
if active_execution.present?
|
38
|
-
[
|
39
|
-
active_execution.workflow_steps.order(:step).last,
|
40
|
-
step_structured_input_config
|
41
|
-
]
|
42
|
-
else
|
43
|
-
[nil, {}]
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# Consolidates all data fetching for the Lexi chat tray using service object
|
48
|
-
def lexi_chat_data(record)
|
49
|
-
LexiChatDataService.new(record).call
|
50
|
-
end
|
51
|
-
|
52
|
-
def structured_form_url(workflow_execution)
|
53
|
-
workflow_execution ? meta_workflows.structured_human_path(workflow_execution.id) : '#'
|
54
|
-
end
|
55
|
-
|
56
|
-
def structured_chat_id(local_assigns)
|
57
|
-
local_assigns[:chat_id] || local_assigns[:current_step]&.chat&.id
|
58
|
-
end
|
59
|
-
|
60
|
-
# Common locals for lexi chat input area
|
61
|
-
def lexi_chat_input_locals(record, chat_data, wrapper_class)
|
62
|
-
{
|
63
|
-
record: record,
|
64
|
-
workflow_execution: chat_data[:active_execution],
|
65
|
-
current_step: chat_data[:current_step],
|
66
|
-
structured_input_config: chat_data[:structured_input_config],
|
67
|
-
chat_id: chat_data[:active_chat]&.id,
|
68
|
-
is_structured_input: chat_data[:is_structured_input],
|
69
|
-
wrapper_class: wrapper_class
|
70
|
-
}
|
71
|
-
end
|
8
|
+
include MetaWorkflows::WorkflowDataHelper
|
72
9
|
end
|
73
10
|
end
|
@@ -49,5 +49,9 @@ module MetaWorkflows
|
|
49
49
|
def meta_lexi_chat_input_area
|
50
50
|
'meta_workflows/lexi_chat_input_area'
|
51
51
|
end
|
52
|
+
|
53
|
+
def structured_form_url(workflow_execution)
|
54
|
+
workflow_execution ? meta_workflows.structured_human_path(workflow_execution.id) : '#'
|
55
|
+
end
|
52
56
|
end
|
53
57
|
end
|
@@ -34,5 +34,30 @@ module MetaWorkflows
|
|
34
34
|
def default_step_progress
|
35
35
|
['Thinking']
|
36
36
|
end
|
37
|
+
|
38
|
+
def show_next_button?(workflow_execution)
|
39
|
+
return false if current_step_has_repetitions?(workflow_execution)
|
40
|
+
|
41
|
+
workflow_execution.step_advanceable?(workflow_execution.current_step)
|
42
|
+
end
|
43
|
+
|
44
|
+
def show_skip_button?(workflow_execution)
|
45
|
+
return false if current_step_has_repetitions?(workflow_execution)
|
46
|
+
|
47
|
+
workflow_execution.step_skippable?(workflow_execution.current_step)
|
48
|
+
end
|
49
|
+
|
50
|
+
def show_structured_input?(local_assigns, structured_input_config)
|
51
|
+
current_step = local_assigns[:current_step]
|
52
|
+
|
53
|
+
(structured_input_config.present? && !local_assigns[:initial_load]) ||
|
54
|
+
(local_assigns[:initial_load] && !current_step&.initial_execution?)
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def current_step_has_repetitions?(workflow_execution)
|
60
|
+
workflow_execution.step_repetitions(workflow_execution.current_step).present?
|
61
|
+
end
|
37
62
|
end
|
38
63
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MetaWorkflows
|
4
|
+
module WorkflowDataHelper
|
5
|
+
def current_step_and_config(active_execution, step_structured_input_config)
|
6
|
+
if active_execution.present?
|
7
|
+
[
|
8
|
+
active_execution.workflow_steps.order(:step).last,
|
9
|
+
step_structured_input_config
|
10
|
+
]
|
11
|
+
else
|
12
|
+
[nil, {}]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def structured_chat_id(local_assigns)
|
17
|
+
local_assigns[:chat_id] || local_assigns[:current_step]&.chat&.id
|
18
|
+
end
|
19
|
+
|
20
|
+
# Consolidates all data fetching for the Lexi chat tray using service object
|
21
|
+
def lexi_chat_data(record)
|
22
|
+
LexiChatDataService.new(record).call
|
23
|
+
end
|
24
|
+
|
25
|
+
# Common locals for lexi chat input area
|
26
|
+
def lexi_chat_input_locals(record, chat_data, wrapper_class)
|
27
|
+
{
|
28
|
+
record: record,
|
29
|
+
workflow_execution: chat_data[:active_execution],
|
30
|
+
current_step: chat_data[:current_step],
|
31
|
+
structured_input_config: chat_data[:structured_input_config],
|
32
|
+
chat_id: chat_data[:active_chat]&.id,
|
33
|
+
is_structured_input: chat_data[:is_structured_input],
|
34
|
+
wrapper_class: wrapper_class
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module MetaWorkflows
|
4
4
|
MAJOR = 0
|
5
5
|
MINOR = 9
|
6
|
-
PATCH =
|
6
|
+
PATCH = 39 # this is automatically incremented by the build process
|
7
7
|
|
8
8
|
VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
|
9
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_workflows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonid Medovyy
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- app/helpers/meta_workflows/partial_paths_helper.rb
|
148
148
|
- app/helpers/meta_workflows/status_badge_helper.rb
|
149
149
|
- app/helpers/meta_workflows/ui_state_helper.rb
|
150
|
+
- app/helpers/meta_workflows/workflow_data_helper.rb
|
150
151
|
- app/jobs/meta_workflows/application_job.rb
|
151
152
|
- app/jobs/meta_workflows/concerns/error_handling.rb
|
152
153
|
- app/jobs/meta_workflows/concerns/workflow_params_mergeable.rb
|