Skip to content
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

Add annotation mode #134

Merged
merged 5 commits into from
Dec 6, 2024
Merged

Add annotation mode #134

merged 5 commits into from
Dec 6, 2024

Conversation

TomDijkema
Copy link
Collaborator

Adds the annotation mode to the Digital Specimen page to allow for direct targeting of properties from the view.
This includes some slight changes and fixes to the annotation wizard in general.

Annotation target can be set from view (setup). The annotation wizard needs to adapt to the changing annotation target without effecting the original annotation flow.
Save progress with annotation mode, selecting a direct annotation target will always go to step 3
@TomDijkema TomDijkema requested a review from southeo December 3, 2024 16:02
@TomDijkema TomDijkema self-assigned this Dec 3, 2024
Commit for resolving Sonar Cloud issues
Copy link

sonarqubecloud bot commented Dec 4, 2024

Copy link

@djangobrunink djangobrunink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

@southeo southeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment but isn;t blocking, something to consider in a future pr
🧥

* @param annotationTargetType The type of the annotation target, either class or term
* @param jsonPath The JSON path that targets the class or term
*/
const SetAnnotationTarget = (annotationTargetType: 'class' | 'term', jsonPath: string) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of this seems duplicate from the media.tsx file, do you think you can reuse some code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah my initial idea was to include as an utility function, only I am not allowed to use hooks out of React components, hence I chose to do it this way. I could include it at an ever higher level and pass it as props, but its irrelevant for a lot of child components. For now this seemed the best way, but can probably be optimized somehow in the future.

@TomDijkema TomDijkema merged commit fdbc356 into main Dec 6, 2024
3 checks passed
@TomDijkema TomDijkema deleted the AddAnnotationMode branch December 6, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants