Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 92c93dc

Browse files
authored
fix(gui): is:done filter crashes app (#943)
* fix(gui): `is:done` filter crashes app * style: apply automatic fixes of linters Co-authored-by: lars-reimann <[email protected]>
1 parent f5bb873 commit 92c93dc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

api-editor/gui/src/features/filter/model/DoneFilter.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ export class DoneFilter extends AbstractPythonFilter {
4646

4747
private getAnnotationsForTarget(target: string, annotationStore: AnnotationStore): Annotation[] {
4848
return Object.entries(annotationStore).flatMap(([key, value]) => {
49+
if (typeof value !== 'object') {
50+
return [];
51+
}
52+
4953
if (!(target in value)) {
5054
return [];
5155
}
5256

53-
if (key === 'calledAfters' || key === 'groups') {
57+
if (key === 'calledAfterAnnotations' || key === 'groupAnnotations') {
5458
return Object.values(value[target]);
55-
} else if (key === 'completes') {
59+
} else if (key === 'completeAnnotations') {
5660
return [];
5761
} else {
5862
return [value[target]];

api-editor/gui/src/features/menuBar/MenuBar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import { useLocation, useNavigate } from 'react-router-dom';
6464
import { SelectionBreadcrumbs } from './SelectionBreadcrumbs';
6565
import { HelpMenu } from './HelpMenu';
6666
import { AnnotationStore } from '../annotations/versioning/AnnotationStoreV2';
67-
import { supportedAnnotationStoreSchemaVersions } from '../annotations/versioning/expectedVersions';
67+
import { EXPECTED_ANNOTATION_STORE_SCHEMA_VERSION } from '../annotations/versioning/expectedVersions';
6868

6969
interface MenuBarProps {
7070
displayInferErrors: (errors: string[]) => void;
@@ -99,8 +99,7 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
9999
JSON.stringify(
100100
{
101101
...annotationStore,
102-
schemaVersion:
103-
supportedAnnotationStoreSchemaVersions[supportedAnnotationStoreSchemaVersions.length - 1],
102+
schemaVersion: EXPECTED_ANNOTATION_STORE_SCHEMA_VERSION,
104103
},
105104
null,
106105
4,

0 commit comments

Comments
 (0)