@saooti/octopus-sdk 31.0.1 → 31.0.4

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 (70) hide show
  1. package/README.md +19 -1
  2. package/index.ts +8 -2
  3. package/package.json +3 -3
  4. package/src/assets/general.scss +8 -0
  5. package/src/assets/share.scss +21 -0
  6. package/src/components/display/categories/CategoryFilter.vue +14 -12
  7. package/src/components/display/categories/CategoryList.vue +27 -25
  8. package/src/components/display/comments/CommentInput.vue +21 -19
  9. package/src/components/display/comments/CommentList.vue +2 -0
  10. package/src/components/display/comments/CommentPlayer.vue +2 -0
  11. package/src/components/display/emission/EmissionInlineList.vue +32 -29
  12. package/src/components/display/emission/EmissionList.vue +12 -8
  13. package/src/components/display/emission/EmissionPlayerItem.vue +16 -1
  14. package/src/components/display/filter/AdvancedSearch.vue +2 -0
  15. package/src/components/display/filter/CategoryFilter.vue +1 -1
  16. package/src/components/display/filter/ProductorSearch.vue +16 -5
  17. package/src/components/display/filter/RubriqueFilter.vue +1 -1
  18. package/src/components/display/live/LiveHorizontalList.vue +1 -1
  19. package/src/components/display/live/LiveItem.vue +2 -1
  20. package/src/components/display/live/LiveList.vue +51 -41
  21. package/src/components/display/organisation/OrganisationChooser.vue +1 -1
  22. package/src/components/display/organisation/OrganisationChooserLight.vue +28 -19
  23. package/src/components/display/participant/ParticipantItem.vue +2 -0
  24. package/src/components/display/participant/ParticipantList.vue +30 -19
  25. package/src/components/display/playlist/PlaylistList.vue +12 -3
  26. package/src/components/display/playlist/PodcastList.vue +26 -16
  27. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +204 -0
  28. package/src/components/display/podcasts/AnimatorsItem.vue +2 -0
  29. package/src/components/display/podcasts/ParticipantDescription.vue +1 -5
  30. package/src/components/display/podcasts/PodcastImage.vue +2 -1
  31. package/src/components/display/podcasts/PodcastInlineList.vue +40 -28
  32. package/src/components/display/podcasts/PodcastItem.vue +12 -0
  33. package/src/components/display/podcasts/PodcastList.vue +11 -3
  34. package/src/components/display/podcasts/PodcastPlayBar.vue +2 -0
  35. package/src/components/display/podcasts/TagList.vue +2 -0
  36. package/src/components/display/rubriques/RubriqueList.vue +4 -2
  37. package/src/components/display/sharing/PlayerParameters.vue +2 -0
  38. package/src/components/display/sharing/QrCode.vue +7 -0
  39. package/src/components/display/sharing/ShareDistribution.vue +2 -0
  40. package/src/components/display/sharing/SharePlayer.vue +3 -12
  41. package/src/components/display/sharing/SharePlayerTypes.vue +48 -1
  42. package/src/components/form/ClassicSearch.vue +2 -0
  43. package/src/components/misc/ErrorMessage.vue +2 -0
  44. package/src/components/misc/Footer.vue +2 -0
  45. package/src/components/misc/LeftMenu.vue +2 -0
  46. package/src/components/misc/Player.vue +14 -0
  47. package/src/components/misc/PlayerButtons.vue +2 -14
  48. package/src/components/misc/PlayerClockAndTimeline.vue +2 -0
  49. package/src/components/misc/PlayerProgressBar.vue +2 -0
  50. package/src/components/misc/Popover.vue +5 -0
  51. package/src/components/misc/Snackbar.vue +2 -0
  52. package/src/components/misc/TopBar.vue +2 -0
  53. package/src/components/misc/modal/NewsletterModal.vue +11 -3
  54. package/src/components/misc/modal/ShareModalPlayer.vue +2 -0
  55. package/src/components/mixins/handle403.ts +17 -0
  56. package/src/components/pages/Emission.vue +17 -4
  57. package/src/components/pages/Error403Page.vue +24 -0
  58. package/src/components/pages/Participant.vue +19 -4
  59. package/src/components/pages/Playlist.vue +17 -3
  60. package/src/components/pages/Podcast.vue +28 -12
  61. package/src/components/pages/Podcasts.vue +4 -0
  62. package/src/locale/en.ts +1 -0
  63. package/src/locale/fr.ts +1 -0
  64. package/src/locale/it.ts +298 -0
  65. package/src/locale/messages.ts +2 -0
  66. package/src/router/router.ts +6 -0
  67. package/src/store/class/general/customPlayer.ts +2 -1
  68. package/src/store/class/general/organisation.ts +1 -0
  69. package/src/store/paramStore.ts +12 -11
  70. package/src/store/typeAppStore.ts +0 -4
