-
Notifications
You must be signed in to change notification settings - Fork 30
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
211: Revise TypeHints and server side feedback for creation actions #285
Conversation
99774cb
to
b98c98b
Compare
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.
Thanks @CamilleLetavernier.
I only had time to do a preliminary code review for now, but I will also test the changes later today
packages/client/src/features/tools/edge-creation/edge-creation-tool.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/tools/edge-creation/edge-creation-tool.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/tools/edge-creation/edge-creation-tool.ts
Outdated
Show resolved
Hide resolved
a71b9e7
to
796399b
Compare
- Refactor EdgeTypeHint definition - Add a new 'dynamic' property, indicating that new edges need and additional check with the server before allowing creation - Make source/target element type ids properties optional If not defined, all potential element types are considered to be valid sources/targets - Add `RequestEdgeCheckAction` and `EdgeCheckResultAction` response to implement the dynamic check - Update the EdgeCreationTool to check with the server when trying to create a new edge configured as Dynamic -Refactor `TypeHintsProvider` and `ApplyTypeHintsCommand - Simplify type-hints aware can connect implementation. Just validate against the source/target types of the edge hint that is applicable for the given routable - Ensure that the default (i.e. class-level implementation) of `canConnect` is called if no typehint is applicable to the given routable - Remove `getValidEdgeElementTypes` function from `TypeHintsProvider`. Was only used for the old type-hints aware `canConnect` implementation. Is no longer needed and incomplete anyways (does not consider nested subtypes) - Add tests for type-hints feature Fixes eclipse-glsp/glsp#45 - Remove `hasCompatibleType` utility function from `smodel-util` as it is no longer used and the implementation was incomplete anyways (did not consider nested subtypes) - Also: Don't use stroked lines for edges until eclipse-glsp/glsp/issues/1083 is fixed Part of eclipse-glsp/glsp/issues/211 Co-authored-by: Camille Letavernier <[email protected] >
796399b
to
f16c040
Compare
@martin-fleck-at I have taken over this draft from Camille and have finalized the PR. Could you please have a look at it? |
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 did a quick test on this and the changes look good to me and work as expected. I do have some minor comments that could be integrated but nothing related to the core functionality. Thank you!
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.
LGTM!
Refactor EdgeTypeHint definition
If not defined, all potential element types are considered to be valid sources/targets
Add
RequestEdgeCheckAction
andEdgeCheckResultAction
response to implementthe dynamic check
Update the EdgeCreationTool to check with the server when trying to
create a new edge configured as Dynamic
Refactor
TypeHintsProvider
and `ApplyTypeHintsCommandSimplify type-hints aware can connect implementation. Just validate against the source/target types
of the edge hint that is applicable for the given routable
Ensure that the default (i.e. class-level implementation) of
canConnect
is called if no typehint is applicable to the given routableRemove
getValidEdgeElementTypes
function fromTypeHintsProvider
. Was only usedfor the old type-hints aware
canConnect
implementation. Is no longer needed and incomplete anyways (does not consider nested subtypes)Add tests for type-hints feature
Fixes Consider unit testing Type Hints glsp#45
Remove
hasCompatibleType
utility function fromsmodel-util
as it is no longer usedand the implementation was incomplete anyways (did not consider nested subtypes)
Also: Don't use stroked lines for edges until Edge edit does not work well with stroked lines glsp#1083 is fixed
Part of eclipse-glsp/glsp/issues/211
Co-authored-by: Camille Letavernier <[email protected] >
Note:
weighted edges
which have been changed to a use a dynamic type hint.refs eclipse-glsp/glsp#211