@saooti/octopus-sdk 40.2.19 → 41.0.1-SNAPSHOT

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 (204) hide show
  1. package/package.json +2 -3
  2. package/src/App.vue +68 -88
  3. package/src/components/composable/player/usePlayerLive.ts +12 -3
  4. package/src/components/composable/player/usePlayerLogic.ts +6 -6
  5. package/src/components/composable/podcasts/usePodcastView.ts +3 -3
  6. package/src/components/composable/useInit.ts +2 -2
  7. package/src/components/composable/useMetaTitleWatch.ts +2 -2
  8. package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
  9. package/src/components/display/categories/CategoryChooser.vue +142 -145
  10. package/src/components/display/categories/CategoryFilter.vue +172 -198
  11. package/src/components/display/categories/CategoryList.vue +122 -147
  12. package/src/components/display/comments/CommentInput.vue +100 -122
  13. package/src/components/display/comments/CommentList.vue +169 -191
  14. package/src/components/display/comments/CommentName.vue +35 -45
  15. package/src/components/display/comments/CommentParentInfo.vue +28 -34
  16. package/src/components/display/comments/CommentPlayer.vue +38 -50
  17. package/src/components/display/comments/CommentSection.vue +85 -103
  18. package/src/components/display/comments/item/CommentBasicView.vue +48 -61
  19. package/src/components/display/comments/item/CommentItem.vue +101 -116
  20. package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
  21. package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
  22. package/src/components/display/comments/like/LikeButton.vue +36 -41
  23. package/src/components/display/comments/like/LikeSection.vue +128 -136
  24. package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
  25. package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
  26. package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
  27. package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
  28. package/src/components/display/edit/EditBox.vue +6 -9
  29. package/src/components/display/edit/EditBoxRadio.vue +1 -5
  30. package/src/components/display/emission/EmissionInlineList.vue +82 -97
  31. package/src/components/display/emission/EmissionItem.vue +57 -69
  32. package/src/components/display/emission/EmissionList.vue +192 -218
  33. package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
  34. package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
  35. package/src/components/display/emission/EmissionPresentationList.vue +51 -61
  36. package/src/components/display/filter/AdvancedSearch.vue +154 -176
  37. package/src/components/display/filter/CategorySearchFilter.vue +43 -46
  38. package/src/components/display/filter/DateFilter.vue +76 -91
  39. package/src/components/display/filter/MonetizableFilter.vue +27 -30
  40. package/src/components/display/filter/ProductorSearch.vue +87 -90
  41. package/src/components/display/filter/RubriqueChoice.vue +58 -63
  42. package/src/components/display/filter/RubriqueFilter.vue +154 -169
  43. package/src/components/display/filter/SearchOrder.vue +35 -35
  44. package/src/components/display/list/ListPaginate.vue +80 -93
  45. package/src/components/display/list/PaginateParams.vue +36 -40
  46. package/src/components/display/list/PaginateSection.vue +113 -124
  47. package/src/components/display/list/SwiperList.vue +97 -109
  48. package/src/components/display/live/CountDown.vue +15 -9
  49. package/src/components/display/live/CountdownOctopus.vue +16 -10
  50. package/src/components/display/live/LiveHorizontalList.vue +95 -103
  51. package/src/components/display/live/LiveItem.vue +65 -73
  52. package/src/components/display/live/LiveList.vue +125 -137
  53. package/src/components/display/live/RadioCurrently.vue +66 -73
  54. package/src/components/display/live/RadioImage.vue +39 -50
  55. package/src/components/display/live/RadioItem.vue +9 -14
  56. package/src/components/display/live/RadioList.vue +39 -53
  57. package/src/components/display/live/RadioPlanning.vue +210 -222
  58. package/src/components/display/organisation/OrganisationChooser.vue +116 -122
  59. package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
  60. package/src/components/display/participant/ParticipantInlineList.vue +42 -58
  61. package/src/components/display/participant/ParticipantItem.vue +66 -74
  62. package/src/components/display/participant/ParticipantList.vue +119 -141
  63. package/src/components/display/playlist/PlaylistItem.vue +33 -46
  64. package/src/components/display/playlist/PlaylistList.vue +118 -144
  65. package/src/components/display/playlist/PodcastList.vue +79 -101
  66. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
  67. package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
  68. package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
  69. package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
  70. package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
  71. package/src/components/display/podcasts/PodcastFilterList.vue +48 -53
  72. package/src/components/display/podcasts/PodcastImage.vue +96 -99
  73. package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
  74. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
  75. package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
  76. package/src/components/display/podcasts/PodcastItem.vue +48 -63
  77. package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
  78. package/src/components/display/podcasts/PodcastList.vue +183 -206
  79. package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
  80. package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
  81. package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
  82. package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
  83. package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
  84. package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
  85. package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
  86. package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
  87. package/src/components/display/podcasts/TagList.vue +48 -50
  88. package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
  89. package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
  90. package/src/components/display/rubriques/RubriqueList.vue +140 -160
  91. package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
  92. package/src/components/display/sharing/FormatSwitch.vue +16 -11
  93. package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
  94. package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
  95. package/src/components/display/sharing/PlayerParameters.vue +69 -71
  96. package/src/components/display/sharing/QrCode.vue +55 -67
  97. package/src/components/display/sharing/ShareAnonymous.vue +160 -178
  98. package/src/components/display/sharing/ShareDistribution.vue +103 -117
  99. package/src/components/display/sharing/ShareNewsletter.vue +154 -161
  100. package/src/components/display/sharing/SharePlayer.vue +273 -295
  101. package/src/components/display/sharing/SharePlayerColors.vue +25 -16
  102. package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
  103. package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
  104. package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
  105. package/src/components/display/sharing/SubscribeButtons.vue +184 -207
  106. package/src/components/display/studio/RecordingItemButton.vue +1 -4
  107. package/src/components/form/ClassicCheckbox.vue +26 -30
  108. package/src/components/form/ClassicContentEditable.vue +37 -33
  109. package/src/components/form/ClassicCopyButton.vue +40 -44
  110. package/src/components/form/ClassicDatePicker.vue +114 -114
  111. package/src/components/form/ClassicEmojiPicker.vue +20 -28
  112. package/src/components/form/ClassicInputText.vue +116 -120
  113. package/src/components/form/ClassicLoading.vue +7 -12
  114. package/src/components/form/ClassicMultiselect.vue +106 -116
  115. package/src/components/form/ClassicRadio.vue +21 -16
  116. package/src/components/form/ClassicRadioLabel.vue +23 -22
  117. package/src/components/form/ClassicSearch.vue +24 -19
  118. package/src/components/form/ClassicSelect.vue +47 -38
  119. package/src/components/form/ClassicWysiwyg.vue +116 -123
  120. package/src/components/icons/AmazonMusicIcon.vue +7 -10
  121. package/src/components/icons/ApplePodcastIcon.vue +7 -11
  122. package/src/components/icons/BlueSkyIcon.vue +8 -11
  123. package/src/components/icons/DeezerIcon.vue +8 -11
  124. package/src/components/icons/EditFtpIcon.vue +8 -11
  125. package/src/components/icons/IHeartIcon.vue +8 -11
  126. package/src/components/icons/PlayVideoIcon.vue +7 -10
  127. package/src/components/icons/PlayerFmIcon.vue +7 -10
  128. package/src/components/icons/PocketCastIcon.vue +8 -11
  129. package/src/components/icons/PodcastAddictIcon.vue +7 -10
  130. package/src/components/icons/RadiolineIcon.vue +8 -11
  131. package/src/components/icons/TuninIcon.vue +8 -11
  132. package/src/components/icons/XIcon.vue +7 -10
  133. package/src/components/misc/AcpmImage.vue +6 -7
  134. package/src/components/misc/ClassicAccordion.vue +26 -31
  135. package/src/components/misc/ClassicLazy.vue +86 -90
  136. package/src/components/misc/ClassicNav.vue +16 -20
  137. package/src/components/misc/ClassicPopover.vue +266 -282
  138. package/src/components/misc/ClassicSpinner.vue +5 -27
  139. package/src/components/misc/ErrorMessage.vue +11 -12
  140. package/src/components/misc/FooterGarSection.vue +33 -41
  141. package/src/components/misc/FooterSection.vue +109 -130
  142. package/src/components/misc/HomeDropdown.vue +83 -105
  143. package/src/components/misc/MobileMenu.vue +101 -111
  144. package/src/components/misc/ProgressBar.vue +53 -62
  145. package/src/components/misc/TopBar.vue +97 -120
  146. package/src/components/misc/TopBarMainContent.vue +114 -133
  147. package/src/components/misc/modal/ClassicModal.vue +40 -33
  148. package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
  149. package/src/components/misc/modal/ClipboardModal.vue +27 -30
  150. package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
  151. package/src/components/misc/modal/MessageModal.vue +50 -47
  152. package/src/components/misc/modal/NewsletterModal.vue +30 -31
  153. package/src/components/misc/modal/QrCodeModal.vue +21 -21
  154. package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
  155. package/src/components/misc/player/PlayerCompact.vue +6 -4
  156. package/src/components/misc/player/PlayerComponent.vue +8 -9
  157. package/src/components/misc/player/PlayerLarge.vue +9 -8
  158. package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
  159. package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
  160. package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
  161. package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
  162. package/src/components/misc/player/elements/PlayerImage.vue +51 -57
  163. package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
  164. package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
  165. package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
  166. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
  167. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
  168. package/src/components/misc/player/radio/RadioHistory.vue +80 -99
  169. package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
  170. package/src/components/misc/player/video/PlayerVideo.vue +27 -40
  171. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
  172. package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
  173. package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
  174. package/src/components/pages/CategoryPage.vue +28 -33
  175. package/src/components/pages/EmissionPage.vue +99 -132
  176. package/src/components/pages/EmissionsPage.vue +2 -0
  177. package/src/components/pages/Error403Page.vue +21 -20
  178. package/src/components/pages/HomePage.vue +91 -100
  179. package/src/components/pages/LivesPage.vue +35 -37
  180. package/src/components/pages/MapPage.vue +209 -241
  181. package/src/components/pages/PageLogout.vue +8 -11
  182. package/src/components/pages/PageNotFound.vue +9 -5
  183. package/src/components/pages/ParticipantPage.vue +82 -110
  184. package/src/components/pages/ParticipantsPage.vue +3 -0
  185. package/src/components/pages/PlaylistPage.vue +97 -115
  186. package/src/components/pages/PlaylistsPage.vue +9 -2
  187. package/src/components/pages/PodcastPage.vue +223 -238
  188. package/src/components/pages/PodcastsPage.vue +9 -2
  189. package/src/components/pages/RadioPage.vue +56 -70
  190. package/src/components/pages/RubriquePage.vue +7 -3
  191. package/src/components/pages/SearchPage.vue +31 -36
  192. package/src/components/pages/TagPage.vue +11 -9
  193. package/src/components/pages/VideoPage.vue +14 -11
  194. package/src/helper/displayHelper.ts +1 -1
  195. package/src/i18n.ts +2 -2
  196. package/src/main.ts +1 -1
  197. package/src/stores/class/general/player.ts +1 -0
  198. package/public/css/fonts/icomoon.eot +0 -0
  199. package/public/css/fonts/icomoon.svg +0 -113
  200. package/public/css/fonts/icomoon.ttf +0 -0
  201. package/public/css/fonts/icomoon.woff +0 -0
  202. package/public/css/fonts/icomoon.woff2 +0 -0
  203. package/public/css/fonts/style.css +0 -352
  204. package/sonarqube-scanner.js +0 -10
