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

fix(frontend): show task config when pre annotation config is none #437

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apps/frontend/src/pages/tasks.[id].samples.[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ const AnnotationPage = () => {

const isLoading = useMemo(() => loading || isFetching > 0 || isMutating > 0, [loading, isFetching, isMutating]);

const config = useMemo(() => {
return isSampleAnnotationEmpty && !_.isEmpty(preAnnotationConfig)
? preAnnotationConfig
: configFromParent || editorConfig;
}, [configFromParent, editorConfig, isSampleAnnotationEmpty, preAnnotationConfig]);

if (task?.media_type === MediaType.IMAGE) {
content = (
<ImageAnnotator
Expand All @@ -208,7 +214,7 @@ const AnnotationPage = () => {
onError={onError}
offsetTop={configFromParent ? 100 : 156}
editingSample={editingSample}
config={isSampleAnnotationEmpty ? preAnnotationConfig : configFromParent || editorConfig}
config={config}
/>
);
} else if (task?.media_type === MediaType.VIDEO) {
Expand All @@ -218,7 +224,7 @@ const AnnotationPage = () => {
ref={videoAnnotationRef}
offsetTop={configFromParent ? 100 : 156}
editingSample={editingSample}
config={isSampleAnnotationEmpty ? preAnnotationConfig : configFromParent || editorConfig}
config={config}
toolbarRight={topActionContent}
renderSidebar={renderSidebar}
/>
Expand All @@ -230,7 +236,7 @@ const AnnotationPage = () => {
ref={audioAnnotationRef}
offsetTop={configFromParent ? 100 : 156}
editingSample={editingSample}
config={isSampleAnnotationEmpty ? preAnnotationConfig : configFromParent || editorConfig}
config={config}
toolbarRight={topActionContent}
renderSidebar={renderSidebar}
/>
Expand Down
Loading