-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding editor for schema designer. #18689
base: main
Are you sure you want to change the base?
Conversation
2. Stopping unnecessary updates.
…esigner to use new API
…igner configuration styles
…osition calculations in SchemaDesigner
…eady notification in schema designer service
…designer color configuration
… update connection info handling
… functionality in SchemaDesigner
@@ -207,6 +208,7 @@ | |||
"tmp": "^0.0.28", | |||
"tunnel": "0.0.6", | |||
"underscore": "^1.8.3", | |||
"uuid": "^11.0.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we already have a util function for UUIDs, presumably to keep dependencies lighter. If we wanted to pull in a package instead, maybe we can remove that util function.
save: l10n.t("Save"), | ||
cancel: l10n.t("Cancel"), | ||
dataType: l10n.t("Type"), | ||
primaryKey: l10n.t("PK"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why abbreviated when "Foreign Keys" is spelled out?
editorDiv.style.transform = `scale(${scale})`; | ||
editorDiv.style.top = `${y}px`; | ||
editorDiv.style.left = `${x}px`; | ||
} | ||
function createGraph() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a long function to stick in an effect; can you shift it out to a helper function and add comment?
setSchemaDesigner(graph); | ||
|
||
const exportAsButton = document.querySelector( | ||
".sd-toolbar-button[title='Export']", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does this hardcoded string .sd-toolbar-button
come from?
); | ||
return; | ||
} | ||
// transperant background |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "transparent"
} | ||
createGraph(); | ||
}, [context.schema]); | ||
|
||
return <div id="graphContainer"></div>; | ||
async function exportAs(format: "svg" | "png" | "jpg") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an odd thing to have in the react layer (and likely more difficult to test). Can you tell me more about why this is here? When might imageContent
or context
be undefined resulting in the bulk of this code being executed?
}; | ||
|
||
function calculateEditorPosition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring
tableForeignKeys.filter((fk) => fk.columns.includes(column.name)) | ||
.length > 0; | ||
|
||
const isColumnAlsoAReferencedColumn = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to calculate this one if the first has already triggered, right?
Buffer.from(payload.svgFileContents), | ||
); | ||
} else { | ||
//const outputPath = `/Users/aasimkhan/src/newFile.${payload.format}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
|
||
this._schemaDesignerService.onModelReady(() => { | ||
vscodeWrapper.showInformationMessage( | ||
"Schema Designer model is ready.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loc?
…odel handling in SchemaDesigner
…signer outline dimensions
… auto arrange buttons, and adjust initial state
…to false in schemaDesignerConfig
…, View Code, and Publish
… azdataGraph dependency to version 0.0.119
Editing Table:
Screen.Recording.2025-02-14.at.9.37.34.AM.mov
Updating Editor Position with graph changes (scroll and scale)
Screen.Recording.2025-02-14.at.9.39.12.AM.mov
Add new table
Screen.Recording.2025-02-14.at.9.43.35.AM.mov
Add and editing edge
Screen.Recording.2025-02-14.at.10.03.16.AM.mov
Undo / Redo
Screen.Recording.2025-02-14.at.10.05.42.AM.mov