@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
@@ -2,16 +2,17 @@
2
2
  <section class="page-box">
3
3
  <template v-if="loaded && !error && participant">
4
4
  <h1>
5
- {{ $t("Animator") }}
5
+ {{ t("Animator") }}
6
6
  </h1>
7
7
  <section class="d-flex flex-column align-items-center mb-3">
8
8
  <img
9
9
  v-lazy="useProxyImageUrl(participant.imageUrl, '200')"
10
10
  width="200"
11
11
  height="200"
12
- role="presentation"
12
+ aria-hidden="true"
13
+ alt=""
13
14
 
14
- :title="$t('Animator image', { name: name })"
15
+ :title="t('Animator image', { name: name })"
15
16
  class="img-box mb-3"
16
17
  />
17
18
  <h2 class="text-capitalize">
@@ -24,13 +25,13 @@
24
25
  />
25
26
  <!-- eslint-enable -->
26
27
  <EditBox
27
- v-if="editRight && pageParameters.isEditBox"
28
+ v-if="editRight && !state.generalParameters.podcastmaker"
28
29
  :participant="participant"
29
30
  class="w-100 justify-content-center"
30
31
  @participant-update="updateParticipant"
31
32
  />
32
33
  <ShareSocialsButtons
33
- v-if="pageParameters.isShareButtons"
34
+ v-if="state.podcastPage.ShareButtons"
34
35
  class="w-100"
35
36
  :organisation-id="participant.orga.id"
36
37
  >
@@ -55,16 +56,15 @@
55
56
  />
56
57
  </template>
57
58
  <ClassicLoading
58
- :loading-text="!loaded ? $t('Loading content ...') : undefined"
59
- :error-text="error ? $t(`Animator doesn't exist`) : undefined"
59
+ :loading-text="!loaded ? t('Loading content ...') : undefined"
60
+ :error-text="error ? t(`Animator doesn't exist`) : undefined"
60
61
  />
61
62
  </section>
62
63
  </template>
63
64
 
64
- <script lang="ts">
65
+ <script setup lang="ts">
65
66
  import classicApi from "../../api/classicApi";
66
67
  import { state } from "../../stores/ParamSdkStore";
67
- import { useApiStore } from "../../stores/ApiStore";
68
68
  import { useFilterStore } from "../../stores/FilterStore";
69
69
  import displayHelper from "../../helper/displayHelper";
70
70
  import {useSeoTitleUrl} from "../composable/route/useSeoTitleUrl";
@@ -73,9 +73,10 @@ import {useOrgaComputed} from "../composable/useOrgaComputed";
73
73
  import {useErrorHandler} from "../composable/useErrorHandler";
74
74
  import { Participant } from "@/stores/class/general/participant";
75
75
  import ClassicLoading from "../form/ClassicLoading.vue";
76
- import { defineComponent, defineAsyncComponent } from "vue";
76
+ import { computed, defineAsyncComponent, ref, Ref, watch } from "vue";
77
77
  import { AxiosError } from "axios";
78
- import { mapState } from "pinia";
78
+ import { useI18n } from "vue-i18n";
79
+ import { useRoute } from "vue-router";
79
80
  const ShareSocialsButtons = defineAsyncComponent(
80
81
  () => import("../display/sharing/ShareSocialsButtons.vue"),
81
82
  );
@@ -86,106 +87,77 @@ const EditBox = defineAsyncComponent(
86
87
  () => import("@/components/display/edit/EditBox.vue"),
87
88
  );
88
89
  const ShareAnonymous = defineAsyncComponent(() => import("../display/sharing/ShareAnonymous.vue"));
