@saooti/octopus-sdk 32.0.2 → 32.0.5

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 (89) hide show
  1. package/README.md +6 -1
  2. package/package.json +2 -2
  3. package/public/css/fonts/icomoon.eot +0 -0
  4. package/public/css/fonts/icomoon.svg +130 -0
  5. package/public/css/fonts/icomoon.ttf +0 -0
  6. package/public/css/fonts/icomoon.woff +0 -0
  7. package/public/css/fonts/style.css +185 -1275
  8. package/src/App.vue +1 -1
  9. package/src/assets/bootstrap-diff.scss +1 -0
  10. package/src/assets/form.scss +3 -1
  11. package/src/assets/multiselect.scss +11 -0
  12. package/src/components/display/categories/CategoryChooser.vue +1 -1
  13. package/src/components/display/comments/AddCommentModal.vue +1 -3
  14. package/src/components/display/comments/CommentInput.vue +14 -30
  15. package/src/components/display/comments/CommentItem.vue +7 -14
  16. package/src/components/display/comments/CommentList.vue +7 -15
  17. package/src/components/display/comments/CommentPlayer.vue +1 -4
  18. package/src/components/display/comments/CommentSection.vue +1 -1
  19. package/src/components/display/edit/EditCommentBox.vue +3 -3
  20. package/src/components/display/emission/EmissionChooser.vue +5 -20
  21. package/src/components/display/emission/EmissionInlineList.vue +1 -6
  22. package/src/components/display/emission/EmissionItem.vue +3 -10
  23. package/src/components/display/emission/EmissionList.vue +6 -13
  24. package/src/components/display/emission/EmissionPlayerItem.vue +5 -13
  25. package/src/components/display/filter/AdvancedSearch.vue +6 -14
  26. package/src/components/display/filter/MonetizableFilter.vue +1 -1
  27. package/src/components/display/filter/RubriqueChoice.vue +1 -1
  28. package/src/components/display/filter/RubriqueFilter.vue +1 -3
  29. package/src/components/display/list/ListPaginate.vue +1 -6
  30. package/src/components/display/live/LiveItem.vue +6 -17
  31. package/src/components/display/live/LiveList.vue +12 -16
  32. package/src/components/display/organisation/OrganisationChooser.vue +3 -7
  33. package/src/components/display/organisation/OrganisationChooserLight.vue +1 -5
  34. package/src/components/display/participant/ParticipantItem.vue +4 -9
  35. package/src/components/display/participant/ParticipantList.vue +1 -3
  36. package/src/components/display/playlist/PlaylistItem.vue +6 -16
  37. package/src/components/display/playlist/PlaylistList.vue +2 -5
  38. package/src/components/display/playlist/PodcastList.vue +3 -7
  39. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +2 -9
  40. package/src/components/display/podcasts/AnimatorsItem.vue +1 -1
  41. package/src/components/display/podcasts/ParticipantDescription.vue +1 -1
  42. package/src/components/display/podcasts/PodcastFilterList.vue +1 -1
  43. package/src/components/display/podcasts/PodcastImage.vue +14 -22
  44. package/src/components/display/podcasts/PodcastInlineListClassic.vue +2 -8
  45. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +2 -2
  46. package/src/components/display/podcasts/PodcastItem.vue +2 -5
  47. package/src/components/display/podcasts/PodcastItemInfo.vue +4 -9
  48. package/src/components/display/podcasts/PodcastList.vue +5 -13
  49. package/src/components/display/podcasts/PodcastModuleBox.vue +7 -22
  50. package/src/components/display/podcasts/PodcastPlayBar.vue +3 -4
  51. package/src/components/display/podcasts/PodcastSwiperList.vue +1 -3
  52. package/src/components/display/rubriques/RubriqueChooser.vue +5 -16
  53. package/src/components/display/rubriques/RubriqueList.vue +2 -2
  54. package/src/components/display/sharing/QrCode.vue +1 -1
  55. package/src/components/display/sharing/ShareButtonsIntern.vue +5 -5
  56. package/src/components/display/sharing/ShareDistribution.vue +30 -95
  57. package/src/components/display/sharing/SharePlayer.vue +6 -14
  58. package/src/components/display/sharing/SharePlayerTypes.vue +1 -1
  59. package/src/components/display/sharing/SubscribeButtons.vue +2 -4
  60. package/src/components/form/ClassicSearch.vue +4 -4
  61. package/src/components/form/ClassicSelect.vue +1 -1
  62. package/src/components/misc/Footer.vue +2 -2
  63. package/src/components/misc/HomeDropdown.vue +1 -1
  64. package/src/components/misc/LeftMenu.vue +3 -3
  65. package/src/components/misc/TopBar.vue +11 -15
  66. package/src/components/misc/modal/MessageModal.vue +1 -1
  67. package/src/components/misc/modal/NewsletterModal.vue +5 -7
  68. package/src/components/misc/modal/ShareModalPlayer.vue +4 -4
  69. package/src/components/misc/player/Player.vue +1 -1
  70. package/src/components/misc/player/PlayerCompact.vue +4 -4
  71. package/src/components/misc/player/PlayerLarge.vue +4 -4
  72. package/src/components/misc/player/PlayerTimeline.vue +1 -6
  73. package/src/components/pages/Emission.vue +14 -33
  74. package/src/components/pages/Emissions.vue +6 -15
  75. package/src/components/pages/Home.vue +1 -4
  76. package/src/components/pages/Lives.vue +3 -11
  77. package/src/components/pages/PageNotFound.vue +2 -2
  78. package/src/components/pages/Participant.vue +8 -23
  79. package/src/components/pages/Participants.vue +3 -6
  80. package/src/components/pages/Playlist.vue +10 -13
  81. package/src/components/pages/Playlists.vue +2 -3
  82. package/src/components/pages/Podcast.vue +15 -51
  83. package/src/components/pages/Podcasts.vue +7 -16
  84. package/src/components/pages/Search.vue +3 -6
  85. package/public/css/fonts/saooti-ui.eot +0 -0
  86. package/public/css/fonts/saooti-ui.svg +0 -843
  87. package/public/css/fonts/saooti-ui.ttf +0 -0
  88. package/public/css/fonts/saooti-ui.woff +0 -0
  89. package/public/css/fonts/stitcher-logo.svg +0 -83
