Skip to content

Commit 6abe8a3

Browse files
authored
Revert "Indicate vetting progress to users (#291)"
This reverts commit f703be0.
1 parent f703be0 commit 6abe8a3

4 files changed

Lines changed: 37 additions & 177 deletions

File tree

‎bats_ai/core/views/recording_annotation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def submit_recording_annotation(request: HttpRequest, id: int):
201201
annotation = RecordingAnnotation.objects.get(pk=id)
202202

203203
# Check permission
204-
if annotation.owner != request.user:
204+
if annotation.recording.owner != request.user:
205205
raise HttpError(403, 'Permission denied.')
206206

207207
annotation.submitted = True

‎client/src/components/RecordingList.vue‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ import { EditingRecording } from './UploadRecording.vue';
77
export default defineComponent({
88
setup() {
99
10-
const {
11-
sharedList,
12-
recordingList,
13-
currentUser,
14-
configuration,
15-
showSubmittedRecordings,
16-
myRecordingsDisplay,
17-
sharedRecordingsDisplay,
18-
} = useState();
10+
const { sharedList, recordingList, currentUser, configuration } = useState();
1911
const editingRecording: Ref<EditingRecording | null> = ref(null);
2012
2113
const fetchRecordings = async () => {
@@ -55,27 +47,18 @@ export default defineComponent({
5547
openPanel,
5648
userSubmittedAnnotation,
5749
configuration,
58-
myRecordingsDisplay,
59-
sharedRecordingsDisplay,
60-
showSubmittedRecordings,
6150
};
6251
},
6352
});
6453
</script>
6554

6655
<template>
6756
<v-expansion-panels v-model="openPanel">
68-
<v-checkbox
69-
v-if="configuration.mark_annotations_completed_enabled"
70-
v-model="showSubmittedRecordings"
71-
label="Show submitted recordings"
72-
hide-details
73-
/>
7457
<v-expansion-panel>
7558
<v-expansion-panel-title>My Recordings</v-expansion-panel-title>
7659
<v-expansion-panel-text>
7760
<div
78-
v-for="item in myRecordingsDisplay"
61+
v-for="item in recordingList"
7962
:key="`public_${item.id}`"
8063
>
8164
<v-card class="pa-2 my-2">

‎client/src/use/useState.ts‎

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { computed, ref, Ref, watch } from "vue";
1+
import { ref, Ref, watch } from "vue";
22
import { useRouter } from 'vue-router';
33
import { cloneDeep } from "lodash";
44
import * as d3 from "d3";
@@ -158,66 +158,6 @@ export default function useState() {
158158
return router.currentRoute.value.fullPath.includes('nabat');
159159
}
160160

161-
const showSubmittedRecordings = ref(false);
162-
163-
const submittedMyRecordings = computed(() => {
164-
const submittedByMe = recordingList.value.filter((recording: Recording) => {
165-
const myAnnotations = recording.fileAnnotations.filter((annotation: FileAnnotation) => (
166-
annotation.owner === currentUser.value && annotation.submitted
167-
));
168-
return myAnnotations.length > 0;
169-
});
170-
return submittedByMe;
171-
});
172-
173-
const submittedSharedRecordings = computed(() => {
174-
const submittedByMe = sharedList.value.filter((recording: Recording) => {
175-
const myAnnotations = recording.fileAnnotations.filter((annotation: FileAnnotation) => (
176-
annotation.owner === currentUser.value && annotation.submitted
177-
));
178-
return myAnnotations.length > 0;
179-
});
180-
return submittedByMe;
181-
});
182-
183-
const unsubmittedMyRecordings = computed(() => {
184-
const unsubmitted = recordingList.value.filter((recording: Recording) => {
185-
const myAnnotations = recording.fileAnnotations.filter((annotation: FileAnnotation) => (
186-
annotation.owner === currentUser.value && annotation.submitted
187-
));
188-
return myAnnotations.length === 0;
189-
});
190-
return unsubmitted;
191-
});
192-
193-
const unsubmittedSharedRecordings = computed(() => {
194-
const unsubmitted = sharedList.value.filter((recording: Recording) => {
195-
const myAnnotations = recording.fileAnnotations.filter((annotation: FileAnnotation) => (
196-
annotation.owner === currentUser.value && annotation.submitted
197-
));
198-
return myAnnotations.length === 0;
199-
});
200-
return unsubmitted;
201-
});
202-
203-
// Use state to determine which recordings should be shown to the user
204-
const myRecordingsDisplay = computed(() => {
205-
if (!configuration.value.mark_annotations_completed_enabled) {
206-
return recordingList.value;
207-
} else {
208-
return showSubmittedRecordings.value ? recordingList.value : unsubmittedMyRecordings.value;
209-
}
210-
});
211-
212-
const sharedRecordingsDisplay = computed(() => {
213-
if (!configuration.value.mark_annotations_completed_enabled) {
214-
return sharedList.value;
215-
} else {
216-
return showSubmittedRecordings.value ? sharedList.value : unsubmittedSharedRecordings.value;
217-
}
218-
});
219-
220-
221161

222162
return {
223163
annotationState,
@@ -261,12 +201,5 @@ export default function useState() {
261201
scaledHeight,
262202
fixedAxes,
263203
toggleFixedAxes,
264-
showSubmittedRecordings,
265-
submittedMyRecordings,
266-
submittedSharedRecordings,
267-
unsubmittedMyRecordings,
268-
unsubmittedSharedRecordings,
269-
myRecordingsDisplay,
270-
sharedRecordingsDisplay,
271204
};
272205
}

‎client/src/views/Recordings.vue‎

Lines changed: 33 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import RecordingAnnotationSummary from '@components/RecordingAnnotationSummary.v
2222
import { FilterFunction, InternalItem } from 'vuetify';
2323
2424
export default defineComponent({
25-
components: {
26-
UploadRecording,
27-
MapLocation,
28-
BatchUploadRecording,
29-
RecordingInfoDisplay,
30-
RecordingAnnotationSummary,
31-
},
25+
components: {
26+
UploadRecording,
27+
MapLocation,
28+
BatchUploadRecording,
29+
RecordingInfoDisplay,
30+
RecordingAnnotationSummary,
31+
},
3232
setup() {
3333
const itemsPerPage = ref(-1);
3434
const {
@@ -38,11 +38,6 @@ export default defineComponent({
3838
currentUser,
3939
configuration,
4040
loadCurrentUser,
41-
showSubmittedRecordings,
42-
submittedMyRecordings,
43-
submittedSharedRecordings,
44-
myRecordingsDisplay,
45-
sharedRecordingsDisplay,
4641
} = useState();
4742
const editingRecording: Ref<EditingRecording | null> = ref(null);
4843
let intervalRef: number | null = null;
@@ -236,14 +231,6 @@ export default defineComponent({
236231
}
237232
}
238233
239-
const recordingListStyles = computed(() => {
240-
const sectionHeight = configuration.value.mark_annotations_completed_enabled ? '35vh' : '40vh';
241-
return {
242-
'height': sectionHeight,
243-
'max-height': sectionHeight,
244-
};
245-
});
246-
247234
onMounted(async () => {
248235
await loadCurrentUser();
249236
await fetchRecordingTags();
@@ -321,12 +308,6 @@ export default defineComponent({
321308
dataLoading,
322309
submittedForCurrentUser,
323310
configuration,
324-
submittedMyRecordings,
325-
submittedSharedRecordings,
326-
recordingListStyles,
327-
showSubmittedRecordings,
328-
myRecordingsDisplay,
329-
sharedRecordingsDisplay,
330311
};
331312
},
332313
});
@@ -340,35 +321,26 @@ export default defineComponent({
340321
My Recordings
341322
</div>
342323
<v-spacer />
343-
<div class="d-flex justify-center align-center">
344-
<v-checkbox
345-
v-if="configuration.mark_annotations_completed_enabled"
346-
v-model="showSubmittedRecordings"
347-
class="mr-4"
348-
label="Show submitted recordings"
349-
hide-details
350-
/>
351-
<v-menu>
352-
<template #activator="{ props }">
353-
<v-btn
354-
color="primary"
355-
v-bind="props"
356-
>
357-
Upload <v-icon>mdi-chevron-down</v-icon>
358-
</v-btn>
359-
</template>
360-
<v-list>
361-
<v-list-item @click="uploadDialog=true">
362-
<v-list-item-title>Upload Recording</v-list-item-title>
363-
</v-list-item>
364-
<v-list-item @click="batchUploadDialog=true">
365-
<v-list-item-title>
366-
Batch Upload
367-
</v-list-item-title>
368-
</v-list-item>
369-
</v-list>
370-
</v-menu>
371-
</div>
324+
<v-menu>
325+
<template #activator="{ props }">
326+
<v-btn
327+
color="primary"
328+
v-bind="props"
329+
>
330+
Upload <v-icon>mdi-chevron-down</v-icon>
331+
</v-btn>
332+
</template>
333+
<v-list>
334+
<v-list-item @click="uploadDialog=true">
335+
<v-list-item-title>Upload Recording</v-list-item-title>
336+
</v-list-item>
337+
<v-list-item @click="batchUploadDialog=true">
338+
<v-list-item-title>
339+
Batch Upload
340+
</v-list-item-title>
341+
</v-list-item>
342+
</v-list>
343+
</v-menu>
372344
</v-row>
373345
</v-card-title>
374346
<v-card-text>
@@ -400,14 +372,13 @@ export default defineComponent({
400372
<v-data-table
401373
v-model:items-per-page="itemsPerPage"
402374
:headers="headers"
403-
:items="myRecordingsDisplay"
375+
:items="recordingList"
404376
:custom-filter="tagFilter"
405377
filter-keys="['tag']"
406378
:search="filterTags.length ? 'seach-active' : ''"
407379
density="compact"
408380
:loading="dataLoading"
409381
class="elevation-1 my-recordings"
410-
:style="recordingListStyles"
411382
>
412383
<template #top>
413384
<div max-height="100px">
@@ -553,21 +524,6 @@ export default defineComponent({
553524
</template>
554525
<template #bottom />
555526
</v-data-table>
556-
<div
557-
v-if="recordingList.length && configuration.mark_annotations_completed_enabled"
558-
class="d-flex justify-center align-center"
559-
>
560-
<v-progress-linear
561-
height="10"
562-
color="success"
563-
:model-value="submittedMyRecordings.length"
564-
min="0"
565-
:max="recordingList.length"
566-
/>
567-
<span class="ml-4 text-h6">
568-
({{ submittedMyRecordings.length }}/{{ recordingList.length }})
569-
</span>
570-
</div>
571527
</v-card-text>
572528
<v-dialog
573529
v-model="uploadDialog"
@@ -601,14 +557,13 @@ export default defineComponent({
601557
<v-data-table
602558
v-model:items-per-page="itemsPerPage"
603559
:headers="sharedHeaders"
604-
:items="sharedRecordingsDisplay"
560+
:items="sharedList"
605561
:custom-filter="sharedTagFilter"
606562
filter-keys="['tag']"
607563
:search="sharedFilterTags.length ? 'seach-active' : ''"
608564
:loading="dataLoading"
609565
density="compact"
610566
class="elevation-1 shared-recordings"
611-
:style="recordingListStyles"
612567
>
613568
<template #top>
614569
<div max-height="100px">
@@ -728,30 +683,19 @@ export default defineComponent({
728683
</template>
729684
<template #bottom />
730685
</v-data-table>
731-
<div
732-
v-if="sharedList.length && configuration.mark_annotations_completed_enabled"
733-
class="d-flex justify-center align-center"
734-
>
735-
<v-progress-linear
736-
height="10"
737-
color="success"
738-
:model-value="submittedSharedRecordings.length"
739-
min="0"
740-
:max="sharedList.length"
741-
/>
742-
<span class="ml-4 text-h6">
743-
({{ submittedSharedRecordings.length }}/{{ sharedList.length }})
744-
</span>
745-
</div>
746686
</v-card-text>
747687
</v-card>
748688
</template>
749689

750690
<style scoped>
751691
.my-recordings {
692+
height: 40vh;
693+
max-height: 40vh;
752694
overflow-y:scroll;
753695
}
754696
.shared-recordings {
697+
height: 40vh;
698+
max-height: 40vh;
755699
overflow-y:scroll;
756700
}
757701
</style>

0 commit comments

Comments
 (0)