diff --git a/client/src/App.vue b/client/src/App.vue index 5f2bedb..6eaeec7 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,17 +1,27 @@ @@ -42,9 +64,9 @@ export default defineComponent({ Recordings + + Spectrogram + + + + + Next Sharedmdi-chevron-right + + + + + Name:{{ nextShared.name }} + + + Owner:{{ nextShared.owner_username }} + + + {{ loginText }} diff --git a/client/src/components/AnnotationList.vue b/client/src/components/AnnotationList.vue index 88224ce..a814662 100644 --- a/client/src/components/AnnotationList.vue +++ b/client/src/components/AnnotationList.vue @@ -3,10 +3,12 @@ import { defineComponent, PropType } from "vue"; import { SpectroInfo } from './geoJS/geoJSUtils'; import useState from "../use/useState"; import { watch, ref } from "vue"; +import RecordingList from "./RecordingList.vue"; export default defineComponent({ name: "AnnotationList", components: { + RecordingList, }, props: { spectroInfo: { @@ -36,9 +38,13 @@ export default defineComponent({ // eslint-disable-next-line @typescript-eslint/no-explicit-any const tabSwitch = (event: any) => { // On tab switches we want to deselect the curret anntation - tab.value = event as 'sequence' | 'pulse'; - selectedType.value = event as 'sequence' | 'pulse'; - selectedId.value = null; + if (['sequence', 'pulse'].includes(event)) { + tab.value = event as 'sequence' | 'pulse'; + selectedType.value = event as 'sequence' | 'pulse'; + selectedId.value = null; + } else { + tab.value = 'recordings'; + } }; return { @@ -60,20 +66,38 @@ export default defineComponent({ - - - Pulse - - - Sequence - - + + + + Recordings + + + Pulse + + + Sequence + + + + + + diff --git a/client/src/components/RecordingList.vue b/client/src/components/RecordingList.vue new file mode 100644 index 0000000..b8d5433 --- /dev/null +++ b/client/src/components/RecordingList.vue @@ -0,0 +1,171 @@ + + + + + + My Recordings + + + + + Name + + Public + Annotations + + + + + + + {{ item.name }} + + + + + mdi-check + + + mdi-close + + + + + {{ item.userAnnotations }} + + + + + + + + Public + + + + + + Name + + Owner + Annotated + + + + + + + {{ item.name }} + + + + + {{ item.owner_username }} + + + + + + mdi-check + + + mdi-close + + + + + + + + + + + \ No newline at end of file diff --git a/client/src/use/useState.ts b/client/src/use/useState.ts index 4c0ded3..c9db949 100644 --- a/client/src/use/useState.ts +++ b/client/src/use/useState.ts @@ -1,7 +1,7 @@ -import { ref, Ref } from "vue"; +import { ref, Ref, watch } from "vue"; import { cloneDeep } from "lodash"; import * as d3 from "d3"; -import { OtherUserAnnotations, SpectrogramAnnotation, SpectrogramTemporalAnnotation } from "../api/api"; +import { OtherUserAnnotations, Recording, SpectrogramAnnotation, SpectrogramTemporalAnnotation } from "../api/api"; const annotationState: Ref = ref(""); const creationType: Ref<'pulse' | 'sequence'> = ref("pulse"); @@ -15,6 +15,9 @@ const selectedType: Ref<'pulse' | 'sequence'> = ref('pulse'); const annotations : Ref = ref([]); const temporalAnnotations: Ref = ref([]); const otherUserAnnotations: Ref = ref({}); +const sharedList: Ref = ref([]); +const recordingList: Ref = ref([]); +const nextShared: Ref = ref(false); type AnnotationState = "" | "editing" | "creating" | "disabled"; export default function useState() { @@ -50,6 +53,15 @@ export default function useState() { selectedType.value = annotationType; } } + watch(sharedList, () => { + const filtered = sharedList.value.filter((item) => !item.userMadeAnnotations); + if (filtered.length > 0) { + nextShared.value = filtered[0]; + } else { + nextShared.value = false; + } + }); + return { annotationState, creationType, @@ -68,5 +80,8 @@ export default function useState() { otherUserAnnotations, selectedId, selectedType, + sharedList, + recordingList, + nextShared, }; } diff --git a/client/src/views/Recordings.vue b/client/src/views/Recordings.vue index 5df166c..8a8a344 100644 --- a/client/src/views/Recordings.vue +++ b/client/src/views/Recordings.vue @@ -6,6 +6,7 @@ import { } from "vuetify/labs/VDataTable"; import UploadRecording, { EditingRecording } from '../components/UploadRecording.vue'; import MapLocation from '../components/MapLocation.vue'; +import useState from '../use/useState'; export default defineComponent({ components: { @@ -15,8 +16,7 @@ export default defineComponent({ }, setup() { const itemsPerPage = ref(-1); - const recordingList: Ref = ref([]); - const sharedList: Ref = ref([]); + const { sharedList, recordingList } = useState(); const editingRecording: Ref = ref(null); let intervalRef: number | null = null; @@ -227,7 +227,7 @@ export default defineComponent({ mdi-map - + sharedList { toggleLayerVisibility("grid"); }); + watch(() => props.id, () => { + loadData(); + }); onMounted(() => loadData()); // eslint-disable-next-line @typescript-eslint/no-explicit-any const parentGeoViewerRef: Ref = ref(null); @@ -353,7 +356,7 @@ export default defineComponent({ @selected="setSelection($event)" /> - +