-
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
lib-classifier: refactor single image viewer with VisXZoom #6390
Open
mcbouslog
wants to merge
36
commits into
master
Choose a base branch
from
lib-classifier_mouse-scroll-zoom
base: master
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
36 commits
Select commit
Hold shift + click to select a range
8a2889c
Add initial files for single image viewer with visx zoom
mcbouslog b274f8b
Add rotation to single image viewer
mcbouslog 58d39be
Initial refactor single image viewer with VisXZoom
mcbouslog 878edd9
Refactor single image viewer with VisXZoom mouse drag and zoom
mcbouslog 09d2d92
Rename SingleImageViewer
mcbouslog 0d203b0
Add PlaceholderSVG component
mcbouslog d598a4c
Fix drawing mark dragEnd
mcbouslog c93f219
Refactor viewers that use SingleImageViewer
mcbouslog 39ad1a6
Add resetView to MultiFrameViewer
mcbouslog 7b9da7a
Edit SeparateFrame SingleImageCanvas subjectId
mcbouslog 3929816
Remove SVGPanZoom
mcbouslog b0ef4c6
Add PlaceholderSVG maxHeight
mcbouslog f6b8415
Refactor SeparateFrame with transform matrix
mcbouslog f0d4086
Refactor SeparateFrame with SingleImageContainer
mcbouslog 75a568a
Refactor ImageAndTextViewer properties
mcbouslog 260d87b
Refactor MultiFrameViewer with SingleImageViewer
mcbouslog 467973b
Refactor FlipbookViewer and SeparateFrameViewer with SingleImage comp…
mcbouslog 066619a
Revert FlipbookViewer handleFrameChange changes
mcbouslog 49d6ca3
Add default props to SingleImageCanvas
mcbouslog ec4651c
Refactor FlipbookViewer with SingleImageContainer
mcbouslog 0c27c95
Revert height and width edit in VisXZoom
mcbouslog c1a434e
Remove previous SingleImageViewer tests
mcbouslog f2f2a56
Add PlaceholderSVG stories and tests
mcbouslog 8809d9f
Delete SingleImageConnector
mcbouslog f4bf4b0
Refactor ImageAndTextViewer and MultiFrameViewer to pass loadingState…
mcbouslog 88c669e
Refactor FlipbookViewer with SingleImageViewer and useSubjectImage
mcbouslog 9c0a872
Refactor SeparateFrame with SingleImageViewer and useSubjectImage
mcbouslog a52f9cd
Remove title default prop
mcbouslog 39f75e4
Fix tests, cleanup
mcbouslog c0937af
Fix FlipbookViewer handleSpaceBar
mcbouslog 9c81f38
Add initial SingleImageViewer tests
mcbouslog 128c5b5
Merge branch 'master' into lib-classifier_mouse-scroll-zoom
mcbouslog e8a4c45
Update READMEs, remove SVGPanZoom references
mcbouslog c58b452
Refactor FlipbookViewer onReady exclusively per initial default frame…
mcbouslog e19ef2a
Merge branch 'master' into lib-classifier_mouse-scroll-zoom
mcbouslog 716581f
Merge branch 'master' into lib-classifier_mouse-scroll-zoom
mcbouslog 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 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
13 changes: 9 additions & 4 deletions
13
.../components/Classifier/components/Layout/components/CenteredLayout/CenteredLayout.spec.js
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,12 +1,17 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { render, screen, waitFor } from '@testing-library/react' | ||
import { composeStory } from '@storybook/react' | ||
|
||
import Meta, { Default, mockTasks } from './CenteredLayout.stories.js' | ||
|
||
describe('Component > Layouts > Centered', function () { | ||
it('should render a subject and a task', function () { | ||
it('should render a subject and a task', async function () { | ||
const DefaultStory = composeStory(Default, Meta) | ||
render(<DefaultStory />) | ||
expect(screen.getByLabelText('Subject 1')).exists() // img aria-label from SVGImage | ||
expect(screen.getByText(mockTasks.init.strings.question)).exists() // task question paragraph | ||
|
||
// Mock the loading state transition | ||
Default.store.subjectViewer.onSubjectReady() | ||
|
||
await waitFor(() => expect(screen.getByLabelText('Subject 1')).exists()) // img aria-label from SVGImage | ||
await waitFor(() => expect(screen.getByText(mockTasks.init.strings.question)).exists()) // task question paragraph | ||
}) | ||
}) |
13 changes: 9 additions & 4 deletions
13
...assifier/src/components/Classifier/components/Layout/components/MaxWidth/MaxWidth.spec.js
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,13 +1,18 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { render, screen, waitFor } from '@testing-library/react' | ||
import { composeStory } from '@storybook/react' | ||
|
||
import Meta, { Default, mockTasks } from './MaxWidth.stories.js' | ||
|
||
describe('Component > Layouts > MaxWidth', function () { | ||
|
||
it('should render a subject and a task', function () { | ||
it('should render a subject and a task', async function () { | ||
const DefaultStory = composeStory(Default, Meta) | ||
render(<DefaultStory />) | ||
expect(screen.getByLabelText('Subject 1')).exists() // img aria-label from SVGImage | ||
expect(screen.getByText(mockTasks.init.strings.question)).exists() // task question paragraph | ||
|
||
// Mock the loading state transition | ||
Default.store.subjectViewer.onSubjectReady() | ||
|
||
await waitFor(() => expect(screen.getByLabelText('Subject 1')).exists()) // img aria-label from SVGImage | ||
await waitFor(() => expect(screen.getByText(mockTasks.init.strings.question)).exists()) // task question paragraph | ||
}) | ||
}) |
12 changes: 8 additions & 4 deletions
12
...fier/src/components/Classifier/components/Layout/components/NoMaxWidth/NoMaxWidth.spec.js
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,12 +1,16 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { render, screen, waitFor } from '@testing-library/react' | ||
import { composeStory } from '@storybook/react' | ||
import Meta, { Default, mockTasks } from './NoMaxWidth.stories.js' | ||
|
||
describe('Component > Layouts > NoMaxWidth', function () { | ||
it('should render a subject and a task', function () { | ||
it('should render a subject and a task', async function () { | ||
const DefaultStory = composeStory(Default, Meta) | ||
render(<DefaultStory />) | ||
expect(screen.getByLabelText('Subject 1')).exists() // img aria-label from SVGImage | ||
expect(screen.getByText(mockTasks.init.strings.question)).exists() // task question paragraph | ||
|
||
// Mock the loading state transition | ||
Default.store.subjectViewer.onSubjectReady() | ||
|
||
await waitFor(() => expect(screen.getByLabelText('Subject 1')).exists()) // img aria-label from SVGImage | ||
await waitFor(() => expect(screen.getByText(mockTasks.init.strings.question)).exists()) // task question paragraph | ||
}) | ||
}) |
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
Oops, something went wrong.
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.
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.
Just out of curiosity is the 'todo' at the end in a Github Issue or referenced somewhere else in the code?
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 think #2110 is the related issue. I'm not sure the
NOTE
belongs in the README though. I could remove theNOTE
or update it to include the specific issue?