@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
@@ -8,7 +8,7 @@
8
8
  name: 'emission',
9
9
  params: { emissionId: emission.emissionId },
10
10
  }"
11
- :title="$t('Series name page', { name: emission.name })"
11
+ :title="t('Series name page', { name: emission.name })"
12
12
  class="d-flex-column flex-grow-1 text-dark"
13
13
  :class="isVertical ? 'flex-column' : ''"
14
14
  >
@@ -18,9 +18,10 @@
18
18
  :height="isVertical ? '400' : '250'"
19
19
  :class="isVertical ? 'img-box-bigger' : ''"
20
20
  class="img-box"
21
- role="presentation"
21
+ aria-hidden="true"
22
+ alt=""
22
23
 
23
- :title="$t('Emission name image', { name: emission.name })"
24
+ :title="t('Emission name image', { name: emission.name })"
24
25
  />
25
26
  <div class="classic-element-text">
26
27
  <div class="element-name mb-2 basic-line-clamp">
@@ -43,64 +44,53 @@
43
44
  </article>
44
45
  </template>
45
46
 
46
- <script lang="ts">
47
- import { useFilterStore } from "../../../stores/FilterStore";
47
+ <script setup lang="ts">
48
48
  import {useResizePhone} from "../../composable/useResizePhone";
49
49
  import { Emission } from "@/stores/class/general/emission";
50
50
  import {useImageProxy} from "../../composable/useImageProxy";
51
51
  import displayHelper from "../../../helper/displayHelper";
52
- import { defineComponent } from "vue";
53
- import { mapState } from "pinia";
54
- export default defineComponent({
55
- name: "EmissionItem",
52
+ import { nextTick, useTemplateRef, watch } from "vue";
53
+ import { useI18n } from "vue-i18n";
56
54
 
57
- props: {
58
- emission: { default: () => ({}), type: Object as () => Emission },
59
- isVertical: { default: false, type: Boolean },
60
- isDescription: { default: false, type: Boolean },
61
- },
62
- setup(){
63
- const { isPhone } = useResizePhone();
64
- const { useProxyImageUrl } = useImageProxy();
65
- return { isPhone, useProxyImageUrl }
66
- },
55
+ //Props
56
+ const props = defineProps({
57
+ emission: { default: () => ({}), type: Object as () => Emission },
58
+ isVertical: { default: false, type: Boolean },
59
+ isDescription: { default: false, type: Boolean },
60
+ })
67
61
 
62
+ //Data
63
+ const descriptionEmissionRef = useTemplateRef('descriptionEmission');
64
+ const descriptionEmissionContainerRef = useTemplateRef('descriptionEmissionContainer');
68
65
 
69
- data() {
70
- return {
71
- };
72
- },
73
- computed: {
74
- ...mapState(useFilterStore, ["filterOrgaId"]),
75
- },
76
- watch: {
77
- isPhone: {
78
- immediate: true,
79
- handler() {
80
- this.$nextTick(() => {
81
- if (!this.isDescription || this.isPhone) {
82
- return;
83
- }
84
- const emissionDesc = this.$refs.descriptionEmission as HTMLElement;
85
- const emissionDescContainer = this.$refs
86
- .descriptionEmissionContainer as HTMLElement;
87
- if (
88
- emissionDesc &&
89
- emissionDescContainer &&
90
- emissionDesc.clientHeight > emissionDescContainer.clientHeight
91
- ) {
92
- emissionDescContainer.classList.add("after-element-description");
93
- }
94
- });
95
- },
96
- },
97
- },
98
- methods:{
99
- urlify(text:string|undefined){
100
- return displayHelper.urlify(text);
101
- },
102
- }
103
- });
66
+
67
+ //Composables
68
+ const { t } = useI18n();
69
+ const { isPhone } = useResizePhone();
70
+ const { useProxyImageUrl } = useImageProxy();
71
+
72
+ //Watch
73
+ watch(isPhone, async () => {
74
+ nextTick(() => {
75
+ if (!props.isDescription || isPhone.value) {
76
+ return;
77
+ }
78
+ const emissionDesc = descriptionEmissionRef?.value as HTMLElement;
79
+ const emissionDescContainer = descriptionEmissionContainerRef?.value as HTMLElement;
80
+ if (
81
+ emissionDesc &&
82
+ emissionDescContainer &&
83
+ emissionDesc.clientHeight > emissionDescContainer.clientHeight
84
+ ) {
85
+ emissionDescContainer.classList.add("after-element-description");
86
+ }
87
+ });
88
+ }, {immediate: true});
89
+
90
+ //Methods
91
+ function urlify(text:string|undefined){
92
+ return displayHelper.urlify(text);
93
+ }
104
94
  </script>
105
95
  <style lang="scss">
106
96
  .octopus-app {
@@ -2,8 +2,8 @@
2
2
  <div class="d-flex flex-column p-3">
3
3
  <h2 class="mb-3">{{ title }}</h2>
4
4
  <ClassicLoading
5
- :loading-text="loading ? $t('Loading emissions ...') : undefined"
6
- :error-text="error ? $t(`Error`) : undefined"
5
+ :loading-text="loading ? t('Loading emissions ...') : undefined"
6
+ :error-text="error ? t(`Error`) : undefined"
7
7
  />
8
8
  <template v-if="!loading && !error">
9
9
  <div class="d-flex flex-nowrap align-items-stretch overflow-phone-auto">
@@ -57,79 +57,69 @@
57
57
  </div>
58
58
  </template>
59
59
 
60
- <script lang="ts">
60
+ <script setup lang="ts">
61
61
  import classicApi from "../../../api/classicApi";
62
62
  import {useErrorHandler} from "../../composable/useErrorHandler";
63
63
  import ClassicLoading from "../../form/ClassicLoading.vue";
64
64
  import { Emission } from "@/stores/class/general/emission";
65
- import { defineAsyncComponent, defineComponent } from "vue";
65
+ import { defineAsyncComponent, onMounted, Ref, ref } from "vue";
66
66
  import { AxiosError } from "axios";
67
67
  import {useResizePhone} from "../../composable/useResizePhone";
68
68
  import { ListClassicReturn } from "@/stores/class/general/listReturn";
69
+ import { useI18n } from "vue-i18n";
69
70
  const EmissionItemPresentation = defineAsyncComponent(
70
71
  () => import("./EmissionPresentationItem.vue"),
71
72
  );
72
- export default defineComponent({
73
- name: "EmissionPresentationList",
74
- components: {
75
- ClassicLoading,
76
- EmissionItemPresentation,
77
- },
78
73
 
79
- props: {
80
- organisationId: { default: undefined, type: String },
81
- title: { default: "", type: String },
82
- href: { default: undefined, type: String },
83
- buttonText: { default: undefined, type: String },
84
- isDescription: { default: false, type: Boolean },
85
- rubriquesId: { default: [], type: Array<number> },
86
- },
74
+ //Props
75
+ const props = defineProps({
76
+ organisationId: { default: undefined, type: String },
77
+ title: { default: "", type: String },
78
+ href: { default: undefined, type: String },
79
+ buttonText: { default: undefined, type: String },
80
+ isDescription: { default: false, type: Boolean },
81
+ rubriquesId: { default: [], type: Array<number> },
82
+ })
87
83
 
88
- setup(){
89
- const { isPhone } = useResizePhone();
90
- const {handle403} = useErrorHandler();
91
- return { isPhone, handle403 }
92
- },
84
+ //Data
85
+ const loading = ref(true);
86
+ const error = ref(false);
87
+ const allEmissions: Ref<Array<Emission>> = ref([]);
88
+
89
+ //Composables
90
+ const { t } = useI18n();
91
+ const { isPhone } = useResizePhone();
92
+ const {handle403} = useErrorHandler();
93
93
 
94
- data() {
95
- return {
96
- loading: true as boolean,
97
- error: false as boolean,
98
- allEmissions: [] as Array<Emission>,
99
- };
100
- },
94
+ onMounted(()=>fetchNext())
101
95
 
102
- mounted() {
103
- this.fetchNext();
104
- },
105
- methods: {
106
- async fetchNext(): Promise<void> {
107
- this.loading = true;
108
- try {
109
- const data = await classicApi.fetchData<ListClassicReturn<Emission>>({
110
- api: 0,
111
- path: "emission/search",
112
- parameters: {
113
- first: 0,
114
- size: 5,
115
- organisationId: this.organisationId,
116
- sort: "LAST_PODCAST_DESC",
117
- rubriqueId: this.rubriquesId
118
- },
119
- specialTreatement: true,
120
- });
121
- this.allEmissions = this.allEmissions.concat(
122
- data.result.filter((em: Emission | null) => null !== em),
123
- );
124
- this.loading = false;
125
- } catch (error) {
126
- this.handle403(error as AxiosError);
127
- this.error = true;
128
- }
129
- this.loading = false;
130
- },
131
- },
132
- });
96
+
97
+ //Methods
98
+ async function fetchNext(): Promise<void> {
99
+ loading.value = true;
100
+ try {
101
+ const data = await classicApi.fetchData<ListClassicReturn<Emission>>({
102
+ api: 0,
103
+ path: "emission/search",
104
+ parameters: {
105
+ first: 0,
106
+ size: 5,
107
+ organisationId: props.organisationId,
108
+ sort: "LAST_PODCAST_DESC",
109
+ rubriqueId: props.rubriquesId
110
+ },
111
+ specialTreatement: true,
112
+ });
113
+ allEmissions.value = allEmissions.value.concat(
114
+ data.result.filter((em: Emission | null) => null !== em),
115
+ );
116
+ loading.value = false;
117
+ } catch (errorWs) {
118
+ handle403(errorWs as AxiosError);
119
+ error.value = true;
120
+ }
121
+ loading.value = false;
122
+ }
133
123
  </script>
134
124
  <style lang="scss">
135
125
  .octopus-app {
@@ -4,7 +4,7 @@
4
4
  class="d-flex justify-content-center align-items-center mb-3 text-secondary btn-transparent"
5
5
  @click="clickShowFilters"
6
6
  >
7
- <div>{{ $t("Advanced filters") }}</div>
7
+ <div>{{ t("Advanced filters") }}</div>
8
8
  <ChevronDownIcon :class="{ 'arrow-transform': showFilters }" />
9
9
  </button>
10
10
  <Transition name="advanced-search">
@@ -15,10 +15,10 @@
15
15
  >
16
16
  <fieldset class="d-flex flex-column flex-grow-3">
17
17
  <legend class="text-primary mb-2">
18
- {{ $t("Filter") }}
18
+ {{ t("Filter") }}
19
19
  </legend>
20
20
  <MonetizableFilter
21
- v-if="!isPodcastmaker && !platformEducation"
21
+ v-if="!isPodcastmaker && !generalStore.platformEducation"
22
22
  :is-emission="isEmission"
23
23
  :monetisable="monetisable"
24
24
  @update:monetisable="updateMonetisable"
@@ -51,14 +51,14 @@
51
51
  v-if="isSelectValidity"
52
52
  :text-init="validity"
53
53
  id-select="valid-episodes-select"
54
- :label="$t('Episodes to validate')+' :'"
54
+ :label="t('Episodes to validate')+' :'"
55
55
  :display-label="true"
56
56
  class-label="flex-shrink-0 me-1"
57
57
  class="d-flex align-items-center mt-3 mb-0"
58
58
  :options="[
59
- { title: $t('Display only episodes to validate'), value: 'false' },
60
- { title: $t('Display episodes to validate'), value: '' },
61
- { title: $t('Do not display episodes to validate'), value: 'true' },
59
+ { title: t('Display only episodes to validate'), value: 'false' },
60
+ { title: t('Display episodes to validate'), value: '' },
61
+ { title: t('Do not display episodes to validate'), value: 'true' },
62
62
  ]"
63
63
  @update:text-init="updateValidity"
64
64
  />
@@ -67,7 +67,7 @@
67
67
  :text-init="onlyVideo"
68
68
  class="flex-shrink-0 mt-3"
69
69
  id-checkbox="only-video-checkbox"
70
- :label="$t('Show only episodes with video')"
70
+ :label="t('Show only episodes with video')"
71
71
  @update:text-init="updateOnlyVideo"
72
72
  />
73
73
  </fieldset>
@@ -81,16 +81,16 @@
81
81
  </div>
82
82
  </template>
83
83
 
84
- <script lang="ts">
84
+ <script setup lang="ts">
85
85
  import ChevronDownIcon from "vue-material-design-icons/ChevronDown.vue";
86
86
  import {useOrgaComputed} from "../../composable/useOrgaComputed";
87
87
  import { useAuthStore } from "../../../stores/AuthStore";
88
88
  import { useFilterStore } from "../../../stores/FilterStore";
89
89
  import { useRubriquesFilterParam } from "../../composable/route/useRubriquesFilterParam";
90
90
  import { RubriquageFilter } from "@/stores/class/rubrique/rubriquageFilter";
91
- import { defineComponent, defineAsyncComponent } from "vue";
92
- import { mapState } from "pinia";
91
+ import { defineAsyncComponent, ref, computed, watch } from "vue";
93
92
  import { useGeneralStore } from "../../../stores/GeneralStore";
93
+ import { useI18n } from "vue-i18n";
94
94
  const MonetizableFilter = defineAsyncComponent(
95
95
  () => import("./MonetizableFilter.vue"),
96
96
  );
@@ -108,175 +108,153 @@ const ClassicCheckbox = defineAsyncComponent(
108
108
  );
109
109
  const DateFilter = defineAsyncComponent(() => import("./DateFilter.vue"));
110
110
  const SearchOrder = defineAsyncComponent(() => import("./SearchOrder.vue"));
111
- export default defineComponent({
112
- components: {
113
- MonetizableFilter,
114
- CategorySearchFilter,
115
- RubriqueFilter,
116
- ClassicCheckbox,
117
- DateFilter,
118
- SearchOrder,
119
- ChevronDownIcon,
120
- ClassicSelect
121
- },
122
- props: {
123
- organisationId: { default: undefined, type: String },
124
- isEmission: { default: false, type: Boolean },
125
- includeHidden: { default: false, type: Boolean },
126
- sort: { default: "DATE", type: String },
127
- onlyVideo: { default: false, type: Boolean },
128
- monetisable: { default: "UNDEFINED", type: String },
129
- iabId: { default: undefined, type: Number },
130
- searchPattern: { default: "", type: String },
131
- fromDate: { default: undefined, type: String },
132
- toDate: { default: undefined, type: String },
133
- validity: { default: 'true', type: String },
134
- rubriqueFilter: {
135
- default: () => [],
136
- type: Array as () => Array<RubriquageFilter>,
137
- },
138
- },
139
111
 
140
- emits: [
141
- "update:toDate",
142
- "update:fromDate",
143
- "update:monetisable",
144
- "update:iabId",
145
- "update:sort",
146
- "update:includeHidden",
147
- "update:validity",
148
- "update:rubriqueFilter",
149
- "update:onlyVideo",
150
- ],
151
- setup(){
152
- const { isPodcastmaker, isEditRights } = useOrgaComputed();
153
- const { stringifyRubriquesFilter,updateRouteParamAdvanced } = useRubriquesFilterParam();
154
- return { isPodcastmaker, isEditRights, stringifyRubriquesFilter,updateRouteParamAdvanced }
155
- },
156
- data() {
157
- return {
158
- showFilters: false as boolean,
159
- firstLoaded: false as boolean,
160
- };
112
+ //Props
113
+ const props = defineProps({
114
+ organisationId: { default: undefined, type: String },
115
+ isEmission: { default: false, type: Boolean },
116
+ includeHidden: { default: false, type: Boolean },
117
+ sort: { default: "DATE", type: String },
118
+ onlyVideo: { default: false, type: Boolean },
119
+ monetisable: { default: "UNDEFINED", type: String },
120
+ iabId: { default: undefined, type: Number },
121
+ searchPattern: { default: "", type: String },
122
+ fromDate: { default: undefined, type: String },
123
+ toDate: { default: undefined, type: String },
124
+ validity: { default: 'true', type: String },
125
+ rubriqueFilter: {
126
+ default: () => [],
127
+ type: Array as () => Array<RubriquageFilter>,
161
128
  },
129
+ })
162
130
 
163
- computed: {
164
- ...mapState(useGeneralStore, ["platformEducation"]),
165
- ...mapState(useFilterStore, ["filterOrgaId","filterIab", "filterRubrique"]),
166
- ...mapState(useAuthStore, [
167
- "isRoleProduction",
168
- "isRoleContribution"
169
- ]),
170
- organisationRight(): boolean {
171
- return this.isEditRights(this.organisationId);
172
- },
173
- organisation(): string | undefined {
174
- return this.organisationId ?? this.filterOrgaId;
175
- },
176
- textNotVisible(): string {
177
- return this.isEmission
178
- ? this.$t("Consider podcasts no visible")
179
- : this.$t("See podcasts no visible");
180
- },
181
- isSelectValidity(): boolean {
182
- return (
183
- undefined !== this.organisation &&
184
- this.organisationRight &&
185
- this.isRoleContribution &&
186
- !this.isPodcastmaker &&
187
- !this.isEmission &&
188
- this.includeHidden
189
- );
190
- },
191
- },
192
- watch: {
193
- organisation(): void {
194
- const hidden =
195
- undefined !== this.organisation &&
196
- this.organisationRight &&
197
- !this.isEmission;
198
- if (hidden !== this.includeHidden) {
199
- this.updateIncludeHidden(hidden);
200
- }
201
- },
202
- searchPattern(value: string): void {
203
- const search = value.trim();
204
- let valSort = "SCORE"
205
- if(search.length <= 3){
206
- valSort = this.isEmission? "LAST_PODCAST_DESC" : "DATE";
207
- }
208
- if (valSort !== this.sort) {
209
- this.$emit("update:sort", valSort);
210
- }
211
- this.updateRouteParamAdvanced({
212
- q: search.length ? search : undefined,
213
- s: valSort,
214
- });
215
- },
216
- },
217
- methods: {
218
- updateMonetisable(value: string): void {
219
- this.$emit("update:monetisable", value);
220
- this.updateRouteParamAdvanced({ m: "UNDEFINED" !== value ? value : undefined });
221
- },
222
- updateIab(value: number | undefined) {
223
- this.$emit("update:iabId", 0 !== value ? value : undefined);
224
- let filterIab = {};
225
- if (this.filterIab && this.filterIab.id !== value) {
226
- filterIab = { iabId: undefined };
227
- }
228
- this.updateRouteParamAdvanced({
229
- ...{ i: value ? value.toString() : undefined },
230
- ...filterIab,
231
- });
232
- },
233
- updateSort(value: string) {
234
- this.$emit("update:sort", value);
235
- this.updateRouteParamAdvanced({ s: value });
236
- },
237
- updateIncludeHidden(value: boolean) {
238
- this.$emit("update:includeHidden", value);
239
- this.updateRouteParamAdvanced({ h: value.toString() });
240
- },
241
- updateValidity(value: boolean) {
242
- this.$emit("update:validity", value);
243
- this.updateRouteParamAdvanced({ vl: value.toString() });
244
- },
245
- updateOnlyVideo(value: boolean) {
246
- this.$emit("update:onlyVideo", value);
247
- this.updateRouteParamAdvanced({ v: value ? "true" : undefined });
248
- },
249
- updateDates(value: {
250
- from: string | undefined;
251
- to: string | undefined;
252
- }): void {
253
- this.$emit("update:fromDate", value.from);
254
- this.$emit("update:toDate", value.to);
255
- this.updateRouteParamAdvanced({ from: value.from, to: value.to });
256
- },
257
- updateRubriquageFilter(value: Array<RubriquageFilter>) {
258
- this.$emit("update:rubriqueFilter", value);
259
- let filterRubriques = {};
260
- const valueString = this.stringifyRubriquesFilter(value);
261
- if (
262
- this.filterRubrique.length &&
263
- this.stringifyRubriquesFilter(this.filterRubrique) !== valueString
264
- ) {
265
- filterRubriques = { rubriquesId: undefined };
266
- }
267
- this.updateRouteParamAdvanced({
268
- ...{ r: valueString.length ? valueString : undefined },
269
- ...filterRubriques,
270
- });
271
- },
272
- clickShowFilters(): void {
273
- if (!this.firstLoaded) {
274
- this.firstLoaded = true;
275
- }
276
- this.showFilters = !this.showFilters;
277
- },
278
- },
131
+ //Emits
132
+ const emit = defineEmits([
133
+ "update:toDate",
134
+ "update:fromDate",
135
+ "update:monetisable",
136
+ "update:iabId",
137
+ "update:sort",
138
+ "update:includeHidden",
139
+ "update:validity",
140
+ "update:rubriqueFilter",
141
+ "update:onlyVideo",
142
+ ]);
143
+
144
+ //Data
145
+ const showFilters = ref(false);
146
+ const firstLoaded = ref(false);
147
+
148
+
149
+ //Composables
150
+ const { t } = useI18n();
151
+ const { isPodcastmaker, isEditRights } = useOrgaComputed();
152
+ const { stringifyRubriquesFilter,updateRouteParamAdvanced } = useRubriquesFilterParam();
153
+ const generalStore = useGeneralStore();
154
+ const filterStore = useFilterStore();
155
+ const authStore = useAuthStore();
156
+
157
+
158
+ //Computed
159
+ const organisationRight = computed(() => isEditRights(props.organisationId));
160
+ const organisation = computed(() => props.organisationId ?? filterStore.filterOrgaId);
161
+ const textNotVisible = computed(() => props.isEmission ? t("Consider podcasts no visible"): t("See podcasts no visible"));
162
+ const isSelectValidity = computed(() => {
163
+ return (
164
+ undefined !== organisation.value &&
165
+ organisationRight.value &&
166
+ authStore.isRoleContribution &&
167
+ !isPodcastmaker &&
168
+ !props.isEmission &&
169
+ props.includeHidden
170
+ );
171
+ });
172
+
173
+
174
+ //Watch
175
+ watch(organisation, async () => {
176
+ const hidden =undefined !== organisation.value && organisationRight.value &&!props.isEmission;
177
+ if (hidden !== props.includeHidden) {
178
+ updateIncludeHidden(hidden);
179
+ }
180
+ });
181
+ watch(()=>props.searchPattern, (value: string) => {
182
+ const search = value.trim();
183
+ let valSort = "SCORE"
184
+ if(search.length <= 3){
185
+ valSort = props.isEmission? "LAST_PODCAST_DESC" : "DATE";
186
+ }
187
+ if (valSort !== props.sort) {
188
+ emit("update:sort", valSort);
189
+ }
190
+ updateRouteParamAdvanced({
191
+ q: search.length ? search : undefined,
192
+ s: valSort,
193
+ });
279
194
  });
195
+
196
+
197
+ //Methods
198
+ function updateMonetisable(value: string): void {
199
+ emit("update:monetisable", value);
200
+ updateRouteParamAdvanced({ m: "UNDEFINED" !== value ? value : undefined });
201
+ }
202
+ function updateIab(value: number | undefined) {
203
+ emit("update:iabId", 0 !== value ? value : undefined);
204
+ let filterIab = {};
205
+ if (filterStore.filterIab && filterStore.filterIab.id !== value) {
206
+ filterIab = { iabId: undefined };
207
+ }
208
+ updateRouteParamAdvanced({
209
+ ...{ i: value ? value.toString() : undefined },
210
+ ...filterIab,
211
+ });
212
+ }
213
+ function updateSort(value: string) {
214
+ emit("update:sort", value);
215
+ updateRouteParamAdvanced({ s: value });
216
+ }
217
+ function updateIncludeHidden(value: boolean) {
218
+ emit("update:includeHidden", value);
219
+ updateRouteParamAdvanced({ h: value.toString() });
220
+ }
221
+ function updateValidity(value: boolean) {
222
+ emit("update:validity", value);
223
+ updateRouteParamAdvanced({ vl: value.toString() });
224
+ }
225
+ function updateOnlyVideo(value: boolean) {
226
+ emit("update:onlyVideo", value);
227
+ updateRouteParamAdvanced({ v: value ? "true" : undefined });
228
+ }
229
+ function updateDates(value: {
230
+ from: string | undefined;
231
+ to: string | undefined;
232
+ }): void {
233
+ emit("update:fromDate", value.from);
234
+ emit("update:toDate", value.to);
235
+ updateRouteParamAdvanced({ from: value.from, to: value.to });
236
+ }
237
+ function updateRubriquageFilter(value: Array<RubriquageFilter>) {
238
+ emit("update:rubriqueFilter", value);
239
+ let filterRubriques = {};
240
+ const valueString = stringifyRubriquesFilter(value);
241
+ if (
242
+ filterStore.filterRubrique.length &&
243
+ stringifyRubriquesFilter(filterStore.filterRubrique) !== valueString
244
+ ) {
245
+ filterRubriques = { rubriquesId: undefined };
246
+ }
247
+ updateRouteParamAdvanced({
248
+ ...{ r: valueString.length ? valueString : undefined },
249
+ ...filterRubriques,
250
+ });
251
+ }
252
+ function clickShowFilters(): void {
253
+ if (!firstLoaded.value) {
254
+ firstLoaded.value = true;
255
+ }
256
+ showFilters.value = !showFilters.value;
257
+ }
280
258
  </script>
281
259
  <style lang="scss">
282
260
  .octopus-app {