@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
@@ -2,7 +2,7 @@
2
2
  <div class="page-box">
3
3
  <template v-if="loaded && !error">
4
4
  <div class="page-podcast-title">
5
- <h1 v-if="!isOuestFrance">
5
+ <h1>
6
6
  {{ titlePage }}
7
7
  </h1>
8
8
  <Countdown
@@ -27,9 +27,8 @@
27
27
  @validatePodcast="updatePodcast"
28
28
  />
29
29
  <EditBox
30
- v-else-if="editRight && isEditBox"
30
+ v-else-if="editRight && pageParameters.isEditBox"
31
31
  :podcast="podcast"
32
- :is-ready="true"
33
32
  @validatePodcast="updatePodcast"
34
33
  />
35
34
  <PodcastModuleBox
@@ -38,53 +37,50 @@
38
37
  :fetch-conference="fetchConference"
39
38
  />
40
39
  <SubscribeButtons
41
- v-if="isShareButtons && countLink >= 1"
40
+ v-if="pageParameters.isShareButtons && countLink >= 1"
42
41
  :emission="podcast.emission"
43
42
  />
44
43
  </div>
45
44
  <div
46
45
  class="d-flex flex-column flex-grow-mobile"
47
- :class="authenticated || notExclusive ? 'flex-grow-1' : ''"
48
46
  >
49
47
  <SharePlayer
50
- v-if="isSharePlayer && (authenticated || notExclusive)"
48
+ v-if="pageParameters.isSharePlayer && (authenticated || notExclusive)"
51
49
  :podcast="podcast"
52
50
  :emission="podcast.emission"
53
51
  :exclusive="exclusive"
54
52
  :not-exclusive="notExclusive"
55
- :organisation-id="organisationId"
53
+ :organisation-id="myOrganisationId"
56
54
  :is-education="isEducation"
57
55
  />
58
56
  <ShareButtons
59
- v-if="isShareButtons"
57
+ v-if="pageParameters.isShareButtons"
60
58
  :podcast="podcast"
61
59
  :not-exclusive="notExclusive"
62
60
  />
63
61
  </div>
64
62
  </div>
65
- <template v-if="!isOuestFrance">
66
- <CommentSection
67
- v-if="!isPodcastmaker"
68
- ref="commentSection"
69
- :podcast="podcast"
70
- :fetch-conference="fetchConference"
71
- />
72
- <PodcastInlineList
73
- class="mt-4"
74
- :emission-id="podcast.emission.emissionId"
75
- :href="'/main/pub/emission/' + podcast.emission.emissionId"
76
- :title="$t('More episodes of this emission')"
77
- :button-text="$t('All podcast emission button')"
78
- />
79
- <PodcastInlineList
80
- v-for="c in categories"
81
- :key="c.id"
82
- :iab-id="c.id"
83
- :href="'/main/pub/category/' + c.id"
84
- :title="$t('More episodes of this category : ', { name: c.name })"
85
- :button-text="$t('All podcast button', { name: c.name })"
86
- />
87
- </template>
63
+ <CommentSection
64
+ v-if="!isPodcastmaker"
65
+ ref="commentSection"
66
+ :podcast="podcast"
67
+ :fetch-conference="fetchConference"
68
+ />
69
+ <PodcastInlineList
70
+ class="mt-4"
71
+ :emission-id="podcast.emission.emissionId"
72
+ :href="'/main/pub/emission/' + podcast.emission.emissionId"
73
+ :title="$t('More episodes of this emission')"
74
+ :button-text="$t('All podcast emission button')"
75
+ />
76
+ <PodcastInlineList
77
+ v-for="c in categories"
78
+ :key="c.id"
79
+ :iab-id="c.id"
80
+ :href="'/main/pub/category/' + c.id"
81
+ :title="$t('More episodes of this category : ', { name: c.name })"
82
+ :button-text="$t('All podcast button', { name: c.name })"
83
+ />
88
84
  </template>
89
85
  <ClassicLoading
90
86
  :loading-text="!loaded?$t('Loading content ...'):undefined"
@@ -94,6 +90,7 @@
94
90
  </template>
95
91
 
96
92
  <script lang="ts">
93
+ import { orgaComputed } from '../mixins/orgaComputed';
97
94
  import PodcastInlineList from '../display/podcasts/PodcastInlineList.vue';
98
95
  import PodcastModuleBox from '../display/podcasts/PodcastModuleBox.vue';
99
96
  import ClassicLoading from '../form/ClassicLoading.vue';
