Commit 98450047 authored by Jérome Perrin's avatar Jérome Perrin

Output_viewJobScheduleSpreadsheet: update to new data format

parent d368122d
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
(function (window, rJS, RSVP, moment, initGadgetMixin) { (function (window, rJS, RSVP, moment, initGadgetMixin) {
"use strict"; "use strict";
function job_schedule_spreadsheet_widget(all_data) { function job_schedule_spreadsheet_widget(data, result_id) {
var now = new Date(), var now = new Date(),
name, name,
input_data = all_data.input, input_data = data,
output_data = all_data.result, output_data = data.result.result_list[result_id],
spreadsheet_data = [], spreadsheet_data = [],
spreadsheet_header = [[ spreadsheet_header = [[
"Jobs", "Jobs",
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
// find the input order and order component for this job // find the input order and order component for this job
// XXX this has no real meaning with capacity project // XXX this has no real meaning with capacity project
for (node_id in input_data.nodes) { for (node_id in input_data.graph.node) {
if (input_data.nodes.hasOwnProperty(node_id)) { if (input_data.graph.node.hasOwnProperty(node_id)) {
node = input_data.nodes[node_id]; node = input_data.graph.node[node_id];
if (node.wip) { if (node.wip) {
for (j = 0; j < node.wip.length; j += 1) { for (j = 0; j < node.wip.length; j += 1) {
order = node.wip[j]; order = node.wip[j];
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
return result_list[1].render( return result_list[1].render(
JSON.stringify( JSON.stringify(
job_schedule_spreadsheet_widget( job_schedule_spreadsheet_widget(
JSON.parse(result_list[0])[gadget.props.result] JSON.parse(result_list[0]), gadget.props.result
) )
) )
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment