@saooti/octopus-sdk 31.0.26 → 31.0.29

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.
Files changed (59) hide show
  1. package/README.md +7 -1
  2. package/package.json +2 -1
  3. package/src/assets/bootstrap-diff.scss +3 -34
  4. package/src/assets/general.scss +0 -1
  5. package/src/assets/share.scss +3 -0
  6. package/src/components/display/comments/AddCommentModal.vue +1 -1
  7. package/src/components/display/comments/CommentInput.vue +2 -2
  8. package/src/components/display/comments/CommentItem.vue +1 -1
  9. package/src/components/display/comments/CommentList.vue +1 -1
  10. package/src/components/display/emission/EmissionInlineList.vue +1 -1
  11. package/src/components/display/emission/EmissionList.vue +1 -1
  12. package/src/components/display/live/LiveHorizontalList.vue +1 -1
  13. package/src/components/display/playlist/PlaylistList.vue +1 -1
  14. package/src/components/display/playlist/PodcastList.vue +1 -1
  15. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +1 -1
  16. package/src/components/display/podcasts/PodcastImage.vue +15 -9
  17. package/src/components/display/podcasts/PodcastInlineList.vue +43 -309
  18. package/src/components/display/podcasts/PodcastInlineListClassic.vue +246 -0
  19. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +158 -0
  20. package/src/components/display/podcasts/PodcastList.vue +1 -1
  21. package/src/components/display/podcasts/PodcastModuleBox.vue +3 -26
  22. package/src/components/display/podcasts/PodcastSwiperList.vue +209 -0
  23. package/src/components/display/sharing/ShareButtons.vue +1 -1
  24. package/src/components/display/sharing/ShareDistribution.vue +1 -1
  25. package/src/components/display/sharing/SharePlayer.vue +58 -97
  26. package/src/components/display/sharing/SharePlayerColors.vue +17 -15
  27. package/src/components/display/sharing/SharePlayerTypes.vue +15 -32
  28. package/src/components/display/sharing/SubscribeButtons.vue +44 -200
  29. package/src/components/form/ClassicCheckbox.vue +8 -8
  30. package/src/components/form/ClassicRadio.vue +9 -9
  31. package/src/components/form/ClassicSearch.vue +29 -29
  32. package/src/components/form/ClassicSelect.vue +12 -15
  33. package/src/components/misc/ErrorMessage.vue +6 -8
  34. package/src/components/misc/Footer.vue +63 -95
  35. package/src/components/misc/LeftMenu.vue +41 -89
  36. package/src/components/misc/Snackbar.vue +1 -1
  37. package/src/components/misc/TopBar.vue +41 -82
  38. package/src/components/misc/modal/ClipboardModal.vue +2 -9
  39. package/src/components/misc/modal/MessageModal.vue +3 -4
  40. package/src/components/misc/modal/NewsletterModal.vue +1 -1
  41. package/src/components/misc/modal/QrCodeModal.vue +2 -12
  42. package/src/components/misc/modal/ShareModalPlayer.vue +1 -1
  43. package/src/components/misc/player/PlayerCompact.vue +3 -3
  44. package/src/components/mixins/orgaComputed.ts +15 -0
  45. package/src/components/pages/Emission.vue +43 -86
  46. package/src/components/pages/Emissions.vue +27 -73
  47. package/src/components/pages/Error403Page.vue +1 -1
  48. package/src/components/pages/Home.vue +5 -12
  49. package/src/components/pages/Lives.vue +1 -6
  50. package/src/components/pages/Participant.vue +34 -48
  51. package/src/components/pages/Participants.vue +10 -28
  52. package/src/components/pages/Playlist.vue +20 -31
  53. package/src/components/pages/Playlists.vue +5 -15
  54. package/src/components/pages/Podcast.vue +95 -116
  55. package/src/components/pages/Podcasts.vue +34 -93
  56. package/src/components/pages/Rubrique.vue +6 -17
  57. package/src/components/pages/Search.vue +16 -36
  58. package/src/sass/_variables.scss +1 -1
  59. package/src/store/paramStore.ts +13 -11
