This PR moves majority of the algorithms out of the Body component into a common module so that unit testing of these functions and debugging is less complicated.
Ref #123
Common Module
api
App calls that need to go over the internet
cacheutils
CRUD operations on the imageCache data structure
error
Custom Error classes
types.d.ts
common shared data model for the front end
definitions of the expected structures from backend
Hooks Module
useBackendUrl
memoized hook to provide the back end URL
useDicoderTiff
hook entry point to the Tiff decoder
Quality of life changes
Pure Functions
Functions were converted into pure functions for easier debugging and predictability
Body Component
useEffect dependencies were simplified to reduce the number of chain dependencies
This fixed some rendering issues referenced below
directory_list
Separated Container and View
Example showing separation of Component state and view
Useful for large complicated components
Placing component code in a tsx file with the same name will make it slightly easier to debug since the browser console will indicate the file name of the component with an error or exception
Unit Tests
Multiple strategies for testing the different components are present
single vs parametric test case scenarios
different dependency mocking strategies
Fixes
Fixes #122
An issue where bounding boxes are shown for a different image
An issue where the first image is obscured by the default image placeholder
This PR moves majority of the algorithms out of the Body component into a common module so that unit testing of these functions and debugging is less complicated.
Common Module
Hooks Module
Quality of life changes Pure Functions
Body Component
directory_list
Unit Tests
Fixes