@saooti/octopus-sdk 1.0.0 → 1.1.1

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 (317) hide show
  1. package/README.md +261 -0
  2. package/index.d.ts +4 -0
  3. package/index.ts +55 -3
  4. package/package.json +53 -45
  5. package/public/config.ts +4 -0
  6. package/public/css/fonts/icomoon.eot +0 -0
  7. package/public/css/fonts/icomoon.svg +129 -0
  8. package/public/css/fonts/icomoon.ttf +0 -0
  9. package/public/css/fonts/icomoon.woff +0 -0
  10. package/public/css/fonts/style.css +186 -1224
  11. package/public/img/403.jpeg +0 -0
  12. package/public/img/404.svg +242 -0
  13. package/public/img/ACPM.png +0 -0
  14. package/public/img/ouest_france_logo.svg +12 -0
  15. package/src/App.vue +102 -31
  16. package/src/api/classicCrud.ts +34 -0
  17. package/src/api/initialize.ts +5 -2
  18. package/src/assets/bootstrap-diff.scss +197 -0
  19. package/src/assets/form.scss +77 -77
  20. package/src/assets/general.scss +284 -272
  21. package/src/assets/live.scss +39 -0
  22. package/src/assets/modal.scss +43 -50
  23. package/src/assets/multiselect.scss +522 -573
  24. package/src/assets/octopus-library.scss +18 -4
  25. package/src/assets/share.scss +243 -0
  26. package/src/assets/transition.scss +98 -2
  27. package/src/components/display/aggregator/RssSection.vue +3 -5
  28. package/src/components/display/categories/CategoryChooser.vue +151 -114
  29. package/src/components/display/categories/CategoryFilter.vue +162 -0
  30. package/src/components/display/categories/CategoryList.vue +149 -117
  31. package/src/components/display/comments/AddCommentModal.vue +103 -108
  32. package/src/components/display/comments/CommentBasicView.vue +95 -0
  33. package/src/components/display/comments/CommentInput.vue +195 -183
  34. package/src/components/display/comments/CommentItem.vue +170 -208
  35. package/src/components/display/comments/CommentList.vue +134 -228
  36. package/src/components/display/comments/CommentParentInfo.vue +28 -62
  37. package/src/components/display/comments/CommentPlayer.vue +53 -56
  38. package/src/components/display/comments/CommentSection.vue +52 -83
  39. package/src/components/display/edit/EditBox.vue +10 -4
  40. package/src/components/display/edit/EditCommentBox.vue +124 -38
  41. package/src/components/display/emission/EmissionChooser.vue +88 -108
  42. package/src/components/display/emission/EmissionInlineList.vue +156 -157
  43. package/src/components/display/emission/EmissionItem.vue +72 -226
  44. package/src/components/display/emission/EmissionList.vue +159 -201
  45. package/src/components/display/emission/EmissionPlayerItem.vue +203 -174
  46. package/src/components/display/filter/AdvancedSearch.vue +224 -432
  47. package/src/components/display/filter/CategoryFilter.vue +105 -0
  48. package/src/components/display/filter/MonetizableFilter.vue +18 -15
  49. package/src/components/display/filter/ProductorSearch.vue +153 -176
  50. package/src/components/display/filter/RubriqueChoice.vue +97 -0
  51. package/src/components/display/filter/RubriqueFilter.vue +232 -0
  52. package/src/components/display/list/ListPaginate.vue +145 -0
  53. package/src/components/display/list/Paginate.vue +218 -0
  54. package/src/components/display/live/CountDown.vue +31 -30
  55. package/src/components/display/live/LiveHorizontalList.vue +84 -62
  56. package/src/components/display/live/LiveItem.vue +161 -186
  57. package/src/components/display/live/LiveList.vue +184 -295
  58. package/src/components/display/organisation/OrganisationChooser.vue +124 -162
  59. package/src/components/display/organisation/OrganisationChooserLight.vue +53 -56
  60. package/src/components/display/participant/ParticipantItem.vue +91 -128
  61. package/src/components/display/participant/ParticipantList.vue +134 -121
  62. package/src/components/display/playlist/PlaylistItem.vue +60 -97
  63. package/src/components/display/playlist/PlaylistList.vue +99 -92
  64. package/src/components/display/playlist/PodcastList.vue +117 -132
  65. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +191 -0
  66. package/src/components/display/podcasts/AnimatorsItem.vue +29 -37
  67. package/src/components/display/podcasts/ParticipantDescription.vue +82 -0
  68. package/src/components/display/podcasts/PodcastFilterList.vue +49 -102
  69. package/src/components/display/podcasts/PodcastImage.vue +208 -225
  70. package/src/components/display/podcasts/PodcastInlineList.vue +62 -355
  71. package/src/components/display/podcasts/PodcastInlineListClassic.vue +240 -0
  72. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +167 -0
  73. package/src/components/display/podcasts/PodcastItem.vue +94 -218
  74. package/src/components/display/podcasts/PodcastItemInfo.vue +166 -0
  75. package/src/components/display/podcasts/PodcastList.vue +127 -178
  76. package/src/components/display/podcasts/PodcastModuleBox.vue +234 -0
  77. package/src/components/display/podcasts/PodcastPlayBar.vue +101 -0
  78. package/src/components/display/podcasts/PodcastSwiperList.vue +204 -0
  79. package/src/components/display/podcasts/TagList.vue +60 -38
  80. package/src/components/display/rubriques/RubriqueChooser.vue +144 -131
  81. package/src/components/display/rubriques/RubriqueList.vue +216 -0
  82. package/src/components/display/sharing/PlayerParameters.vue +111 -153
  83. package/src/components/display/sharing/QrCode.vue +96 -0
  84. package/src/components/display/sharing/ShareButtons.vue +63 -233
  85. package/src/components/display/sharing/ShareButtonsIntern.vue +225 -0
  86. package/src/components/display/sharing/ShareDistribution.vue +102 -166
  87. package/src/components/display/sharing/SharePlayer.vue +189 -353
  88. package/src/components/display/sharing/SharePlayerColors.vue +78 -0
  89. package/src/components/display/sharing/SharePlayerTypes.vue +112 -0
  90. package/src/components/display/sharing/SplitButton.vue +42 -0
  91. package/src/components/display/sharing/SubscribeButtons.vue +65 -118
  92. package/src/components/display/studio/RecordingItemButton.vue +3 -5
  93. package/src/components/form/ClassicCheckbox.vue +66 -0
  94. package/src/components/form/ClassicLoading.vue +28 -0
  95. package/src/components/form/ClassicRadio.vue +66 -0
  96. package/src/components/form/ClassicSearch.vue +86 -0
  97. package/src/components/form/ClassicSelect.vue +65 -0
  98. package/src/components/misc/ErrorMessage.vue +27 -18
  99. package/src/components/misc/Footer.vue +151 -108
  100. package/src/components/misc/HomeDropdown.vue +95 -154
  101. package/src/components/misc/LeftMenu.vue +137 -206
  102. package/src/components/misc/Popover.vue +118 -0
  103. package/src/components/misc/Snackbar.vue +73 -37
  104. package/src/components/misc/TopBar.vue +211 -314
  105. package/src/components/misc/modal/ClipboardModal.vue +34 -47
  106. package/src/components/misc/modal/MessageModal.vue +74 -53
  107. package/src/components/misc/modal/NewsletterModal.vue +272 -224
  108. package/src/components/misc/modal/QrCodeModal.vue +58 -0
  109. package/src/components/misc/modal/ShareModalPlayer.vue +140 -74
  110. package/src/components/misc/player/Player.vue +146 -0
  111. package/src/components/misc/player/PlayerCompact.vue +154 -0
  112. package/src/components/misc/player/PlayerLarge.vue +166 -0
  113. package/src/components/misc/player/PlayerProgressBar.vue +112 -0
  114. package/src/components/misc/player/PlayerTimeline.vue +61 -0
  115. package/src/components/mixins/functions.ts +21 -18
  116. package/src/components/mixins/handle403.ts +17 -0
  117. package/src/components/mixins/init.ts +24 -0
  118. package/src/components/mixins/orgaComputed.ts +15 -0
  119. package/src/components/mixins/organisationFilter.ts +41 -0
  120. package/src/components/mixins/player/playerComment.ts +98 -0
  121. package/src/components/mixins/player/playerDisplay.ts +113 -0
  122. package/src/components/mixins/player/playerLive.ts +111 -0
  123. package/src/components/mixins/player/playerLogic.ts +225 -0
  124. package/src/components/mixins/tagOfMixins.ts +19 -0
  125. package/src/components/pages/Category.vue +24 -28
  126. package/src/components/pages/Emission.vue +144 -177
  127. package/src/components/pages/Emissions.vue +94 -110
  128. package/src/components/pages/Error403Page.vue +60 -0
  129. package/src/components/pages/Home.vue +74 -21
  130. package/src/components/pages/Lives.vue +53 -58
  131. package/src/components/pages/PageNotFound.vue +55 -0
  132. package/src/components/pages/Participant.vue +113 -129
  133. package/src/components/pages/Participants.vue +25 -41
  134. package/src/components/pages/Playlist.vue +86 -86
  135. package/src/components/pages/Playlists.vue +33 -52
  136. package/src/components/pages/Podcast.vue +206 -478
  137. package/src/components/pages/Podcasts.vue +112 -156
  138. package/src/components/pages/Rubrique.vue +21 -27
  139. package/src/components/pages/Search.vue +37 -94
  140. package/src/helper/dom.ts +2 -2
  141. package/src/helper/duration.ts +18 -8
  142. package/src/helper/useEventListener.ts +18 -0
  143. package/src/i18n.ts +36 -0
  144. package/src/locale/de.ts +309 -0
  145. package/src/locale/educationen.ts +14 -0
  146. package/src/locale/en.ts +316 -1
  147. package/src/locale/es.ts +309 -0
  148. package/src/locale/fr.ts +47 -15
  149. package/src/locale/it.ts +307 -0
  150. package/src/locale/messages.ts +11 -2
  151. package/src/locale/sl.ts +309 -0
  152. package/src/main.ts +64 -55
  153. package/src/router/router.ts +192 -159
  154. package/src/sass/_variables.scss +10 -8
  155. package/src/shims-tsx.d.ts +15 -0
  156. package/src/shims-vue-recaptcha-v3.d.ts +9 -0
  157. package/src/shims-vue.d.ts +5 -6
  158. package/src/store/AppStore.ts +41 -173
  159. package/src/store/class/adserver/adserverConfig.ts +9 -0
  160. package/src/store/class/adserver/adserverOtherEmission.ts +13 -0
  161. package/src/store/class/adserver/adserverTiming.ts +10 -0
  162. package/src/store/class/cartouchier/cartouche.ts +15 -0
  163. package/src/store/class/cartouchier/cartouchier.ts +9 -0
  164. package/src/store/class/conference/conference.ts +35 -0
  165. package/src/store/class/conference/conferenceMessage.ts +10 -0
  166. package/src/store/class/conference/conferenceParticipant.ts +18 -0
  167. package/src/store/class/conference/pad.ts +15 -0
  168. package/src/store/class/conference/studioCall.ts +7 -0
  169. package/src/store/class/contract/contract.ts +7 -0
  170. package/src/store/class/contract/contractOrganisation.ts +7 -0
  171. package/src/store/class/ftp/ftpEmission.ts +41 -0
  172. package/src/store/class/ftp/ftpParam.ts +12 -0
  173. package/src/store/class/ftp/testFtpEmission.ts +5 -0
  174. package/src/store/class/general/audioView.ts +21 -0
  175. package/src/store/class/general/category.ts +10 -0
  176. package/src/store/class/general/comment.ts +16 -0
  177. package/src/store/class/general/customPlayer.ts +9 -0
  178. package/src/store/class/general/emission.ts +23 -0
  179. package/src/store/class/general/fetchParam.ts +3 -0
  180. package/src/store/class/general/initState.ts +25 -0
  181. package/src/store/class/general/interfacePageable.ts +16 -0
  182. package/src/store/class/general/ituneCategory.ts +5 -0
  183. package/src/store/class/general/media.ts +14 -0
  184. package/src/store/class/general/organisation.ts +20 -0
  185. package/src/store/class/general/pageable.ts +13 -0
  186. package/src/store/class/general/participant.ts +12 -0
  187. package/src/store/class/general/player.ts +14 -0
  188. package/src/store/class/general/playlist.ts +13 -0
  189. package/src/store/class/general/podcast.ts +43 -0
  190. package/src/store/class/general/sortPageable.ts +5 -0
  191. package/src/store/class/general/soundcastCategory.ts +8 -0
  192. package/src/store/class/ouestFrance/ofTag.ts +36 -0
  193. package/src/store/class/ouestFrance/ofTagInfo.ts +9 -0
  194. package/src/store/class/ouestFrance/ofTagPage.ts +7 -0
  195. package/src/store/class/ouestFrance/ofTagSeo.ts +7 -0
  196. package/src/store/class/ouestFrance/ofTagVente.ts +6 -0
  197. package/src/store/class/ouestFrance/ofTagWithParents.ts +26 -0
  198. package/src/store/class/rss/aggregator.ts +28 -0
  199. package/src/store/class/rss/rssEmission.ts +14 -0
  200. package/src/store/class/rss/rssInfo.ts +8 -0
  201. package/src/store/class/rubrique/rubriquage.ts +10 -0
  202. package/src/store/class/rubrique/rubriquageFilter.ts +6 -0
  203. package/src/store/class/rubrique/rubrique.ts +9 -0
  204. package/src/store/class/stat/statArrayIncome.ts +6 -0
  205. package/src/store/class/stat/statArrayObject.ts +34 -0
  206. package/src/store/class/stat/statGraph.ts +7 -0
  207. package/src/store/class/user/person.ts +15 -0
  208. package/src/store/class/user/profile.ts +12 -0
  209. package/src/store/class/user/userKeycloak.ts +24 -0
  210. package/src/store/paramStore.ts +222 -217
  211. package/src/store/typeAppStore.ts +186 -235
  212. package/src/vuex-shim.d.ts +8 -0
  213. package/tsconfig.json +4 -0
  214. package/vue.config.js +16 -0
  215. package/public/css/fonts/saooti-ui.eot +0 -0
  216. package/public/css/fonts/saooti-ui.svg +0 -829
  217. package/public/css/fonts/saooti-ui.ttf +0 -0
  218. package/public/css/fonts/saooti-ui.woff +0 -0
  219. package/public/css/fonts/stitcher-logo.svg +0 -83
  220. package/public/img/ACPM.PNG +0 -0
  221. package/src/api/comments.ts +0 -7
  222. package/src/api/emissions.ts +0 -7
  223. package/src/api/podcasts.ts +0 -7
  224. package/src/api/profile.ts +0 -8
  225. package/src/api/studio.ts +0 -1
  226. package/src/assets/bootstrap_scss/_alert.scss +0 -51
  227. package/src/assets/bootstrap_scss/_badge.scss +0 -54
  228. package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
  229. package/src/assets/bootstrap_scss/_button-group.scss +0 -164
  230. package/src/assets/bootstrap_scss/_buttons.scss +0 -291
  231. package/src/assets/bootstrap_scss/_card.scss +0 -278
  232. package/src/assets/bootstrap_scss/_carousel.scss +0 -197
  233. package/src/assets/bootstrap_scss/_close.scss +0 -41
  234. package/src/assets/bootstrap_scss/_code.scss +0 -48
  235. package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
  236. package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
  237. package/src/assets/bootstrap_scss/_forms.scss +0 -352
  238. package/src/assets/bootstrap_scss/_functions.scss +0 -134
  239. package/src/assets/bootstrap_scss/_grid.scss +0 -69
  240. package/src/assets/bootstrap_scss/_images.scss +0 -42
  241. package/src/assets/bootstrap_scss/_input-group.scss +0 -191
  242. package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
  243. package/src/assets/bootstrap_scss/_list-group.scss +0 -158
  244. package/src/assets/bootstrap_scss/_media.scss +0 -8
  245. package/src/assets/bootstrap_scss/_mixins.scss +0 -47
  246. package/src/assets/bootstrap_scss/_modal.scss +0 -243
  247. package/src/assets/bootstrap_scss/_nav.scss +0 -120
  248. package/src/assets/bootstrap_scss/_navbar.scss +0 -324
  249. package/src/assets/bootstrap_scss/_pagination.scss +0 -74
  250. package/src/assets/bootstrap_scss/_popover.scss +0 -170
  251. package/src/assets/bootstrap_scss/_print.scss +0 -141
  252. package/src/assets/bootstrap_scss/_progress.scss +0 -46
  253. package/src/assets/bootstrap_scss/_reboot.scss +0 -482
  254. package/src/assets/bootstrap_scss/_root.scss +0 -20
  255. package/src/assets/bootstrap_scss/_spinners.scss +0 -55
  256. package/src/assets/bootstrap_scss/_tables.scss +0 -185
  257. package/src/assets/bootstrap_scss/_toasts.scss +0 -44
  258. package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
  259. package/src/assets/bootstrap_scss/_transitions.scss +0 -20
  260. package/src/assets/bootstrap_scss/_type.scss +0 -125
  261. package/src/assets/bootstrap_scss/_utilities.scss +0 -17
  262. package/src/assets/bootstrap_scss/_variables.scss +0 -1145
  263. package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
  264. package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
  265. package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
  266. package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
  267. package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
  268. package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
  269. package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
  270. package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
  271. package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
  272. package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
  273. package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
  274. package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
  275. package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
  276. package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
  277. package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
  278. package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
  279. package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
  280. package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
  281. package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
  282. package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
  283. package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
  284. package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
  285. package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
  286. package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
  287. package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
  288. package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
  289. package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
  290. package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
  291. package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
  292. package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
  293. package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
  294. package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
  295. package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
  296. package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
  297. package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
  298. package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
  299. package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
  300. package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
  301. package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
  302. package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
  303. package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
  304. package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
  305. package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
  306. package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
  307. package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
  308. package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
  309. package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
  310. package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
  311. package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
  312. package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
  313. package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
  314. package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
  315. package/src/components/misc/Player.vue +0 -792
  316. package/src/shims-vuex.d.ts +0 -7
  317. package/src/views/Home.vue +0 -18
