@saooti/octopus-sdk 31.0.35 → 31.0.38

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 (85) hide show
  1. package/README.md +7 -1
  2. package/index.ts +8 -2
  3. package/package.json +1 -1
  4. package/public/img/403.jpeg +0 -0
  5. package/public/img/404.svg +242 -0
  6. package/src/assets/bootstrap-diff.scss +25 -24
  7. package/src/assets/general.scss +57 -2
  8. package/src/assets/modal.scss +5 -4
  9. package/src/assets/share.scss +2 -0
  10. package/src/components/display/categories/CategoryFilter.vue +12 -26
  11. package/src/components/display/categories/CategoryList.vue +14 -20
  12. package/src/components/display/comments/AddCommentModal.vue +19 -36
  13. package/src/components/display/comments/CommentBasicView.vue +2 -5
  14. package/src/components/display/comments/CommentInput.vue +8 -21
  15. package/src/components/display/comments/CommentList.vue +10 -21
  16. package/src/components/display/comments/CommentPlayer.vue +0 -3
  17. package/src/components/display/comments/CommentSection.vue +6 -14
  18. package/src/components/display/emission/EmissionInlineList.vue +5 -10
  19. package/src/components/display/emission/EmissionItem.vue +5 -10
  20. package/src/components/display/emission/EmissionList.vue +66 -68
  21. package/src/components/display/filter/AdvancedSearch.vue +19 -45
  22. package/src/components/display/filter/CategoryFilter.vue +11 -20
  23. package/src/components/display/filter/MonetizableFilter.vue +7 -14
  24. package/src/components/display/filter/ProductorSearch.vue +69 -78
  25. package/src/components/display/filter/RubriqueChoice.vue +1 -4
  26. package/src/components/display/filter/RubriqueFilter.vue +1 -5
  27. package/src/components/display/list/ListPaginate.vue +150 -0
  28. package/src/components/display/list/Paginate.vue +219 -0
  29. package/src/components/display/live/LiveHorizontalList.vue +56 -40
  30. package/src/components/display/organisation/OrganisationChooser.vue +7 -12
  31. package/src/components/display/participant/ParticipantItem.vue +6 -17
  32. package/src/components/display/participant/ParticipantList.vue +53 -46
  33. package/src/components/display/playlist/PlaylistItem.vue +1 -4
  34. package/src/components/display/playlist/PlaylistList.vue +60 -63
  35. package/src/components/display/playlist/PodcastList.vue +74 -101
  36. package/src/components/display/podcasts/AnimatorsItem.vue +17 -28
  37. package/src/components/display/podcasts/ParticipantDescription.vue +3 -11
  38. package/src/components/display/podcasts/PodcastFilterList.vue +8 -16
  39. package/src/components/display/podcasts/PodcastImage.vue +86 -92
  40. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +15 -2
  41. package/src/components/display/podcasts/PodcastItem.vue +1 -2
  42. package/src/components/display/podcasts/PodcastItemInfo.vue +10 -10
  43. package/src/components/display/podcasts/PodcastList.vue +61 -81
  44. package/src/components/display/podcasts/PodcastModuleBox.vue +19 -25
  45. package/src/components/display/podcasts/PodcastSwiperList.vue +6 -9
  46. package/src/components/display/podcasts/TagList.vue +0 -2
  47. package/src/components/display/sharing/QrCode.vue +2 -11
  48. package/src/components/display/sharing/ShareButtons.vue +44 -329
  49. package/src/components/display/sharing/ShareButtonsIntern.vue +209 -0
  50. package/src/components/display/sharing/SharePlayer.vue +21 -53
  51. package/src/components/display/sharing/SplitButton.vue +42 -0
  52. package/src/components/display/sharing/SubscribeButtons.vue +46 -39
  53. package/src/components/misc/Footer.vue +1 -4
  54. package/src/components/misc/HomeDropdown.vue +36 -46
  55. package/src/components/misc/LeftMenu.vue +3 -7
  56. package/src/components/misc/TopBar.vue +10 -17
  57. package/src/components/misc/modal/ClipboardModal.vue +1 -1
  58. package/src/components/misc/modal/MessageModal.vue +1 -1
  59. package/src/components/misc/modal/QrCodeModal.vue +1 -1
  60. package/src/components/misc/modal/ShareModalPlayer.vue +1 -1
  61. package/src/components/mixins/organisationFilter.ts +6 -0
  62. package/src/components/mixins/player/playerLive.ts +1 -1
  63. package/src/components/pages/Category.vue +1 -1
  64. package/src/components/pages/Emission.vue +0 -6
  65. package/src/components/pages/Emissions.vue +1 -1
  66. package/src/components/pages/Error403Page.vue +44 -8
  67. package/src/components/pages/PageNotFound.vue +55 -0
  68. package/src/components/pages/Participant.vue +0 -15
  69. package/src/components/pages/Participants.vue +1 -1
  70. package/src/components/pages/Playlist.vue +2 -2
  71. package/src/components/pages/Playlists.vue +1 -1
  72. package/src/components/pages/Podcast.vue +1 -3
  73. package/src/components/pages/Podcasts.vue +11 -8
  74. package/src/components/pages/Rubrique.vue +1 -1
  75. package/src/locale/de.ts +3 -0
  76. package/src/locale/en.ts +9 -0
  77. package/src/locale/es.ts +3 -0
  78. package/src/locale/fr.ts +10 -1
  79. package/src/locale/it.ts +3 -0
  80. package/src/locale/sl.ts +3 -0
  81. package/src/router/router.ts +2 -0
  82. package/src/sass/_variables.scss +0 -1
  83. package/src/store/class/general/playlist.ts +1 -1
  84. package/src/store/paramStore.ts +7 -11
  85. package/src/store/typeAppStore.ts +20 -2
