@saooti/octopus-sdk 1.0.0 → 29.0.2

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 (230) hide show
  1. package/README.md +73 -0
  2. package/index.d.ts +4 -0
  3. package/index.ts +12 -0
  4. package/package.json +61 -39
  5. package/public/css/fonts/saooti-ui.eot +0 -0
  6. package/public/css/fonts/saooti-ui.svg +30 -19
  7. package/public/css/fonts/saooti-ui.ttf +0 -0
  8. package/public/css/fonts/saooti-ui.woff +0 -0
  9. package/public/css/fonts/style.css +48 -5
  10. package/public/img/ACPM.png +0 -0
  11. package/public/img/article.png +0 -0
  12. package/src/App.vue +97 -31
  13. package/src/api/comments.ts +3 -1
  14. package/src/api/emissions.ts +5 -2
  15. package/src/api/initialize.ts +3 -2
  16. package/src/api/podcasts.ts +5 -2
  17. package/src/api/profile.ts +4 -2
  18. package/src/api/studio.ts +12 -1
  19. package/src/assets/bootstrap-diff.scss +265 -0
  20. package/src/assets/form.scss +23 -0
  21. package/src/assets/general.scss +47 -20
  22. package/src/assets/modal.scss +9 -10
  23. package/src/assets/multiselect.scss +19 -2
  24. package/src/assets/octopus-library.scss +16 -4
  25. package/src/assets/share.scss +343 -0
  26. package/src/components/display/aggregator/RssSection.vue +4 -4
  27. package/src/components/display/categories/CategoryChooser.vue +152 -105
  28. package/src/components/display/categories/CategoryFilter.vue +108 -0
  29. package/src/components/display/categories/CategoryList.vue +138 -109
  30. package/src/components/display/comments/AddCommentModal.vue +104 -87
  31. package/src/components/display/comments/CommentInput.vue +137 -118
  32. package/src/components/display/comments/CommentItem.vue +155 -137
  33. package/src/components/display/comments/CommentList.vue +142 -120
  34. package/src/components/display/comments/CommentParentInfo.vue +39 -35
  35. package/src/components/display/comments/CommentPlayer.vue +54 -48
  36. package/src/components/display/comments/CommentSection.vue +57 -58
  37. package/src/components/display/edit/EditBox.vue +4 -4
  38. package/src/components/display/edit/EditCommentBox.vue +25 -31
  39. package/src/components/display/emission/EmissionChooser.vue +82 -80
  40. package/src/components/display/emission/EmissionInlineList.vue +118 -105
  41. package/src/components/display/emission/EmissionItem.vue +66 -167
  42. package/src/components/display/emission/EmissionList.vue +96 -122
  43. package/src/components/display/emission/EmissionPlayerItem.vue +131 -126
  44. package/src/components/display/filter/AdvancedSearch.vue +306 -372
  45. package/src/components/display/filter/CategoryFilter.vue +117 -0
  46. package/src/components/display/filter/MonetizableFilter.vue +24 -10
  47. package/src/components/display/filter/ProductorSearch.vue +131 -135
  48. package/src/components/display/filter/RubriqueChoice.vue +104 -0
  49. package/src/components/display/filter/RubriqueFilter.vue +235 -0
  50. package/src/components/display/live/CountDown.vue +30 -29
  51. package/src/components/display/live/LiveHorizontalList.vue +40 -34
  52. package/src/components/display/live/LiveItem.vue +146 -158
  53. package/src/components/display/live/LiveList.vue +167 -154
  54. package/src/components/display/organisation/OrganisationChooser.vue +125 -124
  55. package/src/components/display/organisation/OrganisationChooserLight.vue +40 -47
  56. package/src/components/display/participant/ParticipantItem.vue +92 -108
  57. package/src/components/display/participant/ParticipantList.vue +76 -69
  58. package/src/components/display/playlist/PlaylistItem.vue +45 -56
  59. package/src/components/display/playlist/PlaylistList.vue +57 -48
  60. package/src/components/display/playlist/PodcastList.vue +94 -70
  61. package/src/components/display/podcasts/AnimatorsItem.vue +26 -23
  62. package/src/components/display/podcasts/ParticipantDescription.vue +115 -0
  63. package/src/components/display/podcasts/PodcastFilterList.vue +84 -85
  64. package/src/components/display/podcasts/PodcastImage.vue +244 -208
  65. package/src/components/display/podcasts/PodcastInlineList.vue +145 -207
  66. package/src/components/display/podcasts/PodcastItem.vue +150 -132
  67. package/src/components/display/podcasts/PodcastList.vue +89 -110
  68. package/src/components/display/podcasts/TagList.vue +23 -16
  69. package/src/components/display/rubriques/RubriqueChooser.vue +137 -123
  70. package/src/components/display/rubriques/RubriqueList.vue +227 -0
  71. package/src/components/display/sharing/PlayerParameters.vue +154 -106
  72. package/src/components/display/sharing/QrCode.vue +58 -0
  73. package/src/components/display/sharing/ShareButtons.vue +214 -92
  74. package/src/components/display/sharing/ShareDistribution.vue +110 -121
  75. package/src/components/display/sharing/SharePlayer.vue +245 -190
  76. package/src/components/display/sharing/SubscribeButtons.vue +130 -66
  77. package/src/components/display/studio/RecordingItemButton.vue +4 -4
  78. package/src/components/misc/ErrorMessage.vue +21 -16
  79. package/src/components/misc/Footer.vue +131 -66
  80. package/src/components/misc/HomeDropdown.vue +166 -123
  81. package/src/components/misc/LeftMenu.vue +151 -134
  82. package/src/components/misc/Player.vue +332 -328
  83. package/src/components/misc/Snackbar.vue +27 -29
  84. package/src/components/misc/TopBar.vue +204 -174
  85. package/src/components/misc/modal/ClipboardModal.vue +46 -26
  86. package/src/components/misc/modal/MessageModal.vue +67 -51
  87. package/src/components/misc/modal/NewsletterModal.vue +179 -136
  88. package/src/components/misc/modal/QrCodeModal.vue +83 -0
  89. package/src/components/misc/modal/ShareModalPlayer.vue +133 -74
  90. package/src/components/mixins/functions.ts +21 -18
  91. package/src/components/mixins/init.ts +24 -0
  92. package/src/components/mixins/organisationFilter.ts +24 -0
  93. package/src/components/pages/Category.vue +26 -26
  94. package/src/components/pages/Emission.vue +120 -92
  95. package/src/components/pages/Emissions.vue +109 -86
  96. package/src/components/pages/Home.vue +70 -16
  97. package/src/components/pages/Lives.vue +57 -47
  98. package/src/components/pages/Participant.vue +93 -77
  99. package/src/components/pages/Participants.vue +44 -31
  100. package/src/components/pages/Playlist.vue +63 -52
  101. package/src/components/pages/Playlists.vue +41 -39
  102. package/src/components/pages/Podcast.vue +265 -251
  103. package/src/components/pages/Podcasts.vue +135 -104
  104. package/src/components/pages/Rubrique.vue +25 -19
  105. package/src/components/pages/Search.vue +71 -67
  106. package/src/helper/dom.ts +2 -2
  107. package/src/helper/duration.ts +18 -8
  108. package/src/locale/educationen.ts +14 -0
  109. package/src/locale/en.ts +299 -1
  110. package/src/locale/fr.ts +25 -10
  111. package/src/locale/messages.ts +3 -2
  112. package/src/main.ts +54 -32
  113. package/src/router/router.ts +184 -159
  114. package/src/shims-tsx.d.ts +13 -0
  115. package/src/shims-vue-recaptcha-v3.d.ts +9 -0
  116. package/src/shims-vue.d.ts +5 -6
  117. package/src/store/AppStore.ts +36 -171
  118. package/src/store/class/category.ts +8 -0
  119. package/src/store/class/comment.ts +17 -0
  120. package/src/store/class/conference.ts +27 -0
  121. package/src/store/class/customPlayer.ts +8 -0
  122. package/src/store/class/emission.ts +20 -0
  123. package/src/store/class/fetchParam.ts +16 -0
  124. package/src/store/class/media.ts +13 -0
  125. package/src/store/class/organisation.ts +19 -0
  126. package/src/store/class/participant.ts +12 -0
  127. package/src/store/class/person.ts +13 -0
  128. package/src/store/class/player.ts +12 -0
  129. package/src/store/class/playlist.ts +15 -0
  130. package/src/store/class/podcast.ts +37 -0
  131. package/src/store/class/rubriquage.ts +9 -0
  132. package/src/store/class/rubriquageFilter.ts +5 -0
  133. package/src/store/class/rubrique.ts +8 -0
  134. package/src/store/paramStore.ts +70 -29
  135. package/src/store/typeAppStore.ts +171 -237
  136. package/src/vuex-shim.d.ts +8 -0
  137. package/tsconfig.json +4 -0
  138. package/vue.config.js +14 -0
  139. package/public/img/ACPM.PNG +0 -0
  140. package/src/assets/bootstrap_scss/_alert.scss +0 -51
  141. package/src/assets/bootstrap_scss/_badge.scss +0 -54
  142. package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
  143. package/src/assets/bootstrap_scss/_button-group.scss +0 -164
  144. package/src/assets/bootstrap_scss/_buttons.scss +0 -291
  145. package/src/assets/bootstrap_scss/_card.scss +0 -278
  146. package/src/assets/bootstrap_scss/_carousel.scss +0 -197
  147. package/src/assets/bootstrap_scss/_close.scss +0 -41
  148. package/src/assets/bootstrap_scss/_code.scss +0 -48
  149. package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
  150. package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
  151. package/src/assets/bootstrap_scss/_forms.scss +0 -352
  152. package/src/assets/bootstrap_scss/_functions.scss +0 -134
  153. package/src/assets/bootstrap_scss/_grid.scss +0 -69
  154. package/src/assets/bootstrap_scss/_images.scss +0 -42
  155. package/src/assets/bootstrap_scss/_input-group.scss +0 -191
  156. package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
  157. package/src/assets/bootstrap_scss/_list-group.scss +0 -158
  158. package/src/assets/bootstrap_scss/_media.scss +0 -8
  159. package/src/assets/bootstrap_scss/_mixins.scss +0 -47
  160. package/src/assets/bootstrap_scss/_modal.scss +0 -243
  161. package/src/assets/bootstrap_scss/_nav.scss +0 -120
  162. package/src/assets/bootstrap_scss/_navbar.scss +0 -324
  163. package/src/assets/bootstrap_scss/_pagination.scss +0 -74
  164. package/src/assets/bootstrap_scss/_popover.scss +0 -170
  165. package/src/assets/bootstrap_scss/_print.scss +0 -141
  166. package/src/assets/bootstrap_scss/_progress.scss +0 -46
  167. package/src/assets/bootstrap_scss/_reboot.scss +0 -482
  168. package/src/assets/bootstrap_scss/_root.scss +0 -20
  169. package/src/assets/bootstrap_scss/_spinners.scss +0 -55
  170. package/src/assets/bootstrap_scss/_tables.scss +0 -185
  171. package/src/assets/bootstrap_scss/_toasts.scss +0 -44
  172. package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
  173. package/src/assets/bootstrap_scss/_transitions.scss +0 -20
  174. package/src/assets/bootstrap_scss/_type.scss +0 -125
  175. package/src/assets/bootstrap_scss/_utilities.scss +0 -17
  176. package/src/assets/bootstrap_scss/_variables.scss +0 -1145
  177. package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
  178. package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
  179. package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
  180. package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
  181. package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
  182. package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
  183. package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
  184. package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
  185. package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
  186. package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
  187. package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
  188. package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
  189. package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
  190. package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
  191. package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
  192. package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
  193. package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
  194. package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
  195. package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
  196. package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
  197. package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
  198. package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
  199. package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
  200. package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
  201. package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
  202. package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
  203. package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
  204. package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
  205. package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
  206. package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
  207. package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
  208. package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
  209. package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
  210. package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
  211. package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
  212. package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
  213. package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
  214. package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
  215. package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
  216. package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
  217. package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
  218. package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
  219. package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
  220. package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
  221. package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
  222. package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
  223. package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
  224. package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
  225. package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
  226. package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
  227. package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
  228. package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
  229. package/src/shims-vuex.d.ts +0 -7
  230. package/src/views/Home.vue +0 -18
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <li
3
+ v-if="participant"
3
4
  class="participant-item-container"
