Skip to content
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

Introduce form to edit Relationship data and attributes #54

Merged
merged 9 commits into from Apr 18, 2024

Conversation

martin-fleck-at
Copy link
Collaborator

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

Copy link

github-actions bot commented Apr 10, 2024

Unit Test Results

  3 files  ±0   30 suites  ±0   2m 34s ⏱️ -7s
 71 tests ±0   71 ✅ ±0  0 💤 ±0  0 ❌ ±0 
216 runs  ±0  216 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3d9e163. ± Comparison against base commit d6e9ef8.

♻️ This comment has been updated with latest results.

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
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb The PR is ready for review, the Mac build keeps failing for some reason, I'll try to re-trigger it a bit later, maybe it is a temporary problem.

@harmen-xb
Copy link
Contributor

@harmen-xb The PR is ready for review, the Mac build keeps failing for some reason, I'll try to re-trigger it a bit later, maybe it is a temporary problem.

Hi @martin-fleck-at ,

The mac build reran a couple of times but it keeps getting out of memory: https://github.com/CrossBreezeNL/crossmodel/actions/runs/8644531235/job/23747744720#step:5:253

I re-ran the workflow on the main branch to check whether it is a container issue, but it succeeds there. So there seems to be some changes which causes this.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Interesting! Thank you for following up. I'll see if there is anything I can do to find what would be causing this.

@harmen-xb
Copy link
Contributor

@martin-fleck-at martin-fleck-at force-pushed the feature/relationship-form branch 4 times, most recently from ea5eda8 to df50f60 Compare April 12, 2024 13:09
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Unfortunately my idea to upgrade to Node 20 caused some issues on the Windows build with node-pty. I didn't want to invest too much time, so I just upped the Node memory for the build job to 8GB (specs here) which seemed to work. If we want to upgrade Node, we should do it separately then.

Copy link
Contributor

@harmen-xb harmen-xb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remark on the code.

packages/react-model-ui/package.json Outdated Show resolved Hide resolved
@harmen-xb
Copy link
Contributor

harmen-xb commented Apr 16, 2024

@martin-fleck-at

Couple of things:

  1. I notice when I edit any relationship in the property widget and don't press save, click away and click on the edge again the change is gone. Which kinda makes sense, but it's not warning me about losing changes or anything. Would it be easy to add something like it?
  2. CTRL+S is not working in the property widget. Would it be possible to enable the keybinding here?
  3. When I add a child and parent attribute for a relationship in the property widget and press 'Save' it's not persisted. I also see an error on the console:
2024-04-16T10:23:03.354Z root WARN MUI: The value provided to Autocomplete is invalid.
None of the options match with `{"uri":"","label":"ExampleCRM.Address.Street","type":"Entity"}`.
You can use the `isOptionEqualToValue` prop to customize the equality test.
2024-04-16T10:23:05.927Z root ERROR Request update failed with error: Request server/update failed with message: invalid Error: Request server/update failed with message: invalid
    at handleResponse (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
    at handleMessage (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
    at processMessageQueue (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
    at Immediate.<anonymous> (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
    at processImmediate (node:internal/timers:466:21)
  1. When reordering attributes of an entity or attribute-pairs in a relationship the icon for moving attribute up for the first item and moving down for the last item would be better to disable it (or hide it)

Added example theia settings file to disable autosave in this workspace.
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb I pushed a commit that updates the PR and improves UX when it comes to saving properties. I cannot re-produce the error you are seeing when adding attributes to the relationship. Could you please re-test with the latest version of the PR or provide some steps on a concrete example so I can fix that as well.

- 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)
@harmen-xb
Copy link
Contributor

@martin-fleck-at

It all works nicely now. I did notice one strange thing:

  • When in a system diagram and you click on a relationship or entity with a Description and then click on any object of the same type without a Description the value of the previous object is still there while all other properties are updated. When switching object type the Description is updated, so there seems to be something specific when switching between properties of the same object type.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Very good catch! It seems that MUI doesn't like undefined values but when rendering empty strings everything works as expected.

Copy link
Contributor

@harmen-xb harmen-xb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks ok now

@harmen-xb harmen-xb merged commit f0b6dc8 into main Apr 18, 2024
5 checks passed
@harmen-xb harmen-xb deleted the feature/relationship-form branch April 18, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants