Skip to content

Commit 2fdfa0f

Browse files
ianballouadamruzicka
authored andcommitted
Refs #38991 - model dependency task data in rabl
1 parent 3d398a6 commit 2fdfa0f

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object @task
2+
3+
attributes :id, :action, :state, :result
4+
node(:humanized) { @task.humanized[:action] }

app/views/foreman_tasks/api/tasks/details.json.rabl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ node(:depends_on) do
2222
if @task.execution_plan
2323
dynflow_uuids = ForemanTasks.dynflow.world.persistence.find_execution_plan_dependencies(@task.execution_plan.id)
2424
ForemanTasks::Task.where(external_id: dynflow_uuids).map do |task|
25-
{
26-
id: task.id,
27-
action: task.action,
28-
humanized: task.humanized[:action],
29-
state: task.state,
30-
result: task.result
31-
}
25+
partial('foreman_tasks/api/tasks/dependency_summary', :object => task)
3226
end
3327
else
3428
[]
@@ -38,13 +32,7 @@ node(:blocks) do
3832
if @task.execution_plan
3933
dynflow_uuids = ForemanTasks.dynflow.world.persistence.find_blocked_execution_plans(@task.execution_plan.id)
4034
ForemanTasks::Task.where(external_id: dynflow_uuids).map do |task|
41-
{
42-
id: task.id,
43-
action: task.action,
44-
humanized: task.humanized[:action],
45-
state: task.state,
46-
result: task.result
47-
}
35+
partial('foreman_tasks/api/tasks/dependency_summary', :object => task)
4836
end
4937
else
5038
[]

webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ exports[`TaskDetails rendering render with loading Props 1`] = `
5858
<Tab
5959
disabled={true}
6060
eventKey={5}
61+
title="Dependencies"
62+
>
63+
<Dependencies
64+
blocks={Array []}
65+
dependsOn={Array []}
66+
/>
67+
</Tab>
68+
<Tab
69+
disabled={true}
70+
eventKey={6}
6171
title="Raw"
6272
>
6373
<Raw
@@ -136,6 +146,15 @@ exports[`TaskDetails rendering render with min Props 1`] = `
136146
</Tab>
137147
<Tab
138148
eventKey={5}
149+
title="Dependencies"
150+
>
151+
<Dependencies
152+
blocks={Array []}
153+
dependsOn={Array []}
154+
/>
155+
</Tab>
156+
<Tab
157+
eventKey={6}
139158
title="Raw"
140159
>
141160
<Raw

0 commit comments

Comments
 (0)