4
- v-if="participant && (activeParticipant || editRight)"
5
5
  >
6
6
  <router-link
7
7
  :to="{
8
8
  name: 'participant',
9
9
  params: { participantId: participant.participantId },
10
- query: { productor: this.$store.state.filter.organisationId },
10
+ query: { productor: $store.state.filter.organisationId },
11
11
  }"
12
12
  class="mt-3"
13
13
  :aria-label="$t('Participant')"
@@ -15,23 +15,23 @@
15
15
  <div
16
16
  class="img-box-circle"
17
17
  :style="{ 'background-image': 'url(\'' + participant.imageUrl + '\')' }"
18
- ></div>
18
+ />
19
19
  </router-link>
20
20
  <router-link
21
21
  :to="{
22
22
  name: 'participant',
23
23
  params: { participantId: participant.participantId },
24
- query: { productor: this.$store.state.filter.organisationId },
24
+ query: { productor: $store.state.filter.organisationId },
25
25
  }"
26
26
  class="text-dark mt-3"
27
27
  >
28
28
  <div class="participant-name">
29
29
  <img
30
+ v-if="!activeParticipant && !isPodcastmaker && editRight"
30
31
  src="/img/caution.png"
31
32
  class="icon-caution"
32
- v-if="!activeParticipant && !isPodcastmaker && editRight"
33
33
  :title="$t('Participant have not podcasts')"
