@saooti/octopus-sdk 40.2.19 → 41.0.0

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 (214) hide show
  1. package/index.ts +2 -1
  2. package/package.json +4 -3
  3. package/src/App.vue +71 -95
  4. package/src/components/composable/player/usePlayerLive.ts +13 -4
  5. package/src/components/composable/player/usePlayerLogic.ts +6 -6
  6. package/src/components/composable/player/usePlayerVast.ts +7 -7
  7. package/src/components/composable/podcasts/usePodcastView.ts +3 -3
  8. package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
  9. package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
  10. package/src/components/composable/route/useSimplePageParam.ts +15 -8
  11. package/src/components/composable/useInit.ts +2 -2
  12. package/src/components/composable/useMetaTitleWatch.ts +2 -2
  13. package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
  14. package/src/components/display/categories/CategoryChooser.vue +144 -145
  15. package/src/components/display/categories/CategoryFilter.vue +172 -198
  16. package/src/components/display/categories/CategoryList.vue +122 -147
  17. package/src/components/display/comments/CommentInput.vue +100 -122
  18. package/src/components/display/comments/CommentList.vue +169 -191
  19. package/src/components/display/comments/CommentName.vue +35 -45
  20. package/src/components/display/comments/CommentParentInfo.vue +28 -34
  21. package/src/components/display/comments/CommentPlayer.vue +38 -50
  22. package/src/components/display/comments/CommentSection.vue +85 -103
  23. package/src/components/display/comments/item/CommentBasicView.vue +48 -61
  24. package/src/components/display/comments/item/CommentItem.vue +104 -115
  25. package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
  26. package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
  27. package/src/components/display/comments/like/LikeButton.vue +36 -41
  28. package/src/components/display/comments/like/LikeSection.vue +128 -136
  29. package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
  30. package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
  31. package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
  32. package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
  33. package/src/components/display/edit/EditBox.vue +9 -8
  34. package/src/components/display/edit/EditBoxRadio.vue +1 -5
  35. package/src/components/display/emission/EmissionInlineList.vue +82 -97
  36. package/src/components/display/emission/EmissionItem.vue +57 -69
  37. package/src/components/display/emission/EmissionList.vue +189 -218
  38. package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
  39. package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
  40. package/src/components/display/emission/EmissionPresentationList.vue +51 -61
  41. package/src/components/display/filter/AdvancedSearch.vue +151 -176
  42. package/src/components/display/filter/CategorySearchFilter.vue +43 -46
  43. package/src/components/display/filter/DateFilter.vue +76 -91
  44. package/src/components/display/filter/MonetizableFilter.vue +27 -30
  45. package/src/components/display/filter/ProductorSearch.vue +87 -90
  46. package/src/components/display/filter/RubriqueChoice.vue +58 -63
  47. package/src/components/display/filter/RubriqueFilter.vue +154 -169
  48. package/src/components/display/filter/SearchOrder.vue +35 -35
  49. package/src/components/display/list/ListPaginate.vue +72 -93
  50. package/src/components/display/list/PaginateParams.vue +36 -40
  51. package/src/components/display/list/PaginateSection.vue +113 -124
  52. package/src/components/display/list/SwiperList.vue +97 -109
  53. package/src/components/display/live/CountDown.vue +15 -9
  54. package/src/components/display/live/CountdownOctopus.vue +16 -10
  55. package/src/components/display/live/LiveHorizontalList.vue +95 -103
  56. package/src/components/display/live/LiveItem.vue +64 -73
  57. package/src/components/display/live/LiveList.vue +125 -137
  58. package/src/components/display/live/RadioCurrently.vue +66 -73
  59. package/src/components/display/live/RadioImage.vue +39 -50
  60. package/src/components/display/live/RadioItem.vue +9 -14
  61. package/src/components/display/live/RadioList.vue +39 -53
  62. package/src/components/display/live/RadioPlanning.vue +210 -222
  63. package/src/components/display/organisation/OrganisationChooser.vue +116 -122
  64. package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
  65. package/src/components/display/participant/ParticipantInlineList.vue +42 -58
  66. package/src/components/display/participant/ParticipantItem.vue +66 -74
  67. package/src/components/display/participant/ParticipantList.vue +116 -141
  68. package/src/components/display/playlist/PlaylistItem.vue +33 -46
  69. package/src/components/display/playlist/PlaylistList.vue +115 -144
  70. package/src/components/display/playlist/PodcastList.vue +90 -103
  71. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
  72. package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
  73. package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
  74. package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
  75. package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
  76. package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
  77. package/src/components/display/podcasts/PodcastImage.vue +96 -99
  78. package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
  79. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
  80. package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
  81. package/src/components/display/podcasts/PodcastItem.vue +48 -63
  82. package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
  83. package/src/components/display/podcasts/PodcastList.vue +182 -206
  84. package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
  85. package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
  86. package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
  87. package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
  88. package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
  89. package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
  90. package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
  91. package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
  92. package/src/components/display/podcasts/TagList.vue +48 -50
  93. package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
  94. package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
  95. package/src/components/display/rubriques/RubriqueList.vue +140 -160
  96. package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
  97. package/src/components/display/sharing/FormatSwitch.vue +16 -11
  98. package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
  99. package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
  100. package/src/components/display/sharing/PlayerParameters.vue +69 -71
  101. package/src/components/display/sharing/QrCode.vue +55 -67
  102. package/src/components/display/sharing/ShareAnonymous.vue +160 -178
  103. package/src/components/display/sharing/ShareDistribution.vue +103 -117
  104. package/src/components/display/sharing/ShareNewsletter.vue +154 -161
  105. package/src/components/display/sharing/SharePlayer.vue +273 -295
  106. package/src/components/display/sharing/SharePlayerColors.vue +25 -16
  107. package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
  108. package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
  109. package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
  110. package/src/components/display/sharing/SubscribeButtons.vue +184 -207
  111. package/src/components/display/studio/RecordingItemButton.vue +1 -4
  112. package/src/components/form/ClassicCheckbox.vue +26 -30
  113. package/src/components/form/ClassicContentEditable.vue +37 -33
  114. package/src/components/form/ClassicCopyButton.vue +40 -44
  115. package/src/components/form/ClassicDatePicker.vue +114 -114
  116. package/src/components/form/ClassicEmojiPicker.vue +20 -28
  117. package/src/components/form/ClassicInputText.vue +116 -120
  118. package/src/components/form/ClassicLoading.vue +7 -12
  119. package/src/components/form/ClassicMultiselect.vue +115 -117
  120. package/src/components/form/ClassicRadio.vue +21 -16
  121. package/src/components/form/ClassicRadioLabel.vue +23 -22
  122. package/src/components/form/ClassicSearch.vue +24 -19
  123. package/src/components/form/ClassicSelect.vue +47 -38
  124. package/src/components/form/ClassicWysiwyg.vue +116 -123
  125. package/src/components/icons/AmazonMusicIcon.vue +7 -10
  126. package/src/components/icons/ApplePodcastIcon.vue +7 -11
  127. package/src/components/icons/BlueSkyIcon.vue +8 -11
  128. package/src/components/icons/DeezerIcon.vue +8 -11
  129. package/src/components/icons/EditFtpIcon.vue +8 -11
  130. package/src/components/icons/IHeartIcon.vue +8 -11
  131. package/src/components/icons/PlayVideoIcon.vue +7 -10
  132. package/src/components/icons/PlayerFmIcon.vue +7 -10
  133. package/src/components/icons/PocketCastIcon.vue +8 -11
  134. package/src/components/icons/PodcastAddictIcon.vue +7 -10
  135. package/src/components/icons/RadiolineIcon.vue +8 -11
  136. package/src/components/icons/TuninIcon.vue +8 -11
  137. package/src/components/icons/XIcon.vue +7 -10
  138. package/src/components/misc/AcpmImage.vue +6 -7
  139. package/src/components/misc/ClassicAccordion.vue +26 -31
  140. package/src/components/misc/ClassicLazy.vue +86 -90
  141. package/src/components/misc/ClassicNav.vue +16 -20
  142. package/src/components/misc/ClassicPopover.vue +271 -282
  143. package/src/components/misc/ClassicSpinner.vue +5 -27
  144. package/src/components/misc/ErrorMessage.vue +11 -12
  145. package/src/components/misc/FooterGarSection.vue +33 -41
  146. package/src/components/misc/FooterSection.vue +94 -131
  147. package/src/components/misc/HomeDropdown.vue +83 -105
  148. package/src/components/misc/MobileMenu.vue +101 -111
  149. package/src/components/misc/ProgressBar.vue +53 -62
  150. package/src/components/misc/TopBar.vue +98 -120
  151. package/src/components/misc/TopBarMainContent.vue +114 -133
  152. package/src/components/misc/modal/ClassicModal.vue +40 -33
  153. package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
  154. package/src/components/misc/modal/ClipboardModal.vue +27 -30
  155. package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
  156. package/src/components/misc/modal/MessageModal.vue +50 -47
  157. package/src/components/misc/modal/NewsletterModal.vue +30 -31
  158. package/src/components/misc/modal/QrCodeModal.vue +21 -21
  159. package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
  160. package/src/components/misc/player/PlayerCompact.vue +6 -4
  161. package/src/components/misc/player/PlayerComponent.vue +8 -9
  162. package/src/components/misc/player/PlayerLarge.vue +9 -8
  163. package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
  164. package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
  165. package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
  166. package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
  167. package/src/components/misc/player/elements/PlayerImage.vue +51 -57
  168. package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
  169. package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
  170. package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
  171. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
  172. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
  173. package/src/components/misc/player/radio/RadioHistory.vue +80 -99
  174. package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
  175. package/src/components/misc/player/video/PlayerVideo.vue +27 -40
  176. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
  177. package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
  178. package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
  179. package/src/components/pages/CategoryPage.vue +28 -33
  180. package/src/components/pages/EmissionPage.vue +113 -132
  181. package/src/components/pages/EmissionsPage.vue +2 -0
  182. package/src/components/pages/Error403Page.vue +21 -20
  183. package/src/components/pages/HomePage.vue +91 -100
  184. package/src/components/pages/LivesPage.vue +35 -37
  185. package/src/components/pages/MapPage.vue +209 -241
  186. package/src/components/pages/PageLogout.vue +8 -11
  187. package/src/components/pages/PageNotFound.vue +9 -5
  188. package/src/components/pages/ParticipantPage.vue +96 -110
  189. package/src/components/pages/ParticipantsPage.vue +3 -0
  190. package/src/components/pages/PlaylistPage.vue +112 -117
  191. package/src/components/pages/PlaylistsPage.vue +9 -2
  192. package/src/components/pages/PodcastPage.vue +224 -238
  193. package/src/components/pages/PodcastsPage.vue +9 -2
  194. package/src/components/pages/RadioPage.vue +56 -70
  195. package/src/components/pages/RubriquePage.vue +7 -3
  196. package/src/components/pages/SearchPage.vue +31 -36
  197. package/src/components/pages/TagPage.vue +11 -9
  198. package/src/components/pages/VideoPage.vue +14 -11
  199. package/src/helper/displayHelper.ts +1 -1
  200. package/src/helper/loadScript.ts +4 -4
  201. package/src/i18n.ts +2 -2
  202. package/src/main.ts +1 -1
  203. package/src/router/router.ts +17 -4
  204. package/src/stores/AuthStore.ts +12 -12
  205. package/src/stores/FilterStore.ts +1 -1
  206. package/src/stores/VastStore.ts +2 -2
  207. package/src/stores/class/general/player.ts +1 -0
  208. package/public/css/fonts/icomoon.eot +0 -0
  209. package/public/css/fonts/icomoon.svg +0 -113
  210. package/public/css/fonts/icomoon.ttf +0 -0
  211. package/public/css/fonts/icomoon.woff +0 -0
  212. package/public/css/fonts/icomoon.woff2 +0 -0
  213. package/public/css/fonts/style.css +0 -352
  214. package/sonarqube-scanner.js +0 -10
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="d-flex flex-column p-3 list-episode">
3
3
  <ClassicLoading