@@ -1,65 +1,124 @@
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: filterOrga },
11
11
  }"
12
- class="mt-3"
13
- :aria-label="$t('Participant')"
12
+ class="mt-3 text-dark"
13
+ :title="$t('Participant')"
14
14
  >
15
- <div
15
+ <img
16
+ v-lazy="participant.imageUrl"
17
+ :title="$t('Animator image')"
18
+ :alt="$t('Animator image')"
16
19
  class="img-box-circle"
17
- :style="{ 'background-image': 'url(\'' + participant.imageUrl + '\')' }"
18
- ></div>
19
- </router-link>
20
- <router-link
21
- :to="{
22
- name: 'participant',
23
- params: { participantId: participant.participantId },
24
- query: { productor: this.$store.state.filter.organisationId },
25
- }"
26
- class="text-dark mt-3"
27
- >
20
+ >
28
21
  <div class="participant-name">
29
22
  <img
23
+ v-if="!activeParticipant && !isPodcastmaker && editRight"
30
24
  src="/img/caution.png"
31
25
  class="icon-caution"
32
- v-if="!activeParticipant && !isPodcastmaker && editRight"
33
26
  :title="$t('Participant have not podcasts')"
34
- />{{ name }}
27
+ :alt="$t('Participant have not podcasts')"
28
+ >{{ name }}
35
29
  </div>
36
30
  <div
37
- :id="'description-participant-container-' + participant.participantId"
31
+ ref="descriptionParticipantContainer"
38
32
  class="participant-description html-wysiwyg-content"
39
33
  >
34
+ <!-- eslint-disable vue/no-v-html -->
40
35
  <div
41
- :id="'description-participant-' + participant.participantId"
42
- v-html="urlify(description)"
43
- ></div>
36
+ ref="descriptionParticipant"
37
+ v-html="urlify(participant.description|| '')"
38
+ />
39
+ <!-- eslint-enable -->
44
40
  </div>
45
41
  </router-link>
46
42
  <router-link
43
+ v-if="!isPodcastmaker"
47
44
  :to="{
48
45
  name: 'productor',
49
46
  params: { productorId: participant.orga.id },
50
- query: { productor: this.$store.state.filter.organisationId },
47
+ query: { productor: filterOrga },
51
48
  }"
52
- class="text-dark participant-producer"
53
- v-if="!isPodcastmaker"
49
+ class="participant-producer"
54
50
  >
55
- <div class="participant-producer primary-color">
56
- © {{ participant.orga.name }}
57
- </div>
51
+ © {{ participant.orga.name }}
58
52
  </router-link>
59
53
  </li>
60
54
  </template>
61
55
 