@@ -242,9 +242,7 @@ export default defineComponent({
242
242
  `" title="` +
243
243
  this.$t('Listen this episode') +
244
244
  `">
245
- <img width="44" height="44" style="display: inline-block;vertical-align: middle" src="` +
246
- this.resourcesUrl +
247
- `/img/play-podcast.png">
245
+ <img width="44" height="44" style="display: inline-block;vertical-align: middle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAAxElEQVRIie3WMWpCURBG4Q8FSRrtbC2SPhvICmzchVuwtXQLbsE2pVUIkjqQHVgqNmIj6EvxGHhFQAIvcxt/OPVhhrlzh3sKZ4MvTLLFVYNPvJYQB294LiGucMYSw2xxcMQcj9niYIsputni4BvjEuJgjZcS4goXrDDKFgcnLDDIFgd7zNDLFgfvTUHnL23ISJuV7iS3Ooarn1VxkeeUvkDSV2b6J3FQT+pDW8Jb4vRD4Kqe1Kf/Ev4mTj32PhQ6b+9pPT+XHgysHrPM6QAAAABJRU5ErkJggg=="/>
248
246
  </a>
249
247
  <a style="color: #000;text-decoration: none; margin-right:8px" href="` +
250
248
  window.location.href +
@@ -283,6 +281,9 @@ export default defineComponent({
283
281
  });
284
282
  },
285
283
  },
