-
Notifications
You must be signed in to change notification settings - Fork 12
WIP: integrate edge creation/deletion #40
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1a18548
chore: remove unused custom diagram items
reddigari e33115b
feat(ui): add API functions for edge handler endpoint
reddigari e5f3ce8
style: fix indentation
reddigari 24b1075
fix(ui): prevent drag-and-drop callback on icons
reddigari 20a7545
refactor(ui): improve use of react-diagrams base classes
reddigari 5c7f81b
feat(ui): integrate link create/delete with server endpoints
reddigari 7aa7c66
refactor(ui): use default exports
reddigari 7d343c9
fix(ui): remove visual link before API call so it disappears
reddigari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,9 +1,9 @@ | ||
| import { VPLinkModel } from './VPLinkModel'; | ||
| import { DefaultLinkFactory } from '@projectstorm/react-diagrams'; | ||
| import VPLinkModel from './VPLinkModel'; | ||
|
|
||
| export class VPLinkFactory extends DefaultLinkFactory { | ||
| export default class VPLinkFactory extends DefaultLinkFactory { | ||
|
|
||
| generateModel() { | ||
| return new VPLinkModel(); | ||
| return new VPLinkModel(); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,5 +1,5 @@ | ||
| import { DefaultLinkWidget } from '@projectstorm/react-diagrams'; | ||
|
|
||
| export class VPLinkWidget extends DefaultLinkWidget { | ||
| export default class VPLinkWidget extends DefaultLinkWidget { | ||
|
|
||
| } |
This file contains hidden or 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,12 +1,13 @@ | ||
| import { VPPortModel } from './VPPortModel'; | ||
| import { DefaultPortFactory } from '@projectstorm/react-diagrams'; | ||
| import { AbstractModelFactory } from '@projectstorm/react-canvas-core'; | ||
| import VPPortModel from './VPPortModel'; | ||
|
|
||
| export class VPPortFactory extends DefaultPortFactory { | ||
| export default class VPPortFactory extends AbstractModelFactory { | ||
|
|
||
| getType() { | ||
| return "vp-port"; | ||
| constructor() { | ||
| super("vp-port"); | ||
| } | ||
| generateModel(event) { | ||
|
|
||
| generateModel() { | ||
| return new VPPortModel({name: 'vp-port-name'}); | ||
| } | ||
| } |
This file contains hidden or 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,12 +1,16 @@ | ||
| import { DefaultPortModel } from '@projectstorm/react-diagrams'; | ||
| import { VPLinkModel } from '../VPLink/VPLinkModel'; | ||
| import VPLinkFactory from '../VPLink/VPLinkFactory'; | ||
|
|
||
| export default class VPPortModel extends DefaultPortModel { | ||
|
|
||
| export class VPPortModel extends DefaultPortModel { | ||
| createLinkModel() { | ||
| return new VPLinkModel(); | ||
| const factory = new VPLinkFactory(); | ||
| return factory.generateModel(); | ||
| } | ||
|
|
||
| canLinkToPort(port) { | ||
| return port instanceof VPPortModel; | ||
| // can't both be in or out ports | ||
| return port instanceof VPPortModel | ||
| && this.options.in !== port.options.in; | ||
| } | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.