@@ -6,12 +6,12 @@
6
6
  v-model:is-mobile="isMobile"
7
7
  :text-count="
8
8
  displayCount > 1
9
- ? `${$t('Number playlists', { nb: displayCount })}`
9
+ ? `${t('Number playlists', { nb: displayCount })}`
10
10
  : undefined
11
11
  "
12
12
  :total-count="totalCount"
13
13
  :loading="loading"
14
- :loading-text="loading ? $t('Loading content ...') : undefined"
14
+ :loading-text="loading ? t('Loading content ...') : undefined"
15
15
  :player-responsive="true"
16
16
  >
17
17
  <template #list>
@@ -29,7 +29,7 @@
29
29
  name: 'playlist',
30
30
  params: { playlistId: p.playlistId },
31
31
  }"
32
- :title="$t('Playlist name page', { name: p.title })"
32
+ :title="t('Playlist name page', { name: p.title })"
33
33
  >
34
34
  {{ p.title }}
35
35
  </router-link>
@@ -40,7 +40,7 @@
40
40
  </ListPaginate>
41
41
  </template>
42
42
 
43
- <script lang="ts">
43
+ <script setup lang="ts">
44
44
  import ClassicLazy from "../../misc/ClassicLazy.vue";
45
45
  import ListPaginate from "../list/ListPaginate.vue";