34
- />{{ name }}
34
+ >{{ name }}
35
35
  </div>
36
36
  <div
37
37
  :id="'description-participant-container-' + participant.participantId"
@@ -40,17 +40,17 @@
40
40
  <div
41
41
  :id="'description-participant-' + participant.participantId"
42
42
  v-html="urlify(description)"
43
- ></div>
43
+ />
44
44
  </div>
45
45
  </router-link>
46
46
  <router-link
47
+ v-if="!isPodcastmaker"
47
48
  :to="{
48
49
  name: 'productor',
49
50
  params: { productorId: participant.orga.id },
50
- query: { productor: this.$store.state.filter.organisationId },
51
+ query: { productor: $store.state.filter.organisationId },
51
52
  }"
52
53
  class="text-dark participant-producer"
53
- v-if="!isPodcastmaker"
54
54
  >
55
55
  <div class="participant-producer primary-color">
56
56
  © {{ participant.orga.name }}
@@ -59,6 +59,88 @@
59
59
  </li>
60
60
  </template>
61
61
 
62
+ <script lang="ts">
63
+ const octopusApi = require('@saooti/octopus-api');
64
+ import { Participant } from '@/store/class/participant';
65
+ import { state } from '../../../store/paramStore';
66
+ import { displayMethods } from '../../mixins/functions';
67
+ import { defineComponent } from 'vue'
68
+ export default defineComponent({
69
+ name: 'ParticpantItem',
70
+ mixins: [displayMethods],
71
+ props: {
72
+ participant: { default: ()=>({}), type: Object as ()=> Participant},
73
+ },
74
+
75
+ data() {
76
+ return {
77
+ activeParticipant: true as boolean,
78
+ };
79
+ },
80
+
81
+ computed: {
82
+ isPodcastmaker(): boolean {
83
+ return state.generalParameters.podcastmaker;
84
+ },
85
+ description(): string {
86
+ return this.participant.description || '';
87
+ },
88
+ name(): string {
89
+ return (
90
+ (this.participant.firstName || '') +
91
+ ' ' +
92
+ (this.participant.lastName || '')
93
+ ).trim();
94
+ },
95
+ organisationId(): string {
96
+ return state.generalParameters.organisationId;
97
+ },
98
+ authenticated(): boolean {
99
+ return state.generalParameters.authenticated;
100
+ },
101
+ editRight(): boolean {
102
+ if (
103
+ (this.authenticated &&
104
+ this.organisationId === this.participant.orga.id) ||
105
+ state.generalParameters.isAdmin
106
+ )
107
+ return true;
108
+ return false;
109
+ },
110
+ },
111
+
112
+ created() {
113
+ if(!this.editRight)return;
114
+ this.hasPodcast();
115
+ },
116
+ mounted() {
117
+ const participantDesc = document.getElementById(
118
+ 'description-participant-' + this.participant.participantId
119
+ );
120
+ const participantDescContainer = document.getElementById(
121
+ 'description-participant-container-' + this.participant.participantId
122
+ );
123
+ if (
124
+ null !== participantDesc && null !==participantDescContainer &&
125
+ participantDesc.clientHeight > participantDescContainer.clientHeight
126
+ ) {
127
+ participantDescContainer.classList.add('after-participant-description');
128
+ }
129
+ },
130
+ methods: {
131
+ async hasPodcast(): Promise<void> {
132
+ const data = await octopusApi.fetchPodcasts({
133
+ participantId: this.participant.participantId,
134
+ first: 0,
135
+ size: 0,
136
+ });
137
+ if (0 === data.count) {
138
+ this.activeParticipant = false;
139
+ }
140
+ },
141
+ },
142
+ })
143
+ </script>
62
144
  <style lang="scss">