@@ -142,42 +142,27 @@ export default defineComponent({
142
142
  return (state.generalParameters.podcastmaker as boolean);
143
143
  },
144
144
  rssUrl(): string {
145
- return state.generalParameters.ApiUri + 'rss/emission/' + this.emissionId;
145
+ return `${state.generalParameters.ApiUri}rss/emission/${this.emissionId}`;
146
146
  },
147
147
  name(): string {
148
- return this.emission ? this.emission.name : '';
148
+ return this.emission?.name??'';
149
149
  },
150
150
  imageUrl(): string {
151
- return this.emission
152
- ? this.emission.imageUrl + '?dummy=' + this.dummyParam
153
- : '';
151
+ return this.emission? `${this.emission.imageUrl}?dummy=${this.dummyParam}`:'';
154
152
  },
155
153
  description(): string {
156
- return this.emission ? this.emission.description : '';
154
+ return this.emission?.description??'';
157
155
  },
158
156
  editRight(): boolean {
159
- if (
160
- (this.authenticated && this.emission && this.myOrganisationId === this.emission.orga.id) ||
161
- state.generalParameters.isAdmin
162
- ){
163
- return true;
164
- }
165
- return false;
157
+ return (true===this.authenticated && this.myOrganisationId === this.emission?.orga.id) ||
158
+ true===state.generalParameters.isAdmin
166
159
  },
167
160
  countLink(): number {
161
+ const platformShare = ['amazon','googlePodcasts','applePodcast', 'deezer', 'spotify', 'tunein',
162
+ 'radioline', 'podcastAddict', 'playerFm', 'stitcher', 'pocketCasts'];
168
163
  let count = 0;
169
- if (this.emission && this.emission.annotations) {
170
- if (undefined !== this.emission.annotations.amazon) count++;
171
- if (undefined !== this.emission.annotations.applePodcast) count++;
172
- if (undefined !== this.emission.annotations.deezer) count++;
173
- if (undefined !== this.emission.annotations.googlePodcasts) count++;
174
- if (undefined !== this.emission.annotations.spotify) count++;
175
- if (undefined !== this.emission.annotations.tunein) count++;
176
- if (undefined !== this.emission.annotations.radioline) count++;
177
- if (undefined !== this.emission.annotations.podcastAddict) count++;
178
- if (undefined !== this.emission.annotations.playerFm) count++;
179
- if (undefined !== this.emission.annotations.stitcher) count++;
180
- if (undefined !== this.emission.annotations.pocketCasts) count++;
164
+ for (let i = 0, len = platformShare.length; i < len; i++) {
165
+ if (undefined !== this.emission?.annotations?.[platformShare[i]]) count++;
181
166
  }
182
167
  return count;
183
168
  },
@@ -200,22 +185,18 @@ export default defineComponent({
200
185
  this.rssEmission = this.emission.annotations.RSS? true: false;
201
186
  this.ftpEmission = this.emission.annotations.FTP? true: false;
202
187
  if (this.emission.annotations.exclusive) {
203
- this.exclusive =
204
- 'true' === this.emission.annotations.exclusive ? true : false;
205
- this.exclusive =
206
- this.exclusive && this.myOrganisationId !== this.emission.orga.id;
188
+ this.exclusive ='true' === this.emission.annotations.exclusive;
189
+ this.exclusive =this.exclusive && this.myOrganisationId !== this.emission.orga.id;
207
190
  }
208
191
  if (this.emission.annotations.notExclusive) {
209
- this.notExclusive =
210
- 'true' === this.emission.annotations.notExclusive ? true : false;
192
+ this.notExclusive ='true' === this.emission.annotations.notExclusive;
211
193
  }
212
194
  },
213
195
  async getEmissionDetails(): Promise<void> {
214
196
  this.loaded = false;
215
197
  this.error = false;
216
198
  try {
217
- const data: Emission = await octopusApi.fetchData<Emission>(0,'emission/'+this.emissionId);
218
- this.emission = data;
199
+ this.emission = await octopusApi.fetchData<Emission>(0,'emission/'+this.emissionId);
219
200
  if("PUBLIC"!==this.emission.orga.privacy && this.filterOrga!==this.emission.orga.id){
220
201
  this.initError();
221
202
  return;
@@ -86,26 +86,17 @@ export default defineComponent({
86
86
 
87
87
  computed: {
88
88
  titleDisplay(): string{
89
- if(undefined === state.emissionsPage.titlePage){
90
- return this.$t('All emissions');
91
- }
92
- return state.emissionsPage.titlePage;
89
+ return state.emissionsPage.titlePage??this.$t('All emissions');
93
90
  },
94
91
  isProductorSearch(): boolean{
95
92
  return (state.podcastsPage.ProductorSearch as boolean);
96
93
  },
97
94
  organisationRight(): boolean {
98
- if (
99
- (this.authenticated && this.myOrganisationId === this.organisationId) ||
100
- state.generalParameters.isAdmin
101
- )
102
- return true;
103
- return false;
95
+ return (true===this.authenticated && this.myOrganisationId === this.organisationId) ||
96
+ true===state.generalParameters.isAdmin
104
97
  },
105
98
  organisation(): string|undefined {
106
- if (this.organisationId) return this.organisationId;
107
- if (this.filterOrga) return this.filterOrga;
108
- return undefined;
99
+ return this.organisationId??this.filterOrga;
109
100
  },
110
101
  },
111
102
 
@@ -114,8 +105,8 @@ export default defineComponent({
114
105
  },
115
106
  methods: {
116
107
  initComponent(): void{
117
- this.iabId = this.$store.state.filter.iab? this.$store.state.filter.iab.id : undefined;
118
- this.organisationId = this.productor ? this.productor : this.filterOrga;
108
+ this.iabId =this.$store.state.filter.iab?.id;
109
+ this.organisationId = this.productor?? this.filterOrga;
119
110
  if (this.organisation && this.organisationRight) {
120
111
  this.includeHidden = true;
121
112
  }
@@ -51,10 +51,7 @@ export default defineComponent({
51
51
  return this.$store.state.filter.rubriqueDisplay.filter((rubrique: Rubrique) => 0 !== rubrique.podcastCount );
52
52
  },
53
53
  rubriquageFilter(): Array<Rubriquage>{
54
- if(this.$store.state.filter.organisationId){
55
- return this.$store.state.filter.rubriquageArray;
56
- }
57
- return [];
54
+ return this.$store.state.filter.organisationId ? this.$store.state.filter.rubriquageArray :[];
58
55
  },
59
56
  rubriqueFilter(): Array<RubriquageFilter>{
60
57
  return this.$store.state.filter.rubriqueFilter;
@@ -57,11 +57,7 @@ export default defineComponent({
57
57
 
58
58
  computed: {
59
59
  liveRight(): boolean {
60
- if (this.isRoleLive && this.live) return true;
61
- return false;
62
- },
63
- isRoleLive(): boolean {
64
- return (state.generalParameters.isRoleLive as boolean);
60
+ return (state.generalParameters.isRoleLive as boolean)&& this.live;
65
61
  },
66
62
  filterOrga(): string {
67
63
  return this.$store.state.filter.organisationId;
@@ -76,11 +72,7 @@ export default defineComponent({
76
72
  } else if (this.$store.state.filter.organisationId) {
77
73
  this.$emit('update:organisationId',this.$store.state.filter.organisationId);
78
74
  }
79
- if (
80
- this.$store.state.organisation &&
81
- this.$store.state.organisation.attributes &&
82
- !this.$store.state.organisation.attributes['live.active']
83
- ) {
75
+ if (!this.$store.state.organisation?.attributes?.['live.active']) {
84
76
  this.live = false;
85
77
  }
86
78
  },
@@ -89,7 +81,7 @@ export default defineComponent({
89
81
  this.$emit('initConferenceIds', listIds);
90
82
  },
91
83
  onOrganisationSelected(organisation: Organisation|undefined): void {
92
- this.$emit('update:organisationId', organisation ? organisation.id : undefined);
84
+ this.$emit('update:organisationId', organisation?.id);
93
85
  },
94
86
  },
95
87
  })
@@ -11,7 +11,7 @@
11
11
  :to="{
12
12
  name: 'home',
13
13
  query: { productor: $store.state.filter.organisationId,
14
- iabId: $store.state.filter.iab ? $store.state.filter.iab.id : undefined,
14
+ iabId:$store.state.filter.iab?.id,
15
15
  rubriquesId: rubriqueQueryParam},
16
16
  }"
17
17
  >
@@ -28,7 +28,7 @@ export default defineComponent({
28
28
  name: 'PageNotFound',
29
29
  computed:{
30
30
  rubriqueQueryParam(): string|undefined{
31
- if(this.$store.state.filter && this.$store.state.filter.rubriqueFilter && this.$store.state.filter.rubriqueFilter.length){
31
+ if(this.$store.state.filter?.rubriqueFilter?.length){
32
32
  return this.$store.state.filter.rubriqueFilter.map((value: RubriquageFilter) => value.rubriquageId+':'+value.rubriqueId).join();
33
33
  }
34
34
  return undefined;
@@ -96,10 +96,7 @@ export default defineComponent({
96
96
  },
97
97
  computed: {
98
98
  titleDisplay(): string{
99
- if(undefined === state.intervenantPage.titlePage){
100
- return this.$t('Animator');
101
- }
102
- return state.intervenantPage.titlePage;
99
+ return state.intervenantPage.titlePage??this.$t('Animator');
103
100
  },
104
101
  pageParameters(){
105
102
  return {
@@ -109,30 +106,18 @@ export default defineComponent({
109
106
  };
110
107
  },
111
108
  rssUrl(): string {
112
- return state.generalParameters.ApiUri + 'rss/participant/' + this.participantId;
109
+ return `${state.generalParameters.ApiUri}rss/participant/${this.participantId}`;
113
110
  },
114
111
  description(): string {
115
- if(!this.participant){return '';}
116
- return this.participant.description || '';
112
+ return this.participant?.description ?? '';
117
113
  },
118
114
  name(): string {
119
- if(!this.participant){return '';}
120
- return (
121
- (this.participant.firstName || '') +
122
- ' ' +
123
- (this.participant.lastName || '')
124
- ).trim();
115
+ return (`${this.participant?.firstName??''} ${this.participant?.lastName??''}`).trim();
125
116
  },
126
117
  editRight(): boolean {
127
- if(!this.participant || !this.participant.orga ){return false;}
128
- if (
129
- (this.authenticated &&
130
- this.myOrganisationId === this.participant.orga.id) ||
131
- state.generalParameters.isAdmin
132
- ){
133
- return true;
134
- }
135
- return false;
118
+ return (true===this.authenticated &&
119
+ this.myOrganisationId === this.participant?.orga?.id) ||
120
+ true===state.generalParameters.isAdmin
136
121
  },
137
122
  },
138
123
  watch: {
@@ -158,7 +143,7 @@ export default defineComponent({
158
143
  this.loaded = false;
159
144
  try {
160
145
  const data = await octopusApi.fetchData<Participant>(0, 'participant/'+this.participantId);
161
- if(data && data.orga && "PUBLIC"!==data.orga.privacy && this.filterOrga!==data.orga.id){
146
+ if("PUBLIC"!==data?.orga?.privacy && this.filterOrga!==data?.orga?.id){
162
147
  this.initError();
163
148
  return;
164
149
  }
@@ -37,20 +37,17 @@ export default defineComponent({
37
37
  return {
38
38
  first: 0 as number,
39
39
  size: 30 as number,
40
- searchPattern: '',
40
+ searchPattern: '' as string,
41
41
  organisationId: undefined as string | undefined,
42
42
  };
43
43
  },
44
44
  computed: {
45
45
  titleDisplay(): string{
46
- if(undefined === state.intervenantsPage.titlePage){
47
- return this.$t('All participants');
48
- }
49
- return state.intervenantsPage.titlePage;
46
+ return state.intervenantsPage.titlePage ?? this.$t('All participants');
50
47
  },
51
48
  },
52
49
  created() {
53
- this.organisationId = this.productor? this.productor : this.filterOrga;
50
+ this.organisationId = this.productor??this.filterOrga;
54
51
  },
55
52
  })
56
53
  </script>
@@ -34,7 +34,10 @@
34
34
  :organisation-id="myOrganisationId"
35
35
  :is-education="isEducation"
36
36
  />
37
- <ShareButtons v-if="pageParameters.isShareButtons" :playlist="playlist" />
37
+ <ShareButtons
38
+ v-if="pageParameters.isShareButtons"
39
+ :playlist="playlist"
40
+ />
38
41
  </div>
39
42
  </div>
40
43
  <PodcastList :playlist="playlist" />
@@ -92,24 +95,19 @@ export default defineComponent({
92
95
  };
93
96
  },
94
97
  name(): string {
95
- return this.playlist ? this.playlist.title : '';
98
+ return this.playlist?.title ??'';
96
99
  },
97
100
  imageUrl(): string {
98
101
  const dummy = new Date().getTime().toString();
99
102
  return this.playlist ? this.playlist.imageUrl + '?dummy=' + dummy : '';
100
103
  },
101
104
  description(): string {
102
- return this.playlist ? this.playlist.description : '';
105
+ return this.playlist?.description ??'';
103
106
  },
104
107
  editRight(): boolean {
105
- if (
106
- (state.generalParameters.isPlaylist && this.playlist &&
107
- this.myOrganisationId === this.playlist.organisation?.id) ||
108
- state.generalParameters.isAdmin
109
- ){
110
- return true;
111
- }
112
- return false;
108
+ return (true===state.generalParameters.isPlaylist &&
109
+ this.myOrganisationId === this.playlist?.organisation?.id) ||
110
+ true ===state.generalParameters.isAdmin
113
111
  },
114
112
  },
115
113
  watch: {
@@ -130,8 +128,7 @@ export default defineComponent({
130
128
  try {
131
129
  this.loaded = false;
132
130
  this.error = false;
133
- const data: Playlist = await octopusApi.fetchData<Playlist>(0, 'playlist/'+this.playlistId);
134
- this.playlist = data;
131
+ this.playlist = await octopusApi.fetchData<Playlist>(0, 'playlist/'+this.playlistId);
135
132
  if("PUBLIC"!==this.playlist.organisation?.privacy && this.filterOrga!==this.playlist.organisation?.id){
136
133
  this.initError();
137
134
  return;
@@ -61,13 +61,12 @@ export default defineComponent({
61
61
  return (state.generalParameters.podcastmaker as boolean);
62
62
  },
63
63
  editRight(): boolean {
64
- if (state.generalParameters.isPlaylist) return true;
65
- return false;
64
+ return state.generalParameters.isPlaylist ? true : false;
66
65
  },
67
66
  },
68
67
 
69
68
  created() {
70
- this.organisationId = this.productor ? this.productor : this.filterOrga;
69
+ this.organisationId = this.productor ??this.filterOrga;
71
70
  },
72
71
  })
73
72
  </script>
@@ -161,15 +161,9 @@ export default defineComponent({
161
161
  },
162
162
  emissionMainCategory(): number {
163
163
  if(!this.podcast){return 0;}
164
- if (
165
- this.podcast.emission.annotations &&
166
- this.podcast.emission.annotations.mainIabId
167
- ) {
164
+ if (this.podcast.emission.annotations?.mainIabId) {
168
165
  return parseInt((this.podcast.emission.annotations.mainIabId as string), 10);
169
- } else if (
170
- this.podcast.emission.iabIds &&
171
- this.podcast.emission.iabIds.length
172
- ) {
166
+ } else if (this.podcast.emission.iabIds?.length) {
173
167
  return this.podcast.emission.iabIds[0];
174
168
  }
175
169
  return 0;
@@ -178,8 +172,7 @@ export default defineComponent({
178
172
  if ('undefined' === typeof this.podcast) return [];
179
173
  return this.$store.state.categories
180
174
  .filter((item: Category) => {
181
- return ( this.podcast &&
182
- this.podcast.emission.iabIds &&
175
+ return ( this.podcast?.emission.iabIds &&
183
176
  -1 !== this.podcast.emission.iabIds.indexOf(item.id)
184
177
  );
185
178
  })
@@ -190,34 +183,19 @@ export default defineComponent({
190
183
  });
191
184
  },
192
185
  editRight(): boolean {
193
- if ( this.podcast &&
194
- (this.authenticated &&
195
- this.myOrganisationId === this.podcast.organisation.id) ||
196
- state.generalParameters.isAdmin
197
- ){
198
- return true;
199
- }
200
- return false;
186
+ return (true ===this.authenticated &&this.myOrganisationId === this.podcast?.organisation.id) ||true===state.generalParameters.isAdmin;
201
187
  },
202
188
  countLink(): number {
189
+ const platformShare = ['amazon','googlePodcasts','applePodcast', 'deezer', 'spotify', 'tunein',
190
+ 'radioline', 'podcastAddict', 'playerFm', 'stitcher', 'pocketCasts'];
203
191
  let count = 0;
204
- if (this.podcast && this.podcast.emission && this.podcast.emission.annotations) {
205
- if (undefined !== this.podcast.emission.annotations.amazon) count++;
206
- if (undefined !== this.podcast.emission.annotations.googlePodcasts) count++;
207
- if (undefined !== this.podcast.emission.annotations.applePodcast)count++;
208
- if (undefined !== this.podcast.emission.annotations.deezer) count++;
209
- if (undefined !== this.podcast.emission.annotations.spotify) count++;
210
- if (undefined !== this.podcast.emission.annotations.tunein) count++;
211
- if (undefined !== this.podcast.emission.annotations.radioline) count++;
212
- if (undefined !== this.podcast.emission.annotations.podcastAddict) count++;
213
- if (undefined !== this.podcast.emission.annotations.playerFm) count++;
214
- if (undefined !== this.podcast.emission.annotations.stitcher) count++;
215
- if (undefined !== this.podcast.emission.annotations.pocketCasts) count++;
192
+ for (let i = 0, len = platformShare.length; i < len; i++) {
193
+ if (undefined !== this.podcast?.emission?.annotations?.[platformShare[i]]) count++;
216
194
  }
217
195
  return count;
218
196
  },
219
197
  isLiveReadyToRecord(): boolean {
220
- return (undefined!==this.podcast && undefined!==this.podcast.conferenceId && 0 !== this.podcast.conferenceId && 'READY_TO_RECORD' === this.podcast.processingStatus);
198
+ return (undefined!==this.podcast?.conferenceId && 0 !== this.podcast?.conferenceId && 'READY_TO_RECORD' === this.podcast?.processingStatus);
221
199
  },
222
200
  isCounter(): boolean {
223
201
  return (
@@ -242,12 +220,10 @@ export default defineComponent({
242
220
  );
243
221
  },
244
222
  titlePage(): string {
245
- if (this.isLiveReadyToRecord) return this.$t('Live episode').toString();
246
- return this.$t('Episode').toString();
223
+ return this.isLiveReadyToRecord ?this.$t('Live episode'): this.$t('Episode');
247
224
  },
248
225
  timeRemaining(): string {
249
- if(!this.podcast){return "";}
250
- return moment(this.podcast.pubDate).diff(moment(), 'seconds').toString();
226
+ return !this.podcast ? "":moment(this.podcast.pubDate).diff(moment(), 'seconds').toString();
251
227
  },
252
228
  },
253
229
  watch: {
@@ -297,26 +273,14 @@ export default defineComponent({
297
273
  },
298
274
  handleAnnotations(){
299
275
  if(!this.podcast){return;}
300
- if (
301
- this.podcast.emission.annotations &&
302
- this.podcast.emission.annotations.exclusive
303
- ) {
304
- this.exclusive =
305
- 'true' === this.podcast.emission.annotations.exclusive
306
- ? true
307
- : false;
276
+ if (this.podcast.emission.annotations?.exclusive) {
277
+ this.exclusive ='true' === this.podcast.emission.annotations.exclusive;
308
278
  this.exclusive =
309
279
  this.exclusive &&
310
280
  this.myOrganisationId !== this.podcast.organisation.id;
311
281
  }
312
- if (
313
- this.podcast.emission.annotations &&
314
- this.podcast.emission.annotations.notExclusive
315
- ) {
316
- this.notExclusive =
317
- 'true' === this.podcast.emission.annotations.notExclusive
318
- ? true
319
- : false;
282
+ if (this.podcast.emission.annotations?.notExclusive) {
283
+ this.notExclusive ='true' === this.podcast.emission.annotations.notExclusive;
320
284
  }
321
285
  },
322
286
  async getPodcastDetails(): Promise<void> {
@@ -110,23 +110,14 @@ export default defineComponent({
110
110
 
111
111
  computed: {
112
112
  titleDisplay(): string{
113
- if(undefined === state.podcastsPage.titlePage){
114
- return this.$t('All podcasts');
115
- }
116
- return state.podcastsPage.titlePage;
113
+ return state.podcastsPage.titlePage ?? this.$t('All podcasts');
117
114
  },
118
115
  organisationRight(): boolean {
119
- if (
120
- (this.authenticated && this.myOrganisationId === this.organisationId) ||
121
- state.generalParameters.isAdmin
122
- )
123
- return true;
124
- return false;
116
+ return (true===this.authenticated && this.myOrganisationId === this.organisationId) ||
117
+ true===state.generalParameters.isAdmin;
125
118
  },
126
119
  organisation(): string|undefined {
127
- if (this.organisationId) return this.organisationId;
128
- if (this.filterOrga) return this.filterOrga;
129
- return undefined;
120
+ return this.organisationId ?? this.filterOrga;
130
121
  },
131
122
  pageParameters(){
132
123
  return {
@@ -142,10 +133,10 @@ export default defineComponent({
142
133
 
143
134
  methods: {
144
135
  initPodcastsPage(){
145
- this.searchPattern = this.searchInit ? this.searchInit : '';
146
- this.organisationId = this.productor ? this.productor : this.filterOrga;
136
+ this.searchPattern = this.searchInit ?? '';
137
+ this.organisationId = this.productor ?? this.filterOrga;
147
138
  this.includeHidden = this.organisation && this.organisationRight ? true : false;
148
- this.iabId = this.$store.state.filter.iab ? this.$store.state.filter.iab.id : undefined;
139
+ this.iabId =this.$store.state.filter.iab?.id;
149
140
  if(this.$store.state.filter.rubriqueFilter.length){
150
141
  this.updateRubriquageFilter(this.$store.state.filter.rubriqueFilter);
151
142
  }
@@ -43,14 +43,11 @@ export default defineComponent({
43
43
  if(!this.hideBar){
44
44
  return this.$t('Podcast search');
45
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 });
46
+ const locale = !this.noResult ? 'Search results' : 'Search - no results';
47
+ return this.$t(locale, { query: this.rawQuery });
50
48
  },
51
49
  query(): string {
52
- if (this.rawQuery && this.rawQuery.length >= 3) return this.rawQuery;
53
- return '';
50
+ return this.rawQuery && this.rawQuery.length >= 3 ? this.rawQuery : '';
54
51
  },
55
52
  hideBar(): boolean {
56
53
  return (state.searchPage.hideBar as boolean);
Binary file