4
- :loading-text="loading ? $t('Loading emissions ...') : undefined"
4
+ :loading-text="loading ? t('Loading emissions ...') : undefined"
5
5
  />
6
6
  <SwiperList
7
7
  v-if="(displayRubriquage && rubriques) || !(displayRubriquage && loaded)"
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </template>
29
29
 
30
- <script lang="ts">
30
+ <script setup lang="ts">
31
31
  import SwiperList from "../list/SwiperList.vue";
32
32
  import classicApi from "../../../api/classicApi";
33
33
  import EmissionPlayerItem from "./EmissionPlayerItem.vue";
@@ -36,116 +36,101 @@ import {useErrorHandler} from "../../composable/useErrorHandler";
36
36
  import ClassicLoading from "../../form/ClassicLoading.vue";
37
37
  import { Emission } from "@/stores/class/general/emission";
38
38
  import { Rubrique } from "@/stores/class/rubrique/rubrique";
39
- import { defineComponent } from "vue";
39
+ import { computed, onMounted, Ref, ref } from "vue";
40
40
  import { AxiosError } from "axios";
41
41
  import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
42
42
  import { ListClassicReturn } from "@/stores/class/general/listReturn";
43
- export default defineComponent({
44
- name: "EmissionInlineList",
43
+ import { useI18n } from "vue-i18n";
45
44
 
46
- components: {
47
- EmissionPlayerItem,
48
- ClassicLoading,
49
- SwiperList,
50
- },
51
- props: {
52
- organisationId: { default: undefined, type: String },
45
+ //Props
46
+ const props = defineProps({
47
+ organisationId: { default: undefined, type: String },
53
48
  href: { default: undefined, type: String },
54
49
  buttonText: { default: undefined, type: String },
55
50
  rubriqueId: { default: undefined, type: Number },
56
51
  rubriquageId: { default: undefined, type: Number },
57
52
  nbPodcasts: { default: undefined, type: Number },
58
53
  itemSize: { default: undefined, type: Number },
59
- },
54
+ })
60
55
 
61
- setup(){
62
- const {handle403} = useErrorHandler();
63
- return { handle403 }
64
- },
65
56
 
66
- data() {
67
- return {
68
- loading: true as boolean,
69
- allEmissions: [] as Array<Emission>,
70
- rubriques: undefined as Array<Rubrique> | undefined,
71
- };
72
- },
57
+ //Data
58
+ const loading = ref(true);
59
+ const allEmissions: Ref<Array<Emission>> = ref([]);
60
+ const rubriques: Ref<Array<Rubrique> | undefined> = ref(undefined);
73
61
 
74
- computed: {
75
- displayRubriquage(): number | undefined {
76
- return state.emissionsPage.rubriquage;
77
- },
78
- },
79
62
 
80
- mounted() {
81
- this.fetchNext();
82
- if (this.displayRubriquage) {
83
- this.fetchRubriques();
84
- }
85
- },
86
- methods: {
87
- async fetchNext(): Promise<void> {
88
- try {
89
- const data = await classicApi.fetchData<ListClassicReturn<Emission>>({
90
- api: 0,
91
- path: "emission/search",
92
- parameters: {
93
- first: 0,
94
- size: 12,
95
- organisationId: this.organisationId,
96
- rubriqueId: this.rubriqueId ? [this.rubriqueId] : [],
97
- rubriquageId: this.rubriquageId ? [this.rubriquageId] : [],
98
- sort: "LAST_PODCAST_DESC",
99
- },
100
- specialTreatement: true,
101
- });
102
- this.allEmissions = this.allEmissions.concat(
103
- data.result.filter((em: Emission | null) => null !== em),
104
- );
105
- this.loading = false;
106
- } catch (error) {
107
- this.handle403(error as AxiosError);
108
- }
109
- },
63
+ //Composables
64
+ const { t } = useI18n();
65
+ const {handle403} = useErrorHandler();
66
+
110
67
 
111
- reset(): void {
112
- this.loading = true;
113
- this.allEmissions.length = 0;
114
- },
115
- async fetchRubriques(): Promise<void> {
116
- const data = await classicApi.fetchData<Rubriquage>({
117
- api: 0,
118
- path: "rubriquage/" + this.displayRubriquage,
119
- });
120
- this.rubriques = data.rubriques;
121
- },
122
- rubriquesId(emission: Emission): string | undefined {
123
- if (
124
- !this.displayRubriquage ||
125
- !emission.rubriqueIds ||
126
- 0 === emission.rubriqueIds.length ||
127
- !this.rubriques ||
128
- !this.rubriques.length
129
- )
130
- return undefined;
131
- const rubrique = this.rubriques.find(
132
- (element: Rubrique) =>
133
- element.rubriqueId &&
134
- emission.rubriqueIds.includes(element.rubriqueId) &&
135
- element.rubriquageId === this.displayRubriquage,
136
- );
137
- if (rubrique) {
138
- return rubrique.name;
139
- }
140
- },
141
- mainRubriquage(emission: Emission): string {
142
- return state.emissionsPage.mainRubrique &&
143
- emission.rubriqueIds?.includes(state.emissionsPage.mainRubrique)
144
- ? "partenaireRubrique"
145
- : "";
146
- },
147
- },
148
- });
68
+ //Computed
69
+ const displayRubriquage = computed(() => state.emissionsPage.rubriquage);
70
+
71
+ onMounted(()=>{
72
+ fetchNext();
73
+ if (displayRubriquage.value) {
74
+ fetchRubriques();
75
+ }
76
+ })
77
+
78
+ //Methods
79
+ async function fetchNext(): Promise<void> {
80
+ try {
81
+ const data = await classicApi.fetchData<ListClassicReturn<Emission>>({
82
+ api: 0,
83
+ path: "emission/search",
84
+ parameters: {
85
+ first: 0,
86
+ size: 12,
87
+ organisationId: props.organisationId,
88
+ rubriqueId: props.rubriqueId ? [props.rubriqueId] : [],
89
+ rubriquageId: props.rubriquageId ? [props.rubriquageId] : [],
90
+ sort: "LAST_PODCAST_DESC",
91
+ },
92
+ specialTreatement: true,
93
+ });
94
+ allEmissions.value = allEmissions.value.concat(
95
+ data.result.filter((em: Emission | null) => null !== em),
96
+ );
97
+ loading.value = false;
98
+ } catch (error) {
99
+ handle403(error as AxiosError);
100
+ }
101
+ }
102
+ async function fetchRubriques(): Promise<void> {
103
+ const data = await classicApi.fetchData<Rubriquage>({
104
+ api: 0,
105
+ path: "rubriquage/" + displayRubriquage.value,
106
+ });
107
+ rubriques.value = data.rubriques;
108
+ }
109
+ function rubriquesId(emission: Emission): string | undefined {
110
+ if (
111
+ !displayRubriquage.value ||
112
+ !emission.rubriqueIds ||
113
+ 0 === emission.rubriqueIds.length ||
114
+ !rubriques.value ||
115
+ !rubriques.value.length
116
+ )
117
+ return undefined;
118
+ const rubrique = rubriques.value.find(
119
+ (element: Rubrique) =>
120
+ element.rubriqueId &&
121
+ emission.rubriqueIds.includes(element.rubriqueId) &&
122
+ element.rubriquageId === displayRubriquage.value,
123
+ );
124
+ if (rubrique) {
125
+ return rubrique.name;
126
+ }
127
+ }
128
+ function mainRubriquage(emission: Emission): string {
129
+ return state.emissionsPage.mainRubrique &&
130
+ emission.rubriqueIds?.includes(state.emissionsPage.mainRubrique)
131
+ ? "partenaireRubrique"
132
+ : "";
133
+ }
149
134
  </script>