63
145
  .participant-item-container {
64
146
  list-style: none;
@@ -109,102 +191,4 @@
109
191
  margin: 1rem 0 0;
110
192
  }
111
193
  }
112
- </style>
113
-
114
- <script lang="ts">
115
- const octopusApi = require('@saooti/octopus-api');
116
- import { state } from '../../../store/paramStore';
117
- import { displayMethods } from '../../mixins/functions';
118
- import { defineComponent } from 'vue'
119
- export default defineComponent({
120
- name: 'ParticpantItem',
121
-
122
- props: ['participant'],
123
- emits: ['participantNotVisible'],
124
-
125
- mixins: [displayMethods],
126
-
127
- created() {
128
- this.hasPodcast();
129
- },
130
- mounted() {
131
- let participantDesc = document.getElementById(
132
- 'description-participant-' + this.participant.participantId
133
- );
134
- let participantDescContainer:any = document.getElementById(
135
- 'description-participant-container-' + this.participant.participantId
136
- );
137
- if (
138
- null !== participantDesc &&
139
- participantDesc.clientHeight > participantDescContainer.clientHeight
140
- ) {
141
- participantDescContainer.classList.add('after-participant-description');
142
- }
143
- },
144
-
145
- data() {
146
- return {
147
- activeParticipant: true,
148
- };
149
- },
150
-
151
- computed: {
152
- isPodcastmaker() {
153
- return state.generalParameters.podcastmaker;
154
- },
155
-
156
- description():string {
157
- let description;
158
- description = this.participant.description || '';
159
- if (state.generalParameters.isIE11)
160
- return description.substring(0, 50) + '...';
161
- return description;
162
- },
163
-
164
- name():string {
165
- const fullName = (
166
- (this.participant.firstName || '') +
167
- ' ' +
168
- (this.participant.lastName || '')
169
- ).trim();
170
- if (state.generalParameters.isIE11)
171
- return fullName.substring(0, 50) + '...';
172
- return fullName;
173
- },
174
-
175
- organisationId() {
176
- return state.generalParameters.organisationId;
177
- },
178
-
179
- authenticated():boolean {
180
- return state.generalParameters.authenticated;
181
- },
182
-
183
- editRight() {
184
- if (
185
- (this.authenticated &&
186
- this.organisationId === this.participant.orga.id) ||
187
- state.generalParameters.isAdmin
188
- )
189
- return true;
190
- return false;
191
- },
192
- },
193
- methods: {
194
- async hasPodcast() {
195
- const data = await octopusApi.fetchPodcasts({
196
- participantId: this.participant.participantId,
197
- first: 0,
198
- size: 0,
199
- });
200
- if (0 === data.count) {
201
- this.activeParticipant = false;
202
- }
203
- if (this.participant && (this.editRight || this.activeParticipant)) {
204
- return;
205
- }
206
- this.$emit('participantNotVisible');
207
- },
208
- },
209
- });
210
- </script>
194
+ </style>
@@ -1,8 +1,13 @@
1
1
  <template>