56
+ <script lang="ts">
57
+ import octopusApi from '@saooti/octopus-api';
58
+ import { Participant } from '@/store/class/general/participant';
59
+ import { state } from '../../../store/paramStore';
60
+ import { displayMethods } from '../../mixins/functions';
61
+ import { orgaComputed } from '../../mixins/orgaComputed';
62
+ import { defineComponent } from 'vue'
63
+ import { Podcast } from '@/store/class/general/podcast';
64
+ export default defineComponent({
65
+ name: 'ParticpantItem',
66
+ mixins: [displayMethods, orgaComputed],
67
+ props: {
68
+ participant: { default: ()=>({}), type: Object as ()=> Participant},
69
+ },
70
+ data() {
71
+ return {
72
+ activeParticipant: true as boolean,
73
+ };
74
+ },
75
+ computed: {
76
+ isPodcastmaker(): boolean {
77
+ return (state.generalParameters.podcastmaker as boolean);
78
+ },
79
+ name(): string {
80
+ return (`${this.participant.firstName??''} ${this.participant.lastName??''}`).trim();
81
+ },
82
+ editRight(): boolean {
83
+ if(!this.participant || !this.participant.orga){
84
+ return false;
85
+ }
86
+ return (true == this.authenticated &&
87
+ this.myOrganisationId === this.participant.orga.id) ||
88
+ true === state.generalParameters.isAdmin
89
+ },
90
+ },
91
+
92
+ created() {
93
+ if(!this.editRight)return;
94
+ this.hasPodcast();
95
+ },
96
+ mounted() {
97
+ const participantDesc = (this.$refs.descriptionParticipant as HTMLElement);
98
+ const participantDescContainer = (this.$refs.descriptionParticipantContainer as HTMLElement);
99
+ if (
100
+ null !== participantDesc && null !==participantDescContainer &&
101
+ participantDesc.clientHeight > participantDescContainer.clientHeight
102
+ ) {
103
+ participantDescContainer.classList.add('after-participant-description');
104
+ }
105
+ },
106
+ methods: {
107
+ async hasPodcast(): Promise<void> {
108
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
109
+ participantId: this.participant.participantId,
110
+ first: 0,
111
+ size: 0,
112
+ }, true);
113
+ if (0 === data.count) {
114
+ this.activeParticipant = false;
115
+ }
116
+ },
117
+ },
118
+ })
119
+ </script>
62
120
  <style lang="scss">
