fix steps panic
This commit is contained in:
parent
d64e1ddbb1
commit
a0f8dbee22
6 changed files with 142 additions and 2 deletions
|
|
@ -66,6 +66,9 @@ func (c *compiler) compileSteps(m *Map) {
|
|||
if i == 0 {
|
||||
base = m.CopyBase(sf)
|
||||
} else {
|
||||
if steps.Fields[i-1].Map() == nil {
|
||||
continue
|
||||
}
|
||||
base = steps.Fields[i-1].Map().CopyBase(sf)
|
||||
}
|
||||
OverlayMap(base, sf.Map())
|
||||
|
|
|
|||
22
e2etests/testdata/todo/steps_panic/dagre/board.exp.json
generated
vendored
Normal file
22
e2etests/testdata/todo/steps_panic/dagre/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": [],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "hey",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": []
|
||||
}
|
||||
],
|
||||
"steps": [
|
||||
{
|
||||
"name": "id",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": []
|
||||
}
|
||||
]
|
||||
}
|
||||
45
e2etests/testdata/todo/steps_panic/dagre/sketch.exp.svg
vendored
Normal file
45
e2etests/testdata/todo/steps_panic/dagre/sketch.exp.svg
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg
|
||||
id="d2-svg"
|
||||
style="background: white;"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="200" height="200" viewBox="-100 -100 200 200"><style type="text/css">
|
||||
<![CDATA[
|
||||
.shape {
|
||||
shape-rendering: geometricPrecision;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.connection {
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.blend {
|
||||
mix-blend-mode: multiply;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
]]>
|
||||
</style><script type="application/javascript"><![CDATA[window.addEventListener("DOMContentLoaded", () => {
|
||||
if (document.documentElement.getAttribute("id") !== "d2-svg") {
|
||||
return;
|
||||
}
|
||||
const svgEl = document.documentElement;
|
||||
let width = parseInt(svgEl.getAttribute("width"), 10);
|
||||
let height = parseInt(svgEl.getAttribute("height"), 10);
|
||||
let ratio;
|
||||
if (width > height) {
|
||||
if (width > window.innerWidth) {
|
||||
ratio = window.innerWidth / width;
|
||||
}
|
||||
} else if (height > window.innerHeight) {
|
||||
ratio = window.innerHeight / height;
|
||||
}
|
||||
if (ratio) {
|
||||
svgEl.setAttribute("width", width * ratio - 16);
|
||||
svgEl.setAttribute("height", height * ratio - 16);
|
||||
}
|
||||
});
|
||||
]]></script><mask id="121760133" maskUnits="userSpaceOnUse" x="-100" y="-100" width="200" height="200">
|
||||
<rect x="-100" y="-100" width="200" height="200" fill="white"></rect>
|
||||
|
||||
</mask><style type="text/css"><![CDATA[]]></style></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
22
e2etests/testdata/todo/steps_panic/elk/board.exp.json
generated
vendored
Normal file
22
e2etests/testdata/todo/steps_panic/elk/board.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": [],
|
||||
"scenarios": [
|
||||
{
|
||||
"name": "hey",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": []
|
||||
}
|
||||
],
|
||||
"steps": [
|
||||
{
|
||||
"name": "id",
|
||||
"fontFamily": "SourceSansPro",
|
||||
"shapes": [],
|
||||
"connections": []
|
||||
}
|
||||
]
|
||||
}
|
||||
45
e2etests/testdata/todo/steps_panic/elk/sketch.exp.svg
vendored
Normal file
45
e2etests/testdata/todo/steps_panic/elk/sketch.exp.svg
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg
|
||||
id="d2-svg"
|
||||
style="background: white;"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="200" height="200" viewBox="-100 -100 200 200"><style type="text/css">
|
||||
<![CDATA[
|
||||
.shape {
|
||||
shape-rendering: geometricPrecision;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.connection {
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.blend {
|
||||
mix-blend-mode: multiply;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
]]>
|
||||
</style><script type="application/javascript"><![CDATA[window.addEventListener("DOMContentLoaded", () => {
|
||||
if (document.documentElement.getAttribute("id") !== "d2-svg") {
|
||||
return;
|
||||
}
|
||||
const svgEl = document.documentElement;
|
||||
let width = parseInt(svgEl.getAttribute("width"), 10);
|
||||
let height = parseInt(svgEl.getAttribute("height"), 10);
|
||||
let ratio;
|
||||
if (width > height) {
|
||||
if (width > window.innerWidth) {
|
||||
ratio = window.innerWidth / width;
|
||||
}
|
||||
} else if (height > window.innerHeight) {
|
||||
ratio = window.innerHeight / height;
|
||||
}
|
||||
if (ratio) {
|
||||
svgEl.setAttribute("width", width * ratio - 16);
|
||||
svgEl.setAttribute("height", height * ratio - 16);
|
||||
}
|
||||
});
|
||||
]]></script><mask id="121760133" maskUnits="userSpaceOnUse" x="-100" y="-100" width="200" height="200">
|
||||
<rect x="-100" y="-100" width="200" height="200" fill="white"></rect>
|
||||
|
||||
</mask><style type="text/css"><![CDATA[]]></style></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
|
@ -162,11 +162,14 @@ small code: |go
|
|||
`,
|
||||
},
|
||||
{
|
||||
skip: true,
|
||||
name: "steps_panic",
|
||||
script: `steps: {
|
||||
shape: sql_table
|
||||
id: {type: int, constraint: primary_key}
|
||||
id: int {constraint: primary_key}
|
||||
}
|
||||
scenarios: {
|
||||
shape: sql_table
|
||||
hey: int {constraint: primary_key}
|
||||
}
|
||||
`,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue