@saooti/octopus-sdk 40.2.19 → 41.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section
|
|
3
|
-
v-if="(filterOrgaId || organisationId) && radio.length"
|
|
3
|
+
v-if="(filterStore.filterOrgaId || organisationId) && radio.length"
|
|
4
4
|
class="d-flex flex-column align-items-start mt-3"
|
|
5
5
|
>
|
|
6
6
|
<h2 class="mb-0 mb-3">
|
|
7
|
-
{{
|
|
7
|
+
{{ t("Radio") }}
|
|
8
8
|
</h2>
|
|
9
9
|
<template v-if="radio.length">
|
|
10
10
|
<RadioItem
|
|
@@ -16,63 +16,49 @@
|
|
|
16
16
|
</section>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
|
-
<script lang="ts">
|
|
19
|
+
<script setup lang="ts">
|
|
20
20
|
import RadioItem from "./RadioItem.vue";
|
|
21
21
|
import {useErrorHandler} from "../../composable/useErrorHandler";
|
|
22
22
|
import classicApi from "../../../api/classicApi";
|
|
23
23
|
import { useFilterStore } from "../../../stores/FilterStore";
|
|
24
|
-
import { mapState } from "pinia";
|
|
25
24
|
import { Canal } from "@/stores/class/radio/canal";
|
|
26
|
-
import {
|
|
25
|
+
import { computed, Ref, ref, watch } from "vue";
|
|
27
26
|
import { AxiosError } from "axios";
|
|
28
|
-
|
|
29
|
-
name: "Ecbd98d979bd4312Ad5eFc7c1c4a191c",
|
|
30
|
-
components: {
|
|
31
|
-
RadioItem,
|
|
32
|
-
},
|
|
27
|
+
import { useI18n } from "vue-i18n";
|
|
33
28
|
|
|
34
|
-
props: {
|
|
35
|
-
organisationId: { default: undefined, type: String },
|
|
36
|
-
},
|
|
37
|
-
setup(){
|
|
38
|
-
const {handle403} = useErrorHandler();
|
|
39
|
-
return { handle403 }
|
|
40
|
-
},
|
|
41
|
-
data() {
|
|
42
|
-
return {
|
|
43
|
-
radio: [] as Array<Canal>,
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})
|
|
30
|
+
//Props
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
organisationId: { default: undefined, type: String },
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
//Data
|
|
36
|
+
const radio: Ref<Array<Canal>> = ref([]);
|
|
37
|
+
|
|
38
|
+
//Composables
|
|
39
|
+
const { t } = useI18n();
|
|
40
|
+
const {handle403} = useErrorHandler();
|
|
41
|
+
const filterStore = useFilterStore();
|
|
42
|
+
|
|
43
|
+
//Computed
|
|
44
|
+
const filterOrgaUsed = computed(() => filterStore.filterOrgaId ? filterStore.filterOrgaId : props.organisationId);
|
|
45
|
+
|
|
46
|
+
//Watch
|
|
47
|
+
watch(filterOrgaUsed, () =>fetchContent(), {immediate: true});
|
|
48
|
+
|
|
49
|
+
//Methods
|
|
50
|
+
async function fetchContent(): Promise<void> {
|
|
51
|
+
radio.value.length = 0;
|
|
52
|
+
if (!filterOrgaUsed.value) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
radio.value = await classicApi.fetchData<Array<Canal>>({
|
|
57
|
+
api: 14,
|
|
58
|
+
path: "canal/orga/" + filterOrgaUsed.value + "/",
|
|
59
|
+
});
|
|
60
|
+
} catch (error) {
|
|
61
|
+
handle403(error as AxiosError);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
78
64
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="module-box">
|
|
3
3
|
<h2 class="mb-3">
|
|
4
|
-
{{
|
|
4
|
+
{{ t("Program") }}
|
|
5
5
|
</h2>
|
|
6
6
|
<div class="py-3">
|
|
7
7
|
<div class="d-flex align-items-center w-100 mb-3">
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
19
19
|
<button v-if="isPhone" class="btn btn-primary mb-3 mx-0" @click="showAllDays = !showAllDays">
|
|
20
|
-
<template v-if="!showAllDays">{{
|
|
21
|
-
<template v-else>{{
|
|
20
|
+
<template v-if="!showAllDays">{{ t('Show more days') }}</template>
|
|
21
|
+
<template v-else>{{ t('Show fewer days') }}</template>
|
|
22
22
|
</button>
|
|
23
23
|
<div
|
|
24
24
|
class="d-flex align-items-center justify-content-center border-bottom"
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
{{ period.title }}
|
|
33
33
|
</button>
|
|
34
34
|
<button class="btn btn-underline mb-2" @click="changePeriodNow">
|
|
35
|
-
{{
|
|
35
|
+
{{ t("Now") }}
|
|
36
36
|
</button>
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
39
|
<div class="d-flex flex-column p-3">
|
|
40
40
|
<ClassicLoading
|
|
41
|
-
:loading-text="loading ?
|
|
42
|
-
:error-text="error ?
|
|
41
|
+
:loading-text="loading ? t('Loading content ...') : undefined"
|
|
42
|
+
:error-text="error ? t(`Error`) : undefined"
|
|
43
43
|
/>
|
|
44
44
|
<template v-if="!loading && !error">
|
|
45
45
|
<div v-if="!planningLength[daySelected]" class="text-center">
|
|
46
|
-
{{
|
|
46
|
+
{{ t("No programming") }}
|
|
47
47
|
</div>
|
|
48
48
|
<div v-for="period in periodOfDay" v-else :key="period.id">
|
|
49
49
|
<template v-if="planning[daySelected][period.id].length">
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
name: 'podcast',
|
|
74
74
|
params: { podcastId: planningItem.podcastId },
|
|
75
75
|
}"
|
|
76
|
-
:title="
|
|
76
|
+
:title="t('Episode name page', { name: planningItem.title })"
|
|
77
77
|
>
|
|
78
78
|
<img
|
|
79
79
|
v-lazy="
|
|
@@ -82,10 +82,11 @@
|
|
|
82
82
|
width="150"
|
|
83
83
|
height="150"
|
|
84
84
|
class="m-2 program-item-img"
|
|
85
|
-
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
alt=""
|
|
86
87
|
|
|
87
88
|
:title="
|
|
88
|
-
|
|
89
|
+
t('Episode name image', {
|
|
89
90
|
name: planningItem.podcastData.title,
|
|
90
91
|
})
|
|
91
92
|
"
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
v-if="planningItem.liveId"
|
|
97
98
|
class="bg-complementary text-white p-1 me-1"
|
|
98
99
|
>
|
|
99
|
-
{{
|
|
100
|
+
{{ t("Live") }}
|
|
100
101
|
</div>
|
|
101
102
|
<div class="flex-grow-1 fw-bold">
|
|
102
103
|
{{ planningItem.podcastData.title }}
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
</section>
|
|
114
115
|
</template>
|
|
115
116
|
|
|
116
|
-
<script lang="ts">
|
|
117
|
+
<script setup lang="ts">
|
|
117
118
|
import dayjs from "dayjs";
|
|
118
119
|
import utc from "dayjs/plugin/utc";
|
|
119
120
|
dayjs.extend(utc);
|
|
@@ -121,234 +122,221 @@ import classicApi from "../../../api/classicApi";
|
|
|
121
122
|
import {useImageProxy} from "../../composable/useImageProxy";
|
|
122
123
|
import {useResizePhone} from "../../composable/useResizePhone";
|
|
123
124
|
import ClassicLoading from "../../form/ClassicLoading.vue";
|
|
124
|
-
import {
|
|
125
|
+
import { computed, nextTick, onMounted, ref, Ref } from "vue";
|
|
125
126
|
import { Canal } from "@/stores/class/radio/canal";
|
|
126
127
|
import { PlanningOccurrence } from "@/stores/class/radio/recurrence";
|
|
127
128
|
import { PlanningLive } from "@/stores/class/radio/live";
|
|
128
|
-
|
|
129
|
-
name: "RadioPlanning",
|
|
129
|
+
import { useI18n } from "vue-i18n";
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
131
|
+
//Props
|
|
132
|
+
const props = defineProps({
|
|
133
|
+
radio: { default: undefined, type: Object as () => Canal },
|
|
134
|
+
})
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
//Data
|
|
137
|
+
const planning: Ref<{
|
|
138
|
+
[key: number]: {
|
|
139
|
+
morning: Array<PlanningOccurrence | PlanningLive>;
|
|
140
|
+
afternoon: Array<PlanningOccurrence | PlanningLive>;
|
|
141
|
+
evening: Array<PlanningOccurrence | PlanningLive>;
|
|
142
|
+
};
|
|
143
|
+
}> = ref({});
|
|
144
|
+
const planningLength: Ref<{ [key: number]: number }> = ref({});
|
|
145
|
+
const daySelected = ref(dayjs().valueOf());
|
|
146
|
+
const arrayDays: Ref<Array<{
|
|
147
|
+
title: string;
|
|
148
|
+
date: number;
|
|
149
|
+
dayOfWeek: string;
|
|
150
|
+
iso: string;
|
|
151
|
+
}>> = ref([]);
|
|
152
|
+
const loading = ref(true);
|
|
153
|
+
const error = ref(false);
|
|
154
|
+
const showAllDays = ref(false);
|
|
138
155
|
|
|
139
156
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
157
|
+
//Composables
|
|
158
|
+
const { t } = useI18n();
|
|
159
|
+
const { isPhone } = useResizePhone();
|
|
160
|
+
const { useProxyImageUrl } = useImageProxy();
|
|
145
161
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
date: number;
|
|
160
|
-
dayOfWeek: string;
|
|
161
|
-
iso: string;
|
|
162
|
-
}>,
|
|
163
|
-
loading: true as boolean,
|
|
164
|
-
error: false as boolean,
|
|
165
|
-
showAllDays: false as boolean
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
computed: {
|
|
170
|
-
startOfDay(): string {
|
|
171
|
-
return dayjs(this.daySelected).startOf("date").toISOString();
|
|
172
|
-
},
|
|
173
|
-
endOfDay(): string {
|
|
174
|
-
return dayjs(this.daySelected).endOf("date").toISOString();
|
|
162
|
+
//Computed
|
|
163
|
+
const startOfDay = computed(() => dayjs(daySelected.value).startOf("date").toISOString());
|
|
164
|
+
const endOfDay = computed(() => dayjs(daySelected.value).endOf("date").toISOString());
|
|
165
|
+
const periodOfDay = computed(() => {
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
id: "morning",
|
|
169
|
+
title: t("Morning"),
|
|
170
|
+
end: dayjs(daySelected.value)
|
|
171
|
+
.hour(14)
|
|
172
|
+
.minute(0)
|
|
173
|
+
.second(0)
|
|
174
|
+
.millisecond(0),
|
|
175
175
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
.second(0)
|
|
185
|
-
.millisecond(0),
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: "afternoon",
|
|
189
|
-
title: this.$t("Afternoon"),
|
|
190
|
-
end: dayjs(this.daySelected)
|
|
191
|
-
.hour(19)
|
|
192
|
-
.minute(0)
|
|
193
|
-
.second(0)
|
|
194
|
-
.millisecond(0),
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
id: "evening",
|
|
198
|
-
title: this.$t("Evening"),
|
|
199
|
-
end: dayjs(this.daySelected).endOf("date"),
|
|
200
|
-
},
|
|
201
|
-
];
|
|
176
|
+
{
|
|
177
|
+
id: "afternoon",
|
|
178
|
+
title: t("Afternoon"),
|
|
179
|
+
end: dayjs(daySelected.value)
|
|
180
|
+
.hour(19)
|
|
181
|
+
.minute(0)
|
|
182
|
+
.second(0)
|
|
183
|
+
.millisecond(0),
|
|
202
184
|
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return this.arrayDays;
|
|
185
|
+
{
|
|
186
|
+
id: "evening",
|
|
187
|
+
title: t("Evening"),
|
|
188
|
+
end: dayjs(daySelected.value).endOf("date"),
|
|
208
189
|
},
|
|
209
|
-
|
|
190
|
+
];
|
|
191
|
+
});
|
|
192
|
+
const displayArrayDays = computed(() => {
|
|
193
|
+
if(isPhone && !showAllDays.value){
|
|
194
|
+
return arrayDays.value.slice(6, 9);
|
|
195
|
+
}
|
|
196
|
+
return arrayDays.value;
|
|
197
|
+
});
|
|
210
198
|
|
|
211
|
-
mounted() {
|
|
212
|
-
this.createArrayDays();
|
|
213
|
-
this.fetchOccurrences();
|
|
214
|
-
},
|
|
215
199
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
200
|
+
onMounted(()=>{
|
|
201
|
+
createArrayDays();
|
|
202
|
+
fetchOccurrences();
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
//Mounted
|
|
207
|
+
function scrollToElement(id: string) {
|
|
208
|
+
const element = document.getElementById(id);
|
|
209
|
+
if (element) {
|
|
210
|
+
const yOffset = -110;
|
|
211
|
+
const y =
|
|
212
|
+
element.getBoundingClientRect().top + window.scrollY + yOffset;
|
|
213
|
+
window.scrollTo({ top: y, behavior: "smooth" });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function changePeriodNow() {
|
|
217
|
+
const now = dayjs();
|
|
218
|
+
if (!dayjs(daySelected.value).isSame(now, "day")) {
|
|
219
|
+
changeDate(arrayDays.value[7].date);
|
|
220
|
+
}
|
|
221
|
+
nextTick(() => {
|
|
222
|
+
if (!planningLength.value[daySelected.value]) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const arrayOccurrences = Object.values(
|
|
226
|
+
planning.value[daySelected.value],
|
|
227
|
+
).reduce((r, c) => r.concat(c), []);
|
|
228
|
+
let selectedOccurrence = arrayOccurrences[0];
|
|
229
|
+
for (const occ of arrayOccurrences) {
|
|
230
|
+
selectedOccurrence = occ;
|
|
231
|
+
if (dayjs(occ.endDate).isAfter(now)) {
|
|
232
|
+
break;
|
|
230
233
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
234
|
+
}
|
|
235
|
+
scrollToElement(
|
|
236
|
+
"planning-occurrence-" +
|
|
237
|
+
selectedOccurrence.occurrenceId +
|
|
238
|
+
"" +
|
|
239
|
+
selectedOccurrence.liveId,
|
|
240
|
+
);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function createArrayDays() {
|
|
244
|
+
for (let index = -7; index < 3; index++) {
|
|
245
|
+
const dayToAdd = dayjs().add(index, "day");
|
|
246
|
+
if (0 === index) {
|
|
247
|
+
daySelected.value = dayToAdd.valueOf();
|
|
248
|
+
}
|
|
249
|
+
arrayDays.value.push({
|
|
250
|
+
title: dayToAdd.format("D/MM"),
|
|
251
|
+
dayOfWeek: dayToAdd.format("dddd"),
|
|
252
|
+
date: dayToAdd.valueOf(),
|
|
253
|
+
iso: dayToAdd.format("MM-DD"),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function fetchOccurrencesAndLives(): Promise<
|
|
258
|
+
Array<PlanningOccurrence | PlanningLive>
|
|
259
|
+
> {
|
|
260
|
+
const params = {
|
|
261
|
+
canalId: props.radio?.id,
|
|
262
|
+
from:startOfDay.value,
|
|
263
|
+
to:endOfDay.value,
|
|
264
|
+
};
|
|
265
|
+
let occurrences: Array<PlanningOccurrence | PlanningLive> =
|
|
266
|
+
await classicApi.fetchData<Array<PlanningOccurrence>>({
|
|
267
|
+
api: 14,
|
|
268
|
+
path: "planning/occurrence/list",
|
|
269
|
+
parameters: params,
|
|
270
|
+
});
|
|
271
|
+
const lives: Array<PlanningOccurrence> = await classicApi.fetchData<
|
|
272
|
+
Array<PlanningOccurrence>
|
|
273
|
+
>({
|
|
274
|
+
api: 14,
|
|
275
|
+
path: "live/list",
|
|
276
|
+
parameters: params,
|
|
277
|
+
});
|
|
278
|
+
if (lives.length) {
|
|
279
|
+
occurrences = occurrences.concat(lives);
|
|
280
|
+
occurrences.sort((a, b) => {
|
|
281
|
+
if (a.startDate > b.startDate) {
|
|
282
|
+
return 1;
|
|
265
283
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
occurrences = occurrences.concat(lives);
|
|
290
|
-
occurrences.sort((a, b) => {
|
|
291
|
-
if (a.startDate > b.startDate) {
|
|
292
|
-
return 1;
|
|
293
|
-
}
|
|
294
|
-
return b.startDate > a.startDate ? -1 : 0;
|
|
295
|
-
});
|
|
284
|
+
return b.startDate > a.startDate ? -1 : 0;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return occurrences;
|
|
288
|
+
}
|
|
289
|
+
async function fetchOccurrences(): Promise<void> {
|
|
290
|
+
if (planning.value[daySelected.value]) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
planning.value[daySelected.value] = {
|
|
294
|
+
morning: [],
|
|
295
|
+
afternoon: [],
|
|
296
|
+
evening: [],
|
|
297
|
+
};
|
|
298
|
+
planningLength.value[daySelected.value] = 0;
|
|
299
|
+
loading.value = true;
|
|
300
|
+
error.value = false;
|
|
301
|
+
try {
|
|
302
|
+
const occurrences = await fetchOccurrencesAndLives();
|
|
303
|
+
let periodDayIndex = 0;
|
|
304
|
+
for (const occ of occurrences) {
|
|
305
|
+
if (!occ.podcastId) {
|
|
306
|
+
continue;
|
|
296
307
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
return;
|
|
308
|
+
if (
|
|
309
|
+
!dayjs(occ.startDate).isBefore(periodOfDay.value[periodDayIndex].end)
|
|
310
|
+
) {
|
|
311
|
+
periodDayIndex += 1;
|
|
302
312
|
}
|
|
303
|
-
|
|
304
|
-
morning:
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
if (!occ.podcastId) {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
if (
|
|
319
|
-
!dayjs(occ.startDate).isBefore(this.periodOfDay[periodDayIndex].end)
|
|
320
|
-
) {
|
|
321
|
-
periodDayIndex += 1;
|
|
322
|
-
}
|
|
323
|
-
switch (this.periodOfDay[periodDayIndex].id) {
|
|
324
|
-
case "morning":
|
|
325
|
-
this.planning[this.daySelected].morning.push(occ);
|
|
326
|
-
break;
|
|
327
|
-
case "afternoon":
|
|
328
|
-
this.planning[this.daySelected].afternoon.push(occ);
|
|
329
|
-
break;
|
|
330
|
-
case "evening":
|
|
331
|
-
this.planning[this.daySelected].evening.push(occ);
|
|
332
|
-
break;
|
|
333
|
-
default:
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
this.planningLength[this.daySelected] += 1;
|
|
337
|
-
}
|
|
338
|
-
} catch {
|
|
339
|
-
this.error = true;
|
|
313
|
+
switch (periodOfDay.value[periodDayIndex].id) {
|
|
314
|
+
case "morning":
|
|
315
|
+
planning.value[daySelected.value].morning.push(occ);
|
|
316
|
+
break;
|
|
317
|
+
case "afternoon":
|
|
318
|
+
planning.value[daySelected.value].afternoon.push(occ);
|
|
319
|
+
break;
|
|
320
|
+
case "evening":
|
|
321
|
+
planning.value[daySelected.value].evening.push(occ);
|
|
322
|
+
break;
|
|
323
|
+
default:
|
|
324
|
+
break;
|
|
340
325
|
}
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
326
|
+
planningLength.value[daySelected.value] += 1;
|
|
327
|
+
}
|
|
328
|
+
} catch {
|
|
329
|
+
error.value = true;
|
|
330
|
+
}
|
|
331
|
+
loading.value = false;
|
|
332
|
+
}
|
|
333
|
+
function changeDate(date: number) {
|
|
334
|
+
daySelected.value = date;
|
|
335
|
+
fetchOccurrences();
|
|
336
|
+
}
|
|
337
|
+
function dateDisplay(date: Date): string {
|
|
338
|
+
return dayjs(date).format("HH:mm");
|
|
339
|
+
}
|
|
352
340
|
</script>
|
|
353
341
|
<style lang="scss">
|
|
354
342
|
.octopus-app {
|