@saooti/octopus-sdk 40.2.18 → 41.0.0-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 +38 -39
  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 +56 -69
  32. package/src/components/display/emission/EmissionList.vue +192 -218
  33. package/src/components/display/emission/EmissionPlayerItem.vue +48 -65
  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 +40 -51
  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 +211 -223
  58. package/src/components/display/organisation/OrganisationChooser.vue +117 -123
  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 +49 -51
  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 +185 -209
  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 +27 -32
  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 +85 -108
  143. package/src/components/misc/MobileMenu.vue +102 -113
  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 +116 -135
  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 +98 -131
  176. package/src/components/pages/EmissionsPage.vue +2 -0
  177. package/src/components/pages/Error403Page.vue +22 -21
  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 +83 -111
  184. package/src/components/pages/ParticipantsPage.vue +3 -0
  185. package/src/components/pages/PlaylistPage.vue +98 -116
  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
@@ -3,7 +3,7 @@
3
3
  <button
4
4
  id="anonymous-share-button"
5
5
  :class="btnClass"
6
- :title="$t('Share')"
6
+ :title="t('Share')"
7
7
  >
8
8
  <DotsHorizontalIcon />
9
9
  </button>
@@ -67,22 +67,22 @@
67
67
  </div>
68
68
  </template>
69
69
 
70
- <script lang="ts">
70
+ <script setup lang="ts">
71
71
  import QrcodeIcon from "vue-material-design-icons/Qrcode.vue";
72
72
  import LinkVariantIcon from "vue-material-design-icons/LinkVariant.vue";
73
73
  import DotsHorizontalIcon from "vue-material-design-icons/DotsHorizontal.vue";
74
74
  import ClassicPopover from "../../misc/ClassicPopover.vue";
75
75
  import displayHelper from "../../../helper/displayHelper";
76
- import { defineAsyncComponent, defineComponent } from "vue";
76
+ import { computed, defineAsyncComponent, onBeforeMount, ref, useTemplateRef } from "vue";
77
77
  import { useApiStore } from "../../../stores/ApiStore";
78
78
  import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
79
79
  import { useAuthStore } from "../../../stores/AuthStore";
80
80
  import { Podcast } from "@/stores/class/general/podcast";
81
81
  import { Emission } from "@/stores/class/general/emission";
82
82
  import { Playlist } from "@/stores/class/general/playlist";
83
- import { mapActions, mapState } from "pinia";
84
83
  import { state } from "../../../stores/ParamSdkStore";
85
84
  import classicApi from "../../../api/classicApi";
85
+ import { useI18n } from "vue-i18n";
86
86
  const SnackBar = defineAsyncComponent(() => import("../../misc/SnackBar.vue"));
