@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.
- package/index.ts +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script lang="ts">
|
|
26
|
-
import { defineAsyncComponent,
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { computed, defineAsyncComponent, useTemplateRef } from "vue";
|
|
27
|
+
import { useI18n } from "vue-i18n";
|
|
27
28
|
const ThumbUpIcon = defineAsyncComponent(
|
|
28
29
|
() => import("vue-material-design-icons/ThumbUp.vue"),
|
|
29
30
|
);
|
|
@@ -39,46 +40,40 @@ const ThumbDownOutlineIcon = defineAsyncComponent(
|
|
|
39
40
|
const SnackBar = defineAsyncComponent(
|
|
40
41
|
() => import("../../../misc/SnackBar.vue"),
|
|
41
42
|
);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
titleButton(): string {
|
|
67
|
-
return this.like ? this.$t("Like") : this.$t("Dislike");
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
methods: {
|
|
71
|
-
clickButton() {
|
|
72
|
-
if (this.canInteract) {
|
|
73
|
-
this.$emit("like-action", this.actionName);
|
|
74
|
-
} else {
|
|
75
|
-
(this.$refs.snackbar as InstanceType<typeof SnackBar>).open(
|
|
76
|
-
this.$t("Log in to access this service"),
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
},
|
|
43
|
+
|
|
44
|
+
//Props
|
|
45
|
+
const props = defineProps({
|
|
46
|
+
like: { default: true, type: Boolean },
|
|
47
|
+
isActive: { default: false, type: Boolean },
|
|
48
|
+
canInteract: { default: false, type: Boolean },
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
//Emits
|
|
52
|
+
const emit = defineEmits(["like-action"]);
|
|
53
|
+
|
|
54
|
+
//Data
|
|
55
|
+
const snackBarRef = useTemplateRef('snackbar');
|
|
56
|
+
|
|
57
|
+
//Composables
|
|
58
|
+
const { t } = useI18n();
|
|
59
|
+
|
|
60
|
+
//Computed
|
|
61
|
+
const actionName = computed(() => {
|
|
62
|
+
if (props.like) {
|
|
63
|
+
return props.isActive ? "dislike" : "like";
|
|
64
|
+
}
|
|
65
|
+
return props.isActive ? "like" : "dislike";
|
|
81
66
|
});
|
|
67
|
+
const titleButton = computed(() => props.like ? t("Like") : t("Dislike"));
|
|
68
|
+
|
|
69
|
+
//Methods
|
|
70
|
+
function clickButton() {
|
|
71
|
+
if (props.canInteract) {
|
|
72
|
+
emit("like-action", actionName.value);
|
|
73
|
+
} else {
|
|
74
|
+
(snackBarRef?.value as InstanceType<typeof SnackBar>).open(t("Log in to access this service"));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
82
77
|
</script>
|
|
83
78
|
<style lang="scss">
|
|
84
79
|
@use "sass:color";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="d-flex align-items-center mt-1">
|
|
3
3
|
<CheckIdentityModal
|
|
4
4
|
v-if="isCheckIdentityActions"
|
|
5
|
-
:title="
|
|
5
|
+
:title="t('Welcome, thanks for your interaction')"
|
|
6
6
|
@validate="likeActions(isCheckIdentityActions)"
|
|
7
7
|
@close="isCheckIdentityActions = undefined"
|
|
8
8
|
/>
|
|
@@ -22,160 +22,152 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script lang="ts">
|
|
26
|
-
import {
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { defineAsyncComponent, Ref, ref, computed, onBeforeMount } from "vue";
|
|
27
27
|
import classicApi from "../../../../api/classicApi";
|
|
28
28
|
import { useCommentStore } from "../../../../stores/CommentStore";
|
|
29
29
|
import { useAuthStore } from "../../../../stores/AuthStore";
|
|
30
|
-
import { mapActions, mapState } from "pinia";
|
|
31
30
|
import {
|
|
32
31
|
CommentFeelings,
|
|
33
32
|
CommentPodcast,
|
|
34
33
|
} from "@/stores/class/general/comment";
|
|
35
34
|
import { CommentsConfig } from "@/stores/class/config/commentsConfig";
|
|
36
35
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
36
|
+
import { useI18n } from "vue-i18n";
|
|
37
37
|
const CheckIdentityModal = defineAsyncComponent(
|
|
38
38
|
() => import("../modal/CheckIdentityModal.vue"),
|
|
39
39
|
);
|
|
40
40
|
const LikeButton = defineAsyncComponent(() => import("./LikeButton.vue"));
|
|
41
|
-
export default defineComponent({
|
|
42
|
-
name: "LikeSection",
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
42
|
+
//Props
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
comment: { default: () => undefined, type: Object as () => CommentPodcast },
|
|
45
|
+
editRight: { default: false, type: Boolean },
|
|
46
|
+
podcast: { default: undefined, type: Object as () => Podcast },
|
|
47
|
+
})
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
editRight: { default: false, type: Boolean },
|
|
52
|
-
podcast: { default: undefined, type: Object as () => Podcast },
|
|
53
|
-
},
|
|
49
|
+
//Emits
|
|
50
|
+
const emit = defineEmits(["deleteComment", "update:comment"]);
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
//Data
|
|
53
|
+
const isCheckIdentityActions: Ref<string | undefined> = ref(undefined);
|
|
54
|
+
const userFeeling: Ref<string | undefined> = ref(undefined);
|
|
55
|
+
const config: Ref<CommentsConfig | undefined> = ref(undefined);
|
|
56
|
+
const podcastFeeling: Ref<CommentFeelings | undefined> = ref(undefined);
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
feelingSection() {
|
|
78
|
-
return [
|
|
79
|
-
{
|
|
80
|
-
name: "like",
|
|
81
|
-
counter: this.comment?.likes ?? this.podcastFeeling?.likesCount,
|
|
82
|
-
condition: this.configToApply?.likeEnabled ?? false,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "dislike",
|
|
86
|
-
counter: this.editRight
|
|
87
|
-
? (this.comment?.dislikes ?? this.podcastFeeling?.dislikesCount)
|
|
88
|
-
: 0,
|
|
89
|
-
condition: this.configToApply?.dislikeEnabled ?? false,
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
},
|
|
93
|
-
canLikeOrDislike(): boolean {
|
|
94
|
-
return (
|
|
95
|
-
!this.configToApply?.authRequired ||
|
|
96
|
-
(this.configToApply.authRequired && undefined !== this.authOrgaId)
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
created() {
|
|
101
|
-
this.initLikeConfig();
|
|
102
|
-
},
|
|
103
|
-
methods: {
|
|
104
|
-
...mapActions(useCommentStore, ["getCommentsConfig"]),
|
|
105
|
-
async initLikeConfig() {
|
|
106
|
-
if (!this.podcast) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
this.config = await this.getCommentsConfig(this.podcast);
|
|
110
|
-
if (
|
|
111
|
-
this.comment ||
|
|
112
|
-
(!this.config.podcastLikes.likeEnabled &&
|
|
113
|
-
!this.config.podcastLikes.dislikeEnabled)
|
|
114
|
-
) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
await this.fetchPodcastCounters();
|
|
118
|
-
},
|
|
119
|
-
async fetchPodcastCounters() {
|
|
120
|
-
const data = await classicApi.fetchData<{
|
|
121
|
-
[key: number]: CommentFeelings;
|
|
122
|
-
}>({
|
|
123
|
-
api: 2,
|
|
124
|
-
path: "podcast/status",
|
|
125
|
-
parameters: {
|
|
126
|
-
podcastId: [this.podcastId],
|
|
127
|
-
uuid: this.commentUser?.uuid,
|
|
128
|
-
},
|
|
129
|
-
isNotAuth: true,
|
|
130
|
-
});
|
|
131
|
-
this.podcastFeeling = data[this.podcastId];
|
|
132
|
-
if ("LIKED" === this.podcastFeeling.feeling) {
|
|
133
|
-
this.userFeeling = "like";
|
|
134
|
-
} else if ("DISLIKED" === this.podcastFeeling.feeling) {
|
|
135
|
-
this.userFeeling = "dislike";
|
|
136
|
-
}
|
|
58
|
+
|
|
59
|
+
//Composables
|
|
60
|
+
const { t } = useI18n();
|
|
61
|
+
const authStore = useAuthStore();
|
|
62
|
+
const commentStore = useCommentStore();
|
|
63
|
+
|
|
64
|
+
//Computed
|
|
65
|
+
const configToApply = computed(() => {
|
|
66
|
+
if (props.comment) {
|
|
67
|
+
return config.value?.commentLikes;
|
|
68
|
+
}
|
|
69
|
+
return config.value?.podcastLikes;
|
|
70
|
+
});
|
|
71
|
+
const podcastId = computed(() => props.podcast?.podcastId ?? 0);
|
|
72
|
+
const feelingSection = computed(() => {
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
name: "like",
|
|
76
|
+
counter: props.comment?.likes ?? podcastFeeling.value?.likesCount,
|
|
77
|
+
condition: configToApply.value?.likeEnabled ?? false,
|
|
137
78
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
79
|
+
{
|
|
80
|
+
name: "dislike",
|
|
81
|
+
counter: props.editRight
|
|
82
|
+
? (props.comment?.dislikes ?? podcastFeeling.value?.dislikesCount)
|
|
83
|
+
: 0,
|
|
84
|
+
condition: configToApply.value?.dislikeEnabled ?? false,
|
|
143
85
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
86
|
+
];
|
|
87
|
+
});
|
|
88
|
+
const canLikeOrDislike = computed(() => {
|
|
89
|
+
return (
|
|
90
|
+
!configToApply.value?.authRequired ||
|
|
91
|
+
(configToApply.value.authRequired && undefined !== authStore.authOrgaId)
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
onBeforeMount(()=>initLikeConfig())
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
//Methods
|
|
99
|
+
async function initLikeConfig() {
|
|
100
|
+
if (!props.podcast) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
config.value = await commentStore.getCommentsConfig(props.podcast);
|
|
104
|
+
if (
|
|
105
|
+
props.comment ||
|
|
106
|
+
(!config.value.podcastLikes.likeEnabled &&
|
|
107
|
+
!config.value.podcastLikes.dislikeEnabled)
|
|
108
|
+
) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
await fetchPodcastCounters();
|
|
112
|
+
}
|
|
113
|
+
async function fetchPodcastCounters() {
|
|
114
|
+
const data = await classicApi.fetchData<{
|
|
115
|
+
[key: number]: CommentFeelings;
|
|
116
|
+
}>({
|
|
117
|
+
api: 2,
|
|
118
|
+
path: "podcast/status",
|
|
119
|
+
parameters: {
|
|
120
|
+
podcastId: [podcastId.value],
|
|
121
|
+
uuid: commentStore.commentUser?.uuid,
|
|
150
122
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
123
|
+
isNotAuth: true,
|
|
124
|
+
});
|
|
125
|
+
podcastFeeling.value = data[podcastId.value];
|
|
126
|
+
if ("LIKED" === podcastFeeling.value.feeling) {
|
|
127
|
+
userFeeling.value = "like";
|
|
128
|
+
} else if ("DISLIKED" === podcastFeeling.value.feeling) {
|
|
129
|
+
userFeeling.value = "dislike";
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function transformInThousands(nb: number) {
|
|
133
|
+
if (nb >= 1000) {
|
|
134
|
+
return Math.round(nb / 100) / 10 + "k";
|
|
135
|
+
}
|
|
136
|
+
return nb.toString();
|
|
137
|
+
}
|
|
138
|
+
async function initiateLikeActions(actionName: string) {
|
|
139
|
+
if (!commentStore.commentUser?.name) {
|
|
140
|
+
isCheckIdentityActions.value = actionName;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
likeActions(actionName);
|
|
144
|
+
}
|
|
145
|
+
async function likeActions(actionName: string) {
|
|
146
|
+
const prefix = props.comment ? "comment/" : "podcast/";
|
|
147
|
+
const data = await classicApi.putData<{
|
|
148
|
+
[key: number]: CommentFeelings;
|
|
149
|
+
}>({
|
|
150
|
+
api: 2,
|
|
151
|
+
path: prefix + actionName,
|
|
152
|
+
dataToSend: {
|
|
153
|
+
ids: [props.comment?.commentId ?? podcastId.value],
|
|
154
|
+
name: commentStore.commentUser?.name,
|
|
155
|
+
uuid: commentStore.commentUser?.uuid,
|
|
178
156
|
},
|
|
179
|
-
|
|
180
|
-
});
|
|
157
|
+
isNotAuth: true,
|
|
158
|
+
});
|
|
159
|
+
if (props.comment) {
|
|
160
|
+
emit("update:comment", {
|
|
161
|
+
...props.comment,
|
|
162
|
+
...{
|
|
163
|
+
likes: data[props.comment.commentId].likesCount,
|
|
164
|
+
dislikes: data[props.comment.commentId].dislikesCount,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
podcastFeeling.value = data[podcastId.value];
|
|
169
|
+
}
|
|
170
|
+
userFeeling.value = userFeeling.value ? undefined : actionName;
|
|
171
|
+
isCheckIdentityActions.value = undefined;
|
|
172
|
+
}
|
|
181
173
|
</script>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
id-modal="check-identity-modal"
|
|
4
4
|
:title-modal="titleModal"
|
|
5
5
|
:disable-validate="errorName"
|
|
6
|
-
@close="
|
|
6
|
+
@close="emit('close')"
|
|
7
7
|
@validate="updateName"
|
|
8
8
|
>
|
|
9
9
|
<template #form>
|
|
@@ -11,52 +11,47 @@
|
|
|
11
11
|
v-model:text-init="name"
|
|
12
12
|
v-model:error-variable="errorName"
|
|
13
13
|
input-id="adserver-tag"
|
|
14
|
-
:label="
|
|
15
|
-
:max-length="
|
|
16
|
-
:placeholder="
|
|
17
|
-
autocomplete="name"
|
|
14
|
+
:label="t('Let\'s get acquainted :')"
|
|
15
|
+
:max-length="Constants.MAX_COMMENT_NAME"
|
|
16
|
+
:placeholder="t('Your name')"
|
|
17
|
+
autocomplete-type="name"
|
|
18
18
|
/>
|
|
19
19
|
</template>
|
|
20
20
|
</RecaptchaModal>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script lang="ts">
|
|
23
|
+
<script setup lang="ts">
|
|
24
24
|
import Constants from "../../../../../public/config";
|
|
25
25
|
import ClassicInputText from "../../../form/ClassicInputText.vue";
|
|
26
26
|
import RecaptchaModal from "./RecaptchaModal.vue";
|
|
27
|
-
import {
|
|
28
|
-
import { defineComponent } from "vue";
|
|
27
|
+
import { computed, Ref, ref } from "vue";
|
|
29
28
|
import { useCommentStore } from "../../../../stores/CommentStore";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.$emit("validate");
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
});
|
|
29
|
+
import { useI18n } from "vue-i18n";
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
//Props
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
title: { default: undefined, type: String },
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
//Emits
|
|
38
|
+
const emit = defineEmits(["close", "validate"]);
|
|
39
|
+
|
|
40
|
+
//Data
|
|
41
|
+
const errorName = ref(true);
|
|
42
|
+
const name: Ref<string | undefined> = ref(undefined);
|
|
43
|
+
|
|
44
|
+
//Composables
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
const commentStore = useCommentStore();
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
//Computed
|
|
50
|
+
const titleModal = computed(() => props.title ?? t("Welcome, thanks for your comment"));
|
|
51
|
+
|
|
52
|
+
//Methods
|
|
53
|
+
function updateName(): void {
|
|
54
|
+
commentStore.setCommentUser(name.value ?? "");
|
|
55
|
+
emit("validate");
|
|
56
|
+
}
|
|
62
57
|
</script>
|