From b006df1e2dd88e0b11f140134314b898c07bd32f Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Wed, 15 Jan 2025 20:47:01 -0600 Subject: [PATCH] Even more TS work and fixes. --- frontend/components/Account/ApiKeyModal.vue | 3 +- .../components/Admin/Stations/StationForm.vue | 2 - frontend/components/Common/AudioPlayer.vue | 1 - frontend/components/Common/Avatar.vue | 2 - frontend/components/Common/BitrateOptions.vue | 19 +- frontend/components/Common/CardPage.vue | 1 - .../Common/Charts/TimeSeriesChart.vue | 2 +- frontend/components/Common/Dialog.vue | 2 +- frontend/components/Common/GridLayout.vue | 2 - frontend/components/Common/Modal.vue | 3 +- frontend/components/Common/ModalForm.vue | 3 +- frontend/components/Common/PaginationItem.vue | 1 - frontend/components/Common/PlayButton.vue | 5 +- frontend/components/Common/Tab.vue | 8 +- frontend/components/Common/Tabs.vue | 1 - frontend/components/Common/TimeCode.vue | 10 +- frontend/components/Common/Toast.vue | 1 - frontend/components/Common/Waveform.vue | 15 +- .../components/Form/FormGroupCheckbox.vue | 10 +- frontend/components/Form/FormGroupField.vue | 59 +- .../components/Form/FormGroupMultiCheck.vue | 17 +- frontend/components/Form/FormGroupSelect.vue | 12 +- frontend/components/Form/useFormField.ts | 48 +- frontend/components/Recover.vue | 13 +- .../Stations/Branding/BrandingForm.vue | 14 +- .../Stations/HlsStreams/Form/BasicInfo.vue | 2 +- frontend/components/Stations/Media.vue | 31 +- .../components/Stations/Media/EditModal.vue | 6 +- .../Stations/Media/MediaToolbar.vue | 7 +- .../Stations/Media/MoveFilesModal.vue | 3 +- .../Stations/Playlists/Form/BasicInfo.vue | 2 +- .../Stations/Podcasts/PodcastEditModal.vue | 5 +- .../Podcasts/PodcastForm/BasicInfo.vue | 5 +- .../Stations/Profile/StreamsPanel.vue | 3 +- .../Stations/Remotes/Form/BasicInfo.vue | 1 + frontend/components/Stations/SftpUsers.vue | 8 +- frontend/components/Stations/Streamers.vue | 3 +- .../Stations/Streamers/ConnectionInfo.vue | 11 +- .../Stations/Webhooks/EditModal.vue | 2 +- frontend/functions/useBaseEditModal.ts | 2 +- frontend/functions/useChart.ts | 24 +- frontend/functions/useNowPlaying.ts | 6 +- frontend/functions/useVuelidateOnForm.ts | 10 +- frontend/functions/useVuelidateOnFormTab.ts | 21 +- frontend/vendor/gettext.ts | 1 + package-lock.json | 768 ++++++++++-------- package.json | 2 +- 47 files changed, 668 insertions(+), 509 deletions(-) diff --git a/frontend/components/Account/ApiKeyModal.vue b/frontend/components/Account/ApiKeyModal.vue index a39f44fcfc8..6304b6ef95f 100644 --- a/frontend/components/Account/ApiKeyModal.vue +++ b/frontend/components/Account/ApiKeyModal.vue @@ -74,6 +74,7 @@ import {useVuelidateOnForm} from "~/functions/useVuelidateOnForm"; import {useAxios} from "~/vendor/axios"; import Modal from "~/components/Common/Modal.vue"; import {ModalTemplateRef, useHasModal} from "~/functions/useHasModal.ts"; +import {ComponentExposed} from "vue-component-type-helpers"; const props = defineProps<{ createUrl: string, @@ -107,7 +108,7 @@ const create = () => { show(); }; -const $field = ref | null>(null); +const $field = ref | null>(null); const onShown = () => { nextTick(() => { diff --git a/frontend/components/Admin/Stations/StationForm.vue b/frontend/components/Admin/Stations/StationForm.vue index 1f6c748319c..eca6cafdf23 100644 --- a/frontend/components/Admin/Stations/StationForm.vue +++ b/frontend/components/Admin/Stations/StationForm.vue @@ -116,8 +116,6 @@ const props = withDefaults( isRsasInstalled: false, isShoutcastInstalled: false, isStereoToolInstalled: false, - createUrl: null, - editUrl: null, isModal: false } ); diff --git a/frontend/components/Common/AudioPlayer.vue b/frontend/components/Common/AudioPlayer.vue index 944ff76ce86..44b035694dd 100644 --- a/frontend/components/Common/AudioPlayer.vue +++ b/frontend/components/Common/AudioPlayer.vue @@ -20,7 +20,6 @@ const props = withDefaults( isMuted?: boolean }>(), { - title: null, volume: 55, isMuted: false } diff --git a/frontend/components/Common/Avatar.vue b/frontend/components/Common/Avatar.vue index 66cb757afc2..0e7341ec7a1 100644 --- a/frontend/components/Common/Avatar.vue +++ b/frontend/components/Common/Avatar.vue @@ -27,8 +27,6 @@ const props = withDefaults( width?: number }>(), { - service: null, - serviceUrl: null, width: 64 } ); diff --git a/frontend/components/Common/BitrateOptions.vue b/frontend/components/Common/BitrateOptions.vue index 1847fdc077d..59488169420 100644 --- a/frontend/components/Common/BitrateOptions.vue +++ b/frontend/components/Common/BitrateOptions.vue @@ -70,8 +70,8 @@ - diff --git a/frontend/components/Common/GridLayout.vue b/frontend/components/Common/GridLayout.vue index fcf3d1eb23a..db94f8e0350 100644 --- a/frontend/components/Common/GridLayout.vue +++ b/frontend/components/Common/GridLayout.vue @@ -77,8 +77,6 @@ export interface GridLayoutProps { } const props = withDefaults(defineProps(), { - id: null, - apiUrl: null, paginated: false, loading: false, hideOnLoading: true, diff --git a/frontend/components/Common/Modal.vue b/frontend/components/Common/Modal.vue index fc39b6f38c0..cb30868bfca 100644 --- a/frontend/components/Common/Modal.vue +++ b/frontend/components/Common/Modal.vue @@ -67,8 +67,7 @@ const props = withDefaults( { active: false, busy: false, - size: 'md', - title: null + size: 'md' } ); diff --git a/frontend/components/Common/ModalForm.vue b/frontend/components/Common/ModalForm.vue index 93315b7f082..1a8d15d8c42 100644 --- a/frontend/components/Common/ModalForm.vue +++ b/frontend/components/Common/ModalForm.vue @@ -89,8 +89,7 @@ const props = withDefaults( id: 'edit-modal', loading: false, disableSaveButton: false, - noEnforceFocus: false, - error: null + noEnforceFocus: false } ); diff --git a/frontend/components/Common/PaginationItem.vue b/frontend/components/Common/PaginationItem.vue index 4221e2ee6ba..bcd4c43aabc 100644 --- a/frontend/components/Common/PaginationItem.vue +++ b/frontend/components/Common/PaginationItem.vue @@ -33,7 +33,6 @@ const props = withDefaults( }>(), { page: 1, - label: null, active: false, disabled: false, } diff --git a/frontend/components/Common/PlayButton.vue b/frontend/components/Common/PlayButton.vue index 065f977f450..42f71ad7dc5 100644 --- a/frontend/components/Common/PlayButton.vue +++ b/frontend/components/Common/PlayButton.vue @@ -26,12 +26,11 @@ const props = withDefaults( url: string, isStream?: boolean, isHls?: boolean, - iconClass?: stringm + iconClass?: string }>(), { isStream: false, - isHls: false, - iconClass: null + isHls: false } ); diff --git a/frontend/components/Common/Tab.vue b/frontend/components/Common/Tab.vue index 7147b52df3c..ebff756a02c 100644 --- a/frontend/components/Common/Tab.vue +++ b/frontend/components/Common/Tab.vue @@ -11,13 +11,7 @@ diff --git a/frontend/components/Common/Tabs.vue b/frontend/components/Common/Tabs.vue index 747f1d17151..83c3e3dfc42 100644 --- a/frontend/components/Common/Tabs.vue +++ b/frontend/components/Common/Tabs.vue @@ -42,7 +42,6 @@ import {TabParentProps, useTabParent} from "~/functions/tabs.ts"; const props = withDefaults( defineProps(), { - modelValue: null, navTabsClass: 'nav-tabs', contentClass: 'mt-3', destroyOnHide: false, diff --git a/frontend/components/Common/TimeCode.vue b/frontend/components/Common/TimeCode.vue index b82f7c72778..9033021b921 100644 --- a/frontend/components/Common/TimeCode.vue +++ b/frontend/components/Common/TimeCode.vue @@ -15,7 +15,7 @@ import {isEmpty, padStart} from 'lodash'; const props = withDefaults( defineProps<{ - modelValue?: string + modelValue?: string | number | null }>(), { modelValue: null, @@ -23,19 +23,19 @@ const props = withDefaults( ); const emit = defineEmits<{ - (e: 'update:modelValue', value: string | null): void + (e: 'update:modelValue', value: number | null): void }>(); -const parseTimeCode = (timeCode) => { +const parseTimeCode = (timeCode: string | number | null) => { if (timeCode !== '' && timeCode !== null) { - timeCode = padStart(timeCode, 4, '0'); + timeCode = padStart(String(timeCode), 4, '0'); return timeCode.substring(0, 2) + ':' + timeCode.substring(2); } return null; } -const convertToTimeCode = (time) => { +const convertToTimeCode = (time: string): number | null => { if (isEmpty(time)) { return null; } diff --git a/frontend/components/Common/Toast.vue b/frontend/components/Common/Toast.vue index 4f3ead6aab1..e892a24eeac 100644 --- a/frontend/components/Common/Toast.vue +++ b/frontend/components/Common/Toast.vue @@ -53,7 +53,6 @@ const props = withDefaults( variant?: string, }>(), { - title: null, variant: 'info', } ); diff --git a/frontend/components/Common/Waveform.vue b/frontend/components/Common/Waveform.vue index fdfdb7433d5..99b108e7ba4 100644 --- a/frontend/components/Common/Waveform.vue +++ b/frontend/components/Common/Waveform.vue @@ -66,16 +66,11 @@ import usePlayerVolume from "~/functions/usePlayerVolume"; import useShowVolume from "~/functions/useShowVolume.ts"; import MuteButton from "~/components/Common/MuteButton.vue"; -const props = withDefaults( - defineProps<{ - audioUrl: string, - waveformUrl: string, - waveformCacheUrl?: string, - }>(), - { - waveformCacheUrl: null - } -); +const props = defineProps<{ + audioUrl: string, + waveformUrl: string, + waveformCacheUrl?: string, +}>(); const emit = defineEmits(['ready']); diff --git a/frontend/components/Form/FormGroupCheckbox.vue b/frontend/components/Form/FormGroupCheckbox.vue index e210fe4fdc0..743f466b32a 100644 --- a/frontend/components/Form/FormGroupCheckbox.vue +++ b/frontend/components/Form/FormGroupCheckbox.vue @@ -51,15 +51,15 @@ - diff --git a/frontend/components/Form/FormGroupField.vue b/frontend/components/Form/FormGroupField.vue index e4fc25245f8..e221ca972ad 100644 --- a/frontend/components/Form/FormGroupField.vue +++ b/frontend/components/Form/FormGroupField.vue @@ -5,17 +5,14 @@ >