@@ -131,7 +128,7 @@ export default defineComponent({
131
128
  ClassicLoading
132
129
  },
133
130
 
134
- mixins: [handle403],
131
+ mixins: [handle403, orgaComputed],
135
132
 
136
133
  props: {
137
134
  updateStatus: { default: undefined, type: String},
@@ -157,26 +154,12 @@ export default defineComponent({
157
154
  isPodcastmaker(): boolean {
158
155
  return (state.generalParameters.podcastmaker as boolean);
159
156
  },
160
- isEditBox(): boolean {
161
- return (state.podcastPage.EditBox as boolean);
162
- },
163
- isShareButtons(): boolean {
164
- return (state.podcastPage.ShareButtons as boolean);
165
- },
166
- isSharePlayer(): boolean {
167
- return (state.podcastPage.SharePlayer as boolean);
168
- },
169
- allCategories(): Array<Category> {
170
- return this.$store.state.categories;
171
- },
172
- organisationId(): string|undefined {
173
- return state.generalParameters.organisationId;
174
- },
175
- authenticated(): boolean {
176
- return (state.generalParameters.authenticated as boolean);
177
- },
178
- isOuestFrance(): boolean {
179
- return (state.podcastPage.ouestFranceStyle as boolean);
157
+ pageParameters(){
158
+ return {
159
+ isEditBox : (state.podcastPage.EditBox as boolean),
160
+ isShareButtons: (state.podcastPage.ShareButtons as boolean),
161
+ isSharePlayer: (state.podcastPage.SharePlayer as boolean),
162
+ };
180
163
  },
181
164
  emissionMainCategory(): number {
182
165
  if(!this.podcast){return 0;}
@@ -195,7 +178,7 @@ export default defineComponent({
195
178
  },
196
179
  categories(): Array<Category> {
197
180
  if ('undefined' === typeof this.podcast) return [];
198
- return this.allCategories
181
+ return this.$store.state.categories
199
182
  .filter((item: Category) => {
200
183
  return ( this.podcast &&
201
184
  this.podcast.emission.iabIds &&
@@ -211,7 +194,7 @@ export default defineComponent({
211
194
  editRight(): boolean {
212
195
  if ( this.podcast &&
213
196
  (this.authenticated &&
214
- this.organisationId === this.podcast.organisation.id) ||
197
+ this.myOrganisationId === this.podcast.organisation.id) ||
215
198
  state.generalParameters.isAdmin
216
199
  ){
217
200
  return true;
@@ -223,8 +206,7 @@ export default defineComponent({
223
206
  if (this.podcast && this.podcast.emission && this.podcast.emission.annotations) {
224
207
  if (undefined !== this.podcast.emission.annotations.amazon) count++;
225
208
  if (undefined !== this.podcast.emission.annotations.googlePodcasts) count++;
226
- if (undefined !== this.podcast.emission.annotations.applePodcast)
227
- count++;
209
+ if (undefined !== this.podcast.emission.annotations.applePodcast)count++;
228
210
  if (undefined !== this.podcast.emission.annotations.deezer) count++;
229
211
  if (undefined !== this.podcast.emission.annotations.spotify) count++;
230
212
  if (undefined !== this.podcast.emission.annotations.tunein) count++;
@@ -269,9 +251,6 @@ export default defineComponent({
269
251
  if(!this.podcast){return "";}
270
252
  return moment(this.podcast.pubDate).diff(moment(), 'seconds').toString();
271
253
  },
272
- filterOrga(): string {
273
- return this.$store.state.filter.organisationId;
274
- },
275
254
  },
276
255
  watch: {
277
256
  updateStatus(): void {
@@ -279,44 +258,38 @@ export default defineComponent({
279
258
  this.fetchConference.status = this.updateStatus;
280
259
  }
281
260
  },
282
- podcastId(): void {
283
- this.loaded = false;
284
- this.error = false;
285
- this.getPodcastDetails(this.podcastId);
261
+ podcastId: {
262
+ immediate: true,
263
+ async handler() {
264
+ await this.getPodcastDetails();
265
+ this.initConference();
266
+ },
286
267
  },
287
268
  },
288
269
 
289
- async mounted() {
290
- await this.getPodcastDetails(this.podcastId);
291
- if (!this.podcast) return;
292
- if (!this.isLiveReadyToRecord) return;
293
- if (this.isOctopusAndAnimator && undefined!==this.podcast.conferenceId) {
294
- const data = await studioApi.getConference(this.$store.state,this.podcast.conferenceId.toString());
295
- if (data) {
296
- this.fetchConference = data;
297
- } else {
298
- this.fetchConference = {conferenceId:-1, title:''};
299
- }
300
- } else if(undefined!==this.podcast.conferenceId){
301
- const data = await octopusApi.getRealConferenceStatus(this.podcast.conferenceId.toString());
302
- this.fetchConference = {
303
- status: data,
304
- conferenceId: this.podcast.conferenceId,
305
- title:'',
306
- };
307
- }
308
- if (
309
- this.fetchConference &&
310
- -1 !== this.fetchConference.conferenceId &&
311
- 'PUBLISHING' !== this.fetchConference.status &&
312
- 'DEBRIEFING' !== this.fetchConference.status
313
- ) {
314
- this.$emit('initConferenceId', this.podcast.conferenceId);
315
- }
316
- },
317
-
318
-
319
270
  methods: {
271
+ async initConference(){
272
+ if (!this.podcast || !this.isLiveReadyToRecord) return;
273
+ if (this.isOctopusAndAnimator && undefined!==this.podcast.conferenceId) {
274
+ const data = await studioApi.getConference(this.$store.state,this.podcast.conferenceId.toString());
275
+ this.fetchConference = data ? data : {conferenceId:-1, title:''};
276
+ } else if(undefined!==this.podcast.conferenceId){
277
+ const data = await octopusApi.getRealConferenceStatus(this.podcast.conferenceId.toString());
278
+ this.fetchConference = {
279
+ status: data,
280
+ conferenceId: this.podcast.conferenceId,
281
+ title:'',
282
+ };
283
+ }
284
+ if (
285
+ this.fetchConference &&
286
+ -1 !== this.fetchConference.conferenceId &&
287
+ 'PUBLISHING' !== this.fetchConference.status &&
288
+ 'DEBRIEFING' !== this.fetchConference.status
289
+ ) {
290
+ this.$emit('initConferenceId', this.podcast.conferenceId);
291
+ }
292
+ },
320
293
  updatePodcast(podcastUpdated: Podcast): void {
321
294
  this.podcast = podcastUpdated;
322
295
  },
@@ -324,36 +297,42 @@ export default defineComponent({
324
297
  this.error = true;
325
298
  this.loaded = true;
326
299
  },
327
- async getPodcastDetails(podcastId: number): Promise<void> {
300
+ handleAnnotations(){
301
+ if(!this.podcast){return;}
302
+ if (
303
+ this.podcast.emission.annotations &&
304
+ this.podcast.emission.annotations.exclusive
305
+ ) {
306
+ this.exclusive =
307
+ 'true' === this.podcast.emission.annotations.exclusive
308
+ ? true
309
+ : false;
310
+ this.exclusive =
311
+ this.exclusive &&
312
+ this.myOrganisationId !== this.podcast.organisation.id;
313
+ }
314
+ if (
315
+ this.podcast.emission.annotations &&
316
+ this.podcast.emission.annotations.notExclusive
317
+ ) {
318
+ this.notExclusive =
319
+ 'true' === this.podcast.emission.annotations.notExclusive
320
+ ? true
321
+ : false;
322
+ }
323
+ },
324
+ async getPodcastDetails(): Promise<void> {
325
+ this.loaded = false;
326
+ this.error = false;
328
327
  try {
329
- const data : Podcast = await octopusApi.fetchPodcast(podcastId.toString());
328
+ const data : Podcast = await octopusApi.fetchPodcast(this.podcastId.toString());
330
329
  if("PUBLIC"!==data.organisation.privacy && this.filterOrga!==data.organisation.id){
331
330
  this.initError();
332
331
  return;
333
332
  }
334
333
  this.podcast = data;
335
334
  this.$emit('podcastTitle', this.podcast.title);
336
- if (
337
- this.podcast.emission.annotations &&
338
- this.podcast.emission.annotations.exclusive
339
- ) {
340
- this.exclusive =
341
- 'true' === this.podcast.emission.annotations.exclusive
342
- ? true
343
- : false;
344
- this.exclusive =
345
- this.exclusive &&
346
- this.organisationId !== this.podcast.organisation.id;
347
- }
348
- if (
349
- this.podcast.emission.annotations &&
350
- this.podcast.emission.annotations.notExclusive
351
- ) {
352
- this.notExclusive =
353
- 'true' === this.podcast.emission.annotations.notExclusive
354
- ? true
355
- : false;
356
- }
335
+ this.handleAnnotations();
357
336
  if (
358
337
  (!this.podcast.availability.visibility ||
359
338
  ('READY_TO_RECORD' !== this.podcast.processingStatus &&
@@ -3,19 +3,14 @@
3
3
  <div
4
4
  class="d-flex"
5
5
  :class="
6
- isEmissionChooser ? 'justify-content-between' : 'justify-content-center'
6
+ pageParameters.isEmissionChooser ? 'justify-content-between' : 'justify-content-center'
7
7
  "
8
8
  >
9
9
  <h1 class="flex-shrink-0">
10
- <template v-if="undefined === titlePage">
11
- {{ $t('All podcasts') }}
12
- </template>
13
- <template v-else>
14
- {{ titlePage }}
15
- </template>
10
+ {{ titleDisplay }}
16
11
  </h1>
17
12
  <EmissionChooser
18
- v-if="isEmissionChooser"
13
+ v-if="pageParameters.isEmissionChooser"
19
14
  :defaultanswer="$t('No emission filter')"
20
15
  width="auto"
21
16
  class="ms-3"
@@ -23,7 +18,7 @@
23
18
  />
24
19
  </div>
25
20
  <ProductorSearch
26
- v-if="isProductorSearch"
21
+ v-if="pageParameters.isProductorSearch"
27
22
  :organisation-id="organisationId"
28
23
  :search-pattern="searchPattern"
29
24
  @updateOrganisationId="updateOrganisationId"
@@ -33,18 +28,18 @@
33
28
  :is-education="isEducation"
34
29
  :is-emission="false"
35
30
  :reset-rubriquage="resetRubriquage"
36
- :is-search-bar="isProductorSearch"
31
+ :is-search-bar="pageParameters.isProductorSearch"
37
32
  :sort-criteria="sortCriteria"
38
- :includeHidden="includeHidden"
33
+ :include-hidden="includeHidden"
39
34
  :organisation-id="organisationId"
40
- @updateCategory="updateCategory"
35
+ @updateCategory="iabId=$event"
41
36
  @updateRubriquageFilter="updateRubriquageFilter"
42
- @updateMonetization="updateMonetization"
43
- @updateFromDate="updateFromDate"
44
- @updateToDate="updateToDate"
45
- @updateSortCriteria="updateSortCriteria"
46
- @includeHidden="updateHidden"
47
- @notValid="updateNotValid"
37
+ @updateMonetization="monetization = $event"
38
+ @updateFromDate="fromDate = $event"
39
+ @updateToDate="toDate = $event"
40
+ @updateSortCriteria="sortCriteria=$event"
41
+ @includeHidden="includeHidden = $event"
42
+ @notValid="notValid = $event"
48
43
  />
49
44
  <PodcastList
50
45
  :show-count="true"
@@ -68,32 +63,30 @@
68
63
  </template>
69
64
 
70
65
  <script lang="ts">
66
+ import { orgaComputed } from '../mixins/orgaComputed';
71
67
  import PodcastList from '../display/podcasts/PodcastList.vue';
72
68
  import { state } from '../../store/paramStore';
73
69
  import ProductorSearch from '../display/filter/ProductorSearch.vue';
74
70
  import AdvancedSearch from '../display/filter/AdvancedSearch.vue';
75
71
  import { Emission } from '@/store/class/general/emission';
76
- import { Category } from '@/store/class/general/category';
77
72
  import { RubriquageFilter } from '@/store/class/rubrique/rubriquageFilter';
78
73
 
79
74
  import { defineComponent, defineAsyncComponent } from 'vue';
80
75
  const EmissionChooser = defineAsyncComponent(() => import('../display/emission/EmissionChooser.vue'));
81
76
  export default defineComponent({
82
77
  name:"Podcasts",
83
-
84
78
  components: {
85
79
  PodcastList,
86
80
  ProductorSearch,
87
81
  EmissionChooser,
88
82
  AdvancedSearch,
89
83
  },
90
-
84
+ mixins:[orgaComputed],
91
85
  props: {
92
86
  productor: { default: undefined, type: String},
93
87
  isEducation: { default: false, type: Boolean},
94
88
  searchInit: { default: "", type: String}
95
89
  },
96
-
97
90
  data() {
98
91
  return {
99
92
  first: 0 as number,
@@ -116,17 +109,11 @@ export default defineComponent({
116
109
  },
117
110
 
118
111
  computed: {
119
- rubriqueFilter(): Array<RubriquageFilter>{
120
- return this.$store.state.filter.rubriqueFilter;
121
- },
122
- categoryFilter(): Category|undefined{
123
- return this.$store.state.filter.iab;
124
- },
125
- authenticated(): boolean {
126
- return (state.generalParameters.authenticated as boolean);
127
- },
128
- myOrganisationId(): string|undefined {
129
- return state.generalParameters.organisationId;
112
+ titleDisplay(): string{
113
+ if(undefined === state.podcastsPage.titlePage){
114
+ return this.$t('All podcasts');
115
+ }
116
+ return state.podcastsPage.titlePage;
130
117
  },
131
118
  organisationRight(): boolean {
132
119
  if (
@@ -136,62 +123,30 @@ export default defineComponent({
136
123
  return true;
137
124
  return false;
138
125
  },
139
- filterOrga(): string|undefined {
140
- return this.$store.state.filter.organisationId;
141
- },
142
126
  organisation(): string|undefined {
143
127
  if (this.organisationId) return this.organisationId;
144
128
  if (this.filterOrga) return this.filterOrga;
145
129
  return undefined;
146
130
  },
147
- isProductorSearch(): boolean {
148
- return (state.podcastsPage.ProductorSearch as boolean);
149
- },
150
- titlePage(): string|undefined {
151
- return state.podcastsPage.titlePage;
152
- },
153
- isEmissionChooser(): boolean {
154
- return (state.podcastsPage.emissionChooser as boolean);
155
- },
131
+ pageParameters(){
132
+ return {
133
+ isProductorSearch: state.podcastsPage.ProductorSearch,
134
+ isEmissionChooser: state.podcastsPage.emissionChooser
135
+ }
136
+ }
156
137
  },
157
138
 
158
139
  created() {
159
- if(this.searchInit){
160
- this.searchPattern = this.searchInit;
161
- }
162
- if (this.productor) {
163
- this.organisationId = this.productor;
164
- } else if (this.$store.state.filter.organisationId) {
165
- this.organisationId = this.$store.state.filter.organisationId;
166
- }
167
- if (this.organisation && this.organisationRight) {
168
- this.includeHidden = true;
169
- }
170
- if(this.categoryFilter){
171
- this.iabId = this.categoryFilter.id;
172
- }
173
- if(this.rubriqueFilter.length){
174
- this.updateRubriquageFilter(this.rubriqueFilter);
140
+ this.searchPattern = this.searchInit ? this.searchInit : '';
141
+ this.organisationId = this.productor ? this.productor : this.filterOrga;
142
+ this.includeHidden = this.organisation && this.organisationRight ? true : false;
143
+ this.iabId = this.$store.state.filter.iab ? this.$store.state.filter.iab.id : undefined;
144
+ if(this.$store.state.filter.rubriqueFilter.length){
145
+ this.updateRubriquageFilter(this.$store.state.filter.rubriqueFilter);
175
146
  }
176
147
  },
177
148
 
178
-
179
149
  methods: {
180
- updateCategory(value: number|undefined){
181
- this.iabId = value;
182
- },
183
- updateSortCriteria(value: string): void {
184
- this.sortCriteria = value;
185
- },
186
- updateHidden(value: boolean): void {
187
- this.includeHidden = value;
188
- },
189
- updateToDate(value: string): void {
190
- this.toDate = value;
191
- },
192
- updateFromDate(value: string): void {
193
- this.fromDate = value;
194
- },
195
150
  updateRubriquageFilter(value: Array<RubriquageFilter>){
196
151
  const length = value.length;
197
152
  const allRubriquageId: Array<number>= [];
@@ -218,25 +173,11 @@ export default defineComponent({
218
173
  this.organisationId = value;
219
174
  },
220
175
  updateSearchPattern(value: string): void {
221
- if ('' !== value) {
222
- this.sortCriteria = 'SCORE';
223
- } else {
224
- this.sortCriteria = 'DATE';
225
- }
176
+ this.sortCriteria = '' !== value ? 'SCORE' : 'DATE';
226
177
  this.searchPattern = value;
227
178
  },
228
- updateMonetization(value: string): void {
229
- this.monetization = value;
230
- },
231
- updateNotValid(value: boolean): void {
232
- this.notValid = value;
233
- },
234
179
  emissionSelected(emission: Emission): void {
235
- if (emission && emission.emissionId) {
236
- this.emissionId = emission.emissionId;
237
- } else {
238
- this.emissionId = undefined;
239
- }
180
+ this.emissionId = emission && emission.emissionId ? emission.emissionId : undefined;
240
181
  },
241
182
  },
242
183
  })
@@ -15,37 +15,26 @@ import PodcastList from '../display/podcasts/PodcastList.vue';
15
15
  import { defineComponent } from 'vue'
16
16
  export default defineComponent({
17
17
  name:"Rubrique",
18
-
19
18
  components: {
20
19
  PodcastList,
21
20
  },
22
-
23
21
  props: {
24
22
  firstRoute: { default: 0, type: Number},
25
23
  sizeRoute: { default: 12, type: Number},
26
24
  rubriqueId: { default: undefined, type: [ Number ]},
27
25
  },
28
-
29
26
  data() {
30
27
  return {
31
28
  title: '' as string,
32
29
  };
33
30
  },
34
-
35
31
  watch: {
36
- rubriqueId(): void {
37
- this.extractTitle();
38
- },
39
- },
40
-
41
- mounted() {
42
- this.extractTitle();
43
- },
44
-
45
- methods: {
46
- async extractTitle(): Promise<void> {
47
- const data = await octopusApi.fetchRubric(this.rubriqueId);
48
- this.title = data.name;
32
+ rubriqueId: {
33
+ immediate: true,
34
+ async handler() {
35
+ const data = await octopusApi.fetchRubric(this.rubriqueId);
36
+ this.title = data.name;
37
+ },
49
38
  },
50
39
  },
51
40
  })
@@ -1,16 +1,6 @@
1
1
  <template>
2
2
  <div class="page-box">
3
- <h1>
4
- <template v-if="!hideBar">
5
- {{ $t('Podcast search') }}
6
- </template>
7
- <template v-else-if="!noResult">
8
- {{ $t('Search results', { query: rawQuery }) }}
9
- </template>
10
- <template v-else>
11
- {{ $t('Search - no results', { query: rawQuery }) }}
12
- </template>
13
- </h1>
3
+ <h1>{{ titlePage }}</h1>
14
4
  <ClassicSearch
15
5
  v-if="!hideBar"
16
6
  v-model:textInit="rawQuery"
@@ -23,7 +13,7 @@
23
13
  :query="query"
24
14
  :first="0"
25
15
  :size="20"
26
- @emptyList="onListEmpty"
16
+ @emptyList="noResult = true"
27
17
  />
28
18
  </div>
29
19
  </template>
@@ -35,24 +25,29 @@ import PodcastList from '../display/podcasts/PodcastList.vue';
35
25
  import { defineComponent } from 'vue';
36
26
  export default defineComponent({
37
27
  name: "Search",
38
-
39
28
  components: {
40
29
  PodcastList,
41
30
  ClassicSearch
42
31
  },
43
-
44
32
  props: {
45
33
  queryRoute: { default: '', type: String },
46
34
  },
47
-
48
35
  data() {
49
36
  return {
50
37
  rawQuery: '' as string,
51
38
  noResult: false as boolean,
52
39
  };
53
40
  },
54
-
55
41
  computed: {
42
+ titlePage():string{
43
+ if(!this.hideBar){
44
+ return this.$t('Podcast search');
45
+ }
46
+ if(!this.noResult){
47
+ return this.$t('Search results', { query: this.rawQuery })
48
+ }
49
+ return this.$t('Search - no results', { query: this.rawQuery });
50
+ },
56
51
  query(): string {
57
52
  if (this.rawQuery && this.rawQuery.length >= 3) return this.rawQuery;
58
53
  return '';
@@ -61,32 +56,17 @@ export default defineComponent({
61
56
  return (state.searchPage.hideBar as boolean);
62
57
  },
63
58
  },
64
-
65
59
  watch: {
66
60
  rawQuery(): void{
67
61
  if (this.hideBar) {
68
62
  this.noResult = false;
69
63
  }
70
64
  },
71
- query(): void{
72
- this.rawQuery = this.query;
73
- },
74
- queryRoute(): void{
75
- this.rawQuery = this.queryRoute;
76
- }
77
- },
78
-
79
- mounted() {
80
- if (this.queryRoute) {
81
- this.rawQuery = this.queryRoute;
82
- }
83
- },
84
-
85
- methods: {
86
- onListEmpty(): void {
87
- if (this.hideBar) {
88
- this.noResult = true;
89
- }
65
+ queryRoute: {
66
+ immediate: true,
67
+ handler() {
68
+ this.rawQuery = this.queryRoute;
69
+ },
90
70
  },
91
71
  },
92
72
  })