2
2
  <div class="d-flex flex-column align-items-center">
3
- <div class="d-flex justify-content-center" v-if="loading">
4
- <div class="spinner-border mr-3"></div>
5
- <h3 class="mt-2">{{ $t('Loading participants ...') }}</h3>
3
+ <div
4
+ v-if="loading"
5
+ class="d-flex justify-content-center"
6
+ >
7
+ <div class="spinner-border me-3" />
8
+ <h3 class="mt-2">
9
+ {{ $t('Loading participants ...') }}
10
+ </h3>
6
11
  </div>
7
12
  <div
8
13
  v-if="showCount && loaded && participants.length > 1"
@@ -12,98 +17,89 @@
12
17
  $t('Number participants', { nb: displayCount }) + $t('sort by score')
13
18
  }}
14
19
  </div>
15
- <ul class="participant-list" v-show="loaded">
20
+ <ul
21
+ v-show="loaded"
22
+ class="participant-list"
23
+ >
16
24
  <ParticipantItem
17
- v-bind:participant="p"
18
25
  v-for="p in participants"
19
- v-bind:key="p.participantId"
20
- @participantNotVisible="displayCount--"
26
+ :key="p.participantId"
27
+ :participant="p"
21
28
  />
22
29
  </ul>
23
30
  <button
