Skip to content

Commit 7c4aed6

Browse files
committed
bump version to 0.0.131; refactor foreign key validation logic in schema designer
1 parent 8320459 commit 7c4aed6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "azdataGraph",
33
"description": "azdataGraph is a derivative of mxGraph, which is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.",
4-
"version": "0.0.130",
4+
"version": "0.0.131",
55
"homepage": "https://github.com/microsoft/azdataGraph",
66
"author": "Microsoft",
77
"license": "Apache-2.0",

src/ts/schemaDesigner/schemaDesigner.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,7 @@ export class SchemaDesigner {
399399

400400
const self = this;
401401
(this.mxGraph.connectionHandler as extendedConnectionHandler).validateConnection = function (source, target) {
402-
if (this.edgeState && self.isForeignKeyValid !== undefined) {
403-
const edgeStateValue = this.edgeState.cell.value as EdgeCellValue;
404-
if (self.isForeignKeyValid(source, target, edgeStateValue.sourceRow, edgeStateValue.targetRow)) {
405-
return null!;
406-
} else {
407-
return "";
408-
}
409-
}
410-
402+
411403

412404
if (this.edgeState === null) {
413405
return null!;
@@ -424,8 +416,18 @@ export class SchemaDesigner {
424416
return "";
425417
}
426418

419+
if (this.edgeState && self.isForeignKeyValid !== undefined) {
420+
const edgeStateValue = this.edgeState.cell.value as EdgeCellValue;
421+
if (self.isForeignKeyValid(source, target, edgeStateValue.sourceRow, edgeStateValue.targetRow)) {
422+
return null!;
423+
} else {
424+
return "";
425+
}
426+
}
427+
427428
const edgeState = this.edgeState;
428429
const edgeStateValue = edgeState.cell.value as EdgeCellValue;
430+
console.log(edgeStateValue.sourceRow, edgeStateValue.targetRow);
429431
const edgeBetweenSourceAndTarget = this.graph.model.getEdgesBetween(source, target);
430432
for (let i = 0; i < edgeBetweenSourceAndTarget.length; i++) {
431433
const edge = edgeBetweenSourceAndTarget[i];

0 commit comments

Comments
 (0)