121
+ .octopus-app{
63
122
  .participant-item-container {
64
123
  list-style: none;
65
124
  border-radius: 2rem;
@@ -69,6 +128,7 @@
69
128
  align-items: center;
70
129
 
71
130
  .participant-name {
131
+ margin-top: 1rem;
72
132
  font-size: 0.9rem;
73
133
  font-weight: 600;
74
134
  text-align: center;
@@ -93,7 +153,7 @@
93
153
  background: linear-gradient(
94
154
  to bottom,
95
155
  rgba(255, 255, 255, 0),
96
- #f3f3f3 40%
156
+ #fafafa 40%
97
157
  );
98
158
  }
99
159
  }
@@ -109,102 +169,5 @@
109
169
  margin: 1rem 0 0;
110
170
  }
111
171
  }
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>
172
+ }
173
+ </style>
@@ -1,153 +1,166 @@
1
1
  <template>
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>
6
- </div>
7
- <div
8
- v-if="showCount && loaded && participants.length > 1"
9
- class="text-secondary mb-2"
10
- >
11
- {{
12
- $t('Number participants', { nb: displayCount }) + $t('sort by score')
13
- }}
14
- </div>
15
- <ul class="participant-list" v-show="loaded">
16
- <ParticipantItem
17
- v-bind:participant="p"
18
- v-for="p in participants"
19
- v-bind:key="p.participantId"
20
- @participantNotVisible="displayCount--"
21
- />
22
- </ul>
23
- <button
24
- class="btn btn-more"
25
- @click="displayMore"
26
- v-show="!allFetched && loaded"
27
- :aria-label="$t('See more')"
28
- :disabled="inFetching"
29
- >
30
- <div class="saooti-plus"></div>
31
- </button>
32
- </div>
2
+ <ListPaginate
3
+ id="participantListPaginate"
4
+ v-model:first="dfirst"
5
+ v-model:rowsPerPage="dsize"
6
+ v-model:isMobile="isMobile"
7
+ :text-count="showCount && displayCount > 1 ? `${$t('Number participants', { nb: displayCount })} ${$t('sort by score')}`: undefined"
8
+ :total-count="totalCount"
9
+ :loading="loading"
10
+ :loading-text="loading?$t('Loading participants ...'):undefined"
11
+ >
12
+ <template #list>
13
+ <ul
14
+ class="participant-list"
15
+ >
16
+ <template
17
+ v-for="p in displayArray"
18
+ :key="p.participantId"
19
+ >
20
+ <ParticipantItem
21
+ v-if="0!==p.participantId"
22
+ :participant="p"
23
+ />
24
+ </template>
25
+ </ul>
26
+ </template>
27
+ </ListPaginate>
33
28
  </template>