24
- class="btn btn-more"
25
- @click="displayMore"
26
31
  v-show="!allFetched && loaded"
32
+ class="btn btn-more"
27
33
  :aria-label="$t('See more')"
28
34
  :disabled="inFetching"
35
+ @click="displayMore"
29
36
  >
30
- <div class="saooti-plus"></div>
37
+ <div class="saooti-plus" />
31
38
  </button>
32
39
  </div>
33
40
  </template>
34
41
 
35
- <style lang="scss">
36
- .participant-list {
37
- align-self: stretch;
38
- flex-grow: 1;
39
- margin: 0;
40
- padding: 0;
41
- /*For ie11 */
42
- display: flex;
43
- flex-wrap: wrap;
44
- /* end */
45
-
46
- display: grid; /* 1 */
47
- grid-template-columns: repeat(auto-fill, 14rem); /* 2 */
48
- grid-gap: 2rem; /* 3 */
49
- justify-content: space-between; /* 4 */
50
- }
51
- /** PHONES*/
52
- @media (max-width: 655px) {
53
- .participant-list {
54
- align-self: auto;
55
- grid-gap: 0;
56
- }
57
- }
58
- </style>
59
-
60
42
  <script lang="ts">
61
43
  const octopusApi = require('@saooti/octopus-api');
62
44
  import ParticipantItem from './ParticipantItem.vue';
63
45
 
46
+ import { Participant } from '@/store/class/participant';
64
47
  import { defineComponent } from 'vue'
