@saooti/octopus-sdk 31.0.25 → 31.0.28
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/README.md +15 -1
- package/index.ts +5 -2
- package/package.json +2 -1
- package/src/components/display/categories/CategoryList.vue +1 -1
- package/src/components/display/filter/AdvancedSearch.vue +2 -12
- package/src/components/display/filter/ProductorSearch.vue +0 -3
- package/src/components/display/organisation/OrganisationChooserLight.vue +18 -25
- package/src/components/display/podcasts/PodcastImage.vue +15 -9
- package/src/components/display/podcasts/PodcastInlineList.vue +43 -309
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +246 -0
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +158 -0
- package/src/components/display/podcasts/PodcastModuleBox.vue +3 -26
- package/src/components/display/podcasts/PodcastSwiperList.vue +209 -0
- package/src/components/display/sharing/SharePlayer.vue +42 -81
- package/src/components/display/sharing/SharePlayerColors.vue +17 -15
- package/src/components/display/sharing/SharePlayerTypes.vue +15 -32
- package/src/components/display/sharing/SubscribeButtons.vue +44 -200
- package/src/components/form/ClassicCheckbox.vue +8 -8
- package/src/components/form/ClassicRadio.vue +9 -9
- package/src/components/form/ClassicSearch.vue +29 -29
- package/src/components/form/ClassicSelect.vue +12 -15
- package/src/components/misc/ErrorMessage.vue +6 -8
- package/src/components/misc/Footer.vue +63 -95
- package/src/components/misc/LeftMenu.vue +42 -93
- package/src/components/misc/Snackbar.vue +1 -1
- package/src/components/misc/TopBar.vue +42 -86
- package/src/components/misc/modal/ClipboardModal.vue +1 -8
- package/src/components/misc/modal/MessageModal.vue +1 -2
- package/src/components/misc/modal/QrCodeModal.vue +1 -11
- package/src/components/mixins/orgaComputed.ts +15 -0
- package/src/components/mixins/organisationFilter.ts +2 -0
- package/src/components/pages/Emission.vue +43 -86
- package/src/components/pages/Emissions.vue +38 -59
- package/src/components/pages/Home.vue +5 -12
- package/src/components/pages/Lives.vue +1 -6
- package/src/components/pages/Participant.vue +34 -48
- package/src/components/pages/Participants.vue +10 -28
- package/src/components/pages/Playlist.vue +20 -31
- package/src/components/pages/Playlists.vue +5 -15
- package/src/components/pages/Podcast.vue +95 -115
- package/src/components/pages/Podcasts.vue +34 -92
- package/src/components/pages/Rubrique.vue +6 -17
- package/src/components/pages/Search.vue +16 -36
- package/src/locale/en.ts +1 -1
- package/src/store/paramStore.ts +13 -11
package/README.md
CHANGED
|
@@ -573,7 +573,18 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
573
573
|
* 30.0.74 Error locales en allemand (je sens que ça va être fun cette histoire)
|
|
574
574
|
* 30.0.75 Parlement
|
|
575
575
|
* 30.0.76 Space
|
|
576
|
-
|
|
576
|
+
* 30.0.77 V-Calendar bloque version
|
|
577
|
+
* 30.0.78 a -> word-break
|
|
578
|
+
* 30.0.79 DownloadId player
|
|
579
|
+
* 30.0.80 DownloadId player
|
|
580
|
+
* 30.0.81 DownloadId player
|
|
581
|
+
* 30.0.82 Cherry pick Color Qr code
|
|
582
|
+
* 30.0.83 Locales parlement
|
|
583
|
+
* 30.0.84 Une émission non visible n'apparaît pas dans la page émission
|
|
584
|
+
* 30.0.85 PB en cliquant sur le bouton "tous les épisodes de l'organisation" dans la page d'un épisode
|
|
585
|
+
* 30.0.86 Podcastmaker newest
|
|
586
|
+
* 30.0.87 Podcastmaker newest (swiper list)
|
|
587
|
+
* 30.0.88 Podcastmaker newest (swiper list)
|
|
577
588
|
|
|
578
589
|
* 31.0.0 Passage en 31
|
|
579
590
|
* 31.0.1 Ajout pocket casts
|
|
@@ -601,3 +612,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
601
612
|
* 31.0.23 Qr Code option noir
|
|
602
613
|
* 31.0.24 Amélioration accessibilité
|
|
603
614
|
* 31.0.25 Erreur audioUrl
|
|
615
|
+
* 31.0.26 Erreur 403 page expose
|
|
616
|
+
* 31.0.27 Snackbar chose holdtime
|
|
617
|
+
* 31.0.28 Mixins orgComputed
|
package/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ import Search from "./src/components/pages/Search.vue";
|
|
|
12
12
|
import Home from "./src/components/pages/Home.vue";
|
|
13
13
|
import Category from "./src/components/pages/Category.vue";
|
|
14
14
|
import Rubrique from "./src/components/pages/Rubrique.vue";
|
|
15
|
+
import Error403Page from "./src/components/pages/Error403Page.vue";
|
|
15
16
|
//Misc
|
|
16
17
|
import Footer from "./src/components/misc/Footer.vue";
|
|
17
18
|
import LeftMenu from "./src/components/misc/LeftMenu.vue";
|
|
@@ -116,7 +117,8 @@ const components = {
|
|
|
116
117
|
ClassicLoading,
|
|
117
118
|
AdvancedSearch,
|
|
118
119
|
PodcastPlaylistInlineList,
|
|
119
|
-
ClassicSelect
|
|
120
|
+
ClassicSelect,
|
|
121
|
+
Error403Page
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
export default components;
|
|
@@ -171,5 +173,6 @@ export {
|
|
|
171
173
|
ClassicLoading,
|
|
172
174
|
AdvancedSearch,
|
|
173
175
|
PodcastPlaylistInlineList,
|
|
174
|
-
ClassicSelect
|
|
176
|
+
ClassicSelect,
|
|
177
|
+
Error403Page
|
|
175
178
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "31.0.
|
|
3
|
+
"version": "31.0.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"qrcode.vue": "^3.3.3",
|
|
29
29
|
"sass": "^1.49.11",
|
|
30
30
|
"sass-loader": "^12.6.0",
|
|
31
|
+
"swiper": "^8.1.5",
|
|
31
32
|
"v-calendar": "^3.0.0-alpha.8",
|
|
32
33
|
"vue": "^3.2.31",
|
|
33
34
|
"vue-i18n": "^9.2.0-beta.34",
|
|
@@ -145,7 +145,7 @@ export default defineComponent({
|
|
|
145
145
|
},
|
|
146
146
|
resizeWindow(): void {
|
|
147
147
|
const categoryList = (this.$refs.categoryListContainer as HTMLElement);
|
|
148
|
-
if(null === categoryList){
|
|
148
|
+
if(null === categoryList ||!categoryList){
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
categoryList.style.justifyContent = 'flex-start';
|
|
@@ -172,10 +172,10 @@ export default defineComponent({
|
|
|
172
172
|
isTo: false as boolean,
|
|
173
173
|
fromDate: moment().subtract(10, 'days').toISOString() as string,
|
|
174
174
|
toDate: moment().toISOString() as string,
|
|
175
|
-
isNotVisible:
|
|
175
|
+
isNotVisible: this.includeHidden as boolean,
|
|
176
176
|
isNotValidate: false as boolean,
|
|
177
177
|
showFilters: false as boolean,
|
|
178
|
-
sort:
|
|
178
|
+
sort: this.sortCriteria as string,
|
|
179
179
|
};
|
|
180
180
|
},
|
|
181
181
|
|
|
@@ -268,16 +268,6 @@ export default defineComponent({
|
|
|
268
268
|
this.sort = this.sortCriteria;
|
|
269
269
|
},
|
|
270
270
|
},
|
|
271
|
-
|
|
272
|
-
created() {
|
|
273
|
-
if (!this.isEmission) {
|
|
274
|
-
this.isNotVisible = this.includeHidden;
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
mounted() {
|
|
279
|
-
this.sort = this.sortCriteria;
|
|
280
|
-
},
|
|
281
271
|
methods: {
|
|
282
272
|
updateFromDate(): void {
|
|
283
273
|
if (
|
|
@@ -138,9 +138,6 @@ export default defineComponent({
|
|
|
138
138
|
async onKeepOrganisation(): Promise<void> {
|
|
139
139
|
if(!this.organisationId){return}
|
|
140
140
|
if (!this.keepOrganisation) {
|
|
141
|
-
if (this.$route.query.productor !== this.organisationId) {
|
|
142
|
-
this.$router.push({ query: { productor: this.organisationId } });
|
|
143
|
-
}
|
|
144
141
|
await this.selectOrganisation(this.organisationId);
|
|
145
142
|
return;
|
|
146
143
|
}
|
|
@@ -4,29 +4,24 @@
|
|
|
4
4
|
class="default-multiselect-width organisation-chooser-light"
|
|
5
5
|
:style="{ width: width }"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/>
|
|
26
|
-
</template>
|
|
27
|
-
<template v-else>
|
|
28
|
-
{{ organisation.name }}
|
|
29
|
-
</template>
|
|
7
|
+
<select
|
|
8
|
+
:id="'organisation_chooser_light' + page"
|
|
9
|
+
v-model="actual"
|
|
10
|
+
class="mb-0 c-hand border-0"
|
|
11
|
+
@change="onOrganisationSelected"
|
|
12
|
+
>
|
|
13
|
+
<option :value="organisation.id">
|
|
14
|
+
{{ organisation.name }}
|
|
15
|
+
</option>
|
|
16
|
+
<option :value="-1">
|
|
17
|
+
{{ $t('No organisation filter') }}
|
|
18
|
+
</option>
|
|
19
|
+
</select>
|
|
20
|
+
<label
|
|
21
|
+
:for="'organisation_chooser_light' + page"
|
|
22
|
+
class="d-inline"
|
|
23
|
+
:title="$t('select productor')"
|
|
24
|
+
/>
|
|
30
25
|
</div>
|
|
31
26
|
</template>
|
|
32
27
|
|
|
@@ -48,7 +43,6 @@ export default defineComponent({
|
|
|
48
43
|
actual: -1 as number|string,
|
|
49
44
|
organisation: undefined as Organisation|undefined,
|
|
50
45
|
init: false as boolean,
|
|
51
|
-
privateOrganisation: false as boolean
|
|
52
46
|
};
|
|
53
47
|
},
|
|
54
48
|
|
|
@@ -82,7 +76,6 @@ export default defineComponent({
|
|
|
82
76
|
const data = await octopusApi.fetchOrganisation(this.value);
|
|
83
77
|
this.organisation = data;
|
|
84
78
|
this.actual = data.id;
|
|
85
|
-
this.privateOrganisation = "PUBLIC"!==data.privacy;
|
|
86
79
|
this.init = true;
|
|
87
80
|
},
|
|
88
81
|
},
|
|
@@ -237,6 +237,9 @@ export default defineComponent({
|
|
|
237
237
|
'PENDING' === this.fetchConference.status)
|
|
238
238
|
);
|
|
239
239
|
},
|
|
240
|
+
clickPlayGoPage():boolean{
|
|
241
|
+
return (state.podcastPage.clickPlayGoPage as boolean);
|
|
242
|
+
},
|
|
240
243
|
},
|
|
241
244
|
watch: {
|
|
242
245
|
arrowDirection(): void {
|
|
@@ -265,16 +268,19 @@ export default defineComponent({
|
|
|
265
268
|
}
|
|
266
269
|
if (!this.recordingLive) {
|
|
267
270
|
this.$store.commit('playerPlayPodcast', this.podcast);
|
|
268
|
-
|
|
271
|
+
}else{
|
|
272
|
+
this.$store.commit('playerPlayPodcast', {
|
|
273
|
+
title: this.podcast.title,
|
|
274
|
+
audioUrl: this.podcast.audioUrl,
|
|
275
|
+
duration: this.podcast.duration,
|
|
276
|
+
conferenceId: this.fetchConference ? this.fetchConference.conferenceId : undefined,
|
|
277
|
+
livePodcastId: this.podcast.podcastId,
|
|
278
|
+
organisation: this.podcast.organisation,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if(this.clickPlayGoPage){
|
|
282
|
+
this.$router.push('/main/pub/podcast/'+this.podcast.podcastId);
|
|
269
283
|
}
|
|
270
|
-
this.$store.commit('playerPlayPodcast', {
|
|
271
|
-
title: this.podcast.title,
|
|
272
|
-
audioUrl: this.podcast.audioUrl,
|
|
273
|
-
duration: this.podcast.duration,
|
|
274
|
-
conferenceId: this.fetchConference ? this.fetchConference.conferenceId : undefined,
|
|
275
|
-
livePodcastId: this.podcast.podcastId,
|
|
276
|
-
organisation: this.podcast.organisation,
|
|
277
|
-
});
|
|
278
284
|
},
|
|
279
285
|
showDescription(): void {
|
|
280
286
|
if (this.isDescription) {
|
|
@@ -1,108 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-if="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<button
|
|
37
|
-
class="btn admin-button m-1"
|
|
38
|
-
:class="{ disabled: !nextAvailable }"
|
|
39
|
-
:title="$t('Display next')"
|
|
40
|
-
@click="displayNext()"
|
|
41
|
-
>
|
|
42
|
-
<div class="saooti-right fw-bold" />
|
|
43
|
-
</button>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<ClassicLoading
|
|
47
|
-
:loading-text="loading?$t('Loading podcasts ...'):undefined"
|
|
48
|
-
/>
|
|
49
|
-
<transition-group
|
|
50
|
-
v-show="loaded"
|
|
51
|
-
:name="transitionName"
|
|
52
|
-
class="element-list-inline"
|
|
53
|
-
tag="ul"
|
|
54
|
-
:class="[
|
|
55
|
-
alignLeft ? 'justify-content-start' : '',
|
|
56
|
-
overflowScroll ? 'overflowScroll' : '',
|
|
57
|
-
]"
|
|
58
|
-
:css="isInlineAnimation"
|
|
59
|
-
>
|
|
60
|
-
<PodcastItem
|
|
61
|
-
v-for="p in podcasts"
|
|
62
|
-
:key="p.podcastId"
|
|
63
|
-
class="flex-shrink-0 item-phone-margin"
|
|
64
|
-
:podcast="p"
|
|
65
|
-
:class="[alignLeft ? 'me-3' : '']"
|
|
66
|
-
/>
|
|
67
|
-
</transition-group>
|
|
68
|
-
<router-link
|
|
69
|
-
class="btn btn-link align-self-center width-fit-content m-4"
|
|
70
|
-
:to="refTo"
|
|
71
|
-
@click="handleSeeMoreButton"
|
|
72
|
-
>
|
|
73
|
-
{{ buttonText }}
|
|
74
|
-
<div
|
|
75
|
-
v-if="buttonPlus"
|
|
76
|
-
class="ms-1 saooti-more"
|
|
77
|
-
/>
|
|
78
|
-
</router-link>
|
|
79
|
-
</div>
|
|
2
|
+
<PodcastInlineListClassic
|
|
3
|
+
v-if="listTypeClassic"
|
|
4
|
+
:organisation-id="organisationId"
|
|
5
|
+
:emission-id="emissionId"
|
|
6
|
+
:iab-id="iabId"
|
|
7
|
+
:title="title"
|
|
8
|
+
:href="href"
|
|
9
|
+
:button-text="buttonText"
|
|
10
|
+
:is-arrow="isArrow"
|
|
11
|
+
:require-popular-sort="requirePopularSort"
|
|
12
|
+
:button-plus="buttonPlus"
|
|
13
|
+
:rubrique-id="rubriqueId"
|
|
14
|
+
:rubriquage-id="rubriquageId"
|
|
15
|
+
:no-rubriquage-id="noRubriquageId"
|
|
16
|
+
:query="query"
|
|
17
|
+
@update:isArrow="$emit('update:isArrow',$event)"
|
|
18
|
+
/>
|
|
19
|
+
<PodcastSwiperList
|
|
20
|
+
v-else
|
|
21
|
+
:organisation-id="organisationId"
|
|
22
|
+
:emission-id="emissionId"
|
|
23
|
+
:iab-id="iabId"
|
|
24
|
+
:title="title"
|
|
25
|
+
:href="href"
|
|
26
|
+
:button-text="buttonText"
|
|
27
|
+
:is-arrow="isArrow"
|
|
28
|
+
:require-popular-sort="requirePopularSort"
|
|
29
|
+
:button-plus="buttonPlus"
|
|
30
|
+
:rubrique-id="rubriqueId"
|
|
31
|
+
:rubriquage-id="rubriquageId"
|
|
32
|
+
:no-rubriquage-id="noRubriquageId"
|
|
33
|
+
:query="query"
|
|
34
|
+
@update:isArrow="$emit('update:isArrow',$event)"
|
|
35
|
+
/>
|
|
80
36
|
</template>
|
|
81
37
|
|
|
82
38
|
<script lang="ts">
|
|
83
|
-
import { handle403 } from '../../mixins/handle403';
|
|
84
|
-
import octopusApi from '@saooti/octopus-api';
|
|
85
|
-
import domHelper from '../../../helper/dom';
|
|
86
|
-
import PodcastItem from './PodcastItem.vue';
|
|
87
|
-
import ClassicLoading from '../../form/ClassicLoading.vue';
|
|
88
|
-
const PHONE_WIDTH = 960;
|
|
89
39
|
import { state } from '../../../store/paramStore';
|
|
90
|
-
import {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
import { RouteLocationRaw } from 'vue-router';
|
|
94
|
-
import { AxiosError } from 'axios';
|
|
95
|
-
import { Rubrique } from '@/store/class/rubrique/rubrique';
|
|
40
|
+
import { defineAsyncComponent, defineComponent } from 'vue';
|
|
41
|
+
const PodcastInlineListClassic = defineAsyncComponent(() => import('./PodcastInlineListClassic.vue'));
|
|
42
|
+
const PodcastSwiperList = defineAsyncComponent(() => import('./PodcastSwiperList.vue'));
|
|
96
43
|
export default defineComponent({
|
|
97
44
|
name: 'PodcastInlineList',
|
|
98
45
|
|
|
99
46
|
components: {
|
|
100
|
-
|
|
101
|
-
|
|
47
|
+
PodcastInlineListClassic,
|
|
48
|
+
PodcastSwiperList,
|
|
102
49
|
},
|
|
103
|
-
|
|
104
|
-
mixins: [handle403],
|
|
105
|
-
|
|
106
50
|
props: {
|
|
107
51
|
organisationId: { default: undefined, type: String},
|
|
108
52
|
emissionId: { default: undefined, type: Number},
|
|
@@ -119,220 +63,10 @@ export default defineComponent({
|
|
|
119
63
|
query: { default: undefined, type: String},
|
|
120
64
|
},
|
|
121
65
|
emits: ['update:isArrow'],
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
loading: true as boolean,
|
|
126
|
-
loaded: true as boolean,
|
|
127
|
-
index: 0 as number,
|
|
128
|
-
first: 0 as number,
|
|
129
|
-
size: 5 as number,
|
|
130
|
-
totalCount: 0 as number,
|
|
131
|
-
popularSort: false as boolean,
|
|
132
|
-
allPodcasts: [] as Array<Podcast>,
|
|
133
|
-
direction: 1 as number,
|
|
134
|
-
alignLeft: false as boolean,
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
computed: {
|
|
138
|
-
podcasts(): Array<Podcast> {
|
|
139
|
-
return this.allPodcasts.slice(this.index, this.index + this.size);
|
|
140
|
-
},
|
|
141
|
-
sizeItem(): number {
|
|
142
|
-
return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
|
|
143
|
-
},
|
|
144
|
-
overflowScroll(): boolean {
|
|
145
|
-
return (state.emissionPage.overflowScroll as boolean);
|
|
146
|
-
},
|
|
147
|
-
isInlineAnimation(): boolean {
|
|
148
|
-
return (state.generalParameters.isInlineAnimation as boolean);
|
|
149
|
-
},
|
|
150
|
-
filterOrga(): string {
|
|
151
|
-
return this.$store.state.filter.organisationId;
|
|
152
|
-
},
|
|
153
|
-
organisation(): string|undefined {
|
|
154
|
-
if (this.organisationId) return this.organisationId;
|
|
155
|
-
if (this.filterOrga) return this.filterOrga;
|
|
156
|
-
return undefined;
|
|
66
|
+
computed:{
|
|
67
|
+
listTypeClassic(): boolean {
|
|
68
|
+
return (state.podcastPage.listTypeClassic as boolean);
|
|
157
69
|
},
|
|
158
|
-
|
|
159
|
-
if(this.$store.state.filter && this.$store.state.filter.rubriqueFilter && this.$store.state.filter.rubriqueFilter.length){
|
|
160
|
-
return this.$store.state.filter.rubriqueFilter.map((value: RubriquageFilter) => value.rubriquageId+':'+value.rubriqueId).join();
|
|
161
|
-
}
|
|
162
|
-
return undefined;
|
|
163
|
-
},
|
|
164
|
-
refTo(): string | RouteLocationRaw {
|
|
165
|
-
if (this.href) return this.href;
|
|
166
|
-
if(this.iabId){
|
|
167
|
-
return {
|
|
168
|
-
name: 'category',
|
|
169
|
-
params:{ 'iabId': this.iabId },
|
|
170
|
-
query: { productor: this.$store.state.filter.organisationId },
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
name: 'podcasts',
|
|
175
|
-
query: { productor: this.$store.state.filter.organisationId,
|
|
176
|
-
iabId: this.$store.state.filter.iab ? this.$store.state.filter.iab.id : undefined,
|
|
177
|
-
rubriquesId: this.rubriqueQueryParam },
|
|
178
|
-
};
|
|
179
|
-
},
|
|
180
|
-
previousAvailable(): boolean {
|
|
181
|
-
return this.index > 0;
|
|
182
|
-
},
|
|
183
|
-
nextAvailable(): boolean {
|
|
184
|
-
return this.index + this.size < this.totalCount;
|
|
185
|
-
},
|
|
186
|
-
transitionName(): string {
|
|
187
|
-
return this.direction > 0 ? 'out-left' : 'out-right';
|
|
188
|
-
},
|
|
189
|
-
watchVariable():string{
|
|
190
|
-
return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
watch: {
|
|
194
|
-
watchVariable(): void {
|
|
195
|
-
this.reset();
|
|
196
|
-
this.fetchNext();
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
created() {
|
|
201
|
-
if (undefined !== this.requirePopularSort) {
|
|
202
|
-
this.popularSort = this.requirePopularSort;
|
|
203
|
-
}
|
|
204
|
-
if (undefined !== this.isArrow) {
|
|
205
|
-
this.$emit('update:isArrow', true);
|
|
206
|
-
}
|
|
207
|
-
window.addEventListener('resize', this.handleResize);
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
unmounted() {
|
|
211
|
-
window.removeEventListener('resize', this.handleResize);
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
mounted() {
|
|
215
|
-
this.handleResize();
|
|
216
|
-
this.fetchNext();
|
|
217
|
-
},
|
|
218
|
-
methods: {
|
|
219
|
-
handleSeeMoreButton(event: { preventDefault: () => void; }){
|
|
220
|
-
if(!this.rubriqueId || this.noRubriquageId.length){
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
event.preventDefault();
|
|
224
|
-
const rubriqueChosenId = this.rubriqueId[this.rubriqueId.length - 1];
|
|
225
|
-
let filterToAdd: RubriquageFilter = {
|
|
226
|
-
rubriquageId: 0,
|
|
227
|
-
rubriqueId: rubriqueChosenId,
|
|
228
|
-
nameRubriquage: '',
|
|
229
|
-
nameRubrique: ''
|
|
230
|
-
};
|
|
231
|
-
if(this.$store.state.filter.rubriquageArray.length){
|
|
232
|
-
const rubriqueChosen = this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
|
|
233
|
-
filterToAdd = {
|
|
234
|
-
rubriquageId: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriquageId,
|
|
235
|
-
rubriqueId: rubriqueChosenId,
|
|
236
|
-
nameRubriquage: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].title,
|
|
237
|
-
nameRubrique: rubriqueChosen.name
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
const newFilter: Array<RubriquageFilter> = Array.from(this.$store.state.filter.rubriqueFilter);
|
|
241
|
-
newFilter.push(filterToAdd);
|
|
242
|
-
this.$store.commit('filterRubrique', newFilter);
|
|
243
|
-
const queries = this.$route.query;
|
|
244
|
-
const queryString = newFilter.map(value => value.rubriquageId+':'+value.rubriqueId).join();
|
|
245
|
-
this.$router.push({ name: 'podcasts',query: { ...queries, ...{ rubriquesId: queryString }} });
|
|
246
|
-
},
|
|
247
|
-
async fetchNext(): Promise<void> {
|
|
248
|
-
try {
|
|
249
|
-
const data = await octopusApi.fetchPodcasts({
|
|
250
|
-
first: this.first,
|
|
251
|
-
size: this.size + 1,
|
|
252
|
-
organisationId: this.organisation,
|
|
253
|
-
emissionId: this.emissionId,
|
|
254
|
-
iabId: this.iabId,
|
|
255
|
-
rubriqueId: this.rubriqueId.length ?this.rubriqueId:undefined,
|
|
256
|
-
rubriquageId: this.rubriquageId.length ?this.rubriquageId : undefined,
|
|
257
|
-
noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
|
|
258
|
-
sort: this.popularSort ? 'POPULARITY' : 'DATE',
|
|
259
|
-
query: this.query,
|
|
260
|
-
});
|
|
261
|
-
this.loading = false;
|
|
262
|
-
this.loaded = true;
|
|
263
|
-
this.totalCount = data.count;
|
|
264
|
-
if (this.allPodcasts.length + data.result.length < this.totalCount) {
|
|
265
|
-
const nexEl = data.result.pop() as Podcast;
|
|
266
|
-
this.preloadImage(nexEl.imageUrl?nexEl.imageUrl:'');
|
|
267
|
-
}
|
|
268
|
-
this.allPodcasts = this.allPodcasts.concat(
|
|
269
|
-
data.result.filter((pod: Podcast|null) => null !== pod)
|
|
270
|
-
);
|
|
271
|
-
if (this.allPodcasts.length <= 3) {
|
|
272
|
-
this.alignLeft = true;
|
|
273
|
-
} else {
|
|
274
|
-
this.alignLeft = false;
|
|
275
|
-
}
|
|
276
|
-
this.first += this.size;
|
|
277
|
-
} catch (error) {
|
|
278
|
-
this.handle403((error as AxiosError));
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
displayPrevious(): void {
|
|
282
|
-
this.direction = -1;
|
|
283
|
-
if (this.previousAvailable) {
|
|
284
|
-
this.index -= 1;
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
displayNext(): void {
|
|
288
|
-
this.direction = 1;
|
|
289
|
-
if (!this.nextAvailable) return;
|
|
290
|
-
if (
|
|
291
|
-
this.first - (this.index + this.size) < 2 &&
|
|
292
|
-
this.allPodcasts.length < this.totalCount
|
|
293
|
-
) {
|
|
294
|
-
this.fetchNext();
|
|
295
|
-
}
|
|
296
|
-
this.index += 1;
|
|
297
|
-
},
|
|
298
|
-
handleResize(): void {
|
|
299
|
-
if (!this.$el) return;
|
|
300
|
-
if (this.overflowScroll) {
|
|
301
|
-
this.size = 20;
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (window.innerWidth <= PHONE_WIDTH) {
|
|
305
|
-
this.size = 10;
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
const width = (this.$el as HTMLElement).offsetWidth;
|
|
309
|
-
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.7);
|
|
310
|
-
this.size = Math.floor(width / sixteen);
|
|
311
|
-
},
|
|
312
|
-
sortPopular(): void {
|
|
313
|
-
if (this.popularSort) return;
|
|
314
|
-
this.popularSort = true;
|
|
315
|
-
this.reset();
|
|
316
|
-
this.fetchNext();
|
|
317
|
-
},
|
|
318
|
-
sortChrono(): void {
|
|
319
|
-
if (!this.popularSort) return;
|
|
320
|
-
this.popularSort = false;
|
|
321
|
-
this.reset();
|
|
322
|
-
this.fetchNext();
|
|
323
|
-
},
|
|
324
|
-
reset(): void {
|
|
325
|
-
this.loading = true;
|
|
326
|
-
this.loaded = true;
|
|
327
|
-
this.index = 0;
|
|
328
|
-
this.first = 0;
|
|
329
|
-
this.totalCount = 0;
|
|
330
|
-
this.allPodcasts.length = 0;
|
|
331
|
-
},
|
|
332
|
-
preloadImage(url: string): void {
|
|
333
|
-
const img = new Image();
|
|
334
|
-
img.src = url;
|
|
335
|
-
},
|
|
336
|
-
},
|
|
70
|
+
}
|
|
337
71
|
})
|
|
338
72
|
</script>
|