34
29
 
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
30
  <script lang="ts">
61
- const octopusApi = require('@saooti/octopus-api');
31
+ import ListPaginate from '../list/ListPaginate.vue';
32
+ import { handle403 } from '../../mixins/handle403';
33
+ import octopusApi from '@saooti/octopus-api';
62
34
  import ParticipantItem from './ParticipantItem.vue';
63
-
35
+ import { Participant } from '@/store/class/general/participant';
36
+ import { emptyParticipantData } from '@/store/typeAppStore';
64
37
  import { defineComponent } from 'vue'
38
+ import { AxiosError } from 'axios';
65
39
  export default defineComponent({
66
40
  name: 'ParticipantList',
67
41
 
68
- props: ['first', 'size', 'query', 'organisationId', 'showCount'],
69
-
70
42
  components: {
71
43
  ParticipantItem,
44
+ ListPaginate
72
45
  },
73
46
 
74
- created() {
75
- this.fetchContent(true);
47
+ mixins: [handle403],
48
+
49
+ props: {
50
+ first: { default: 0, type: Number },
51
+ size: { default: 30, type: Number },
52
+ query: { default: undefined, type: String},
53
+ organisationId: { default: undefined, type: String},
54
+ showCount: { default: false, type: Boolean },
76
55
  },
77
56
 
78
57
  data() {
79
58
  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,
59
+ loading: true as boolean,
60
+ dfirst: this.first as number,
61
+ dsize: this.size as number,
62
+ totalCount: 0 as number,
63
+ displayCount: 0 as number,
64
+ participants: [] as Array<Participant>,
65
+ isMobile: false as boolean,
88
66
  };
89
67
  },
90
68
 
69
+
91
70
  computed: {
92
- allFetched():boolean {
93
- return this.dfirst >= this.totalCount;
71
+ displayArray(): Array<Participant>{
72
+ if(this.isMobile){
73
+ return this.participants;
74
+ }
75
+ return this.participants.slice(this.dfirst, Math.min(this.dfirst + this.dsize,this.totalCount));
76
+ },
77
+ organisation(): string|undefined {
78
+ return this.organisationId??this.$store.state.filter.organisationId;
94
79
  },
95
- filterOrga():any {
96
- return this.$store.state.filter.organisationId;
80
+ },
81
+ watch: {
82
+ query(): void {
83
+ this.reloadList();
97
84
  },
98
- organisation():any {
99
- if (this.organisationId) return this.organisationId;
100
- if (this.filterOrga) return this.filterOrga;
101
- return undefined;
85
+ organisation(): void {
86
+ this.reloadList();
102
87
  },
88
+ dsize():void{
89
+ this.reloadList();
90
+ },
91
+ dfirst(): void{
92
+ if(!this.participants[this.dfirst] || 0===this.participants[this.dfirst].participantId){
93
+ this.fetchContent(false);
94
+ }
95
+ },
103
96
  },
104
97
 
98
+ created() {
99
+ this.fetchContent(true);
100
+ },
105
101
  methods: {
106
- async fetchContent(reset: boolean) {
107
- this.inFetching = true;
108
- if (reset) {
109
- this.participants.length = 0;
110
- this.dfirst = 0;
111
- this.loading = true;
112
- this.loaded = false;
102
+ reloadList(){
103
+ this.dfirst = 0;
104
+ this.fetchContent(true);
105
+ },
106
+ async fetchContent(reset: boolean): Promise<void> {
107
+ this.loading = true;
108
+ try {
109
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Participant>;sort: string;}>(0, 'participant/search',{
110
+ first: this.dfirst,
111
+ size: this.dsize,
112
+ query: this.query,
113
+ organisationId: this.organisation,
114
+ }, true);
115
+ if (reset) {
116
+ this.participants.length = 0;
117
+ }
118
+ this.displayCount = data.count;
119
+ if(this.dfirst > this.participants.length){
120
+ for (let i = this.participants.length-1, len = this.dfirst + this.dsize; i < len; i++) {
121
+ this.participants.push(emptyParticipantData());
122
+ }
123
+ }
124
+ const responseParticipants = data.result.filter((p: Participant | null) => {
125
+ if (null === p) {
126
+ this.displayCount--;
127
+ }
128
+ return null !== p;
129
+ });
130
+ this.participants = this.participants.slice(0, this.dfirst).concat(responseParticipants).concat(this.participants.slice(this.dfirst+this.dsize, this.participants.length));
131
+ this.totalCount = data.count;
132
+ } catch (error) {
133
+ this.handle403((error as AxiosError));
113
134
  }
114
- const data = await octopusApi.fetchParticipants({
115
- first: this.dfirst,
116
- size: this.dsize,
117
- query: this.query,
118
- organisationId: this.organisation,
119
- });
120
135
  this.loading = false;
121
- this.loaded = true;
122
- this.displayCount = data.count;
123
- this.participants = this.participants.concat(data.result).filter((p: null) => {
124
- if (null === p) {
125
- this.displayCount--;
126
- }
127
- return null !== p;
128
- });
129
- this.dfirst += this.dsize;
130
- this.totalCount = data.count;
131
- this.inFetching = false;
132
- },
133
-
134
- displayMore(event: { preventDefault: () => void; }) {
135
- event.preventDefault();
136
- this.fetchContent(false);
137
- },
138
- },
139
-
140
- watch: {
141
- query: {
142
- handler() {
143
- this.fetchContent(true);
144
- },
145
- },
146
- organisation: {
147
- handler() {
148
- this.fetchContent(true);
149
- },
150
136
  },
151
137
  },
152
- });
138
+ })
153
139
  </script>
140
+
141
+ <style lang="scss">
142
+ .octopus-app{
143
+ .participant-list {
144
+ align-self: stretch;
145
+ flex-grow: 1;
146
+ margin: 0;
147
+ padding: 0;
148
+ /*For ie11 */
149
+ display: flex;
150
+ flex-wrap: wrap;
151
+ /* end */
152
+
153
+ display: grid; /* 1 */
154
+ grid-template-columns: repeat(auto-fill, 14rem); /* 2 */
155
+ grid-gap: 2rem; /* 3 */
156
+ justify-content: space-between; /* 4 */
157
+ }
158
+ /** PHONES*/
159
+ @media (max-width: 655px) {
160
+ .participant-list {
161
+ align-self: auto;
162
+ grid-gap: 0;
163
+ }
164
+ }
165
+ }
166
+ </style>