284
+ created(){
285
+ this.initColor();
286
+ },
286
287
  methods: {
287
288
  closePopup(event: { preventDefault: () => void }): void {
288
289
  event.preventDefault();
@@ -302,12 +303,18 @@ export default defineComponent({
302
303
  },
303
304
  afterCopy(): void{
304
305
  (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Data in clipboard'));
306
+ },
307
+ initColor(): void {
308
+ if(state.generalParameters.podcastmaker && state.generalParameters.podcastmakerColor){
309
+ this.color = state.generalParameters.podcastmakerColor;
310
+ }
305
311
  }
306
312
  },
307
313
  })
308
314
  </script>
309
315
 
310
316
  <style lang="scss">
317
+ .octopus-app{
311
318
  #newsletter-modal {
312
319
  textarea {
313
320
  border: 2px solid #eee;
@@ -323,4 +330,5 @@ export default defineComponent({
323
330
  max-width: 60%;
324
331
  }
325
332
  }
333
+ }
326
334
  </style>
@@ -139,6 +139,7 @@ export default defineComponent({
139
139
  </script>
140
140
 
141
141
  <style lang="scss">
142
+ .octopus-app{
142
143
  .share-modal-border {
143
144
  border-right: solid 1px rgb(222, 226, 230);
144
145
  border-left: solid 1px rgb(222, 226, 230);
@@ -178,4 +179,5 @@ export default defineComponent({
178
179
  align-self: center;
179
180
  }
180
181
  }
182
+ }
181
183
  </style>
@@ -0,0 +1,17 @@
1
+ import { AxiosError } from 'axios';
2
+ import { defineComponent } from 'vue';
3
+ export const handle403 = defineComponent({
4
+ methods: {
5
+ handle403(error: AxiosError): void {
6
+ if (403 === error.response?.status) {
7
+ if(!this.$store.state.authentication.isAuthenticated){
8
+ this.$router.push("/sso/login");
9
+ }else{
10
+ this.$router.push({
11
+ path: '/main/pub/error'
12
+ });
13
+ }
14
+ }
15
+ },
16
+ },
17
+ });
@@ -103,9 +103,11 @@
103
103
  import octopusApi from '@saooti/octopus-api';
104
104
  import { state } from '../../store/paramStore';
105
105
  import { displayMethods } from '../mixins/functions';
106
+ import { handle403 } from '../mixins/handle403';
106
107
  import { Emission } from '@/store/class/general/emission';
107
108
  import ClassicLoading from '../form/ClassicLoading.vue';
108
109
  import { defineComponent, defineAsyncComponent } from 'vue';
110
+ import { AxiosError } from 'axios';
109
111
  const PodcastFilterList = defineAsyncComponent(() => import('../display/podcasts/PodcastFilterList.vue'));
110
112
  const SharePlayer = defineAsyncComponent(() => import('../display/sharing/SharePlayer.vue'));
111
113
  const ShareButtons = defineAsyncComponent(() => import('../display/sharing/ShareButtons.vue'));
@@ -126,7 +128,7 @@ export default defineComponent({
126
128
  LiveHorizontalList,
127
129
  ClassicLoading
128
130
  },
129
- mixins: [displayMethods],
131
+ mixins: [displayMethods, handle403],
130
132
  props: {
131
133
  emissionId: { default: undefined, type: Number},
132
134
  isEducation: { default: false, type: Boolean},
@@ -220,6 +222,9 @@ export default defineComponent({
220
222
  }
221
223
  return count;
222
224
  },
225
+ filterOrga(): string {
226
+ return this.$store.state.filter.organisationId;
227
+ },
223
228
  },
224
229
  watch: {
225
230
  emissionId(): void {
@@ -231,12 +236,20 @@ export default defineComponent({
231
236
  this.getEmissionDetails();
232
237
  },
233
238
  methods: {
239
+ initError():void{
240
+ this.error = true;
241
+ this.loaded = true;
242
+ },
234
243
  async getEmissionDetails(): Promise<void> {
235
244
  this.loaded = false;
236
245
  this.error = false;
237
246
  try {
238
247
  const data: Emission = await octopusApi.fetchEmission(this.emissionId);
239
248
  this.emission = data;
249
+ if(this.emission.orga.private && this.filterOrga!==this.emission.orga.id){
250
+ this.initError();
251
+ return;
252
+ }
240
253
  this.$emit('emissionTitle', this.name);
241
254
  this.loaded = true;
242
255
  if (!this.emission.annotations) return;
@@ -252,9 +265,9 @@ export default defineComponent({
252
265
  this.notExclusive =
253
266
  'true' === this.emission.annotations.notExclusive ? true : false;
254
267
  }
255
- } catch {
256
- this.error = true;
257
- this.loaded = true;
268
+ } catch(error) {
269
+ this.handle403((error as AxiosError));
270
+ this.initError();
258
271
  }
259
272
  },
260
273
  fetch(/* podcasts */) {
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div class="page-box page-box-absolute bg-white justify-content-evenly">
3
+ <img
4
+ class="logo-octopus"
5
+ src="/img/logo_octopus_final.svg"
6
+ :alt="$t('Logo of main page')"
7
+ >
8
+ <h2>{{ $t('You do not have the right to access this page' ) }}</h2>
9
+ <a
10
+ class="btn btn-link"
11
+ href="/sso/logout"
12
+ >{{ $t('Logout') }}</a>
13
+ </div>
14
+ </template>
15
+
16
+ <script lang="ts">
17
+ import { defineComponent } from 'vue';
18
+ export default defineComponent({
19
+ name: 'Error403Page',
20
+ mounted() {
21
+ document.title = this.$store.state.general.metaTitle;
22
+ },
23
+ });
24
+ </script>
@@ -82,9 +82,11 @@
82
82
  import octopusApi from '@saooti/octopus-api';
83
83
  import { state } from '../../store/paramStore';
84
84
  import { displayMethods } from '../mixins/functions';
85
+ import { handle403 } from '../mixins/handle403';
85
86
  import { Participant } from '@/store/class/general/participant';
86
87
  import ClassicLoading from '../form/ClassicLoading.vue';
87
88
  import { defineComponent, defineAsyncComponent } from 'vue';
89
+ import { AxiosError } from 'axios';
88
90
  const ShareButtons = defineAsyncComponent(() => import('../display/sharing/ShareButtons.vue'));
89
91
  const PodcastFilterList = defineAsyncComponent(() => import('../display/podcasts/PodcastFilterList.vue'));
90
92
  const EditBox = defineAsyncComponent(() => import('@/components/display/edit/EditBox.vue'));
@@ -97,7 +99,7 @@ export default defineComponent({
97
99
  PodcastList,
98
100
  ClassicLoading
99
101
  },
100
- mixins: [displayMethods],
102
+ mixins: [displayMethods, handle403],
101
103
  props: {
102
104
  participantId: { default: undefined, type: Number},
103
105
  },
@@ -160,6 +162,9 @@ export default defineComponent({
160
162
  }
161
163
  return false;
162
164
  },
165
+ filterOrga(): string {
166
+ return this.$store.state.filter.organisationId;
167
+ },
163
168
  },
164
169
  watch: {
165
170
  participant: {
@@ -173,16 +178,24 @@ export default defineComponent({
173
178
  this.getParticipantDetails();
174
179
  },
175
180
  methods: {
181
+ initError():void{
182
+ this.error = true;
183
+ this.loaded = true;
184
+ },
176
185
  async getParticipantDetails(): Promise<void> {
177
186
  this.loaded = false;
178
187
  try {
179
188
  const data = await octopusApi.fetchParticipant(this.participantId ? this.participantId.toString(): "");
189
+ if(data && data.orga && data.orga.private && this.filterOrga!==data.orga.id){
190
+ this.initError();
191
+ return;
192
+ }
180
193
  this.participant = data;
181
194
  this.$emit('participantTitle', this.name);
182
195
  this.loaded = true;
183
- } catch {
184
- this.error = true;
185
- this.loaded = true;
196
+ } catch(error) {
197
+ this.handle403((error as AxiosError));
198
+ this.initError();
186
199
  }
187
200
  },
188
201
  updateParticipant(participant: Participant): void {
@@ -194,10 +207,12 @@ export default defineComponent({
194
207
  </script>
195
208
 
196
209
  <style lang="scss">
210
+ .octopus-app{
197
211
  @media (min-width: 950px) {
198
212
  .participant-desc {
199
213
  max-width: 50%;
200
214
  line-height: 1.5em;
201
215
  }
202
216
  }
217
+ }
203
218
  </style>
@@ -53,8 +53,10 @@ import PodcastList from '../display/playlist/PodcastList.vue';
53
53
  import octopusApi from '@saooti/octopus-api';
54
54
  import { state } from '../../store/paramStore';
55
55
  import { displayMethods } from '../mixins/functions';
56
+ import { handle403 } from '../mixins/handle403';
56
57
  import { Playlist } from '@/store/class/general/playlist';
57
58
  import { defineComponent, defineAsyncComponent } from 'vue';
59
+ import { AxiosError } from 'axios';
58
60
  const ShareButtons = defineAsyncComponent(() => import('../display/sharing/ShareButtons.vue'));
59
61
  const EditBox = defineAsyncComponent(() => import('@/components/display/edit/EditBox.vue'));
60
62
  const SharePlayer = defineAsyncComponent(() => import('../display/sharing/SharePlayer.vue'));
@@ -66,7 +68,7 @@ export default defineComponent({
66
68
  SharePlayer,
67
69
  ClassicLoading
68
70
  },
69
- mixins:[displayMethods],
71
+ mixins:[displayMethods, handle403],
70
72
  props: {
71
73
  playlistId: { default: undefined, type: Number},
72
74
  isEducation: { default: false, type: Boolean},
@@ -117,6 +119,9 @@ export default defineComponent({
117
119
  }
118
120
  return false;
119
121
  },
122
+ filterOrga(): string {
123
+ return this.$store.state.filter.organisationId;
124
+ },
120
125
  },
121
126
  watch: {
122
127
  playlistId() {
@@ -128,15 +133,24 @@ export default defineComponent({
128
133
  this.getPlaylistDetails();
129
134
  },
130
135
  methods: {
136
+ initError():void{
137
+ this.error = true;
138
+ this.loaded = true;
139
+ },
131
140
  async getPlaylistDetails(): Promise<void> {
132
141
  try {
133
142
  this.loaded = false;
134
143
  this.error = false;
135
144
  const data: Playlist = await octopusApi.fetchPlaylist(this.playlistId ? this.playlistId.toString(): "");
136
145
  this.playlist = data;
146
+ if(this.playlist.organisation.private && this.filterOrga!==this.playlist.organisation.id){
147
+ this.initError();
148
+ return;
149
+ }
137
150
  this.$emit('playlistTitle', this.playlist.title);
138
- } catch {
139
- this.error = true;
151
+ } catch(error) {
152
+ this.handle403((error as AxiosError));
153
+ this.initError();
140
154
  }
141
155
  this.loaded = true;
142
156
  },
@@ -1,14 +1,16 @@
1
1
  <template>
2
2
  <div class="page-box">
3
3
  <template v-if="loaded && !error">
4
- <h1 v-if="!isOuestFrance">
5
- {{ titlePage }}
6
- </h1>
7
- <Countdown
8
- v-if="isCounter"
9
- :time-remaining="timeRemaining"
10
- />
11
- <div class="d-flex">
4
+ <div class="page-podcast-title">
5
+ <h1 v-if="!isOuestFrance">
6
+ {{ titlePage }}
7
+ </h1>
8
+ <Countdown
9
+ v-if="isCounter"
10
+ :time-remaining="timeRemaining"
11
+ />
12
+ </div>
13
+ <div class="d-flex page-podcast">
12
14
  <div class="d-flex flex-column flex-super-grow">
13
15
  <RecordingItemButton
14
16
  v-if="
@@ -101,11 +103,12 @@ import { state } from '../../store/paramStore';
101
103
  import moment from 'moment';
102
104
  import { Podcast } from '@/store/class/general/podcast';
103
105
  import { Conference } from '@/store/class/conference/conference';
104
-
106
+ import { handle403 } from '../mixins/handle403';
105
107
  import { defineComponent, defineAsyncComponent } from 'vue';
106
108
  import CommentSectionVue from '../display/comments/CommentSection.vue';
107
109
  import { CommentPodcast } from '@/store/class/general/comment';
108
110
  import { Category } from '@/store/class/general/category';
111
+ import { AxiosError } from 'axios';
109
112
  const ShareButtons = defineAsyncComponent(() => import('../display/sharing/ShareButtons.vue'));
110
113
  const SharePlayer = defineAsyncComponent(() => import('../display/sharing/SharePlayer.vue'));
111
114
  const EditBox = defineAsyncComponent(() => import('@/components/display/edit/EditBox.vue'));
@@ -128,6 +131,8 @@ export default defineComponent({
128
131
  ClassicLoading
129
132
  },
130
133
 
134
+ mixins: [handle403],
135
+
131
136
  props: {
132
137
  updateStatus: { default: undefined, type: String},
133
138
  playingPodcast: { default: undefined, type: Object as ()=> Podcast},
@@ -264,6 +269,9 @@ export default defineComponent({
264
269
  if(!this.podcast){return "";}
265
270
  return moment(this.podcast.pubDate).diff(moment(), 'seconds').toString();
266
271
  },
272
+ filterOrga(): string {
273
+ return this.$store.state.filter.organisationId;
274
+ },
267
275
  },
268
276
  watch: {
269
277
  updateStatus(): void {
@@ -312,9 +320,17 @@ export default defineComponent({
312
320
  updatePodcast(podcastUpdated: Podcast): void {
313
321
  this.podcast = podcastUpdated;
314
322
  },
323
+ initError():void{
324
+ this.error = true;
325
+ this.loaded = true;
326
+ },
315
327
  async getPodcastDetails(podcastId: number): Promise<void> {
316
328
  try {
317
329
  const data : Podcast = await octopusApi.fetchPodcast(podcastId.toString());
330
+ if(data.organisation.private && this.filterOrga!==data.organisation.id){
331
+ this.initError();
332
+ return;
333
+ }
318
334
  this.podcast = data;
319
335
  this.$emit('podcastTitle', this.podcast.title);
320
336
  if (
@@ -348,9 +364,9 @@ export default defineComponent({
348
364
  this.error = true;
349
365
  }
350
366
  this.loaded = true;
351
- } catch {
352
- this.error = true;
353
- this.loaded = true;
367
+ } catch(error) {
368
+ this.handle403((error as AxiosError));
369
+ this.initError();
354
370
  }
355
371
  },
356
372
  removeDeleted(): void {
@@ -90,6 +90,7 @@ export default defineComponent({
90
90
  props: {
91
91
  productor: { default: undefined, type: String},
92
92
  isEducation: { default: false, type: Boolean},
93
+ searchInit: { default: "", type: String}
93
94
  },
94
95
 
95
96
  data() {
@@ -154,6 +155,9 @@ export default defineComponent({
154
155
  },
155
156
 
156
157
  created() {
158
+ if(this.searchInit){
159
+ this.searchPattern = this.searchInit;
160
+ }
157
161
  if (this.productor) {
158
162
  this.organisationId = this.productor;
159
163
  } else if (this.$store.state.filter.organisationId) {
package/src/locale/en.ts CHANGED
@@ -297,4 +297,5 @@ export default{
297
297
  'From RSS': "From an RSS feed",
298
298
  "User menu":"User menu",
299
299
  'Podcast tags': 'Podcast tags',
300
+ "You do not have the right to access this page":"You do not have the right to access this page",
300
301
  };
package/src/locale/fr.ts CHANGED
@@ -297,4 +297,5 @@ export default{
297
297
  'From RSS': "Issu d'un flux RSS",
298
298
  "User menu":"Menu utilisateur",
299
299
  'Podcast tags': "Mot-clé de l'épisode",
300
+ "You do not have the right to access this page":"Vous n’avez pas le droit d’accéder à cette page",
300
301
  };