@@ -0,0 +1,246 @@
1
+ <template>
2
+ <PodcastInlineListTemplate
3
+ v-if="loading || (!loading && 0 !== allPodcasts.length)"
4
+ :display-arrow="true"
5
+ :popular-sort="popularSort"
6
+ :button-text="buttonText"
7
+ :button-plus="buttonPlus"
8
+ :title="title"
9
+ :href="href"
10
+ :iab-id="iabId"
11
+ :rubrique-id="rubriqueId"
12
+ :previous-available="previousAvailable"
13
+ :next-available="nextAvailable"
14
+ :no-rubriquage-id="noRubriquageId"
15
+ @sortChrono="sortChrono"
16
+ @sortPopular="sortPopular"
17
+ @displayPrevious="displayPrevious"
18
+ @displayNext="displayNext"
19
+ >
20
+ <template #list-inline>
21
+ <ClassicLoading
22
+ :loading-text="loading?$t('Loading podcasts ...'):undefined"
23
+ />
24
+ <transition-group
25
+ v-show="loaded"
26
+ :name="transitionName"
27
+ class="element-list-inline"
28
+ tag="ul"
29
+ :class="[
30
+ alignLeft ? 'justify-content-start' : '',
31
+ overflowScroll ? 'overflowScroll' : '',
32
+ ]"
33
+ :css="isInlineAnimation"
34
+ >
35
+ <PodcastItem
36
+ v-for="p in podcasts"
37
+ :key="p.podcastId"
38
+ class="flex-shrink-0 item-phone-margin"
39
+ :podcast="p"
40
+ :class="[alignLeft ? 'me-3' : '']"
41
+ />
42
+ </transition-group>
43
+ </template>
44
+ </PodcastInlineListTemplate>
45
+ </template>
46
+
47
+ <script lang="ts">
48
+ import PodcastInlineListTemplate from './PodcastInlineListTemplate.vue';
49
+ import octopusApi from '@saooti/octopus-api';
50
+ import domHelper from '../../../helper/dom';
51
+ import PodcastItem from './PodcastItem.vue';
52
+ import ClassicLoading from '../../form/ClassicLoading.vue';
53
+ const PHONE_WIDTH = 960;
54
+ import { state } from '../../../store/paramStore';
55
+ import { Podcast } from '@/store/class/general/podcast';
56
+ import { defineComponent } from 'vue'
57
+ export default defineComponent({
58
+ name: 'PodcastInlineListClassic',
59
+
60
+ components: {
61
+ PodcastItem,
62
+ ClassicLoading,
63
+ PodcastInlineListTemplate
64
+ },
65
+
66
+ props: {
67
+ organisationId: { default: undefined, type: String},
68
+ emissionId: { default: undefined, type: Number},
69
+ iabId: { default: undefined, type: Number},
70
+ title: { default: '', type: String},
71
+ href: { default: undefined, type: String},
72
+ buttonText: { default: undefined, type: String},
73
+ isArrow: { default: false, type: Boolean},
74
+ requirePopularSort: { default:undefined, type: Boolean},
75
+ buttonPlus: { default:false, type: Boolean},
76
+ rubriqueId: { default: () => [], type: Array as ()=> Array<number> },
77
+ rubriquageId:{ default: () => [], type: Array as ()=> Array<number> },
78
+ noRubriquageId: { default: () => [], type: Array as ()=> Array<number> },
79
+ query: { default: undefined, type: String},
80
+ },
81
+ emits: ['update:isArrow'],
82
+
83
+ data() {
84
+ return {
85
+ loading: true as boolean,
86
+ loaded: true as boolean,
87
+ index: 0 as number,
88
+ first: 0 as number,
89
+ size: 5 as number,
90
+ totalCount: 0 as number,
91
+ popularSort: false as boolean,
92
+ allPodcasts: [] as Array<Podcast>,
93
+ direction: 1 as number,
94
+ alignLeft: false as boolean,
95
+ };
96
+ },
97
+ computed: {
98
+ podcasts(): Array<Podcast> {
99
+ return this.allPodcasts.slice(this.index, this.index + this.size);
100
+ },
101
+ sizeItem(): number {
102
+ return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
103
+ },
104
+ overflowScroll(): boolean {
105
+ return (state.emissionPage.overflowScroll as boolean);
106
+ },
107
+ isInlineAnimation(): boolean {
108
+ return (state.generalParameters.isInlineAnimation as boolean);
109
+ },
110
+ filterOrga(): string {
111
+ return this.$store.state.filter.organisationId;
112
+ },
113
+ organisation(): string|undefined {
114
+ if (this.organisationId) return this.organisationId;
115
+ if (this.filterOrga) return this.filterOrga;
116
+ return undefined;
117
+ },
118
+ previousAvailable(): boolean {
119
+ return this.index > 0;
120
+ },
121
+ nextAvailable(): boolean {
122
+ return this.index + this.size < this.totalCount;
123
+ },
124
+ transitionName(): string {
125
+ return this.direction > 0 ? 'out-left' : 'out-right';
126
+ },
127
+ watchVariable():string{
128
+ return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
129
+ }
130
+ },
131
+ watch: {
132
+ watchVariable(): void {
133
+ this.reset();
134
+ this.fetchNext();
135
+ },
136
+ },
137
+
138
+ created() {
139
+ if (undefined !== this.requirePopularSort) {
140
+ this.popularSort = this.requirePopularSort;
141
+ }
142
+ if (undefined !== this.isArrow) {
143
+ this.$emit('update:isArrow', true);
144
+ }
145
+ window.addEventListener('resize', this.handleResize);
146
+ },
147
+
148
+ unmounted() {
149
+ window.removeEventListener('resize', this.handleResize);
150
+ },
151
+
152
+ mounted() {
153
+ this.handleResize();
154
+ this.fetchNext();
155
+ },
156
+ methods: {
157
+ async fetchNext(): Promise<void> {
158
+ const data = await octopusApi.fetchPodcasts({
159
+ first: this.first,
160
+ size: this.size + 1,
161
+ organisationId: this.organisation,
162
+ emissionId: this.emissionId,
163
+ iabId: this.iabId,
164
+ rubriqueId: this.rubriqueId.length ?this.rubriqueId:undefined,
165
+ rubriquageId: this.rubriquageId.length ?this.rubriquageId : undefined,
166
+ noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
167
+ sort: this.popularSort ? 'POPULARITY' : 'DATE',
168
+ query: this.query,
169
+ });
170
+ this.loading = false;
171
+ this.loaded = true;
172
+ this.totalCount = data.count;
173
+ if (this.allPodcasts.length + data.result.length < this.totalCount) {
174
+ const nexEl = data.result.pop() as Podcast;
175
+ if(nexEl){
176
+ this.preloadImage(nexEl.imageUrl?nexEl.imageUrl:'');
177
+ }
178
+ }
179
+ this.allPodcasts = this.allPodcasts.concat(
180
+ data.result.filter((pod: Podcast|null) => null !== pod)
181
+ );
182
+ if (this.allPodcasts.length <= 3) {
183
+ this.alignLeft = true;
184
+ } else {
185
+ this.alignLeft = false;
186
+ }
187
+ this.first += this.size;
188
+ },
189
+ displayPrevious(): void {
190
+ this.direction = -1;
191
+ if (this.previousAvailable) {
192
+ this.index -= 1;
193
+ }
194
+ },
195
+ displayNext(): void {
196
+ this.direction = 1;
197
+ if (!this.nextAvailable) return;
198
+ if (
199
+ this.first - (this.index + this.size) < 2 &&
200
+ this.allPodcasts.length < this.totalCount
201
+ ) {
202
+ this.fetchNext();
203
+ }
204
+ this.index += 1;
205
+ },
206
+ handleResize(): void {
207
+ if (!this.$el) return;
208
+ if (this.overflowScroll) {
209
+ this.size = 20;
210
+ return;
211
+ }
212
+ if (window.innerWidth <= PHONE_WIDTH) {
213
+ this.size = 10;
214
+ return;
215
+ }
216
+ const width = (this.$el as HTMLElement).offsetWidth;
217
+ const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.7);
218
+ this.size = Math.floor(width / sixteen);
219
+ },
220
+ sortPopular(): void {
221
+ if (this.popularSort) return;
222
+ this.popularSort = true;
223
+ this.reset();
224
+ this.fetchNext();
225
+ },
226
+ sortChrono(): void {
227
+ if (!this.popularSort) return;
228
+ this.popularSort = false;
229
+ this.reset();
230
+ this.fetchNext();
231
+ },
232
+ reset(): void {
233
+ this.loading = true;
234
+ this.loaded = true;
235
+ this.index = 0;
236
+ this.first = 0;
237
+ this.totalCount = 0;
238
+ this.allPodcasts.length = 0;
239
+ },
240
+ preloadImage(url: string): void {
241
+ const img = new Image();
242
+ img.src = url;
243
+ },
244
+ },
245
+ })
246
+ </script>
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <div
3
+ class="d-flex flex-column p-3"
4
+ >
5
+ <h2>{{ title }}</h2>
6
+ <div class="d-flex justify-content-between">
7
+ <div class="d-flex">
8
+ <button
9
+ class="btn btn-underline"
10
+ :class="{ active: !popularSort }"
11
+ @click="sortChrono()"
12
+ >
13
+ {{ $t('Last added') }}
14
+ </button>
15
+ <button
16
+ class="btn btn-underline"
17
+ :class="{ active: popularSort }"
18
+ @click="sortPopular()"
19
+ >
20
+ {{ $t('Most popular') }}
21
+ </button>
22
+ </div>
23
+ <div
24
+ v-if="displayArrow"
25
+ class="hide-phone"
26
+ >
27
+ <button
28
+ class="btn admin-button m-1"
29
+ :class="{ disabled: !previousAvailable }"
30
+ :title="$t('Display previous')"
31
+ @click="displayPrevious()"
32
+ >
33
+ <div class="saooti-left fw-bold" />
34
+ </button>
35
+ <button
36
+ class="btn admin-button m-1"
37
+ :class="{ disabled: !nextAvailable }"
38
+ :title="$t('Display next')"
39
+ @click="displayNext()"
40
+ >
41
+ <div class="saooti-right fw-bold" />
42
+ </button>
43
+ </div>
44
+ </div>
45
+ <slot name="list-inline" />
46
+ <router-link
47
+ class="btn btn-primary align-self-center width-fit-content m-4"
48
+ :to="refTo"
49
+ @click="handleSeeMoreButton"
50
+ >
51
+ {{ buttonText }}
52
+ <div
53
+ v-if="buttonPlus"
54
+ class="ms-1 saooti-more"
55
+ />
56
+ </router-link>
57
+ </div>
58
+ </template>
59
+
60
+ <script lang="ts">
61
+ import { RubriquageFilter } from '@/store/class/rubrique/rubriquageFilter';
62
+ import { defineComponent } from 'vue'
63
+ import { RouteLocationRaw } from 'vue-router';
64
+ import { Rubrique } from '@/store/class/rubrique/rubrique';
65
+ export default defineComponent({
66
+ name: 'PodcastInlineListTemplate',
67
+
68
+ components: {
69
+ },
70
+
71
+ props: {
72
+ displayArrow: { default: true, type: Boolean},
73
+ previousAvailable: { default: false, type: Boolean},
74
+ nextAvailable: { default: false, type: Boolean},
75
+ popularSort: { default: false, type: Boolean},
76
+ buttonText: { default: undefined, type: String},
77
+ buttonPlus: { default:false, type: Boolean},
78
+ title: { default: '', type: String},
79
+ href: { default: undefined, type: String},
80
+ iabId: { default: undefined, type: Number},
81
+ rubriqueId: { default: () => [], type: Array as ()=> Array<number> },
82
+ noRubriquageId: { default: () => [], type: Array as ()=> Array<number> },
83
+ },
84
+ emits:['sortChrono','sortPopular', 'displayPrevious', 'displayNext'],
85
+ data() {
86
+ return {
87
+ };
88
+ },
89
+
90
+ computed: {
91
+ rubriqueQueryParam(): string|undefined{
92
+ if(this.$store.state.filter && this.$store.state.filter.rubriqueFilter && this.$store.state.filter.rubriqueFilter.length){
93
+ return this.$store.state.filter.rubriqueFilter.map((value: RubriquageFilter) => value.rubriquageId+':'+value.rubriqueId).join();
94
+ }
95
+ return undefined;
96
+ },
97
+ refTo(): string | RouteLocationRaw {
98
+ if (this.href) return this.href;
99
+ if(this.iabId){
100
+ return {
101
+ name: 'category',
102
+ params:{ 'iabId': this.iabId },
103
+ query: { productor: this.$store.state.filter.organisationId },
104
+ };
105
+ }
106
+ return {
107
+ name: 'podcasts',
108
+ query: { productor: this.$store.state.filter.organisationId,
109
+ iabId: this.$store.state.filter.iab ? this.$store.state.filter.iab.id : undefined,
110
+ rubriquesId: this.rubriqueQueryParam },
111
+ };
112
+ },
113
+ },
114
+
115
+ methods: {
116
+ sortChrono():void{
117
+ this.$emit('sortChrono');
118
+ },
119
+ sortPopular():void{
120
+ this.$emit('sortPopular');
121
+ },
122
+ displayPrevious():void{
123
+ this.$emit('displayPrevious');
124
+ },
125
+ displayNext():void{
126
+ this.$emit('displayNext');
127
+ },
128
+ handleSeeMoreButton(event: { preventDefault: () => void; }){
129
+ if(!this.rubriqueId || 0===this.rubriqueId.length || this.noRubriquageId.length){
130
+ return;
131
+ }
132
+ event.preventDefault();
133
+ const rubriqueChosenId = this.rubriqueId[this.rubriqueId.length - 1];
134
+ let filterToAdd: RubriquageFilter = {
135
+ rubriquageId: 0,
136
+ rubriqueId: rubriqueChosenId,
137
+ nameRubriquage: '',
138
+ nameRubrique: ''
139
+ };
140
+ if(this.$store.state.filter.rubriquageArray.length){
141
+ const rubriqueChosen = this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
142
+ filterToAdd = {
143
+ rubriquageId: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].rubriquageId,
144
+ rubriqueId: rubriqueChosenId,
145
+ nameRubriquage: this.$store.state.filter.rubriquageArray[this.rubriqueId.length - 1].title,
146
+ nameRubrique: rubriqueChosen.name
147
+ };
148
+ }
149
+ const newFilter: Array<RubriquageFilter> = Array.from(this.$store.state.filter.rubriqueFilter);
150
+ newFilter.push(filterToAdd);
151
+ this.$store.commit('filterRubrique', newFilter);
152
+ const queries = this.$route.query;
153
+ const queryString = newFilter.map(value => value.rubriquageId+':'+value.rubriqueId).join();
154
+ this.$router.push({ name: 'podcasts',query: { ...queries, ...{ rubriquesId: queryString }} });
155
+ },
156
+ },
157
+ })
158
+ </script>
@@ -23,7 +23,7 @@
23
23
  <button