87
87
  const NewsletterModal = defineAsyncComponent(
88
88
  () => import("../../misc/modal/NewsletterModal.vue"),
@@ -105,186 +105,168 @@ const EmailNewsletterIcon = defineAsyncComponent(
105
105
  const RssIcon = defineAsyncComponent(
106
106
  () => import("vue-material-design-icons/Rss.vue"),
107
107
  );
108
- export default defineComponent({
109
- name: "PodcastShareAnonymous",
110
- components: {
111
- ClassicPopover,
112
- DotsHorizontalIcon,
113
- LinkVariantIcon,
114
- EmailNewsletterIcon,
115
- QrcodeIcon,
116
- CodeTagsIcon,
117
- RssIcon,
118
- SnackBar,
119
- NewsletterModal,
120
- QrCodeModal,
121
- ClipboardModal,
122
- PlayerAnonymousModal
123
- },
124
108
 
125
- props: {
126
- podcast: { default: undefined, type: Object as () => Podcast },
127
- emission: { default: undefined, type: Object as () => Emission },
128
- playlist: { default: undefined, type: Object as () => Playlist },
129
- participantId: { default: undefined, type: Number },
130
- organisationId: { default: undefined, type: String },
131
- relativeClass: { default: "page-element", type: String },
132
- btnClass: { default: "btn btn-transparent", type: String },
133
- },
109
+ //Props
110
+ const props = defineProps({
111
+ podcast: { default: undefined, type: Object as () => Podcast },
112
+ emission: { default: undefined, type: Object as () => Emission },
113
+ playlist: { default: undefined, type: Object as () => Playlist },
114
+ participantId: { default: undefined, type: Number },
115
+ organisationId: { default: undefined, type: String },
116
+ relativeClass: { default: "page-element", type: String },
117
+ btnClass: { default: "btn btn-transparent", type: String },
118
+ })
134
119
 
135
- data() {
136
- return {
137
- lazyLoadingSnackbar: false as boolean,
138
- isNewsletterModal: false as boolean,
139
- isQrCodeModal: false as boolean,
140
- displayRss: false as boolean,
141
- noSharing: true as boolean,
142
- playerCanBeSharedAnonymous: false as boolean,
143
- playerCanBeSharedOthers: false as boolean,
144
- isLoading: true as boolean,
145
- isRssModal: false as boolean,
146
- isPlayerModal: false as boolean
147
- };
148
- },
149
- computed:{
150
- ...mapState(useAuthStore, ["isGarRole","authOrgaId"]),
151
- ...mapState(useApiStore, ["apiUrl"]),
152
- urlPage(): string {
153
- return window.location.href;
154
- },
155
- isPodcastmaker(): boolean {
156
- return state.generalParameters.podcastmaker as boolean;
157
- },
158
- rssUrl(): string {
159
- const api = this.apiUrl + "rss/";
160
- if (
161
- (!this.isPodcastmaker && this.playlist) ||
162
- this.podcast ||
163
- this.emission
164
- ) {
165
- return "";
166
- }
167
- if (this.participantId) {
168
- return api + "participant/" + this.participantId + ".rss";
169
- }
170
- if (this.playlist) {
171
- return api + "playlist/" + this.playlist.playlistId + ".rss";
172
- }
173
- if (this.organisationId) {
174
- return api + "productor/" + this.organisationId + ".rss";
175
- }
176
- return "";
177
- },
178
- titleRssButton(): string {
179
- if (this.participantId) {
180
- return this.$t("Subscribe to this participant");
181
- }
182
- if (this.emission) {
183
- return this.$t("Subscribe to this emission");
184
- }
185
- return this.$t("Subscribe to this RSS feed");
186
- },
187
- dropdownButtons() {
188
- return [
189
- {
190
- title: this.$t("Copy this page URL"),
191
- icon: "LinkVariantIcon",
192
- condition:true,
193
- emitName: "link",
194
- },
195
- {
196
- title: this.$t("Share the player"),
197
- icon: "CodeTagsIcon",
198
- condition: !this.isPodcastmaker && (this.playerCanBeSharedAnonymous || (this.playerCanBeSharedOthers && this.authOrgaId)),
199
- emitName: "player",
200
- },
201
- {
202
- title: this.$t("Share newsletter"),
203
- icon: "EmailNewsletterIcon",
204
- condition: this.podcast || this.emission || this.playlist,
205
- emitName: "newsletter",
206
- },
207
- {
208
- title: this.$t("Share QR Code"),
209
- icon: "QrcodeIcon",
210
- condition: true,
211
- emitName: "qrcode",
212
- },
213
- {
214
- title: this.titleRssButton,
215
- icon: "RssIcon",
216
- condition: '' !== this.rssUrl && this.displayRss && !this.isGarRole,
217
- emitName: "rss",
218
- },
219
- ];
120
+ //Data
121
+ const lazyLoadingSnackbar = ref(false);
122
+ const isNewsletterModal = ref(false);
123
+ const isQrCodeModal = ref(false);
124
+ const displayRss = ref(false);
125
+ const noSharing = ref(true);
126
+ const playerCanBeSharedAnonymous = ref(false);
127
+ const playerCanBeSharedOthers = ref(false);
128
+ const isLoading = ref(true);
129
+ const isRssModal = ref(false);
130
+ const isPlayerModal = ref(false);
131
+ const snackBarRef = useTemplateRef('snackbar');
132
+
133
+
134
+ //Composables
135
+ const { t } = useI18n();
136
+ const authStore = useAuthStore();
137
+ const apiStore = useApiStore();
138
+ const saveFetchStore = useSaveFetchStore();
139
+
140
+
141
+ //Computed
142
+ const urlPage = computed(() => window.location.href);
143
+ const isPodcastmaker = computed(() => state.generalParameters.podcastmaker);
144
+ const rssUrl = computed(() => {
145
+ const api = apiStore.apiUrl + "rss/";
146
+ if (
147
+ (!isPodcastmaker.value && props.playlist) ||
148
+ props.podcast ||
149
+ props.emission
150
+ ) {
151
+ return "";
152
+ }
153
+ if (props.participantId) {
154
+ return api + "participant/" + props.participantId + ".rss";
155
+ }
156
+ if (props.playlist) {
157
+ return api + "playlist/" + props.playlist.playlistId + ".rss";
158
+ }
159
+ if (props.organisationId) {
160
+ return api + "productor/" + props.organisationId + ".rss";
161
+ }
162
+ return "";
163
+ });
164
+ const titleRssButton = computed(() => {
165
+ if (props.participantId) {
166
+ return t("Subscribe to this participant");
167
+ }
168
+ if (props.emission) {
169
+ return t("Subscribe to this emission");
170
+ }
171
+ return t("Subscribe to this RSS feed");
172
+ });
173
+ const dropdownButtons = computed(() => {
174
+ return [
175
+ {
176
+ title: t("Copy this page URL"),
177
+ icon: LinkVariantIcon,
178
+ condition:true,
179
+ emitName: "link",
220
180
  },
221
- },
222
- created() {
223
- this.initShareButtons();
224
- },
225
- methods:{
226
- ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
227
- async initShareButtons() {
228
- if (undefined !== this.participantId) {
229
- this.displayRss = await classicApi.fetchData<boolean>({
230
- api: 0,
231
- path: `rss/participants/allowed/${this.organisationId}`,
232
- isNotAuth: true,
233
- });
234
- } else {
235
- this.displayRss = true;
236
- }
237
- this.determinePlayerCanBeShared();
238
- if (!this.organisationId) {
239
- return;
240
- }
241
- const attributes = await this.getOrgaAttributes(this.organisationId);
242
- this.noSharing = "true" === attributes.noSharing;
243
- this.isLoading = false;
181
+ {
182
+ title: t("Share the player"),
183
+ icon: CodeTagsIcon,
184
+ condition: !isPodcastmaker.value && (playerCanBeSharedAnonymous.value || (playerCanBeSharedOthers.value && authStore.authOrgaId)),
185
+ emitName: "player",
244
186
  },
245
- determinePlayerCanBeShared() {
246
- const emissionAnnot = this.podcast?.emission.annotations ?? this.emission?.annotations;
247
- if (!emissionAnnot) { return }
248
- if (emissionAnnot.exclusive) {
249
- this.playerCanBeSharedOthers = "true" !== emissionAnnot.exclusive;
250
- }
251
- if (emissionAnnot.notExclusive) {
252
- this.playerCanBeSharedAnonymous = "true" === emissionAnnot.notExclusive;
253
- }
187
+ {
188
+ title: t("Share newsletter"),
189
+ icon: EmailNewsletterIcon,
190
+ condition: props.podcast || props.emission || props.playlist,
191
+ emitName: "newsletter",
254
192
  },
255
- clickButton(name: string) {
256
- switch (name) {
257
- case "link":
258
- displayHelper.onCopyCode(this.urlPage, this.afterCopy);
259
- break;
260
- case "newsletter":
261
- this.isNewsletterModal = true;
262
- break;
263
- case "qrcode":
264
- this.isQrCodeModal = true;
265
- break;
266
- case "rss":
267
- this.isRssModal = true;
268
- break;
269
- case "player":
270
- this.isPlayerModal = true;
271
- break;
272
- default:
273
- break;
274
- }
193
+ {
194
+ title: t("Share QR Code"),
195
+ icon: QrcodeIcon,
196
+ condition: true,
197
+ emitName: "qrcode",
275
198
  },
276
- afterCopy(): void {
277
- if (!this.lazyLoadingSnackbar) {
278
- this.lazyLoadingSnackbar = true;
279
- setTimeout(() => {
280
- this.afterCopy();
281
- }, 500);
282
- } else {
283
- (this.$refs.snackbar as InstanceType<typeof SnackBar>).open(
284
- this.$t("Link in clipboard"),
285
- );
286
- }
199
+ {
200
+ title: titleRssButton.value,
201
+ icon: RssIcon,
202
+ condition: '' !== rssUrl.value && displayRss.value && !authStore.isGarRole,
203
+ emitName: "rss",
287
204
  },
288
- }
205
+ ];
289
206
  });
207
+
208
+
209
+ onBeforeMount(()=>initShareButtons())
210
+
211
+
212
+ //Methods
213
+ async function initShareButtons() {
214
+ if (undefined !== props.participantId) {
215
+ displayRss.value = await classicApi.fetchData<boolean>({
216
+ api: 0,
217
+ path: `rss/participants/allowed/${props.organisationId}`,
218
+ isNotAuth: true,
219
+ });
220
+ } else {
221
+ displayRss.value = true;
222
+ }
223
+ determinePlayerCanBeShared();
224
+ if (!props.organisationId) {
225
+ return;
226
+ }
227
+ const attributes = await saveFetchStore.getOrgaAttributes(props.organisationId);
228
+ noSharing.value = "true" === attributes.noSharing;
229
+ isLoading.value = false;
230
+ }
231
+ function determinePlayerCanBeShared() {
232
+ const emissionAnnot = props.podcast?.emission.annotations ?? props.emission?.annotations;
233
+ if (!emissionAnnot) { return }
234
+ if (emissionAnnot.exclusive) {
235
+ playerCanBeSharedOthers.value = "true" !== emissionAnnot.exclusive;
236
+ }
237
+ if (emissionAnnot.notExclusive) {
238
+ playerCanBeSharedAnonymous.value = "true" === emissionAnnot.notExclusive;
239
+ }
240
+ }
241
+ function clickButton(name: string) {
242
+ switch (name) {
243
+ case "link":
244
+ displayHelper.onCopyCode(urlPage.value, afterCopy);
245
+ break;
246
+ case "newsletter":
247
+ isNewsletterModal.value = true;
248
+ break;
249
+ case "qrcode":
250
+ isQrCodeModal.value = true;
251
+ break;
252
+ case "rss":
253
+ isRssModal.value = true;
254
+ break;
255
+ case "player":
256
+ isPlayerModal.value = true;
257
+ break;
258
+ default:
259
+ break;
260
+ }
261
+ }
262
+ function afterCopy(): void {
263
+ if (!lazyLoadingSnackbar.value) {
264
+ lazyLoadingSnackbar.value = true;
265
+ setTimeout(() => {
266
+ afterCopy();
267
+ }, 500);
268
+ } else {
269
+ (snackBarRef?.value as InstanceType<typeof SnackBar>).open(t("Link in clipboard"));
270
+ }
271
+ }
290
272
  </script>
@@ -1,18 +1,18 @@
1
1
  <template>
2
2
  <section class="module-box">
3
3
  <h2 class="mb-3">
4
- {{ $t("Distribute") }}
4
+ {{ t("Distribute") }}
5
5
  </h2>
6
6
  <div class="sharing-distribution-container">
7
- {{ $t("Rss feed:") }}
7
+ {{ t("Rss feed:") }}
8
8
  <div class="text-primary hide-small-screen text-break">
9
9
  {{ rss }}
10
10
  </div>
11
11
  <ClassicCopyButton
12
- :text="$t('Copy')"
13
- :text-after-copy="$t('Copied!')"
12
+ :text="t('Copy')"
13
+ :text-after-copy="t('Copied!')"
14
14
  :data-to-copy="rss"
15
- :snackbar-text="$t('Link in clipboard')"
15
+ :snackbar-text="t('Link in clipboard')"
16
16
  />
17
17
  </div>
18
18
  <RssSection v-if="emission" :emission="emission" />
@@ -33,7 +33,7 @@
33
33
  </section>
34
34
  </template>
35
35
 
36
- <script lang="ts">
36
+ <script setup lang="ts">
37
37
  import ClassicCopyButton from "../../form/ClassicCopyButton.vue";
38
38
  import RadiolineIcon from "../../icons/RadiolineIcon.vue";
39
39
  import TuninIcon from "../../icons/TuninIcon.vue";
@@ -50,126 +50,112 @@ import { useApiStore } from "../../../stores/ApiStore";
50
50
  import classicApi from "../../../api/classicApi";
51
51
  import { Emission } from "@/stores/class/general/emission";
52
52
 
53
- import { defineComponent, defineAsyncComponent } from "vue";
54
- import { mapState } from "pinia";
53
+ import { defineAsyncComponent, ref, Ref, computed, onMounted } from "vue";
54
+ import { useI18n } from "vue-i18n";
55
55
  const RssSection = defineAsyncComponent(
56
56
  () => import("@/components/display/aggregator/RssSection.vue"),
57
57
  );
58
- export default defineComponent({
59
- components: {
60
- RssSection,
61
- SpotifyIcon,
62
- YoutubeIcon,
63
- ApplePodcastIcon,
64
- DeezerIcon,
65
- AmazonMusicIcon,
66
- IHeartIcon,
67
- PlayerFmIcon,
68
- PocketCastIcon,
69
- PodcastAddictIcon,
70
- TuninIcon,
71
- RadiolineIcon,
72
- ClassicCopyButton
73
- },
74
- props: {
75
- emissionId: { default: undefined, type: Number },
76
- },
77
-
78
- data() {
79
- return {
80
- emission: undefined as Emission | undefined,
81
- rss: "" as string,
82
- };
83
- },
84
- computed: {
85
- ...mapState(useApiStore, ["apiUrl"]),
86
- platformShare() {
87
- return [
88
- {
89
- url: this.getUrl("amazon"),
90
- icon: "AmazonMusicIcon",
91
- title: "Amazon Music",
92
- color: "#0c6cb3",
93
- },
94
- {
95
- url: this.getUrl("apple"),
96
- icon: "ApplePodcastIcon",
97
- title: "Apple Podcast / iTunes",
98
- color:"#aa1dd3"
99
- },
100
- { url: this.getUrl("deezer"),
101
- icon: "DeezerIcon",
102
- title: "Deezer",
103
- color:"#a238ff" },
104
- { url: this.getUrl("iHeart"),
105
- icon: "IHeartIcon",
106
- title: "iHeart",
107
- color:"#e11b22" },
108
- {
109
- url: this.getUrl("PlayerFM"),
110
- icon: "PlayerFmIcon",
111
- title: "PlayerFM",
112
- color:"#bb202a"
113
- },
114
- {
115
- url: this.getUrl("PocketCasts"),
116
- icon: "PocketCastIcon",
117
- title: "Pocket Casts",
118
- color:"#f43e37"
119
- },
120
- {
121
- url: this.getUrl("PodcastAddict"),
122
- icon: "PodcastAddictIcon",
123
- title: "Podcast Addict",
124
- color:"#f4842d"
125
- },
126
- {
127
- url: this.getUrl("radioline"),
128
- icon: "RadiolineIcon",
129
- title: "Radioline",
130
- color:"#1678bd"
131
- },
132
- {
133
- url: this.getUrl("spotify"),
134
- icon: "SpotifyIcon",
135
- title: "Spotify",
136
- color: "#1ed760",
137
- },
138
- { url: this.getUrl("tuneIn"),
139
- icon: "TuninIcon",
140
- title: "TuneIn",
141
- color:"#36b4a7" },
142
- {
143
- url: this.getUrl("youtube"),
144
- icon: "YoutubeIcon",
145
- title: "YouTube Music",
146
- color: "#fe0000",
147
- },
148
- ];
149
- },
150
- },
151
58
 
152
- mounted() {
153
- this.getEmissionDetails();
154
- this.getRSS();
155
- },
59
+ //Props
60
+ const props = defineProps({
61
+ emissionId: { default: undefined, type: Number },
62
+ })
63
+
64
+ //Data
65
+ const rss = ref("");
66
+ const emission : Ref<Emission | undefined>= ref(undefined);
156
67
 
157
- methods: {
158
- getUrl(platform: string): string {
159
- return `/main/priv/distribution/${platform}/${this.emissionId}`;
68
+ //Composables
69
+ const { t } = useI18n();
70
+ const apiStore = useApiStore();
71
+
72
+ //Computed
73
+ const platformShare = computed(() => {
74
+ return [
75
+ {
76
+ url: getUrl("amazon"),
77
+ icon: AmazonMusicIcon,
78
+ title: "Amazon Music",
79
+ color: "#0c6cb3",
80
+ },
81
+ {
82
+ url: getUrl("apple"),
83
+ icon: ApplePodcastIcon,
84
+ title: "Apple Podcast / iTunes",
85
+ color:"#aa1dd3"
86
+ },
87
+ { url: getUrl("deezer"),
88
+ icon: DeezerIcon,
89
+ title: "Deezer",
90
+ color:"#a238ff" },
91
+ { url: getUrl("iHeart"),
92
+ icon: IHeartIcon,
93
+ title: "iHeart",
94
+ color:"#e11b22" },
95
+ {
96
+ url: getUrl("PlayerFM"),
97
+ icon: PlayerFmIcon,
98
+ title: "PlayerFM",
99
+ color:"#bb202a"
100
+ },
101
+ {
102
+ url: getUrl("PocketCasts"),
103
+ icon: PocketCastIcon,
104
+ title: "Pocket Casts",
105
+ color:"#f43e37"
106
+ },
107
+ {
108
+ url: getUrl("PodcastAddict"),
109
+ icon: PodcastAddictIcon,
110
+ title: "Podcast Addict",
111
+ color:"#f4842d"
112
+ },
113
+ {
114
+ url: getUrl("radioline"),
115
+ icon: RadiolineIcon,
116
+ title: "Radioline",
117
+ color:"#1678bd"
160
118
  },
161
- async getEmissionDetails(): Promise<void> {
162
- this.emission = await classicApi.fetchData<Emission>({
163
- api: 0,
164
- path: "emission/" + this.emissionId,
165
- });
119
+ {
120
+ url: getUrl("spotify"),
121
+ icon: SpotifyIcon,
122
+ title: "Spotify",
123
+ color: "#1ed760",
166
124
  },
167
- getRSS(): void {
168
- if (!this.$props.emissionId || this.$props.emissionId <= 0) return;
169
- this.rss = `${this.apiUrl}rss/emission/${this.emissionId}.rss`;
125
+ { url: getUrl("tuneIn"),
126
+ icon: TuninIcon,
127
+ title: "TuneIn",
128
+ color:"#36b4a7" },
129
+ {
130
+ url: getUrl("youtube"),
131
+ icon: YoutubeIcon,
132
+ title: "YouTube Music",
133
+ color: "#fe0000",
170
134
  },
171
- },
135
+ ];
172
136
  });
137
+
138
+
139
+ onMounted(()=>{
140
+ getEmissionDetails();
141
+ getRSS();
142
+ })
143
+
144
+
145
+ //Methods
146
+ function getUrl(platform: string): string {
147
+ return `/main/priv/distribution/${platform}/${props.emissionId}`;
148
+ }
149
+ async function getEmissionDetails(): Promise<void> {
150
+ emission.value = await classicApi.fetchData<Emission>({
151
+ api: 0,
152
+ path: "emission/" + props.emissionId,
153
+ });
154
+ }
155
+ function getRSS(): void {
156
+ if (!props.emissionId || props.emissionId <= 0) return;
157
+ rss.value = `${apiStore.apiUrl}rss/emission/${props.emissionId}.rss`;
158
+ }
173
159
  </script>
174
160
 
175
161
  <style lang="scss">