65
48
  export default defineComponent({
66
49
  name: 'ParticipantList',
67
50
 
68
- props: ['first', 'size', 'query', 'organisationId', 'showCount'],
69
-
70
51
  components: {
71
52
  ParticipantItem,
72
53
  },
73
-
74
- created() {
75
- this.fetchContent(true);
54
+ props: {
55
+ first: { default: 0, type: Number },
56
+ size: { default: 12, type: Number },
57
+ query: { default: undefined, type: String},
58
+ organisationId: { default: undefined, type: String},
59
+ showCount: { default: false, type: Boolean },
76
60
  },
77
61
 
78
62
  data() {
79
63
  return {
80
- loading: true,
81
- loaded: true,
82
- dfirst: this.$props.first,
83
- dsize: this.$props.size,
84
- totalCount: 0,
85
- displayCount: 0,
86
- participants: [] as any,
87
- inFetching: false,
64
+ loading: true as boolean,
65
+ loaded: true as boolean,
66
+ dfirst: this.first as number,
67
+ dsize: this.size as number,
68
+ totalCount: 0 as number,
69
+ displayCount: 0 as number,
70
+ participants: [] as Array<Participant>,
71
+ inFetching: false as boolean,
88
72
  };
89
73
  },
90
74
 
75
+
91
76
  computed: {
92
- allFetched():boolean {
77
+ allFetched(): boolean {
93
78
  return this.dfirst >= this.totalCount;
94
79
  },
95
- filterOrga():any {
80
+ filterOrga(): string {
96
81
  return this.$store.state.filter.organisationId;
97
82
  },
98
- organisation():any {
83
+ organisation(): string|undefined {
99
84
  if (this.organisationId) return this.organisationId;
100
85
  if (this.filterOrga) return this.filterOrga;
101
86
  return undefined;
102
87
  },
103
88
  },
89
+ watch: {
90
+ query(): void {
91
+ this.fetchContent(true);
92
+ },
93
+ organisation(): void {
94
+ this.fetchContent(true);
95
+ },
96
+ },
104
97
 
98
+ created() {
99
+ this.fetchContent(true);
100
+ },
105
101
  methods: {
106
- async fetchContent(reset: boolean) {
102
+ async fetchContent(reset: boolean): Promise<void> {
107
103
  this.inFetching = true;
108
104
  if (reset) {
109
105
  this.participants.length = 0;
@@ -120,7 +116,7 @@ export default defineComponent({
120
116
  this.loading = false;
121
117
  this.loaded = true;
122
118
  this.displayCount = data.count;
123
- this.participants = this.participants.concat(data.result).filter((p: null) => {
119
+ this.participants = this.participants.concat(data.result).filter((p: Participant | null) => {
124
120
  if (null === p) {
125
121
  this.displayCount--;
126
122
  }
@@ -130,24 +126,35 @@ export default defineComponent({
130
126
  this.totalCount = data.count;
131
127
  this.inFetching = false;
132
128
  },
133
-
134
- displayMore(event: { preventDefault: () => void; }) {
129
+ displayMore(event: { preventDefault: () => void }): void {
135
130
  event.preventDefault();
136
131
  this.fetchContent(false);
137
132
  },
138
133
  },
139
-
140
- watch: {
141
- query: {
142
- handler() {
143
- this.fetchContent(true);
144
- },
145
- },
146
- organisation: {
147
- handler() {
148
- this.fetchContent(true);
149
- },
150
- },
151
- },
152
- });
134
+ })
153
135
  </script>
136
+
137
+ <style lang="scss">
138
+ .participant-list {
139
+ align-self: stretch;
140
+ flex-grow: 1;
141
+ margin: 0;
142
+ padding: 0;
143
+ /*For ie11 */
144
+ display: flex;
145
+ flex-wrap: wrap;
146
+ /* end */
147
+
148
+ display: grid; /* 1 */
149
+ grid-template-columns: repeat(auto-fill, 14rem); /* 2 */
150
+ grid-gap: 2rem; /* 3 */
151
+ justify-content: space-between; /* 4 */
152
+ }
153
+ /** PHONES*/
154
+ @media (max-width: 655px) {
155
+ .participant-list {
156
+ align-self: auto;
157
+ grid-gap: 0;
158
+ }
159
+ }
160
+ </style>
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <li
3
- class="mt-3 emission-item-container shadow-element"
4
3
  v-if="editRight || activePlaylist"
4
+ class="mt-3 emission-item-container shadow-element"
5
5
  >
6
6
  <router-link
7
7
  :to="{
8
8
  name: 'playlist',
9
9
  params: { playlistId: playlist.playlistId },
10
- query: { productor: this.$store.state.filter.organisationId },
10
+ query: { productor: $store.state.filter.organisationId },
11
11
  }"
12
12
  :aria-label="$t('Playlist')"
13
13
  class="text-dark"
@@ -18,24 +18,24 @@
18
18
  'background-image':
19
19
  'url(\'' + playlist.imageUrl + '?dummy=' + dummyParam + '\')',
20
20
  }"
21
- ></div>
21
+ />
22
22
  </router-link>
23
23
  <div class="emission-item-text">
24
24
  <router-link
25
25
  :to="{
26
26
  name: 'playlist',
27
27
  params: { playlistId: playlist.playlistId },
28
- query: { productor: this.$store.state.filter.organisationId },
28
+ query: { productor: $store.state.filter.organisationId },
29
29
  }"
30
30
  class="text-dark"
31
31
  >
32
32
  <div class="emission-name">
33
33
  <img
34
+ v-if="!activePlaylist && !isPodcastmaker"
34
35
  class="icon-caution"
35
36
  src="/img/caution.png"
36
- v-if="!activePlaylist && !isPodcastmaker"
37
37
  :title="$t('Playlist have not podcasts')"
38
- />{{ name }}
38
+ >{{ name }}
39
39
  </div>
40
40
  <div
41
41
  :id="'description-playlist-container-' + playlist.playlistId"
@@ -44,18 +44,18 @@
44
44
  <div
45
45
  :id="'description-playlist-' + playlist.playlistId"
46
46
  v-html="urlify(description)"
47
- ></div>
47
+ />
48
48
  </div>
49
49
  </router-link>
50
- <div class="flex-grow"></div>
50
+ <div class="flex-grow" />
51
51
  <router-link
52
+ v-if="!isPodcastmaker && playlist.organisation"
52
53
  :to="{
53
54
  name: 'productor',
54
55
  params: { productorId: playlist.organisation.id },
55
- query: { productor: this.$store.state.filter.organisationId },
56
+ query: { productor: $store.state.filter.organisationId },
56
57
  }"
57
58
  class="text-dark"
58
- v-if="!isPodcastmaker && playlist.organisation"
59
59
  >
60
60
  <div class="emission-producer primary-color">
61
61
  © {{ playlist.organisation.name }}
@@ -65,74 +65,46 @@
65
65
  </li>
66
66
  </template>
67
67
 
68
- <style lang="scss"></style>
69
-
70
68
  <script lang="ts">
69
+ import { Playlist } from '@/store/class/playlist';
71
70
  import { state } from '../../../store/paramStore';
72
71
  import { displayMethods } from '../../mixins/functions';
73
- /* import octopusApi from "@saooti/octopus-api"; */
74
72
  import { defineComponent } from 'vue'
75
73
  export default defineComponent({
76
74
  name: 'PlaylistItem',
77
75
 
78
- props: ['playlist'],
79
- emits: ['playlistNotVisible'],
80
-
81
76
  mixins: [displayMethods],
82
77
 
83
- mounted() {
84
- let playlistDesc = document.getElementById(
85
- 'description-playlist-' + this.playlist.playlistId
86
- );
87
- let playlistDescContainer:any = document.getElementById(
88
- 'description-playlist-container-' + this.playlist.playlistId
89
- );
90
- if (
91
- null !== playlistDesc &&
92
- playlistDesc.clientHeight > playlistDescContainer.clientHeight
93
- ) {
94
- playlistDescContainer.classList.add('after-emission-description');
95
- }
96
- if (this.editRight || this.activePlaylist) {
97
- return;
98
- }
99
- this.$emit('playlistNotVisible');
78
+ props: {
79
+ playlist: { default: ()=>({}), type: Object as ()=>Playlist},
100
80
  },
101
81
 
102
82
  data() {
103
83
  return {
104
- dummyParam: new Date().getTime().toString(),
84
+ dummyParam: new Date().getTime().toString() as string,
105
85
  };
106
86
  },
107
-
87
+
108
88
  computed: {
109
- isPodcastmaker() {
89
+ isPodcastmaker(): boolean {
110
90
  return state.generalParameters.podcastmaker;
111
91
  },
112
-
113
- organisation():string {
114
- return '' + this.playlist.publisher.organisation.name;
92
+ organisation(): string {
93
+ if(this.playlist && this.playlist.publisher && this.playlist.publisher.organisation){
94
+ return '' + this.playlist.publisher.organisation.name;
95
+ }
96
+ return '';
115
97
  },
116
-
117
- description():string {
118
- let description;
119
- description = this.playlist.description || '';
120
- if (state.generalParameters.isIE11)
121
- return description.substring(0, 50) + '...';
122
- return description;
98
+ description(): string {
99
+ return this.playlist.description || '';
123
100
  },
124
-
125
- name():string {
126
- if (state.generalParameters.isIE11)
127
- return this.playlist.title.substring(0, 50) + '...';
101
+ name(): string {
128
102
  return this.playlist.title;
129
103
  },
130
-
131
- organisationId() {
104
+ organisationId(): string {
132
105
  return state.generalParameters.organisationId;
133
106
  },
134
-
135
- editRight() {
107
+ editRight(): boolean {
136
108
  if (
137
109
  (state.generalParameters.isPlaylist &&
138
110
  this.organisationId === this.playlist.organisation.id) ||
@@ -141,11 +113,28 @@ export default defineComponent({
141
113
  return true;
142
114
  return false;
143
115
  },
144
- activePlaylist():boolean {
116
+ activePlaylist(): boolean {
145
117
  return 0 !== Object.keys(this.playlist.podcasts).length;
146
118
  },
147
119
  },
148
120
 
121
+
122
+ mounted() {
123
+ const playlistDesc = document.getElementById(
124
+ 'description-playlist-' + this.playlist.playlistId
125
+ );
126
+ const playlistDescContainer = document.getElementById(
127
+ 'description-playlist-container-' + this.playlist.playlistId
128
+ );
129
+ if (
130
+ null !== playlistDesc && null !== playlistDescContainer &&
131
+ playlistDesc.clientHeight > playlistDescContainer.clientHeight
132
+ ) {
133
+ playlistDescContainer.classList.add('after-emission-description');
134
+ }
135
+ },
149
136
  methods: {},
150
- });
137
+ })
151
138
  </script>
139
+
140
+ <style lang="scss"></style>