24
24
  v-show="!allFetched"
25
25
  class="btn"
26
- :class="buttonPlus ? 'btn-link align-self-center width-fit-content m-4' : 'btn-more'"
26
+ :class="buttonPlus ? 'btn-primary align-self-center width-fit-content m-4' : 'btn-more'"
27
27
  :disabled="inFetching"
28
28
  :title="$t('See more')"
29
29
  @click="displayMore"
@@ -1,26 +1,15 @@
1
1
  <template>
2
2
  <div class="module-box">
3
3
  <div
4
- v-if="!isOuestFrance"
5
4
  class="text-uppercase h4"
6
5
  >
7
6
  {{ podcast.title }}
8
7
  </div>
9
- <router-link
10
- v-else
11
- :to="{
12
- name: 'emission',
13
- params: { emissionId: podcast.emission.emissionId },
14
- query: { productor: $store.state.filter.organisationId },
15
- }"
16
- >
17
- <h1>{{ podcast.emission.name }}</h1>
18
- </router-link>
19
8
  <div class="mb-5 mt-3 d-flex">
20
9
  <div class="w-100">
21
10
  <PodcastImage
22
11
  :class="[
23
- !isOuestFrance && !isLiveReadyToRecord
12
+ !isLiveReadyToRecord
24
13
  ? 'shadow-element'
