@@ -22,13 +22,13 @@ import RecordingAnnotationSummary from '@components/RecordingAnnotationSummary.v
2222import { FilterFunction , InternalItem } from ' vuetify' ;
2323
2424export 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 {
@@ -39,6 +39,10 @@ export default defineComponent({
3939 configuration,
4040 loadCurrentUser,
4141 showSubmittedRecordings,
42+ submittedMyRecordings,
43+ submittedSharedRecordings,
44+ myRecordingsDisplay,
45+ sharedRecordingsDisplay,
4246 } = useState ();
4347 const editingRecording: Ref <EditingRecording | null > = ref (null );
4448 let intervalRef: number | null = null ;
@@ -232,46 +236,6 @@ export default defineComponent({
232236 }
233237 }
234238
235- const submittedMyRecordings = computed (() => {
236- const submittedByMe = recordingList .value .filter ((recording : Recording ) => {
237- const myAnnotations = recording .fileAnnotations .filter ((annotation : FileAnnotation ) => (
238- annotation .owner === currentUser .value && annotation .submitted
239- ));
240- return myAnnotations .length > 0 ;
241- });
242- return submittedByMe ;
243- });
244-
245- const submittedSharedRecordings = computed (() => {
246- const submittedByMe = sharedList .value .filter ((recording : Recording ) => {
247- const myAnnotations = recording .fileAnnotations .filter ((annotation : FileAnnotation ) => (
248- annotation .owner === currentUser .value && annotation .submitted
249- ));
250- return myAnnotations .length > 0 ;
251- });
252- return submittedByMe ;
253- });
254-
255- const unsubmittedMyRecordings = computed (() => {
256- const unsubmitted = recordingList .value .filter ((recording : Recording ) => {
257- const myAnnotations = recording .fileAnnotations .filter ((annotation : FileAnnotation ) => (
258- annotation .owner === currentUser .value && annotation .submitted
259- ));
260- return myAnnotations .length === 0 ;
261- });
262- return unsubmitted ;
263- });
264-
265- const unsubmittedSharedRecordings = computed (() => {
266- const unsubmitted = sharedList .value .filter ((recording : Recording ) => {
267- const myAnnotations = recording .fileAnnotations .filter ((annotation : FileAnnotation ) => (
268- annotation .owner === currentUser .value && annotation .submitted
269- ));
270- return myAnnotations .length === 0 ;
271- });
272- return unsubmitted ;
273- });
274-
275239 const recordingListStyles = computed (() => {
276240 const sectionHeight = configuration .value .mark_annotations_completed_enabled ? ' 35vh' : ' 40vh' ;
277241 return {
@@ -359,10 +323,10 @@ export default defineComponent({
359323 configuration ,
360324 submittedMyRecordings ,
361325 submittedSharedRecordings ,
362- unsubmittedMyRecordings ,
363- unsubmittedSharedRecordings ,
364326 recordingListStyles ,
365327 showSubmittedRecordings ,
328+ myRecordingsDisplay ,
329+ sharedRecordingsDisplay ,
366330 };
367331 },
368332});
@@ -436,7 +400,7 @@ export default defineComponent({
436400 <v-data-table
437401 v-model:items-per-page =" itemsPerPage"
438402 :headers =" headers"
439- :items =" showSubmittedRecordings ? recordingList : unsubmittedMyRecordings "
403+ :items =" myRecordingsDisplay "
440404 :custom-filter =" tagFilter"
441405 filter-keys =" ['tag']"
442406 :search =" filterTags.length ? 'seach-active' : ''"
@@ -637,7 +601,7 @@ export default defineComponent({
637601 <v-data-table
638602 v-model:items-per-page =" itemsPerPage"
639603 :headers =" sharedHeaders"
640- :items =" showSubmittedRecordings ? sharedList : unsubmittedSharedRecordings "
604+ :items =" sharedRecordingsDisplay "
641605 :custom-filter =" sharedTagFilter"
642606 filter-keys =" ['tag']"
643607 :search =" sharedFilterTags.length ? 'seach-active' : ''"
0 commit comments