150
135
 
151
136
  <style lang="scss">
@@ -5,7 +5,7 @@
5
5
  name: 'emission',
6
6
  params: { emissionId: emission.emissionId },
7
7
  }"
8
- :title="$t('Series name page', { name: emission.name })"
8
+ :title="t('Series name page', { name: emission.name })"
9
9
  class="d-flex flex-grow-1 text-dark"
10
10
  >
11
11
  <img
@@ -13,8 +13,9 @@
13
13
  width="250"
14
14
  height="250"
15
15
  class="img-box"
16
- role="presentation"
17
- :title="$t('Emission name image', { name: emission.name })"
16
+ aria-hidden="true"
17
+ alt=""
18
+ :title="t('Emission name image', { name: emission.name })"
18
19
  />
19
20
  <div class="classic-element-text">
20
21
  <div class="d-flex align-items-center element-name basic-line-clamp">
@@ -22,7 +23,7 @@
22
23
  v-if="!activeEmission && !isPodcastmaker && editRight"
23
24
  :size="16"
24
25
  class="text-danger me-1"
25
- :title="$t('Emission have not podcasts')"
26
+ :title="t('Emission have not podcasts')"
26
27
  />
27
28
  {{ emission.name }}
28
29
  </div>
@@ -52,83 +53,70 @@
52
53
  </article>