25
14
  : '',
26
15
  isLiveReadyToRecord &&
@@ -38,25 +27,16 @@
38
27
  :is-animator-live="isOctopusAndAnimator"
39
28
  @playPodcast="playPodcast"
40
29
  />
41
- <h3 v-if="isOuestFrance">
42
- {{ podcast.title }}
43
- </h3>
44
30
  <div
45
31
  class="d-flex flex-wrap mb-3"
46
32
  :class="isLiveReady ? 'justify-content-between' : ''"
47
33
  >
48
34
  <div
49
- v-if="!isOuestFrance && 0 !== date.length"
35
+ v-if="0 !== date.length"
50
36
  :class="!isLiveReady ? 'me-5' : ''"
51
37
  >
52
38
  {{ date }}
53
39
  </div>
54
- <div>
55
- <span
56
- v-if="isOuestFrance"
57
- class="saooti-clock3"
58
- />{{ $t('Duration', { duration: duration }) }}
59
- </div>
60
40
  <div
61
41
  v-if="isLiveReady"
62
42
  class="text-danger"
@@ -72,7 +52,7 @@
72
52
  <!-- eslint-enable -->
73
53
  <div class="my-3">
74
54
  <ParticipantDescription :participants="podcast.animators" />
75
- <div v-if="!isOuestFrance">
55
+ <div>
76
56
  {{ $t('Emission') + ' : ' }}