46
46
  import {useErrorHandler} from "../../composable/useErrorHandler";
@@ -48,153 +48,127 @@ import classicApi from "../../../api/classicApi";
48
48
  import PlaylistItem from "./PlaylistItem.vue";
49
49
  import { Playlist, emptyPlaylistData } from "@/stores/class/general/playlist";
50
50
  import { useFilterStore } from "../../../stores/FilterStore";
51
- import { mapState } from "pinia";
52
- import { defineComponent } from "vue";
51
+ import { computed, onMounted, Ref, ref, watch } from "vue";
53
52
  import { AxiosError } from "axios";
54
53
  import { ListClassicReturn } from "@/stores/class/general/listReturn";
55
- export default defineComponent({
56
- name: "PlaylistList",
54
+ import { useI18n } from "vue-i18n";
57
55
 
58
- components: {
59
- PlaylistItem,
60
- ListPaginate,
61
- ClassicLazy,
62
- },
56
+ //Props
57
+ const props = defineProps({
58
+ first: { default: 0, type: Number },
59
+ size: { default: 30, type: Number },
60
+ query: { default: undefined, type: String },
61
+ organisationId: { default: undefined, type: String },
62
+ })
63
63
 
64
- props: {
65
- first: { default: 0, type: Number },
66
- size: { default: 30, type: Number },
67
- query: { default: undefined, type: String },
68
- organisationId: { default: undefined, type: String },
69
- },
64
+ //Data
65
+ const loading = ref(true);
66
+ const dfirst = ref(props.first);
67
+ const dsize = ref(props.size);
68
+ const totalCount = ref(0);
69
+ const displayCount = ref(0);
70
+ const isMobile = ref(false);
71
+ const playlists: Ref<Array<Playlist>> = ref([]);
70
72
 
71
- setup(){
72
- const {handle403} = useErrorHandler();
73
- return { handle403 }
74
- },
75
73
 
76
- data() {
77
- return {
78
- loading: true as boolean,
79
- dfirst: this.first,
80
- dsize: this.size,
81
- totalCount: 0 as number,
82
- displayCount: 0 as number,
83
- playlists: [] as Array<Playlist>,
84
- isMobile: false as boolean,
85
- };
86
- },
74
+ //Composables
75
+ const { t } = useI18n();
76
+ const {handle403} = useErrorHandler();
77
+ const filterStore = useFilterStore();
87
78
 
88
- computed: {
89
- ...mapState(useFilterStore, ["filterOrgaId"]),
90
- displayArray(): Array<Playlist> {
91
- if (this.isMobile) {
92
- return this.playlists;
93
- }
94
- return this.playlists.slice(
95
- this.dfirst,
96
- Math.min(this.dfirst + this.dsize, this.totalCount),
97
- );
98
- },
99
- changed(): string {
100
- return `${this.organisationId}|${this.query}`;
101
- },
102
- changePaginate(): string {
103
- return `${this.first}|${this.size}`;
104
- },
105
- sort(): string {
106
- return !this.query ? "NAME" : "SCORE";
107
- },
108
- organisation(): string | undefined {
109
- return this.organisationId ? this.organisationId : this.filterOrgaId;
110
- },
111
- },
112
- watch: {
113
- changePaginate() {
114
- this.dfirst = this.first;
115
- this.dsize = this.size;
116
- },
117
- changed(): void {
118
- this.reloadList();
119
- },
120
- dsize(): void {
121
- this.reloadList();
122
- },
123
- dfirst(): void {
124
- if (
125
- !this.playlists[this.dfirst] ||
126
- 0 === this.playlists[this.dfirst].playlistId
127
- ) {
128
- this.fetchContent(false);
129
- }
130
- },
131
- },
132
79
 
133
- mounted() {
134
- this.fetchContent(true);
135
- },
136
- methods: {
137
- reloadList() {
138
- this.dfirst = 0;
139
- this.fetchContent(true);
140
- },
141
- async fetchContent(reset: boolean): Promise<void> {
142
- this.loading = true;
143
- const param = {
144
- first: this.dfirst,
145
- size: this.dsize,
146
- query: this.query,
147
- organisationId: this.organisation,
148
- type: "NONE",
149
- sort: this.sort,
150
- };
151
- try {
152
- const data = await classicApi.fetchData<ListClassicReturn<Playlist>>({
153
- api: 0,
154
- path: "playlist/search",
155
- parameters: param,
156
- specialTreatement: true,
157
- });
158
- this.afterFetching(reset, data);
159
- } catch (error) {
160
- this.handle403(error as AxiosError);
161
- }
162
- },
163
- afterFetching(
164
- reset: boolean,
165
- data: { count: number; result: Array<Playlist>; sort: string },
166
- ): void {
167
- if (reset) {
168
- this.playlists.length = 0;
169
- }
170
- if (this.dfirst > this.playlists.length) {
171
- for (
172
- let i = this.playlists.length - 1, len = this.dfirst + this.dsize;
173
- i < len;
174
- i++
175
- ) {
176
- this.playlists.push(emptyPlaylistData());
177
- }
178
- }
179
- this.displayCount = data.count;
180
- const responsePlaylists = data.result.filter((e: Playlist | null) => {
181
- if (null === e) {
182
- this.displayCount--;
183
- }
184
- return null !== e;
185
- });
186
- this.playlists = this.playlists
187
- .slice(0, this.dfirst)
188
- .concat(responsePlaylists)
189
- .concat(
190
- this.playlists.slice(this.dfirst + this.dsize, this.playlists.length),
191
- );
192
- this.totalCount = data.count;
193
- this.loading = false;
194
- },
195
- displayMore(): void {
196
- this.fetchContent(false);
197
- },
198
- },
80
+ //Computed
81
+ const displayArray = computed(() => {
82
+ if (isMobile.value) {
83
+ return playlists.value;
84
+ }
85
+ return playlists.value.slice(
86
+ dfirst.value,
87
+ Math.min(dfirst.value + dsize.value, totalCount.value),
88
+ );
199
89
  });
90
+ const changed = computed(() => `${props.organisationId}|${props.query}`);
91
+ const changePaginate = computed(() => `${props.first}|${props.size}`);
92
+ const sort = computed(() => !props.query ? "NAME" : "SCORE");
93
+ const organisation = computed(() => props.organisationId ? props.organisationId : filterStore.filterOrgaId);
94
+
95
+
96
+ //Watch
97
+ watch(changePaginate, () => {
98
+ dfirst.value = props.first;
99
+ dsize.value = props.size;
100
+ });
101
+ watch(changed, () => reloadList());
102
+ watch(dsize, () => reloadList());
103
+ watch(dfirst, () => {
104
+ if (
105
+ !playlists.value[dfirst.value] ||
106
+ 0 === playlists.value[dfirst.value].playlistId
107
+ ) {
108
+ fetchContent(false);
109
+ }
110
+ });
111
+
112
+ onMounted(()=>fetchContent(true))
113
+
114
+
115
+ //Methods
116
+ function reloadList() {
117
+ dfirst.value = 0;
118
+ fetchContent(true);
119
+ }
120
+ async function fetchContent(reset: boolean): Promise<void> {
121
+ loading.value = true;
122
+ const param = {
123
+ first: dfirst.value,
124
+ size: dsize.value,
125
+ query: props.query,
126
+ organisationId: organisation.value,
127
+ type: "NONE",
128
+ sort: sort.value,
129
+ };
130
+ try {
131
+ const data = await classicApi.fetchData<ListClassicReturn<Playlist>>({
132
+ api: 0,
133
+ path: "playlist/search",
134
+ parameters: param,
135
+ specialTreatement: true,
136
+ });
137
+ afterFetching(reset, data);
138
+ } catch (error) {
139
+ handle403(error as AxiosError);
140
+ }
141
+ }
142
+ function afterFetching(
143
+ reset: boolean,
144
+ data: { count: number; result: Array<Playlist>; sort: string },
145
+ ): void {
146
+ if (reset) {
147
+ playlists.value.length = 0;
148
+ }
149
+ if (dfirst.value > playlists.value.length) {
150
+ for (
151
+ let i = playlists.value.length - 1, len = dfirst.value + dsize.value;
152
+ i < len;
153
+ i++
154
+ ) {
155
+ playlists.value.push(emptyPlaylistData());
156
+ }
157
+ }
158
+ displayCount.value = data.count;
159
+ const responsePlaylists = data.result.filter((e: Playlist | null) => {
160
+ if (null === e) {
161
+ displayCount.value--;
162
+ }
163
+ return null !== e;
164
+ });
165
+ playlists.value = playlists.value
166
+ .slice(0, dfirst.value)
167
+ .concat(responsePlaylists)
168
+ .concat(
169
+ playlists.value.slice(dfirst.value + dsize.value, playlists.value.length),
170
+ );
171
+ totalCount.value = data.count;
172
+ loading.value = false;
173
+ }
200
174
  </script>
@@ -8,7 +8,7 @@
8
8
  v-model:text-init="searchPattern"
9
9
  class="align-self-baseline mb-2"
10
10
  id-search="podcast-list-search"
11
- :label="$t('Search')"
11
+ :label="t('Search')"
12
12
  />
13
13
  <ListPaginate
14
14
  id="podcastPlaylistListPaginate"
@@ -17,15 +17,15 @@
17
17
  v-model:is-mobile="isMobile"
18
18
  :text-count="
19
19
  podcasts.length > 1
20
- ? `${$t('Number podcasts', { nb: podcasts.length })}`
20
+ ? `${t('Number podcasts', { nb: podcasts.length })}`
21
21
  : undefined
22
22
  "
23
23
  :total-count="podcasts.length"
24
24
  :loading="loading"
25
- :loading-text="loading ? $t('Loading podcasts ...') : undefined"
25
+ :loading-text="loading ? t('Loading podcasts ...') : undefined"
26
26
  :error-text="
27
27
  !loading && !podcasts.length && notEmptyPlaylist
28
- ? $t(`No podcast match your query`)
28
+ ? t(`No podcast match your query`)
29
29
  : undefined
30
30
  "
31
31
  :player-responsive="true"
@@ -44,7 +44,7 @@
44
44
  name: 'podcast',
45
45
  params: { podcastId: p.podcastId },
46
46
  }"
47
- :title="$t('Episode name page', { name: p.title })"
47
+ :title="t('Episode name page', { name: p.title })"
48
48
  >
49
49
  {{ p.title }}
50
50
  </router-link>
@@ -56,7 +56,7 @@
56
56
  </div>
57
57
  </template>
58
58
 
59
- <script lang="ts">
59
+ <script setup lang="ts">
60
60
  import ListPaginate from "../list/ListPaginate.vue";
61
61
  import {useErrorHandler} from "../../composable/useErrorHandler";
62
62
  import {useOrgaComputed} from "../../composable/useOrgaComputed";
@@ -66,108 +66,86 @@ import ClassicSearch from "../../form/ClassicSearch.vue";
66
66
  import ClassicLazy from "../../misc/ClassicLazy.vue";
67
67
  import { Podcast } from "@/stores/class/general/podcast";
68
68
  import { Playlist } from "@/stores/class/general/playlist";
69
- import { defineComponent } from "vue";
69
+ import { computed, onBeforeMount, Ref, ref, watch } from "vue";
70
70
  import { AxiosError } from "axios";
71
- export default defineComponent({
72
- name: "PodcastList",
71
+ import { useI18n } from "vue-i18n";
73
72
 
74
- components: {
75
- PodcastItem,
76
- ClassicSearch,
77
- ListPaginate,
78
- ClassicLazy,
79
- },
73
+ //Props
74
+ const props = defineProps({
75
+ playlist: { default: () => ({}), type: Object as () => Playlist },
76
+ })
80
77
 
81
- props: {
82
- playlist: { default: () => ({}), type: Object as () => Playlist },
83
- },
78
+ //Data
79
+ const loading = ref(true);
80
+ const podcasts: Ref<Array<Podcast>> = ref([]);
81
+ const podcastsQuery: Ref<Array<Podcast>> = ref([]);
82
+ const size = ref(30);
83
+ const first = ref(0);
84
+ const searchPattern = ref("");
85
+ const isMobile = ref(false);
84
86
 
85
- setup(){
86
- const {handle403} = useErrorHandler();
87
- const { isEditRights } = useOrgaComputed();
88
- return { handle403, isEditRights }
89
- },
87
+ //Composables
88
+ const { t } = useI18n();
89
+ const {handle403} = useErrorHandler();
90
+ const { isEditRights } = useOrgaComputed();
90
91
 
91
- data() {
92
- return {
93
- loading: true as boolean,
94
- podcasts: [] as Array<Podcast>,
95
- podcastsQuery: [] as Array<Podcast>,
96
- size: 30 as number,
97
- first: 0 as number,
98
- searchPattern: "" as string,
99
- isMobile: false as boolean,
100
- };
101
- },
92
+ //Computed
93
+ const titleList = computed(() => notEmptyPlaylist.value? t("Podcasts in the playlist"): t("No podcasts in the playlist"));
94
+ const notEmptyPlaylist = computed(() => 0 !== Object.keys(props.playlist.samplingViews ?? []).length);
95
+ const podcastsDisplay = computed(() => {
96
+ if (isMobile.value) {
97
+ return podcastsQuery.value.slice(
98
+ 0,
99
+ Math.min(first.value + size.value, podcasts.value.length),
100
+ );
101
+ }
102
+ return podcastsQuery.value.slice(
103
+ first.value,
104
+ Math.min(first.value + size.value, podcasts.value.length),
105
+ );
106
+ });
107
+ const editRight = computed(() =>isEditRights(props.playlist.organisation?.id));
102
108
 
103
- computed: {
104
- titleList(): string {
105
- return this.notEmptyPlaylist
106
- ? this.$t("Podcasts in the playlist")
107
- : this.$t("No podcasts in the playlist");
108
- },
109
- notEmptyPlaylist(): boolean {
110
- return 0 !== Object.keys(this.playlist.samplingViews ?? []).length;
111
- },
112
- podcastsDisplay(): Array<Podcast> {
113
- if (this.isMobile) {
114
- return this.podcastsQuery.slice(
115
- 0,
116
- Math.min(this.first + this.size, this.podcasts.length),
117
- );
118
- }
119
- return this.podcastsQuery.slice(
120
- this.first,
121
- Math.min(this.first + this.size, this.podcasts.length),
122
- );
123
- },
124
- editRight(): boolean {
125
- return this.isEditRights(this.playlist.organisation?.id);
126
- },
127
- },
128
- watch: {
129
- searchPattern(): void {
130
- if ("" !== this.searchPattern) {
131
- this.podcastsQuery = this.podcasts.filter((el: Podcast) => {
132
- return el.title
133
- .toLowerCase()
134
- .includes(this.searchPattern.toLowerCase());
135
- });
136
- } else {
137
- this.podcastsQuery = this.podcasts;
138
- }
139
- },
140
- },
109
+ //Watch
110
+ watch(searchPattern,() => {
111
+ if ("" !== searchPattern.value) {
112
+ podcastsQuery.value = podcasts.value.filter((el: Podcast) => {
113
+ return el.title
114
+ .toLowerCase()
115
+ .includes(searchPattern.value.toLowerCase());
116
+ });
117
+ } else {
118
+ podcastsQuery.value = podcasts.value;
119
+ }
120
+ });
141
121
 
142
- created() {
143
- this.fetchContent();
144
- },
145
- methods: {
146
- async fetchContent(): Promise<void> {
147
- if (this.notEmptyPlaylist) {
148
- this.podcasts.length = 0;
149
- this.loading = true;
150
- try {
151
- this.podcasts = await classicApi.fetchData<Array<Podcast>>({
152
- api: 0,
153
- path: "playlist/" + this.playlist.playlistId + "/content",
154
- });
155
- if (!this.editRight) {
156
- this.podcasts = this.podcasts.filter((p: Podcast | null) => {
157
- return (
158
- null !== p &&
159
- (!p.availability || true === p.availability.visibility)
160
- );
161
- });
162
- }
163
- this.podcastsQuery = this.podcasts;
164
- } catch (error) {
165
- this.handle403(error as AxiosError);
166
- }
122
+ onBeforeMount(()=>fetchContent());
123
+
124
+
125
+ //Methods
126
+ async function fetchContent(): Promise<void> {
127
+ if (notEmptyPlaylist.value) {
128
+ podcasts.value.length = 0;
129
+ loading.value = true;
130
+ try {
131
+ podcasts.value = await classicApi.fetchData<Array<Podcast>>({
132
+ api: 0,
133
+ path: "playlist/" + props.playlist.playlistId + "/content",
134
+ });
135
+ if (!editRight.value) {
136
+ podcasts.value = podcasts.value.filter((p: Podcast | null) => {
137
+ return (
138
+ null !== p &&
139
+ (!p.availability || true === p.availability.visibility)
140
+ );
141
+ });
167
142
  }
168
- this.loading = false;
169
- },
170
- },
171
- });
143
+ podcastsQuery.value = podcasts.value;
144
+ } catch (error) {
145
+ handle403(error as AxiosError);
146
+ }
147
+ }
148
+ loading.value = false;
149
+ }
172
150
  </script>
173
151
 
@@ -2,7 +2,7 @@
2
2
  <PodcastInlineListTemplate
3
3
  v-if="loading || (!loading && 0 !== allPodcasts.length)"
4
4
  :display-arrow="false"
5
- :button-text="$t('See more')"
5
+ :button-text="t('See more')"
6
6
  :button-plus="true"
7
7
  :title="playlist?.title ?? ''"
8
8
  :href="'/main/pub/playlist/' + playlistId"
@@ -11,7 +11,7 @@
11
11
  <template #list-inline>
12
12
  <ClassicLoading
13
13
  class="loading-size"
14
- :loading-text="loading ? $t('Loading podcasts ...') : undefined"
14
+ :loading-text="loading ? t('Loading podcasts ...') : undefined"
15
15
  />
16
16
  <SwiperList
17
17
  v-if="!loading"
@@ -29,7 +29,7 @@
29
29
  </PodcastInlineListTemplate>
30
30
  </template>
31
31
 
32
- <script lang="ts">
32
+ <script setup lang="ts">
33
33
  import classicApi from "../../../api/classicApi";
34
34
  import PodcastInlineListTemplate from "../podcasts/PodcastInlineListTemplate.vue";
35
35
  import PodcastItem from "../podcasts/PodcastItem.vue";
@@ -38,75 +38,63 @@ import ClassicLoading from "../../form/ClassicLoading.vue";
38
38
  import { useAuthStore } from "../../../stores/AuthStore";
39
39
  import { Podcast } from "@/stores/class/general/podcast";
40
40
  import { Playlist } from "@/stores/class/general/playlist";
41
- import { defineComponent } from "vue";
42
- import { mapState } from "pinia";
43
- export default defineComponent({
44
- name: "PodcastPlaylistInlineList",
41
+ import { onMounted, Ref, ref, watch } from "vue";
42
+ import { useI18n } from "vue-i18n";
45
43
 
46
- components: {
47
- PodcastItem,
48
- ClassicLoading,
49
- PodcastInlineListTemplate,
50
- SwiperList,
51
- },
44
+ //Props
45
+ const props = defineProps({
46
+ playlistId: { default: undefined, type: Number },
47
+ sizeItemOverload: { default: undefined, type: Number }
48
+ })
52
49
 
53
- props: {
54
- playlistId: { default: undefined, type: Number },
55
- sizeItemOverload: { default: undefined, type: Number },
56
- },
50
+ //Data
51
+ const loading = ref(true);
52
+ const totalCount = ref(0);
53
+ const playlist: Ref<Playlist | undefined> = ref(undefined);
54
+ const allPodcasts: Ref<Array<Podcast>> = ref([]);
57
55
 
58
- data() {
59
- return {
60
- loading: true as boolean,
61
- totalCount: 0 as number,
62
- playlist: undefined as Playlist | undefined,
63
- allPodcasts: [] as Array<Podcast>,
64
- };
65
- },
66
- computed: {
67
- ...mapState(useAuthStore, ["authOrgaId", "isRoleAdmin"]),
68
- },
69
- watch: {
70
- playlistId(): void {
71
- this.reset();
72
- this.fetchContent();
73
- },
74
- },
75
- mounted() {
76
- this.fetchContent();
77
- },
78
- methods: {
79
- async fetchContent(): Promise<void> {
80
- this.allPodcasts.length = 0;
81
- this.loading = true;
82
- this.playlist = await classicApi.fetchData<Playlist>({
83
- api: 0,
84
- path: "playlist/" + this.playlistId,
85
- });
86
- this.allPodcasts = await classicApi.fetchData<Array<Podcast>>({
87
- api: 0,
88
- path: "playlist/" + this.playlistId + "/content",
89
- });
90
- if (
91
- !(
92
- (undefined !== this.authOrgaId &&
93
- this.authOrgaId === this.playlist?.organisation?.id) ||
94
- this.isRoleAdmin
95
- )
96
- ) {
97
- this.allPodcasts = this.allPodcasts.filter((p: Podcast | null) => {
98
- return (
99
- null !== p &&
100
- (!p.availability || true === p.availability.visibility)
101
- );
102
- });
103
- }
104
- this.loading = false;
105
- },
106
- reset(): void {
107
- this.totalCount = 0;
108
- this.allPodcasts.length = 0;
109
- },
110
- },
56
+ //Composables
57
+ const { t } = useI18n();
58
+ const authStore = useAuthStore();
59
+
60
+ //Watch
61
+ watch(()=>props.playlistId, () => {
62
+ reset();
63
+ fetchContent();
111
64
  });
65
+
66
+ onMounted(()=>fetchContent())
67
+
68
+ //Methods
69
+ async function fetchContent(): Promise<void> {
70
+ allPodcasts.value.length = 0;
71
+ loading.value = true;
72
+ playlist.value = await classicApi.fetchData<Playlist>({
73
+ api: 0,
74
+ path: "playlist/" + props.playlistId,
75
+ });
76
+ allPodcasts.value = await classicApi.fetchData<Array<Podcast>>({
77
+ api: 0,
78
+ path: "playlist/" + props.playlistId + "/content",
79
+ });
80
+ if (
81
+ !(
82
+ (undefined !== authStore.authOrgaId &&
83
+ authStore.authOrgaId === playlist.value?.organisation?.id) ||
84
+ authStore.isRoleAdmin
85
+ )
86
+ ) {
87
+ allPodcasts.value = allPodcasts.value.filter((p: Podcast | null) => {
88
+ return (
89
+ null !== p &&
90
+ (!p.availability || true === p.availability.visibility)
91
+ );
92
+ });
93
+ }
94
+ loading.value = false;
95
+ }
96
+ function reset(): void {
97
+ totalCount.value = 0;
98
+ allPodcasts.value.length = 0;
99
+ }
112
100
  </script>