From 1fa0ab618b09214ad9f4085474e7ff24eb4232f4 Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Wed, 4 Jan 2023 11:54:37 -0600 Subject: [PATCH] Use pickProps for prop-drilling in other components. --- frontend/vue/components/Public/FullPlayer.vue | 3 +- frontend/vue/components/Stations/Podcasts.vue | 5 +-- .../Stations/Podcasts/episodesViewProps.js | 15 ++++++-- .../Stations/Podcasts/listViewProps.js | 35 +++++++++++++++---- 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/frontend/vue/components/Public/FullPlayer.vue b/frontend/vue/components/Public/FullPlayer.vue index 070bd1fdc..22a03439b 100644 --- a/frontend/vue/components/Public/FullPlayer.vue +++ b/frontend/vue/components/Public/FullPlayer.vue @@ -8,7 +8,7 @@
@@ -59,6 +59,7 @@ import Icon from '~/components/Common/Icon'; import RadioPlayer from './Player.vue'; import {ref} from "vue"; import playerProps from "~/components/Public/playerProps"; +import {pickProps} from "~/functions/pickProps"; const props = defineProps({ ...playerProps, diff --git a/frontend/vue/components/Stations/Podcasts.vue b/frontend/vue/components/Stations/Podcasts.vue index 84ecaf543..99fb0e925 100644 --- a/frontend/vue/components/Stations/Podcasts.vue +++ b/frontend/vue/components/Stations/Podcasts.vue @@ -1,13 +1,13 @@ @@ -18,6 +18,7 @@ import ListView from './Podcasts/ListView'; import {ref} from "vue"; import episodesViewProps from "./Podcasts/episodesViewProps"; import listViewProps from "./Podcasts/listViewProps"; +import {pickProps} from "~/functions/pickProps"; const props = defineProps({ ...episodesViewProps, diff --git a/frontend/vue/components/Stations/Podcasts/episodesViewProps.js b/frontend/vue/components/Stations/Podcasts/episodesViewProps.js index 7b9f8da39..85a849458 100644 --- a/frontend/vue/components/Stations/Podcasts/episodesViewProps.js +++ b/frontend/vue/components/Stations/Podcasts/episodesViewProps.js @@ -1,5 +1,14 @@ export default { - locale: String, - stationTimeZone: String, - quotaUrl: String + locale: { + type: String, + required: true + }, + stationTimeZone: { + type: String, + required: true + }, + quotaUrl: { + type: String, + required: true + } } diff --git a/frontend/vue/components/Stations/Podcasts/listViewProps.js b/frontend/vue/components/Stations/Podcasts/listViewProps.js index 34b71abb2..bcb62f0ac 100644 --- a/frontend/vue/components/Stations/Podcasts/listViewProps.js +++ b/frontend/vue/components/Stations/Podcasts/listViewProps.js @@ -1,9 +1,30 @@ export default { - listUrl: String, - newArtUrl: String, - quotaUrl: String, - locale: String, - stationTimeZone: String, - languageOptions: Object, - categoriesOptions: Object + listUrl: { + type: String, + required: true + }, + newArtUrl: { + type: String, + required: true + }, + quotaUrl: { + type: String, + required: true + }, + locale: { + type: String, + required: true + }, + stationTimeZone: { + type: String, + required: true + }, + languageOptions: { + type: Object, + required: true + }, + categoriesOptions: { + type: Object, + required: true + } }