77
57
  <router-link
78
58
  class="fw-bold"
@@ -198,9 +178,6 @@ export default defineComponent({
198
178
  authenticated(): boolean {
199
179
  return (state.generalParameters.authenticated as boolean);
200
180
  },
201
- isOuestFrance(): boolean {
202
- return (state.podcastPage.ouestFranceStyle as boolean);
203
- },
204
181
  date(): string {
205
182
  if (this.podcast && 1970 !== moment(this.podcast.pubDate).year()){
206
183
  return moment(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
@@ -0,0 +1,209 @@
1
+ <template>
2
+ <PodcastInlineListTemplate
3
+ v-if="loading || (!loading && 0 !== allPodcasts.length)"
4
+ :display-arrow="false"
5
+ :popular-sort="popularSort"
6
+ :button-text="buttonText"
7
+ :button-plus="buttonPlus"
8
+ :title="title"
9
+ :href="href"
10
+ :iab-id="iabId"
11
+ :rubrique-id="rubriqueId"
12
+ :no-rubriquage-id="noRubriquageId"
13
+ @sortChrono="sortChrono"
14
+ @sortPopular="sortPopular"
15
+ >
16
+ <template #list-inline>
17
+ <ClassicLoading
18
+ :loading-text="loading?$t('Loading podcasts ...'):undefined"
19
+ />
20
+ <swiper
21
+ v-show="loaded"
22
+ :slides-per-view="numberItem"
23
+ :space-between="10"
24
+ :loop="true"
25
+ :navigation="true"
26
+ :modules="modules"
27
+ class="mySwiper"
28
+ >
29
+ <swiper-slide
30
+ v-for="p in allPodcasts"
31
+ :key="p.podcastId"
32
+ >
33
+ <PodcastItem
34
+ class="flex-shrink-0 item-phone-margin"
35
+ :podcast="p"
36
+ />
37
+ </swiper-slide>
38
+ </swiper>
39
+ </template>
40
+ </PodcastInlineListTemplate>
41
+ </template>
42
+
43
+ <script lang="ts">
44
+ import PodcastInlineListTemplate from './PodcastInlineListTemplate.vue';
45
+ import octopusApi from '@saooti/octopus-api';
46
+ import domHelper from '../../../helper/dom';
47
+ import PodcastItem from './PodcastItem.vue';
48
+ import { state } from '../../../store/paramStore';
49
+ import ClassicLoading from '../../form/ClassicLoading.vue';
50
+ import { Swiper, SwiperSlide } from "swiper/vue";
51
+ import { Navigation } from "swiper";
52
+ import "swiper/css";
53
+ import "swiper/css/navigation";
54
+ import { Podcast } from '@/store/class/general/podcast';
55
+ import { defineComponent } from 'vue'
56
+ export default defineComponent({
57
+ name: 'PodcastSwiperList',
58
+
59
+ components: {
60
+ PodcastInlineListTemplate,
61
+ PodcastItem,
62
+ ClassicLoading,
63
+ Swiper,
64
+ SwiperSlide,
65
+ },
66
+
67
+ props: {
68
+ organisationId: { default: undefined, type: String},
69
+ emissionId: { default: undefined, type: Number},
70
+ iabId: { default: undefined, type: Number},
71
+ title: { default: '', type: String},
72
+ href: { default: undefined, type: String},
73
+ buttonText: { default: undefined, type: String},
74
+ isArrow: { default: false, type: Boolean},
75
+ requirePopularSort: { default:undefined, type: Boolean},
76
+ buttonPlus: { default:false, type: Boolean},
77
+ rubriqueId: { default: () => [], type: Array as ()=> Array<number> },
78
+ rubriquageId:{ default: () => [], type: Array as ()=> Array<number> },
79
+ noRubriquageId: { default: () => [], type: Array as ()=> Array<number> },
80
+ query: { default: undefined, type: String},
81
+ },
82
+ emits: ['update:isArrow'],
83
+
84
+ data() {
85
+ return {
86
+ loading: true as boolean,
87
+ loaded: true as boolean,
88
+ popularSort: false as boolean,
89
+ allPodcasts: [] as Array<Podcast>,
90
+ modules: [Navigation],
91
+ numberItem: 5 as number
92
+ };
93
+ },
94
+ computed: {
95
+ filterOrga(): string {
96
+ return this.$store.state.filter.organisationId;
97
+ },
98
+ organisation(): string|undefined {
99
+ if (this.organisationId) return this.organisationId;
100
+ if (this.filterOrga) return this.filterOrga;
101
+ return undefined;
102
+ },
103
+ watchVariable():string{
104
+ return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
105
+ },
106
+ sizeItem(): number {
107
+ return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
108
+ },
109
+ },
110
+ watch: {
111
+ watchVariable(): void {
112
+ this.reset();
113
+ this.fetchNext();
114
+ },
115
+ },
116
+
117
+ created() {
118
+ if (undefined !== this.requirePopularSort) {
119
+ this.popularSort = this.requirePopularSort;
120
+ }
121
+ if (undefined !== this.isArrow) {
122
+ this.$emit('update:isArrow', true);
123
+ }
124
+ window.addEventListener('resize', this.handleResize);
125
+ },
126
+ unmounted() {
127
+ window.removeEventListener('resize', this.handleResize);
128
+ },
129
+
130
+
131
+ mounted() {
132
+ this.fetchNext();
133
+ },
134
+ methods: {
135
+ handleResize(): void {
136
+ if (!this.$el) return;
137
+ const width = (this.$el as HTMLElement).offsetWidth;
138
+ const sixteen = domHelper.convertRemToPixels(this.sizeItem + 2);
139
+ this.numberItem = Math.floor(width / sixteen);
140
+ },
141
+ async fetchNext(): Promise<void> {
142
+ const data = await octopusApi.fetchPodcasts({
143
+ first: 0,
144
+ size: 10,
145
+ organisationId: this.organisation,
146
+ emissionId: this.emissionId,
147
+ iabId: this.iabId,
148
+ rubriqueId: this.rubriqueId.length ?this.rubriqueId:undefined,
149
+ rubriquageId: this.rubriquageId.length ?this.rubriquageId : undefined,
150
+ noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
151
+ sort: this.popularSort ? 'POPULARITY' : 'DATE',
152
+ query: this.query,
153
+ });
154
+ this.loading = false;
155
+ this.loaded = true;
156
+ this.allPodcasts = this.allPodcasts.concat(
157
+ data.result.filter((pod: Podcast|null) => null !== pod)
158
+ );
159
+ },
160
+ sortPopular(): void {
161
+ if (this.popularSort) return;
162
+ this.popularSort = true;
163
+ this.reset();
164
+ this.fetchNext();
165
+ },
166
+ sortChrono(): void {
167
+ if (!this.popularSort) return;
168
+ this.popularSort = false;
169
+ this.reset();
170
+ this.fetchNext();
171
+ },
172
+ reset(): void {
173
+ this.loading = true;
174
+ this.loaded = true;
175
+ this.allPodcasts.length = 0;
176
+ },
177
+ },
178
+ })
179
+ </script>
180
+ <style lang="scss">
181
+ @import '../../../sass/_variables.scss';
182
+ .swiper {
183
+ width: 100%;
184
+ height: 100%;
185
+ padding: 50px 20px;
186
+ }
187
+ .swiper-button-next, .swiper-button-prev{
188
+ color: $octopus-primary-color !important;
189
+ height: 100%;
190
+ top: 0;
191
+ bottom: 0;
192
+ margin: 0;
193
+ width: 50px;
194
+ }
195
+ .swiper-button-next{
196
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%,#fafafa 50%, #fafafa 100%);
197
+ right: 0;
198
+ }
199
+ .swiper-button-prev{
200
+ background: linear-gradient(90deg, #fafafa 0%,#fafafa 50%, rgba(255, 255, 255, 0) 100%);
201
+ left: 0;
202
+ }
203
+
204
+ .swiper-slide {
205
+ display: flex;
206
+ justify-content: center;
207
+ align-items: center;
208
+ }
209
+ </style>
@@ -87,7 +87,7 @@
87
87
  rel="noopener"
88
88
  target="_blank"
89
89
  :class="[
90
- bigRound ? 'btn btn-big-round' : 'btn btn-linkedin share-btn mb-2',
90
+ bigRound ? 'btn btn-big-round' : 'btn btn-primaryedin share-btn mb-2',
91
91
  verticalDisplay ? '' : 'mx-2',
92
92
  ]"
93
93
  :href="linkedinURL"