Skip to content

Commit bed84ab

Browse files
committed
[TODOs] Fix some
1 parent 16c2c14 commit bed84ab

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

src/components/home/PreviewProvider.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import type {
77
ShallowAnnotationSessionDto
88
} from '@/types/dtos/ShallowAnnotationSessionDto';
9+
import {
10+
computed
11+
} from 'vue';
912
import {
1013
useAnnotationSessionStore
1114
} from '@/ts/stores/annotationSessionStore';
@@ -14,6 +17,11 @@
1417
'session': ShallowAnnotationSessionDto
1518
}>();
1619
const annotationSessionStore = useAnnotationSessionStore();
20+
const unassignedCount = computed( () => {
21+
return props.session.annotationsMetaData
22+
? props.session.annotationsMetaData.total! - props.session.annotationsMetaData.done!
23+
: -1;
24+
} );
1725
</script>
1826

1927
<template>
@@ -35,7 +43,7 @@
3543
Word count
3644
</p>
3745
<p class="content">
38-
{{ 'N/A' }}
46+
N/A
3947
</p>
4048
</td>
4149
<td>
@@ -53,28 +61,26 @@
5361
Last modified on
5462
</p>
5563
<p class="content">
56-
{{ $props.session.lastEdited ? formatDateTime(new Date($props.session.lastEdited)) : 'N/A' }}
64+
{{ props.session.lastEdited ? formatDateTime(new Date(props.session.lastEdited)) : 'N/A' }}
5765
</p>
5866
</td>
5967
<td>
6068
<p class="title">
6169
Assigned
6270
</p>
6371
<p class="content">
64-
{{ props.session.annotationsMetaData ? $props.session.annotationsMetaData?.done : 'N/A' }}
72+
{{ props.session.annotationsMetaData ? props.session.annotationsMetaData?.done : 'N/A' }}
6573
</p>
6674
</td>
6775
<td>
6876
<p class="title">
6977
Unassigned
7078
</p>
71-
<!-- TODO: Set color class depending on value. (success on 0, warning > 0) -->
72-
<!-- Using v-if on props currently crashes after reload -->
7379
<p
7480
class="content information"
81+
:class="unassignedCount > 0 || unassignedCount == -1 ? 'warning' : 'sucess'"
7582
>
76-
{{ $props.session.annotationsMetaData
77-
? $props.session.annotationsMetaData.total! - $props.session.annotationsMetaData.done! : 'N/A' }}
83+
{{ unassignedCount > -1 ? unassignedCount : 'N/A' }}
7884
</p>
7985
</td>
8086
</tr>

src/editor/components/KeybindPane.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
{
3232
'keybind': 'Backspace',
33-
'function': 'Undo'
33+
'function': 'Delete annotation'
3434
},
3535
{
3636
'keybind': 'CTRL + SHIFT + Z',
@@ -55,6 +55,10 @@
5555
{
5656
'keybind': 'Delete',
5757
'function': 'Mark fixation as invalid'
58+
},
59+
{
60+
'keybind': 'Enter',
61+
'function': '(hold) Show assignments of all algorithms'
5862
}
5963
];
6064
const show = defineModel<boolean>();

src/editor/io/keyboard.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export const keyboardHandler = ( renderer: Renderer ) => {
101101
);
102102
} catch { /* empty */ }
103103
} else if ( ev.key === 'Delete' ) {
104-
// TODO: Update this keybind if needed
105104
ev.preventDefault();
106105
annotation.markAsInvalid( selectedFixation.value );
107106
} else if ( ev.key === 'Enter' ) {

src/editor/loaders/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const loadEditorDataFromBackend = async ( renderer: Renderer ) => {
8080

8181
if ( annotationLoad )
8282
annotationLoad.forEach( annotation => {
83-
// TODO: Need algorithm name. Editor's Annotation object already supports it
8483
const ann: EditorAnnotation = {
8584
'fixationIdx': getFixIdxFromId( annotation.fixation!.id! ),
8685
'boxIdx': getBoxIdxFromId( annotation.characterBoundingBox!.id! )
@@ -90,6 +89,7 @@ export const loadEditorDataFromBackend = async ( renderer: Renderer ) => {
9089

9190
if ( annotation.annotationType === 'MACHINE_ANNOTATED' ) {
9291
userAnnotations.value.push( ann );
92+
ann.algorithm = 'default';
9393
}
9494

9595
annotations.value.push( ann );

src/editor/manager/history.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ const startHistoryTracker = ( renderer: Renderer, annotation: AnnotationManager
5858
} else {
5959
fixations.value[ last.annotation.fixationIdx ]!.assigned = 'unassigned';
6060
}
61+
62+
renderer.renderLines.render();
63+
renderer.renderFixations.render();
6164
};
6265

6366
const add = ( annotation: EditorAnnotation, selectedFixation: number ) => {
@@ -112,6 +115,7 @@ const startHistoryTracker = ( renderer: Renderer, annotation: AnnotationManager
112115
selectedFixation.value = last.selectedFixation + 1;
113116

114117
renderer.renderLines.render();
118+
renderer.renderFixations.render();
115119
};
116120

117121
onMounted( () => {

0 commit comments

Comments
 (0)