Skip to content

Change function name to make it compatible with artemis #183

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

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/lib/apollon-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class ApollonEditor {
if (this.reactFlowInstance) {
this.deSelectAllNodes()
const diagramTitle = this.metadataStore.getState().diagramTitle
const diagram = this.getDiagram()
const diagram = this.model
exportAsJSON(diagram, diagramTitle)
} else {
console.error("ReactFlowInstance is not available for exporting JSON.")
Expand Down Expand Up @@ -224,7 +224,7 @@ export class ApollonEditor {
public subscribeToModelChange(callback: (state: UMLModel) => void): number {
const subscriberId = this.getNewSubscriptionId()
const unsubscribeCallback = this.diagramStore.subscribe(() =>
callback(this.getDiagram())
callback(this.model)
)
this.subscribers[subscriberId] = unsubscribeCallback
return subscriberId
Expand Down Expand Up @@ -265,7 +265,7 @@ export class ApollonEditor {
return { diagramTitle, diagramType }
}

public getDiagram(): UMLModel {
get model(): UMLModel {
const { nodes, edges, diagramId } = this.diagramStore.getState()
const { diagramTitle, diagramType } = this.metadataStore.getState()
return {
Expand Down
2 changes: 1 addition & 1 deletion standalone/webapp/src/components/modals/ShareModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ShareModal = () => {
toast.error("Editor instance is not available.")
return
}
const model = editor.getDiagram()
const model = editor.model

await fetch(`${backendURL}/api/`, {
method: "POST",
Expand Down
2 changes: 1 addition & 1 deletion standalone/webapp/src/pages/ApollonWithConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const ApollonWithConnection: React.FC = () => {

intervalRef.current = setInterval(() => {
if (instance && diagramId && diagramIsUpdated.current) {
const diagramData = instance.getDiagram()
const diagramData = instance.model
sendPutRequest(diagramId, diagramData)
diagramIsUpdated.current = false
}
Expand Down