-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce form to edit Relationship data and attributes (#54)
* Introduce form to edit Relationship data and attributes Introduce reference resolution and completion mechanism for elements - Ensure we send the global id as part of each identifiable element - Attach reference data to GLSP elements for property view - Replace specific 'requestDiagramNodeEntityModel' method - Replace specific 'findRootReferenceName' method Create Form for Relationship data - Unify form for property view and editor (also for Entity) - Use MUI components consistently and add theming for them - Remove custom stylesheets - Remove dependency to 'react-tabs' as it is no longer used Refactorings: - Rename 'ExternalId' to 'GlobalId' - Ensure IDs do not contain any invalid characters - Fix issue with attribute serialization for relationships * Allow more Node memory usage * Moved node memory setting to crossmodel-app prepare (since issue occurs there). * Changed export env to use cross-env. * Updated node options settings. * Added back to memory setting in the workflow, since it's not being picked up on mac. * Added name to ExampleCRM relationship. Added example theia settings file to disable autosave in this workspace. * PR Feedback - Remove @mui/lab - Introduce dirty state into the Header part for properties - Disable attribute move up/down when appropriate - Warn user before unsaved changes are lost - Further unify editor and property widget for save mechanism - Overwrite Theia property widget to delegate Save command (Ctrl+S) * PR Feedback: Adapt for undefined handling in MUI --------- Co-authored-by: Harmen Wessels <97173058+harmen-xb@users.noreply.github.com>
- Loading branch information
1 parent
d6e9ef8
commit f0b6dc8
Showing
75 changed files
with
2,226 additions
and
1,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"files.autoSave": "off" | ||
} |
5 changes: 3 additions & 2 deletions
5
examples/mapping-example/Sources/ExampleCRM/relationships/Address_Customer.relationship.cm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
relationship: | ||
id: Address_Customer | ||
name: "Address - Customer" | ||
parent: Customer | ||
child: ExampleCRM.Address | ||
type: "1:1" | ||
attributes: | ||
- parent: Customer.Id | ||
child: ExampleCRM.Address.CustomerID | ||
- parent: Customer.Id | ||
child: ExampleCRM.Address.CustomerID |
3 changes: 2 additions & 1 deletion
3
examples/mapping-example/Sources/ExampleCRM/relationships/Order_Customer.relationship.cm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
relationship: | ||
id: Order_Customer | ||
name: "Order - Customer" | ||
parent: Customer | ||
child: Order | ||
type: "1:1" | ||
type: "1:n" | ||
attributes: | ||
- parent: Customer.Id | ||
child: Order.CustomerId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
extensions/crossmodel-lang/src/language-server/cross-model-index-manager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 CrossBreeze. | ||
********************************************************************************/ | ||
import { AstNode, AstNodeDescription, DefaultIndexManager, URI } from 'langium'; | ||
import { CrossModelSharedServices } from './cross-model-module.js'; | ||
import { SemanticRoot, findSemanticRoot } from './util/ast-util.js'; | ||
|
||
export class CrossModelIndexManager extends DefaultIndexManager { | ||
constructor(protected services: CrossModelSharedServices) { | ||
super(services); | ||
} | ||
|
||
getElementById(globalId: string, type?: string): AstNodeDescription | undefined { | ||
return this.allElements().find(desc => desc.name === globalId && (!type || desc.type === type)); | ||
} | ||
|
||
resolveElement(description?: AstNodeDescription): AstNode | undefined { | ||
if (!description) { | ||
return undefined; | ||
} | ||
const document = this.services.workspace.LangiumDocuments.getDocument(description.documentUri); | ||
return document | ||
? this.serviceRegistry.getServices(document.uri).workspace.AstNodeLocator.getAstNode(document.parseResult.value, description.path) | ||
: undefined; | ||
} | ||
|
||
resolveElementById(globalId: string, type?: string): AstNode | undefined { | ||
return this.resolveElement(this.getElementById(globalId, type)); | ||
} | ||
|
||
resolveSemanticElement(uri: URI): SemanticRoot | undefined { | ||
const document = this.services.workspace.LangiumDocuments.getDocument(uri); | ||
return document ? findSemanticRoot(document) : undefined; | ||
} | ||
} |
Oops, something went wrong.