Skip to content

Commit 1ef6fa0

Browse files
authored
Merge pull request #107 from buildingSMART/IVS-138-Improve-ALS016-message
add additional information for alignment continuity reporting
2 parents 97b0aae + 303e69b commit 1ef6fa0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

frontend/src/GherkinResult.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ function unsafe_format(obj) {
3434
return <div>{ctx}<div></div><ul>{obj.oneOf.map(v =><li>{v}</li>)}</ul></div>
3535
} else if (typeof obj== 'object' && 'num_digits' in obj) {
3636
// custom formatting for calculated alignment consistency (e.g. ALS016, ALS017, ALS018)
37-
console.log(`object is ${obj.expected}`);
3837
let ctx = obj.context ? `${obj.context.charAt(0).toUpperCase()}${obj.context.slice(1)} :` : `One of:`
3938
let value = obj.expected || obj.observed;
4039
let display_value = value.toExponential(obj.num_digits);
41-
return <div>{ctx} {display_value}</div>
40+
if ('continuity_details' in obj) {
41+
let dts = obj.continuity_details;
42+
return <div>
43+
<div>{ctx} {display_value}</div>
44+
<div>at end of {dts.previous_segment}</div>
45+
<ul>Coords: ({dts.preceding_end_point[0]}, {dts.preceding_end_point[1]})</ul>
46+
<ul>Tangent Direction: {dts.preceding_end_direction}</ul>
47+
<br/>
48+
<div>and start of {dts.segment_to_analyze}</div>
49+
<ul>Coords: ({dts.current_start_point[0]}, {dts.current_start_point[1]})</ul>
50+
<ul>Tangent Direction: {dts.current_start_direction}</ul>
51+
</div>
52+
} else {
53+
return <div>{ctx} {display_value}</div>
54+
}
4255
} else {
4356
return JSON.stringify(obj);
4457
}

0 commit comments

Comments
 (0)