@@ -28,16 +28,10 @@
28
28
  {{ countName + ' / ' + maxName }}
29
29
  </p>
30
30
  <div
31
- v-if="sendError"
31
+ v-if="''!==errorText"
32
32
  class="mt-1 text-danger"
33
33
  >
34
- {{ $t('Recaptcha error') }}
35
- </div>
36
- <div
37
- v-if="isCaptchaTest"
38
- class="mt-1 text-danger"
39
- >
40
- {{ $t('Recaptcha not active') }}
34
+ {{ errorText }}
41
35
  </div>
42
36
  </template>
43
37
  <template v-else>
@@ -85,8 +79,12 @@ export default defineComponent({
85
79
  maxName : Constants.MAX_COMMENT_NAME as number
86
80
  };
87
81
  },
88
-
89
82
  computed: {
83
+ errorText():string {
84
+ if(this.isCaptchaTest) return this.$t('Recaptcha not active');
85
+ if(this.sendError) return this.$t('Recaptcha error');
86
+ return '';
87
+ },
90
88
  validName(): boolean{
91
89
  return this.countName <= this.maxName;
92
90
  },
@@ -102,45 +100,30 @@ export default defineComponent({
102
100
  this.displayCaptcha('block');
103
101
  this.initAuthenticatedName();
104
102
  },
105
-
106
103
  unmounted() {
107
104
  this.displayCaptcha('none');
108
105
  },
109
-
110
106
  methods: {
111
107
  initAuthenticatedName():void{
112
- if (state.generalParameters.authenticated) {
113
- this.name = (
114
- (this.$store.state.profile.firstname || '') +
115
- ' ' +
116
- (this.$store.state.profile.lastname || '')
117
- ).trim();
118
- this.needVerify = false;
119
- }
108
+ if (!state.generalParameters.authenticated) { return; }
109
+ this.name = (`${this.$store.state.profile.firstname||''} ${this.$store.state.profile.lastname||''}`).trim();
110
+ this.needVerify = false;
120
111
  },
121
112
  displayCaptcha(displayStyle: string): void{
122
113
  const captcha = document.getElementsByClassName('grecaptcha-badge')[0];
123
- if (captcha) {
124
- (captcha as HTMLElement).style.display = displayStyle;
125
- }
114
+ if (!captcha) {return;}
115
+ (captcha as HTMLElement).style.display = displayStyle;
126
116
  },
127
117
  async validateName(): Promise<void> {
128
- if (!this.needVerify || this.isCaptchaTest) {
129
- this.sendComment();
130
- return;
131
- }
132
- try {
133
- await this.$recaptchaLoaded()
134
- const token = await this.$recaptcha('login');
135
- this.sendError = false;
136
- const ok = await api.checkToken(token);
137
- if (!ok) {
118
+ if (this.needVerify && this.isCaptchaTest) {
119
+ try {
120
+ await this.$recaptchaLoaded()
121
+ const token = await this.$recaptcha('login');
122
+ this.sendError = !await api.checkToken(token);
123
+ } catch {
138
124
  this.sendError = true;
139
- return;
140
125
  }
141
- } catch {
142
- this.sendError = true;
143
- return;
126
+ if(this.sendError){return;}
144
127
  }
145
128
  this.sendComment();
146
129
  },
@@ -78,13 +78,10 @@ export default defineComponent({
78
78
  return 'Valid'=== this.comment.status;
79
79
  },
80
80
  date(): string {
81
- if (this.comment.date)
82
- return moment(this.comment.date).format('D MMMM YYYY HH[h]mm');
83
- return '';
81
+ return this.comment.date ? moment(this.comment.date).format('D MMMM YYYY HH[h]mm') : '';
84
82
  },
85
83
  readMore(): string {
86
- if (this.summary) return this.$t('Read more').toString();
87
- return this.$t('Read less').toString();
84
+ return this.summary ? this.$t('Read more') : this.$t('Read less');
88
85
  },
89
86
  contentDisplay(): string {
90
87
  if (!this.summary){return this.comment.content;}
@@ -166,8 +166,7 @@ export default defineComponent({
166
166
  return true;
167
167
  },
168
168
  placeholder(): string {
169
- if (this.comment && this.comment.comId) return this.$t('Answer a comment').toString();
170
- return this.$t('Write a comment').toString();
169
+ return this.comment && this.comment.comId? this.$t('Answer a comment') : this.$t('Write a comment');
171
170
  },
172
171
  isCertified(): boolean {
173
172
  if (
@@ -180,8 +179,7 @@ export default defineComponent({
180
179
  return false;
181
180
  },
182
181
  userId(): string|undefined {
183
- if (state.generalParameters.authenticated) return this.$store.state.profile.userId;
184
- return undefined;
182
+ return state.generalParameters.authenticated ? this.$store.state.profile.userId : undefined;
185
183
  },
186
184
  phase(): string|undefined {
187
185
  if(undefined === this.podcast){
@@ -237,11 +235,8 @@ export default defineComponent({
237
235
  this.editName = false;
238
236
  },
239
237
  inputExceeded(text: string, font: string): number {
240
- const element = document.createElement('canvas');
241
- const context = element.getContext('2d');
242
- if(null === context){
243
- return 0;
244
- }
238
+ const context = document.createElement('canvas').getContext('2d');
239
+ if(null === context){return 0;}
245
240
  context.font = font;
246
241
  return context.measureText(text).width;
247
242
  },
@@ -259,27 +254,19 @@ export default defineComponent({
259
254
  let timeline = 0;
260
255
  if (
261
256
  undefined !== this.podcast &&(
262
- (this.$store.state.player.podcast &&
263
- this.$store.state.player.podcast.podcastId ===
264
- this.podcast.podcastId) ||
265
- (this.$store.state.player.live &&
266
- this.$store.state.player.live.livePodcastId ===
267
- this.podcast.podcastId))
257
+ (this.$store.state.player.podcast?.podcastId ===this.podcast.podcastId) ||
258
+ (this.$store.state.player.live?.livePodcastId ===this.podcast.podcastId))
268
259
  ) {
269
260
  timeline = Math.round(
270
261
  this.$store.state.player.elapsed * this.$store.state.player.total
271
262
  );
272
263
  if (this.podcast.duration && this.$store.state.player.podcast) {
273
264
  timeline = Math.round(
274
- timeline -
275
- (this.$store.state.player.total - this.podcast.duration / 1000)
265
+ timeline - (this.$store.state.player.total - this.podcast.duration / 1000)
276
266
  );
277
267
  }
278
- if (timeline < 0) {
279
- timeline = 0;
280
- }
281
268
  }
282
- return timeline;
269
+ return timeline < 0? 0 : timeline;
283
270
  },
284
271
  async postComment(name?: string): Promise<void> {
285
272
  if (name) {
@@ -98,13 +98,16 @@ export default defineComponent({
98
98
  return true;
99
99
  return false;
100
100
  },
101
+ watchVariable():string{
102
+ return `${this.reload}|${this.status}`
103
+ }
101
104
  },
102
105
  watch: {
103
- reload(): void {
104
- this.fetchContent();
105
- },
106
- status(): void {
107
- this.fetchContent();
106
+ watchVariable: {
107
+ immediate:true,
108
+ handler(){
109
+ this.fetchContent();
110
+ }
108
111
  },
109
112
  comments: {
110
113
  deep: true,
@@ -113,9 +116,6 @@ export default defineComponent({
113
116
  }
114
117
  },
115
118
  },
116
- created() {
117
- this.fetchContent();
118
- },
119
119
  methods: {
120
120
  async fetchContent(reset=true): Promise<void> {
121
121
  this.loading = true;
@@ -135,11 +135,7 @@ export default defineComponent({
135
135
  status:this.editRight && this.status?[this.status]: this.editRight? ['Valid','Pending', 'Invalid']:['Valid'],
136
136
  organisationId: undefined === this.podcastId? this.organisation: undefined,
137
137
  };
138
- if (!this.isFlat) {
139
- data = await octopusApi.fetchRootComments(param);
140
- } else {
141
- data = await octopusApi.fetchComments(param);
142
- }
138
+ data = this.isFlat ? await octopusApi.fetchComments(param) : await octopusApi.fetchRootComments(param);
143
139
  }
144
140
  if(reset){
145
141
  this.comments.length = 0;
@@ -228,11 +224,4 @@ export default defineComponent({
228
224
  },
229
225
  },
230
226
  })
231
- </script>
232
-
233
- <style lang="scss">
234
- @import '../../../sass/_variables.scss';
235
- .octopus-app{
236
-
237
- }
238
- </style>
227
+ </script>
@@ -41,14 +41,11 @@ import { selenium } from '../../mixins/functions';
41
41
  import { defineComponent } from 'vue'
42
42
  export default defineComponent({
43
43
  name: 'CommentPlayer',
44
-
45
- components: {},
46
44
  mixins:[selenium],
47
45
  props: {
48
46
  comments: { default: undefined, type: Array as ()=>Array<CommentPodcast>},
49
47
  totalTime: { default: 0, type: Number},
50
48
  },
51
-
52
49
  data() {
53
50
  return {
54
51
  displayContent: undefined as CommentPodcast|undefined,
@@ -8,18 +8,13 @@
8
8
  class="mb-0 me-2"
9
9
  data-selenium="episode-comment-counter"
10
10
  >
11
- {{ $t("Podcast's comments") }}
12
- <template v-if="loaded && totalCount > 0">
13
- {{
14
- $t('()', { nb: totalCount })
15
- }}
16
- </template>
11
+ {{ commentTitle }}
17
12
  </h2>
18
13
  <button
19
14
  v-if="!isLive"
20
15
  :title="$t('Refresh')"
21
16
  class="btn admin-button saooti-refresh-stud"
22
- @click="reloadComments"
17
+ @click="reload = !reload"
23
18
  />
24
19
  </div>
25
20
  <CommentInput
@@ -51,18 +46,15 @@ import CommentListVue from './CommentList.vue';
51
46
  import { CommentPodcast } from '@/store/class/general/comment';
52
47
  export default defineComponent({
53
48
  name: 'CommentSection',
54
-
55
49
  components: {
56
50
  CommentList,
57
51
  CommentInput,
58
52
  },
59
53
  mixins:[cookies],
60
-
61
54
  props: {
62
55
  podcast: { default: undefined, type: Object as ()=>Podcast },
63
56
  fetchConference: { default: undefined, type: Object as ()=>Conference },
64
57
  },
65
-
66
58
  data() {
67
59
  return {
68
60
  totalCount: 0 as number,
@@ -70,8 +62,11 @@ export default defineComponent({
70
62
  reload: false as boolean,
71
63
  };
72
64
  },
73
-
74
65
  computed: {
66
+ commentTitle():string{
67
+ const count = this.loaded && this.totalCount > 0 ? this.$t('()', { nb: this.totalCount }) : '';
68
+ return this.$t("Podcast's comments")+count;
69
+ },
75
70
  isComments(): boolean {
76
71
  if (!this.podcast) return true;
77
72
  let podcastComment = 'INHERIT';
@@ -123,9 +118,6 @@ export default defineComponent({
123
118
  });
124
119
  this.totalCount = value.count;
125
120
  },
126
- reloadComments(): void {
127
- this.reload = !this.reload;
128
- },
129
121
  newComment(comment: CommentPodcast): void {
130
122
  (this.$refs.commentList as InstanceType<typeof CommentListVue>).addNewComment(comment, true);
131
123
  },
@@ -23,15 +23,9 @@
23
23
  </button>
24
24
  </div>
25
25
  </div>
26
- <div
27
- v-if="loading"
28
- class="d-flex justify-content-center"
29
- >
30
- <div class="spinner-border me-3" />
31
- <h3 class="mt-2">
32
- {{ $t('Loading emissions ...') }}
33
- </h3>
34
- </div>
26
+ <ClassicLoading
27
+ :loading-text="loading?$t('Loading emissions ...'):undefined"
28
+ />
35
29
  <transition-group
36
30
  v-show="
37
31
  (displayRubriquage && rubriques) || !(displayRubriquage && loaded)
@@ -73,7 +67,7 @@ import EmissionPlayerItem from './EmissionPlayerItem.vue';
73
67
  import { state } from '../../../store/paramStore';
74
68
  import { handle403 } from '../../mixins/handle403';
75
69
  const PHONE_WIDTH = 960;
76
-
70
+ import ClassicLoading from '../../form/ClassicLoading.vue';
77
71
  import { Emission } from '@/store/class/general/emission';
78
72
  import { Rubrique } from '@/store/class/rubrique/rubrique';
79
73
  import { defineComponent } from 'vue'
@@ -83,6 +77,7 @@ export default defineComponent({
83
77
 
84
78
  components: {
85
79
  EmissionPlayerItem,
80
+ ClassicLoading
86
81
  },
87
82
 
88
83
  mixins: [handle403],
@@ -6,7 +6,7 @@
6
6
  :to="{
7
7
  name: 'emission',
8
8
  params: { emissionId: emission.emissionId },
9
- query: { productor: $store.state.filter.organisationId },
9
+ query: { productor: filterOrga },
10
10
  }"
11
11
  :title="$t('Emission')"
12
12
  class="d-flex text-dark"
@@ -44,7 +44,7 @@
44
44
  :to="{
45
45
  name: 'productor',
46
46
  params: { productorId: emission.orga.id },
47
- query: { productor: $store.state.filter.organisationId },
47
+ query: { productor: filterOrga },
48
48
  }"
49
49
  >
50
50
  <div class="emission-producer">
@@ -57,6 +57,7 @@
57
57
  </template>
58
58
 
59
59
  <script lang="ts">
60
+ import { orgaComputed } from '../../mixins/orgaComputed';
60
61
  import { Emission } from '@/store/class/general/emission';
61
62
  import { state } from '../../../store/paramStore';
62
63
  import octopusApi from '@saooti/octopus-api';
@@ -65,7 +66,7 @@ import { defineComponent } from 'vue'
65
66
  export default defineComponent({
66
67
  name: 'EmissionItem',
67
68
 
68
- mixins: [displayMethods],
69
+ mixins: [displayMethods, orgaComputed],
69
70
 
70
71
  props: {
71
72
  emission: { default: ()=>({}), type: Object as ()=> Emission},
@@ -87,15 +88,9 @@ export default defineComponent({
87
88
  }
88
89
  return '';
89
90
  },
90
- organisationId(): string|undefined {
91
- return state.generalParameters.organisationId;
92
- },
93
- authenticated(): boolean {
94
- return (state.generalParameters.authenticated as boolean);
95
- },
96
91
  editRight(): boolean {
97
92
  if (
98
- (this.authenticated && this.organisationId === this.emission.orga.id) ||
93
+ (this.authenticated && this.myOrganisationId === this.emission.orga.id) ||
99
94
  state.generalParameters.isAdmin
100
95
  )
101
96
  return true;
@@ -1,73 +1,64 @@
1
1
  <template>
2
- <div class="d-flex flex-column align-items-center">
3
- <ClassicLoading
4
- :loading-text="loading?$t('Loading emissions ...'):undefined"
5
- />
6
- <template v-if="isLoadingMoreOrFinished">
7
- <div
8
- v-if="showCount && emissions.length > 1"
9
- class="text-secondary mb-2"
10
- >
11
- {{ $t('Number emissions', { nb: displayCount }) + sortText }}
12
- </div>
2
+ <ListPaginate
3
+ id="emissionListPaginate"
4
+ v-model:first="dfirst"
5
+ v-model:rowsPerPage="dsize"
6
+ v-model:isMobile="isMobile"
7
+ :text-count="showCount && emissions.length > 1 ? $t('Number emissions', { nb: displayCount }) + sortText : undefined"
8
+ :total-count="totalCount"
9
+ :loading="loading"
10
+ :loading-text="loading?$t('Loading emissions ...'):undefined"
11
+ >
12
+ <template #list>
13
13
  <ul
14
14
  v-if="!itemPlayer"
15
15
  class="emission-list"
16
16
  :class="smallItems ? 'three-emissions' : 'two-emissions'"
17
17
  >
18
- <EmissionItem
19
- v-for="e in emissions"
18
+ <template
19
+ v-for="e in displayArray"
20
20
  :key="e.emissionId"
21
- :emission="e"
22
- />
21
+ >
22
+ <EmissionItem
23
+ v-if="-1!==e.emissionId"
24
+ :emission="e"
25
+ />
26
+ </template>
23
27
  </ul>
24
28
  <div
25
- v-show="
26
- (displayRubriquage && rubriques) || !(displayRubriquage)
27
- "
28
29
  v-else
30
+ v-show="(displayRubriquage && rubriques)||!displayRubriquage"
29
31
  class="d-flex flex-wrap justify-content-around"
30
32
  >
31
- <EmissionPlayerItem
32
- v-for="e in emissions"
33
+ <template
34
+ v-for="e in displayArray"
33
35
  :key="e.emissionId"
34
- :emission="e"
35
- class="m-3 flex-shrink-0"
36
- :class="mainRubriquage(e)"
37
- :rubrique-name="rubriquesId(e)"
38
- @emissionNotVisible="displayCount--"
39
- />
40
- </div>
41
- <button
42
- v-show="!allFetched"
43
- class="btn"
44
- :class="buttonPlus ? 'btn-primary align-self-center width-fit-content m-4' : 'btn-more'"
45
- :disabled="loading"
46
- :title="$t('See more')"
47
- @click="fetchContent(false)"
48
- >
49
- <template v-if="buttonPlus">
50
- {{ $t('See more') }}
36
+ >
37
+ <EmissionPlayerItem
38
+ v-if="-1!==e.emissionId"
39
+ :emission="e"
40
+ class="m-3 flex-shrink-0"
41
+ :class="mainRubriquage(e)"
42
+ :rubrique-name="rubriquesId(e)"
43
+ @emissionNotVisible="displayCount--"
44
+ />
51
45
  </template>
52
- <div
53
- :class="buttonPlus?'ms-1':''"
54
- class="saooti-more"
55
- />
56
- </button>
46
+ </div>
57
47
  </template>
58
- </div>
48
+ </ListPaginate>
59
49
  </template>
60
50
 
61
51
  <script lang="ts">
52
+ import ListPaginate from '../list/ListPaginate.vue';
62
53
  import octopusApi from '@saooti/octopus-api';
63
54
  import { handle403 } from '../../mixins/handle403';
64
55
  import { state } from '../../../store/paramStore';
65
- import ClassicLoading from '../../form/ClassicLoading.vue';
66
56
  import { Emission } from '@/store/class/general/emission';
67
57
  import { Rubrique } from '@/store/class/rubrique/rubrique';
68
58
  import { defineComponent, defineAsyncComponent } from 'vue';
69
59
  import { FetchParam } from '@/store/class/general/fetchParam';
70
60
  import { AxiosError } from 'axios';
61
+ import { emptyEmissionData } from '@/store/typeAppStore';
71
62
  const EmissionItem = defineAsyncComponent(() => import('./EmissionItem.vue'));
72
63
  const EmissionPlayerItem = defineAsyncComponent(() => import('./EmissionPlayerItem.vue'));
73
64
  export default defineComponent({
@@ -76,14 +67,14 @@ export default defineComponent({
76
67
  components: {
77
68
  EmissionItem,
78
69
  EmissionPlayerItem,
79
- ClassicLoading
70
+ ListPaginate
80
71
  },
81
72
 
82
73
  mixins: [handle403],
83
74
 
84
75
  props: {
85
76
  first: { default: 0, type: Number },
86
- size: { default: 12, type: Number },
77
+ size: { default: 30, type: Number },
87
78
  query: { default: undefined, type: String},
88
79
  iabId: { default: undefined, type: Number },
89
80
  organisationId: { default: undefined, type: String},
@@ -107,19 +98,17 @@ export default defineComponent({
107
98
  displayCount: 0 as number,
108
99
  emissions: [] as Array<Emission>,
109
100
  rubriques: undefined as Array<Rubrique>|undefined,
101
+ isMobile: false as boolean,
110
102
  };
111
103
  },
112
104
 
113
105
  computed: {
114
- isLoadingMoreOrFinished():boolean{
115
- return !this.loading || this.emissions.length > 1;
116
- },
117
- allFetched(): boolean {
118
- return this.dfirst >= this.totalCount;
119
- },
120
- buttonPlus(): boolean {
121
- return (state.generalParameters.buttonPlus as boolean);
122
- },
106
+ displayArray(): Array<Emission>{
107
+ if(this.isMobile){
108
+ return this.emissions;
109
+ }
110
+ return this.emissions.slice(this.dfirst, Math.min(this.dfirst + this.dsize,this.totalCount));
111
+ },
123
112
  smallItems(): boolean {
124
113
  return (state.emissionsPage.smallItems as boolean);
125
114
  },
@@ -145,19 +134,24 @@ export default defineComponent({
145
134
  return " "+this.$t('sort by date').toString();
146
135
  }
147
136
  },
148
- filterOrga(): string {
149
- return this.$store.state.filter.organisationId;
150
- },
151
137
  organisation(): string|undefined {
152
138
  if (this.organisationId) return this.organisationId;
153
- if (this.filterOrga) return this.filterOrga;
139
+ if (this.$store.state.filter.organisationId) return this.$store.state.filter.organisationId;
154
140
  return undefined;
155
141
  },
156
142
  },
157
143
  watch: {
158
144
  changed(): void {
159
- this.fetchContent(true);
160
- },
145
+ this.reloadList();
146
+ },
147
+ dsize():void{
148
+ this.reloadList();
149
+ },
150
+ dfirst(): void{
151
+ if(!this.emissions[this.dfirst] || -1===this.emissions[this.dfirst].emissionId){
152
+ this.fetchContent(false);
153
+ }
154
+ },
161
155
  },
162
156
 
163
157
  mounted() {
@@ -167,11 +161,12 @@ export default defineComponent({
167
161
  }
168
162
  },
169
163
  methods: {
164
+ reloadList(){
165
+ this.dfirst = 0;
166
+ this.fetchContent(true);
167
+ },
170
168
  async fetchContent(reset: boolean): Promise<void> {
171
169
  this.loading = true;
172
- if (reset) {
173
- this.dfirst = 0;
174
- }
175
170
  const param: FetchParam = {
176
171
  first: this.dfirst,
177
172
  size: this.dsize,
@@ -197,17 +192,20 @@ export default defineComponent({
197
192
  afterFetching(reset: boolean, data: {count: number, result: Array<Emission>, sort: string}): void {
198
193
  if (reset) {
199
194
  this.emissions.length = 0;
200
- this.dfirst = 0;
201
195
  }
202
- this.loading = false;
196
+ if(this.dfirst > this.emissions.length){
197
+ for (let i = this.emissions.length-1, len = this.dfirst + this.dsize; i < len; i++) {
198
+ this.emissions.push(emptyEmissionData());
199
+ }
200
+ }
203
201
  this.displayCount = data.count;
204
- this.emissions = this.emissions.concat(data.result).filter((e: Emission|null) => {
202
+ const responseEmissions = data.result.filter((e: Emission|null) => {
205
203
  if (null === e) {
206
204
  this.displayCount--;
207
205
  }
208
206
  return null !== e;
209
207
  });
210
- this.dfirst += this.dsize;
208
+ this.emissions = this.emissions.slice(0, this.dfirst).concat(responseEmissions).concat(this.emissions.slice(this.dfirst+this.dsize, this.emissions.length));
211
209
  this.totalCount = data.count;
212
210
  this.loading = false;
213
211
  },