-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor annotation groups #563
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
Open
richartkeil
wants to merge
29
commits into
develop-annotation-service
Choose a base branch
from
refactor-annotation-groups
base: develop-annotation-service
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
cf2d072
refactor: remove external dependency for layer sorting
richartkeil edf8ab0
fix: Import annotation groups correctly
Tonybodo 2dd3c82
fix: Import for single Images
Tonybodo be5dd36
fix: DnD for annotation groups and Image Layers
Tonybodo 21139d0
Feat: Add new Annotation Group
Tonybodo 9b49968
feat: Add Annotation Groups via UI
Tonybodo 951ce82
Merge pull request #568 from HealthML/annotation-groups-only
Tonybodo d241ab4
Fix: Can not drag and drop after import
Tonybodo 16940ae
Feat: Delete AnnotationsGroups
Tonybodo b96499c
Merge branch 'refactor-annotation-groups-ui' into add-and-delete-anno…
Tonybodo 455f90a
Feat: Delete annotation references from database
Tonybodo bee5af2
Feat: Refactor saveAs method, so that its add metadata
Tonybodo aa379ae
Fix: First annotation-layer not draggable
Tonybodo 3d9643f
Feat: Confirmation popups for delete annotation groups
Tonybodo d59c816
Fix: Review adjustments
Tonybodo 58be698
Refactor: SaveAs changes metadata for existing group
Tonybodo 079385b
Fix: Flanky import and imported group naming
Tonybodo 01750d4
Fix: Updating hasChanges on annotation groups
Tonybodo 79d7877
Fix: Create squashed Nifti and export popup
Tonybodo 2c6a2c7
Fix: Fixes for presentation
Tonybodo 8c0350f
Merge pull request #567 from HealthML/refactor-annotation-groups-ui
Tonybodo ed85c4d
Merge pull request #573 from HealthML/add-and-delete-annotation-groups
Tonybodo 244efd9
Merge branch 'refactor-annotation-groups' into refactor-saving
Tonybodo 6a9566c
Fix: Merge request
Tonybodo 46f2f94
Refactor: Remove popup for groups without metadata
Tonybodo e66bd44
Merge pull request #577 from HealthML/refactor-saving
Tonybodo 075847f
Merge branch 'develop-annotation-service' into refactor-annotation-gr…
Tonybodo 70f3eaf
Fix: File endings corrupt saving
Tonybodo da4c03b
Fix: Review changes
Tonybodo 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 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 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
46 changes: 46 additions & 0 deletions
46
apps/editor/src/components/editor/layers/draggable-group-list-item.tsx
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { useSortable } from "@dnd-kit/sortable"; | ||
| import { CSS } from "@dnd-kit/utilities"; | ||
| import { IAnnotationGroup, ILayer } from "@visian/ui-shared"; | ||
| import { observer } from "mobx-react-lite"; | ||
| import styled from "styled-components"; | ||
|
|
||
| import { AnnotationGroupListItem } from "./group-list-item"; | ||
|
|
||
| const DraggableDiv = styled.div<{ | ||
| opacity: number; | ||
| transform: string | undefined; | ||
| transition: string | undefined; | ||
| }>` | ||
| opacity: ${({ opacity }) => opacity}; | ||
| transform: ${({ transform }) => transform}; | ||
| transition: ${({ transition }) => transition}; | ||
| `; | ||
|
|
||
| export const DraggableAnnotationGroupListItem = observer<{ | ||
| group: IAnnotationGroup; | ||
| isActive: boolean; | ||
| isLast?: boolean; | ||
| isDragged?: boolean; | ||
| draggedLayer?: ILayer; | ||
| }>(({ group, isActive, isLast, isDragged, draggedLayer }) => { | ||
| const { attributes, listeners, setNodeRef, transform, transition } = | ||
| useSortable({ id: group.id, data: { annotationGroup: group } }); | ||
|
|
||
| return ( | ||
| <DraggableDiv | ||
| ref={setNodeRef} | ||
| transform={CSS.Transform.toString(transform)} | ||
| transition={transition} | ||
| opacity={isDragged ? 0.3 : 1} | ||
| {...attributes} | ||
| {...listeners} | ||
| > | ||
| <AnnotationGroupListItem | ||
| group={group} | ||
| isActive={isActive} | ||
| isLast={isLast} | ||
| draggedLayer={draggedLayer} | ||
| /> | ||
| </DraggableDiv> | ||
| ); | ||
| }); |
43 changes: 43 additions & 0 deletions
43
apps/editor/src/components/editor/layers/draggable-layer-list-item.tsx
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { useSortable } from "@dnd-kit/sortable"; | ||
| import { CSS } from "@dnd-kit/utilities"; | ||
| import { ILayer } from "@visian/ui-shared"; | ||
| import { observer } from "mobx-react-lite"; | ||
| import styled from "styled-components"; | ||
|
|
||
| import { LayerListItem } from "./layer-list-item"; | ||
|
|
||
| const DraggableDiv = styled.div<{ | ||
| opacity: number; | ||
| transform: string | undefined; | ||
| transition: string | undefined; | ||
| }>` | ||
| opacity: ${({ opacity }) => opacity}; | ||
| transform: ${({ transform }) => transform}; | ||
| transition: ${({ transition }) => transition}; | ||
| `; | ||
|
|
||
| export const DraggableLayerListItem = observer<{ | ||
| layer: ILayer; | ||
| isActive?: boolean; | ||
| isLast?: boolean; | ||
| isDragged?: boolean; | ||
| }>(({ layer, isActive, isLast, isDragged }) => { | ||
| const { attributes, listeners, setNodeRef, transform, transition } = | ||
| useSortable({ | ||
| id: layer.id, | ||
| data: { layer }, | ||
| }); | ||
|
|
||
| return ( | ||
| <DraggableDiv | ||
| ref={setNodeRef} | ||
| transform={CSS.Transform.toString(transform)} | ||
| transition={transition} | ||
| opacity={isDragged ? 0.3 : 1} | ||
| {...attributes} | ||
| {...listeners} | ||
| > | ||
| <LayerListItem layer={layer} isActive={isActive} isLast={isLast} /> | ||
| </DraggableDiv> | ||
| ); | ||
| }); |
Oops, something went wrong.
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.