53
54
  </template>
54
55
 
55
- <script lang="ts">
56
+ <script setup lang="ts">
56
57
  import AlertIcon from "vue-material-design-icons/Alert.vue";
57
58
  import {useOrgaComputed} from "../../composable/useOrgaComputed";
58
59
  import { Emission } from "@/stores/class/general/emission";
59
60
  import classicApi from "../../../api/classicApi";
60
61
  import {useImageProxy} from "../../composable/useImageProxy";
61
62
  import displayHelper from "../../../helper/displayHelper";
62
- import { defineComponent } from "vue";
63
+ import { computed, onBeforeMount, onMounted, ref, useTemplateRef } from "vue";
63
64
  import { Podcast } from "@/stores/class/general/podcast";
64
65
  import { ListClassicReturn } from "@/stores/class/general/listReturn";
65
- export default defineComponent({
66
- name: "EmissionItem",
67
- components: {
68
- AlertIcon,
69
- },
66
+ import { useI18n } from "vue-i18n";
70
67
 
71
- props: {
72
- emission: { default: () => ({}), type: Object as () => Emission },
73
- },
68
+ //Props
69
+ const props = defineProps({
70
+ emission: { default: () => ({}), type: Object as () => Emission },
71
+ })
74
72
 
75
- setup(){
76
- const { useProxyImageUrl } = useImageProxy();
77
- const { isPodcastmaker, isEditRights } = useOrgaComputed();
78
- return { useProxyImageUrl, isPodcastmaker, isEditRights }
79
- },
73
+ //Data
74
+ const activeEmission = ref(true);
80
75
 
81
- data() {
82
- return {
83
- activeEmission: true as boolean,
84
- };
85
- },
76
+ //Composables
77
+ const { t } = useI18n();
78
+ const { useProxyImageUrl } = useImageProxy();
79
+ const { isPodcastmaker, isEditRights } = useOrgaComputed();
86
80
 
87
- computed: {
88
- organisation(): string {
89
- return this.emission?.publisher?.organisation?.name ?? "";
90
- },
91
- editRight(): boolean {
92
- return this.isEditRights(this.emission.orga.id);
93
- },
94
- },
81
+ //Computed
82
+ const editRight = computed(() => isEditRights(props.emission.orga.id));
95
83
 
96
- created() {
97
- if (!this.editRight) return;
98
- this.hasPodcast();
99
- },
100
- mounted() {
101
- const emissionDesc = this.$refs.descriptionEmission as HTMLElement;
102
- const emissionDescContainer = this.$refs
103
- .descriptionEmissionContainer as HTMLElement;
104
- if (
105
- null !== emissionDesc &&
106
- null !== emissionDescContainer &&
107
- emissionDesc.clientHeight > emissionDescContainer.clientHeight
108
- ) {
109
- emissionDescContainer.classList.add("after-element-description");
110
- }
111
- },
112
- methods: {
113
- urlify(text:string|undefined){
114
- return displayHelper.urlify(text);
115
- },
116
- async hasPodcast(): Promise<void> {
117
- const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({
118
- api: 0,
119
- path: "podcast/search",
120
- parameters: {
121
- emissionId: this.emission.emissionId,
122
- first: 0,
123
- size: 0,
124
- includeStatus: ["READY", "PROCESSING"],
125
- },
126
- specialTreatement: true,
127
- });
128
- if (0 === data.count) {
129
- this.activeEmission = false;
130
- }
84
+
85
+ onBeforeMount(()=>{
86
+ if (!editRight.value) return;
87
+ hasPodcast();
88
+ })
89
+
90
+ onMounted(()=>{
91
+ const emissionDesc = useTemplateRef('descriptionEmission')?.value as HTMLElement;
92
+ const emissionDescContainer = useTemplateRef('descriptionEmissionContainer')?.value as HTMLElement;
93
+ if (
94
+ null !== emissionDesc &&
95
+ null !== emissionDescContainer &&
96
+ emissionDesc.clientHeight > emissionDescContainer.clientHeight
97
+ ) {
98
+ emissionDescContainer.classList.add("after-element-description");
99
+ }
100
+ })
101
+
102
+ //Methods
103
+ function urlify(text:string|undefined){
104
+ return displayHelper.urlify(text);
105
+ }
106
+ async function hasPodcast(): Promise<void> {
107
+ const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({
108
+ api: 0,
109
+ path: "podcast/search",
110
+ parameters: {
111
+ emissionId: props.emission.emissionId,
112
+ first: 0,
113
+ size: 0,
114
+ includeStatus: ["READY", "PROCESSING"],
131
115
  },
132
- },
133
- });
116
+ specialTreatement: true,
117
+ });
118
+ if (0 === data.count) {
119
+ activeEmission.value = false;
120
+ }
121
+ }
134
122
  </script>