89
- export default defineComponent({
90
- components: {
91
- ShareSocialsButtons,
92
- PodcastFilterList,
93
- EditBox,
94
- ClassicLoading,
95
- ShareAnonymous
96
- },
97
- props: {
98
- participantId: { default: undefined, type: Number },
99
- },
100
- setup(){
101
- const { useProxyImageUrl } = useImageProxy();
102
- const { isEditRights } = useOrgaComputed();
103
- const { updatePathParams } = useSeoTitleUrl();
104
- const {handle403} = useErrorHandler();
105
- return { useProxyImageUrl, isEditRights, updatePathParams, handle403 }
106
- },
107
- data() {
108
- return {
109
- loaded: false as boolean,
110
- participant: undefined as Participant | undefined,
111
- error: false as boolean,
112
- reload: false as boolean,
113
- };
114
- },
115
- computed: {
116
- ...mapState(useFilterStore, ["filterOrgaId"]),
117
- ...mapState(useApiStore, ["apiUrl"]),
118
- pageParameters() {
119
- return {
120
- isEditBox: !state.generalParameters.podcastmaker as boolean,
121
- isShareButtons: state.podcastPage.ShareButtons as boolean,
122
- };
123
- },
124
- rssUrl(): string {
125
- return `${this.apiUrl}rss/participant/${this.participantId}`;
126
- },
127
- description(): string {
128
- return this.participant?.description ?? "";
129
- },
130
- name(): string {
131
- return `${this.participant?.firstName ?? ""} ${
132
- this.participant?.lastName ?? ""
133
- }`.trim();
134
- },
135
- editRight(): boolean {
136
- return this.isEditRights(this.participant?.orga?.id);
137
- },
138
- },
139
- watch: {
140
- participant: {
141
- deep: true,
142
- handler() {
143
- this.reload = !this.reload;
144
- },
145
- },
146
- participantId: {
147
- immediate: true,
148
- handler() {
149
- this.getParticipantDetails();
150
- },
151
- },
152
- },
153
- methods: {
154
- urlify(text:string|undefined){
155
- return displayHelper.urlify(text);
156
- },
157
- initError(): void {
158
- this.error = true;
159
- this.loaded = true;
160
- },
161
- async getParticipantDetails(): Promise<void> {
162
- this.loaded = false;
163
- try {
164
- const data = await classicApi.fetchData<Participant>({
165
- api: 0,
166
- path: "participant/" + this.participantId,
167
- });
168
- if (
169
- "PUBLIC" !== data?.orga?.privacy &&
170
- this.filterOrgaId !== data?.orga?.id &&
171
- this.$route.query.productor !== data?.orga?.id
172
- ) {
173
- this.initError();
174
- return;
175
- }
176
- this.updateParticipant(data);
177
- this.loaded = true;
178
- } catch (error) {
179
- this.handle403(error as AxiosError);
180
- this.initError();
181
- }
182
- },
183
- updateParticipant(participant: Participant): void {
184
- this.participant = participant;
185
- this.updatePathParams(this.name);
186
- },
187
- },
90
+
91
+
92
+ //Props
93
+ const props = defineProps({
94
+ participantId: { default: undefined, type: Number },
188
95
  });
96
+
97
+
98
+ //Data
99
+ const loaded = ref(false);
100
+ const error = ref(false);
101
+ const reload = ref(false);
102
+ const participant: Ref<Participant | undefined> = ref(undefined);
103
+
104
+
105
+ //Composables
106
+ const route = useRoute();
107
+ const { t } = useI18n();
108
+ const { useProxyImageUrl } = useImageProxy();
109
+ const { isEditRights } = useOrgaComputed();
110
+ const { updatePathParams } = useSeoTitleUrl();
111
+ const {handle403} = useErrorHandler();
112
+ const filterStore = useFilterStore();
113
+
114
+
115
+ //Computed
116
+ const description = computed(() =>participant.value?.description ?? "");
117
+ const name = computed(() =>`${participant.value?.firstName ?? ""} ${participant.value?.lastName ?? ""}`.trim());
118
+ const editRight = computed(() =>isEditRights(participant.value?.orga?.id));
119
+
120
+
121
+ //Watch
122
+ watch(participant, () => {reload.value = !reload.value}, {deep: true});
123
+ watch(()=>props.participantId, () =>getParticipantDetails(), {immediate: true});
124
+
125
+
126
+
127
+ //Methods
128
+ function urlify(text:string|undefined){
129
+ return displayHelper.urlify(text);
130
+ }
131
+ function initError(): void {
132
+ error.value = true;
133
+ loaded.value = true;
134
+ }
135
+ async function getParticipantDetails(): Promise<void> {
136
+ loaded.value = false;
137
+ try {
138
+ const data = await classicApi.fetchData<Participant>({
139
+ api: 0,
140
+ path: "participant/" + props.participantId,
141
+ });
142
+ if (
143
+ "PUBLIC" !== data?.orga?.privacy &&
144
+ filterStore.filterOrgaId !== data?.orga?.id &&
145
+ route.query.productor !== data?.orga?.id
146
+ ) {
147
+ initError();
148
+ return;
149
+ }
150
+ updateParticipant(data);
151
+ loaded.value = true;
152
+ } catch (error) {
153
+ handle403(error as AxiosError);
154
+ initError();
155
+ }
156
+ }
157
+ function updateParticipant(participantUpdated: Participant): void {
158
+ participant.value = participantUpdated;
159
+ updatePathParams(name.value);
160
+ }
189
161
  </script>
190
162
 
191
163
  <style lang="scss">
@@ -20,6 +20,7 @@ import { useSimplePageParam } from "../composable/route/useSimplePageParam";
20
20
  import ParticipantList from "../display/participant/ParticipantList.vue";
21
21
  import ProductorSearch from "../display/filter/ProductorSearch.vue";
22
22
 
23
+ //Props
23
24
  const props = defineProps({
24
25
  pr: { default: 0, type: Number },
25
26
  ps: { default: 30, type: Number },
@@ -27,6 +28,8 @@ const props = defineProps({
27
28
  routeQuery: { default: "", type: String },
28
29
  });
29
30
 
31
+
32
+ //Composables
30
33
  const {
31
34
  searchPattern,
32
35
  organisationId,
@@ -17,9 +17,10 @@
17
17
  v-lazy="useProxyImageUrl(playlist.imageUrl, '250')"
18
18
  width="250"
19
19
  height="250"
20
- role="presentation"
20
+ aria-hidden="true"
21
+ alt=""
21
22
 
22
- :title="$t('Playlist name image', { name: name })"
23
+ :title="t('Playlist name image', { name: name })"
23
24
  class="img-box float-start me-3 mb-3"
24
25
  />
25
26
  <div class="d-flex align-items-center justify-content-between">
@@ -37,7 +38,7 @@
37
38
  :organisation-id="authOrgaId"
38
39
  />
39
40
  <ShareSocialsButtons
40
- v-if="pageParameters.isShareButtons"
41
+ v-if="state.podcastPage.ShareButtons"
41
42
  :organisation-id="playlist.organisation.id"
42
43
  />
43
44
  <section class="module-box">
@@ -46,16 +47,15 @@
46
47
  </div>
47
48
  </template>
48
49
  <ClassicLoading
49
- :loading-text="!loaded ? $t('Loading content ...') : undefined"
50
- :error-text="error ? $t(`Playlist doesn't exist`) : undefined"
50
+ :loading-text="!loaded ? t('Loading content ...') : undefined"
51
+ :error-text="error ? t(`Playlist doesn't exist`) : undefined"
51
52
  />
52
53
  </section>
53
54
  </template>
54
55
 
55
- <script lang="ts">
56
+ <script setup lang="ts">
56
57
  import { useGeneralStore } from "../../stores/GeneralStore";
57
58
  import { useAuthStore } from "../../stores/AuthStore";
58
- import { mapActions, mapState } from "pinia";
59
59
  import {useOrgaComputed} from "../composable/useOrgaComputed";
60
60
  import {useSeoTitleUrl} from "../composable/route/useSeoTitleUrl";
61
61
  import ClassicLoading from "../form/ClassicLoading.vue";
@@ -67,8 +67,10 @@ import displayHelper from "../../helper/displayHelper";
67
67
  import {useImageProxy} from "../composable/useImageProxy";
68
68
  import {useErrorHandler} from "../composable/useErrorHandler";
69
69
  import { Playlist } from "@/stores/class/general/playlist";
70
- import { defineComponent, defineAsyncComponent } from "vue";
70
+ import {defineAsyncComponent, ref, Ref, computed, watch, onBeforeUnmount } from "vue";
71
71
  import { AxiosError } from "axios";
72
+ import { useI18n } from "vue-i18n";
73
+ import { useRoute } from "vue-router";
72
74
  const ShareSocialsButtons = defineAsyncComponent(
73
75
  () => import("../display/sharing/ShareSocialsButtons.vue"),
74
76
  );
@@ -82,112 +84,92 @@ const PodcastmakerHeader = defineAsyncComponent(
82
84
  () => import("../display/podcastmaker/PodcastmakerHeader.vue"),
83
85
  );
84
86
  const ShareAnonymous = defineAsyncComponent(() => import("../display/sharing/ShareAnonymous.vue"));
85
- export default defineComponent({
86
- components: {
87
- ShareSocialsButtons,
88
- EditBox,
89
- PodcastList,
90
- SharePlayer,
91
- ClassicLoading,
92
- PodcastmakerHeader,
93
- ShareAnonymous
94
- },
95
-
96
- props: {
97
- playlistId: { default: undefined, type: Number },
98
- },
99
- setup(){
100
- const { useProxyImageUrl } = useImageProxy();
101
- const { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();
102
- const { updatePathParams } = useSeoTitleUrl();
103
- const {handle403} = useErrorHandler();
104
- return { useProxyImageUrl, isPodcastmaker, isEditRights, authOrgaId, updatePathParams, handle403 }
105
- },
106
- data() {
107
- return {
108
- loaded: false as boolean,
109
- playlist: undefined as Playlist | undefined,
110
- error: false as boolean,
111
- };
112
- },
113
- computed: {
114
- ...mapState(useFilterStore, ["filterOrgaId"]),
115
- ...mapState(useAuthStore, ["isRolePlaylists"]),
116
- pageParameters() {
117
- return {
118
- isShareButtons: state.podcastPage.ShareButtons as boolean,
119
- };
120
- },
121
- pageTitle(): string {
122
- return this.playlistRadio
123
- ? this.$t("Mix of episodes")
124
- : this.$t("Playlist");
125
- },
126
- playlistRadio(): boolean {
127
- return (
128
- "AMBIANCE" === this.playlist?.ambianceType ||
129
- "AMBIANCE_PROGRAMMED" === this.playlist?.ambianceType
130
- );
131
- },
132
- name(): string {
133
- return this.playlist?.title ?? "";
134
- },
135
- description(): string {
136
- return this.playlist?.description ?? "";
137
- },
138
- editRight(): boolean {
139
- return this.isEditRights(
140
- this.playlist?.organisation?.id,
141
- this.isRolePlaylists,
142
- );
143
- },
144
- },
145
- watch: {
146
- playlistId: {
147
- immediate: true,
148
- handler() {
149
- this.getPlaylistDetails();
150
- },
151
- },
152
- },
153
- beforeUnmount() {
154
- this.contentToDisplayUpdate(null);
155
- },
156
-
157
- methods: {
158
- ...mapActions(useGeneralStore, ["contentToDisplayUpdate"]),
159
- urlify(text:string|undefined){
160
- return displayHelper.urlify(text);
161
- },
162
- initError(): void {
163
- this.error = true;
164
- this.loaded = true;
165
- },
166
- async getPlaylistDetails(): Promise<void> {
167
- try {
168
- this.loaded = false;
169
- this.error = false;
170
- this.playlist = await classicApi.fetchData<Playlist>({
171
- api: 0,
172
- path: "playlist/" + this.playlistId,
173
- });
174
- if (
175
- (!this.editRight && this.playlistRadio) ||
176
- ("PUBLIC" !== this.playlist.organisation?.privacy &&
177
- this.filterOrgaId !== this.playlist.organisation?.id &&
178
- this.$route.query.productor !== this.playlist.organisation?.id)
179
- ) {
180
- this.initError();
181
- return;
182
- }
183
- this.contentToDisplayUpdate(this.playlist);
184
- this.updatePathParams(this.playlist.title);
185
- } catch (error) {
186
- this.handle403(error as AxiosError);
187
- this.initError();
188
- }
189
- this.loaded = true;
190
- },
191
- },
87
+
88
+
89
+ //Props
90
+ const props = defineProps({
91
+ playlistId: { default: undefined, type: Number },
92
+ });
93
+
94
+
95
+ //Data
96
+ const loaded = ref(false);
97
+ const error = ref(false);
98
+ const playlist : Ref<Playlist | undefined> = ref(undefined);
99
+
100
+
101
+ //Composables
102
+ const route = useRoute();
103
+ const { t } = useI18n();
104
+ const { useProxyImageUrl } = useImageProxy();
105
+ const { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();
106
+ const { updatePathParams } = useSeoTitleUrl();
107
+ const {handle403} = useErrorHandler();
108
+ const authStore = useAuthStore();
109
+ const filterStore = useFilterStore();
110
+ const generalStore = useGeneralStore();
111
+
112
+
113
+
114
+ //Computed
115
+ const playlistRadio = computed(() =>{
116
+ return (
117
+ "AMBIANCE" === playlist.value?.ambianceType ||
118
+ "AMBIANCE_PROGRAMMED" === playlist.value?.ambianceType
119
+ );
192
120
  });
121
+ const pageTitle = computed(() =>playlistRadio.value? t("Mix of episodes"): t("Playlist"));
122
+ const name = computed(() =>playlist.value?.title ?? "");
123
+ const description = computed(() =>playlist.value?.description ?? "");
124
+ const editRight = computed(() =>{
125
+ return isEditRights(
126
+ playlist.value?.organisation?.id,
127
+ authStore.isRolePlaylists,
128
+ );
129
+ });
130
+
131
+
132
+ //Watch
133
+ watch(()=>props.playlistId, () => {getPlaylistDetails()}, {immediate: true});
134
+
135
+
136
+ onBeforeUnmount(() => {
137
+ generalStore.contentToDisplayUpdate(null);
138
+ });
139
+
140
+
141
+ //Methods
142
+ function urlify(text:string|undefined){
143
+ return displayHelper.urlify(text);
144
+ }
145
+ function initError(): void {
146
+ error.value = true;
147
+ loaded.value = true;
148
+ }
149
+ async function getPlaylistDetails(): Promise<void> {
150
+ try {
151
+ loaded.value = false;
152
+ error.value = false;
153
+ playlist.value = await classicApi.fetchData<Playlist>({
154
+ api: 0,
155
+ path: "playlist/" + props.playlistId,
156
+ });
157
+ if (
158
+ (!editRight.value && playlistRadio.value) ||
159
+ ("PUBLIC" !== playlist.value.organisation?.privacy &&
160
+ filterStore.filterOrgaId !== playlist.value.organisation?.id &&
161
+ route.query.productor !== playlist.value.organisation?.id)
162
+ ) {
163
+ initError();
164
+ return;
165
+ }
166
+ generalStore.contentToDisplayUpdate(playlist.value);
167
+ updatePathParams(playlist.value.title);
168
+ } catch (error) {
169
+ handle403(error as AxiosError);
170
+ initError();
171
+ }
172
+ loaded.value = true;
173
+ }
174
+
193
175
  </script>
@@ -6,7 +6,7 @@
6
6
  class="d-flex justify-content-center my-3"
7
7
  >
8
8
  <div class="btn btn-primary">
9
- {{ $t("Create playlist") }}
9
+ {{ t("Create playlist") }}
10
10
  </div>
11
11
  </router-link>
12
12
  <ProductorSearch
@@ -30,9 +30,12 @@ import PlaylistList from "../display/playlist/PlaylistList.vue";
30
30
  import { useAuthStore } from "../../stores/AuthStore";
31
31
  import { state } from "../../stores/ParamSdkStore";
32
32
  import { computed, defineAsyncComponent } from "vue";
33
+ import { useI18n } from "vue-i18n";
33
34
  const ProductorSearch = defineAsyncComponent(
34
35
  () => import("../display/filter/ProductorSearch.vue"),
35
36
  );
37
+
38
+ //Props
36
39
  const props = defineProps({
37
40
  pr: { default: 0, type: Number },
38
41
  ps: { default: 30, type: Number },
@@ -40,6 +43,9 @@ const props = defineProps({
40
43
  routeQuery: { default: "", type: String },
41
44
  });
42
45
 
46
+
47
+ //Composables
48
+ const { t } = useI18n();
43
49
  const {
44
50
  searchPattern,
45
51
  organisationId,
@@ -47,9 +53,10 @@ const {
47
53
  paginateFirst,
48
54
  isInit
49
55
  } = useSimplePageParam(props);
50
-
51
56
  const authStore = useAuthStore();
52
57
 
58
+
59
+ //Computed
53
60
  const isPodcastmaker = computed(() =>state.generalParameters.podcastmaker as boolean);
54
61
  const isRolePlaylists = computed(() =>authStore.isRolePlaylists);
55
62