Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
48adee34
Commit
48adee34
authored
Feb 25, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input_viewResultComparison: support cases where a given order does not exist in all scenarios
parent
568a370b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
dream/platform/src/dream/Input_viewResultComparison.js
dream/platform/src/dream/Input_viewResultComparison.js
+23
-17
No files found.
dream/platform/src/dream/Input_viewResultComparison.js
View file @
48adee34
...
...
@@ -19,7 +19,7 @@
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
order_lateness
=
{},
json_result
;
var
gadget
=
this
,
order_lateness
=
{},
general_json
;
this
.
props
.
jio_key
=
options
.
id
;
return
gadget
.
aq_getAttachment
({
...
...
@@ -34,11 +34,12 @@
throw
error
;
})
.
push
(
function
(
sim_json
)
{
var
result
=
JSON
.
parse
(
sim_json
).
result
,
var
json
=
JSON
.
parse
(
sim_json
),
result
=
json
.
result
,
result_list
=
[],
document_list
=
[],
i
;
json_result
=
result
;
general_json
=
result
;
if
(
result
&&
result
.
result_list
)
{
document_list
=
result
.
result_list
;
}
...
...
@@ -51,16 +52,17 @@
return
RSVP
.
all
(
result_list
);
})
.
push
(
function
(
result_list
)
{
var
i
,
link
,
result
,
var
i
,
link
,
result
,
scenario_id
,
calculateOrderLateness
=
function
(
order_id
)
{
var
order
=
result
.
order_lateness
[
order_id
];
order
.
link
=
link
;
if
(
!
order_lateness
[
order_id
]){
order_lateness
[
order_id
]
=
[]
;
order_lateness
[
order_id
]
=
{}
;
}
order_lateness
[
order_id
]
.
push
(
order
)
;
order_lateness
[
order_id
]
[
scenario_id
]
=
order
;
};
for
(
i
=
0
;
i
<
result_list
.
length
;
i
+=
1
)
{
scenario_id
=
result_list
[
i
][
1
].
name
||
i
;
link
=
result_list
[
i
][
0
];
result
=
result_list
[
i
][
1
];
Object
.
keys
(
result
.
order_lateness
).
forEach
(
calculateOrderLateness
);
...
...
@@ -69,16 +71,16 @@
})
.
push
(
function
(
tableeditor
)
{
var
i
,
data
=
[],
data
=
{},
data_list
=
[],
colHeaders
=
[
"
Project
"
],
columns
=
[{
data
:
0
}];
columns
=
[{
data
:
"
id
"
}];
Object
.
keys
(
order_lateness
).
forEach
(
function
(
order_id
)
{
var
order
=
order_lateness
[
order_id
];
order
.
unshift
(
order_id
)
;
data
.
push
(
order
)
;
order
.
id
=
order_id
;
data
[
order_id
]
=
order
;
});
/*jslint unparam: true */
function
orderHtmlRenderer
(
instance
,
td
,
row
,
col
,
prop
,
value
,
cellProperties
)
{
var
a
,
color
=
"
yellow
"
;
...
...
@@ -89,7 +91,7 @@
if
(
value
.
delay
>
0.5
)
{
color
=
"
red
"
;
}
$
(
td
).
css
({
"
background-color
"
:
color
});
$
(
td
).
text
(
""
).
css
({
"
background-color
"
:
color
});
a
=
$
(
"
<a>
"
).
attr
(
"
href
"
,
value
.
link
)
.
text
(
value
.
completionDate
+
"
\n
"
+
(
value
.
delay
||
0
).
toFixed
(
0
))
.
css
({
color
:
"
black
"
,
"
text-shadow
"
:
"
none
"
});
...
...
@@ -98,13 +100,17 @@
return
td
;
}
for
(
i
=
1
;
i
<
data
[
0
]
.
length
;
i
+=
1
)
{
colHeaders
.
push
(
json_result
.
result_list
[
i
-
1
].
name
||
(
"
Solution #
"
+
i
));
columns
.
push
({
data
:
i
,
renderer
:
orderHtmlRenderer
});
for
(
i
=
0
;
i
<
general_json
.
result_list
.
length
;
i
+=
1
)
{
colHeaders
.
push
(
general_json
.
result_list
[
i
].
name
||
(
"
Solution #
"
+
(
i
+
1
)
));
columns
.
push
({
data
:
general_json
.
result_list
[
i
].
name
||
i
,
renderer
:
orderHtmlRenderer
});
}
Object
.
keys
(
data
).
forEach
(
function
(
order_id
)
{
data_list
.
push
(
order_lateness
[
order_id
]);
});
return
tableeditor
.
render
(
JSON
.
stringify
(
data
),
JSON
.
stringify
(
data
_list
),
{
colHeaders
:
colHeaders
,
columns
:
columns
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment