@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
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ClassicModal
|
|
3
3
|
id-modal="edit-comment-modal"
|
|
4
|
-
:title-modal="
|
|
4
|
+
:title-modal="t('Edit comment')"
|
|
5
5
|
@close="closePopup"
|
|
6
6
|
>
|
|
7
7
|
<template #body>
|
|
8
8
|
<ClassicLoading
|
|
9
|
-
:loading-text="inProcessing ?
|
|
10
|
-
:error-text="errorUpdate ?
|
|
9
|
+
:loading-text="inProcessing ? t('Send in progress') : undefined"
|
|
10
|
+
:error-text="errorUpdate ? t(`An error occurred`) : undefined"
|
|
11
11
|
/>
|
|
12
12
|
<template v-if="!inProcessing && !errorUpdate">
|
|
13
13
|
<ClassicInputText
|
|
14
14
|
v-model:text-init="commentText"
|
|
15
15
|
v-model:error-variable="errorCommentText"
|
|
16
16
|
input-id="comment-textarea"
|
|
17
|
-
:label="
|
|
18
|
-
:max-length="
|
|
19
|
-
:error-text="
|
|
17
|
+
:label="t('Comment')"
|
|
18
|
+
:max-length="Constants.MAX_COMMENT"
|
|
19
|
+
:error-text="t('Please provide a comment')"
|
|
20
20
|
:is-textarea="true"
|
|
21
21
|
:is-emoji-picker="true"
|
|
22
22
|
popover-relative-class="octopus-modal"
|
|
@@ -26,36 +26,37 @@
|
|
|
26
26
|
v-if="editRight"
|
|
27
27
|
v-model:text-init="commentState"
|
|
28
28
|
id-select="comment-state-select"
|
|
29
|
-
:label="
|
|
29
|
+
:label="t('Status')"
|
|
30
30
|
:display-label="true"
|
|
31
31
|
:options="[
|
|
32
|
-
{ title:
|
|
33
|
-
{ title:
|
|
34
|
-
{ title:
|
|
32
|
+
{ title: t('pending'), value: 'PENDING' },
|
|
33
|
+
{ title: t('Validated'), value: 'VALIDATED' },
|
|
34
|
+
{ title: t('Invalid'), value: 'NOT_VALID' },
|
|
35
35
|
]"
|
|
36
36
|
/>
|
|
37
37
|
</template>
|
|
38
38
|
</template>
|
|
39
39
|
<template #footer>
|
|
40
40
|
<button class="btn m-1" @click="closePopup">
|
|
41
|
-
{{
|
|
41
|
+
{{ t("No") }}
|
|
42
42
|
</button>
|
|
43
43
|
<button
|
|
44
44
|
class="btn btn-primary m-1"
|
|
45
45
|
:disabled="errorCommentText"
|
|
46
46
|
@click="onEditComment"
|
|
47
47
|
>
|
|
48
|
-
{{
|
|
48
|
+
{{ t("Yes") }}
|
|
49
49
|
</button>
|
|
50
50
|
</template>
|
|
51
51
|
</ClassicModal>
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
|
-
<script lang="ts">
|
|
54
|
+
<script setup lang="ts">
|
|
55
55
|
import classicApi from "../../../../api/classicApi";
|
|
56
56
|
import Constants from "../../../../../public/config";
|
|
57
|
-
import { defineAsyncComponent,
|
|
57
|
+
import { defineAsyncComponent, onBeforeMount, Ref, ref } from "vue";
|
|
58
58
|
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
59
|
+
import { useI18n } from "vue-i18n";
|
|
59
60
|
const ClassicModal = defineAsyncComponent(
|
|
60
61
|
() => import("../../../misc/modal/ClassicModal.vue"),
|
|
61
62
|
);
|
|
@@ -68,72 +69,65 @@ const ClassicInputText = defineAsyncComponent(
|
|
|
68
69
|
const ClassicSelect = defineAsyncComponent(
|
|
69
70
|
() => import("../../../form/ClassicSelect.vue"),
|
|
70
71
|
);
|
|
71
|
-
export default defineComponent({
|
|
72
|
-
name: "EditCommentModal",
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
//Props
|
|
74
|
+
const props = defineProps({
|
|
75
|
+
comment: {
|
|
76
|
+
default: undefined,
|
|
77
|
+
type: Object as () => CommentPodcast,
|
|
79
78
|
},
|
|
79
|
+
editRight: { default: false, type: Boolean },
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
//Emits
|
|
83
|
+
const emit = defineEmits(["close", "update:comment"]);
|
|
80
84
|
|
|
81
|
-
props: {
|
|
82
|
-
comment: {
|
|
83
|
-
default: undefined,
|
|
84
|
-
type: Object as () => CommentPodcast,
|
|
85
|
-
},
|
|
86
|
-
editRight: { default: false, type: Boolean },
|
|
87
|
-
},
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
});
|
|
86
|
+
//Data
|
|
87
|
+
const commentText: Ref<string | undefined> = ref(undefined);
|
|
88
|
+
const errorCommentText = ref(true);
|
|
89
|
+
const commentState = ref("PENDING");
|
|
90
|
+
const errorUpdate = ref(false);
|
|
91
|
+
const inProcessing = ref(false);
|
|
92
|
+
|
|
93
|
+
//Composables
|
|
94
|
+
const { t } = useI18n();
|
|
95
|
+
|
|
96
|
+
onBeforeMount(()=>initComment())
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
//Methods
|
|
100
|
+
function initComment() {
|
|
101
|
+
if (!props.comment) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
commentText.value = props.comment.content;
|
|
105
|
+
commentState.value = props.comment.state;
|
|
106
|
+
}
|
|
107
|
+
async function onEditComment() {
|
|
108
|
+
if (!props.comment) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
inProcessing.value = true;
|
|
112
|
+
try {
|
|
113
|
+
const commentUpdated = await classicApi.putData({
|
|
114
|
+
api: 2,
|
|
115
|
+
path: "comment/",
|
|
116
|
+
dataToSend: {
|
|
117
|
+
commentId: props.comment.commentId,
|
|
118
|
+
content: commentText.value,
|
|
119
|
+
state: commentState.value,
|
|
120
|
+
},
|
|
121
|
+
isNotAuth: !props.editRight,
|
|
122
|
+
});
|
|
123
|
+
emit("update:comment", commentUpdated);
|
|
124
|
+
closePopup();
|
|
125
|
+
} catch {
|
|
126
|
+
errorUpdate.value = true;
|
|
127
|
+
}
|
|
128
|
+
inProcessing.value = false;
|
|
129
|
+
}
|
|
130
|
+
function closePopup() {
|
|
131
|
+
emit("close");
|
|
132
|
+
}
|
|
139
133
|
</script>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
v-else
|
|
13
13
|
:loading-text="
|
|
14
14
|
isInTreatment && !errorText && !successText
|
|
15
|
-
?
|
|
15
|
+
? t('Loading content ...')
|
|
16
16
|
: undefined
|
|
17
17
|
"
|
|
18
18
|
:error-text="errorText"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
<template #footer>
|
|
23
23
|
<button class="btn m-1" @click="closePopup">
|
|
24
|
-
{{
|
|
24
|
+
{{ t("Close") }}
|
|
25
25
|
</button>
|
|
26
26
|
<vue-recaptcha
|
|
27
27
|
v-if="!isVerify"
|
|
@@ -38,78 +38,73 @@
|
|
|
38
38
|
:disabled="disableValidate || isInTreatment"
|
|
39
39
|
@click="submit"
|
|
40
40
|
>
|
|
41
|
-
{{
|
|
41
|
+
{{ t("Yes") }}
|
|
42
42
|
</button>
|
|
43
43
|
</template>
|
|
44
44
|
</ClassicModal>
|
|
45
45
|
</template>
|
|
46
46
|
|
|
47
|
-
<script lang="ts">
|
|
47
|
+
<script setup lang="ts">
|
|
48
48
|
import { state } from "../../../../stores/ParamSdkStore";
|
|
49
49
|
import ClassicLoading from "../../../form/ClassicLoading.vue";
|
|
50
50
|
import ClassicModal from "../../../misc/modal/ClassicModal.vue";
|
|
51
51
|
import api from "@/api/initialize";
|
|
52
52
|
import { VueRecaptcha } from "vue-recaptcha";
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
name: "RecaptchaModal",
|
|
56
|
-
components: {
|
|
57
|
-
VueRecaptcha,
|
|
58
|
-
ClassicModal,
|
|
59
|
-
ClassicLoading,
|
|
60
|
-
},
|
|
61
|
-
props: {
|
|
62
|
-
idModal: { default: undefined, type: String },
|
|
63
|
-
titleModal: { default: undefined, type: String },
|
|
64
|
-
disableValidate: { default: false, type: Boolean },
|
|
65
|
-
errorText: { default: undefined, type: String },
|
|
66
|
-
successText: { default: undefined, type: String },
|
|
67
|
-
},
|
|
53
|
+
import { computed, ref, useTemplateRef } from "vue";
|
|
54
|
+
import { useI18n } from "vue-i18n";
|
|
68
55
|
|
|
69
|
-
|
|
56
|
+
//Props
|
|
57
|
+
defineProps({
|
|
58
|
+
idModal: { default: undefined, type: String },
|
|
59
|
+
titleModal: { default: undefined, type: String },
|
|
60
|
+
disableValidate: { default: false, type: Boolean },
|
|
61
|
+
errorText: { default: undefined, type: String },
|
|
62
|
+
successText: { default: undefined, type: String },
|
|
63
|
+
})
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async handleSuccess(token: string) {
|
|
91
|
-
this.isVerify = await api.checkToken(token);
|
|
92
|
-
this.sendAction();
|
|
93
|
-
},
|
|
94
|
-
handleError() {
|
|
95
|
-
this.isVerify = false;
|
|
96
|
-
this.sendError = true;
|
|
97
|
-
},
|
|
98
|
-
async submit(): Promise<void> {
|
|
99
|
-
this.isInTreatment = true;
|
|
100
|
-
if (!this.isVerify && !this.isCaptchaTest) {
|
|
101
|
-
return (
|
|
102
|
-
this.$refs.invisibleRecaptcha as InstanceType<typeof VueRecaptcha>
|
|
103
|
-
).execute();
|
|
104
|
-
}
|
|
105
|
-
this.sendAction();
|
|
106
|
-
},
|
|
107
|
-
closePopup(): void {
|
|
108
|
-
this.$emit("close");
|
|
109
|
-
},
|
|
110
|
-
sendAction(): void {
|
|
111
|
-
this.$emit("validate");
|
|
112
|
-
},
|
|
113
|
-
},
|
|
65
|
+
//Emits
|
|
66
|
+
const emit = defineEmits(["close", "validate"]);
|
|
67
|
+
|
|
68
|
+
//Data
|
|
69
|
+
const sendError = ref(false);
|
|
70
|
+
const isVerify = ref(false);
|
|
71
|
+
const isInTreatment = ref(false);
|
|
72
|
+
const captchRef = useTemplateRef('invisibleRecaptcha');
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
//Composables
|
|
76
|
+
const { t } = useI18n();
|
|
77
|
+
|
|
78
|
+
//Computed
|
|
79
|
+
const errorRecaptchaText = computed(() =>{
|
|
80
|
+
if (isCaptchaTest.value) {
|
|
81
|
+
return t("Recaptcha not active");
|
|
82
|
+
}
|
|
83
|
+
return sendError.value ? t("Recaptcha error") : "";
|
|
114
84
|
});
|
|
85
|
+
const isCaptchaTest = computed(() => state.generalParameters.isCaptchaTest as boolean);
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
//Methods
|
|
89
|
+
async function handleSuccess(token: string) {
|
|
90
|
+
isVerify.value = await api.checkToken(token);
|
|
91
|
+
sendAction();
|
|
92
|
+
}
|
|
93
|
+
function handleError() {
|
|
94
|
+
isVerify.value = false;
|
|
95
|
+
sendError.value = true;
|
|
96
|
+
}
|
|
97
|
+
async function submit(): Promise<void> {
|
|
98
|
+
isInTreatment.value = true;
|
|
99
|
+
if (!isVerify.value && !isCaptchaTest.value) {
|
|
100
|
+
(captchRef?.value as InstanceType<typeof VueRecaptcha>).execute();
|
|
101
|
+
}
|
|
102
|
+
sendAction();
|
|
103
|
+
}
|
|
104
|
+
function closePopup(): void {
|
|
105
|
+
emit("close");
|
|
106
|
+
}
|
|
107
|
+
function sendAction(): void {
|
|
108
|
+
emit("validate");
|
|
109
|
+
}
|
|
115
110
|
</script>
|
|
@@ -1,104 +1,97 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<RecaptchaModal
|
|
3
3
|
id-modal="report-abuse-modal"
|
|
4
|
-
:title-modal="
|
|
4
|
+
:title-modal="t('Report abuse')"
|
|
5
5
|
:disable-validate="errorName || abuseDescriptionError"
|
|
6
6
|
:error-text="errorSendAbuse"
|
|
7
7
|
:success-text="successText"
|
|
8
|
-
@close="
|
|
8
|
+
@close="emit('close')"
|
|
9
9
|
@validate="reportAbuse"
|
|
10
10
|
>
|
|
11
11
|
<template #form>
|
|
12
12
|
<ClassicInputText
|
|
13
|
-
v-if="!commentUser?.name"
|
|
13
|
+
v-if="!commentStore.commentUser?.name"
|
|
14
14
|
v-model:text-init="name"
|
|
15
15
|
v-model:error-variable="errorName"
|
|
16
16
|
input-id="comment-user-name"
|
|
17
|
-
:label="
|
|
18
|
-
:max-length="
|
|
19
|
-
:placeholder="
|
|
20
|
-
autocomplete="name"
|
|
17
|
+
:label="t('Let\'s get acquainted :')"
|
|
18
|
+
:max-length="Constants.MAX_COMMENT_NAME"
|
|
19
|
+
:placeholder="t('Your name')"
|
|
20
|
+
autocomplete-type="name"
|
|
21
21
|
/>
|
|
22
22
|
<ClassicInputText
|
|
23
23
|
v-model:text-init="abuseDescription"
|
|
24
24
|
v-model:error-variable="abuseDescriptionError"
|
|
25
25
|
:is-textarea="true"
|
|
26
26
|
input-id="abuse-description"
|
|
27
|
-
:label="
|
|
28
|
-
:max-length="
|
|
27
|
+
:label="t('Describe the reason for the report')"
|
|
28
|
+
:max-length="Constants.MAX_COMMENT"
|
|
29
29
|
:focus="true"
|
|
30
30
|
/>
|
|
31
31
|
</template>
|
|
32
32
|
</RecaptchaModal>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
|
-
<script lang="ts">
|
|
35
|
+
<script setup lang="ts">
|
|
36
36
|
import Constants from "../../../../../public/config";
|
|
37
37
|
import ClassicInputText from "../../../form/ClassicInputText.vue";
|
|
38
38
|
import RecaptchaModal from "./RecaptchaModal.vue";
|
|
39
|
-
import {
|
|
40
|
-
import { defineComponent } from "vue";
|
|
39
|
+
import { Ref, ref } from "vue";
|
|
41
40
|
import { useCommentStore } from "../../../../stores/CommentStore";
|
|
42
41
|
import classicApi from "../../../../api/classicApi";
|
|
43
42
|
import {
|
|
44
43
|
CommentAbuseInfo,
|
|
45
44
|
CommentPodcast,
|
|
46
45
|
} from "@/stores/class/general/comment";
|
|
47
|
-
|
|
48
|
-
name: "ReportAbuseModal",
|
|
49
|
-
components: {
|
|
50
|
-
RecaptchaModal,
|
|
51
|
-
ClassicInputText,
|
|
52
|
-
},
|
|
53
|
-
props: {
|
|
54
|
-
comment: { default: undefined, type: Object as () => CommentPodcast },
|
|
55
|
-
},
|
|
46
|
+
import { useI18n } from "vue-i18n";
|
|
56
47
|
|
|
57
|
-
emits: ["close", "update:comment"],
|
|
58
48
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
//Props
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
comment: { default: undefined, type: Object as () => CommentPodcast },
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
//Emits
|
|
55
|
+
const emit = defineEmits(["close", "update:comment"]);
|
|
56
|
+
|
|
57
|
+
//Data
|
|
58
|
+
const errorName = ref(false);
|
|
59
|
+
const name: Ref<string | undefined> = ref(undefined);
|
|
60
|
+
const abuseDescription: Ref<string | undefined> = ref(undefined);
|
|
61
|
+
const abuseDescriptionError = ref(true);
|
|
62
|
+
const errorSendAbuse: Ref<string | undefined> = ref(undefined);
|
|
63
|
+
const successText: Ref<string | undefined> = ref(undefined);
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
//Composables
|
|
67
|
+
const { t } = useI18n();
|
|
68
|
+
const commentStore = useCommentStore();
|
|
69
|
+
|
|
70
|
+
//Methods
|
|
71
|
+
async function reportAbuse(): Promise<void> {
|
|
72
|
+
if (!commentStore.commentUser?.name) {
|
|
73
|
+
commentStore.setCommentUser(name.value ?? "");
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const abuseObject = {
|
|
77
|
+
commentId: props.comment?.commentId,
|
|
78
|
+
description: abuseDescription.value,
|
|
79
|
+
uuid: commentStore.commentUser?.uuid,
|
|
69
80
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const commentAbuseInfo = await classicApi.postData<CommentAbuseInfo>({
|
|
87
|
-
api: 2,
|
|
88
|
-
path: "abuse/",
|
|
89
|
-
dataToSend: abuseObject,
|
|
90
|
-
});
|
|
91
|
-
this.$emit("update:comment", {
|
|
92
|
-
...this.comment,
|
|
93
|
-
...{ abuse: commentAbuseInfo.abuseCount },
|
|
94
|
-
});
|
|
95
|
-
this.successText = this.$t("Thank you for reporting abuse");
|
|
96
|
-
} catch {
|
|
97
|
-
this.errorSendAbuse = this.$t(
|
|
98
|
-
"Error occurs while post your comment...",
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
});
|
|
81
|
+
const commentAbuseInfo = await classicApi.postData<CommentAbuseInfo>({
|
|
82
|
+
api: 2,
|
|
83
|
+
path: "abuse/",
|
|
84
|
+
dataToSend: abuseObject,
|
|
85
|
+
});
|
|
86
|
+
emit("update:comment", {
|
|
87
|
+
...props.comment,
|
|
88
|
+
...{ abuse: commentAbuseInfo.abuseCount },
|
|
89
|
+
});
|
|
90
|
+
successText.value = t("Thank you for reporting abuse");
|
|
91
|
+
} catch {
|
|
92
|
+
errorSendAbuse.value = t(
|
|
93
|
+
"Error occurs while post your comment...",
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
104
97
|
</script>
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
<div />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script lang="ts">
|
|
5
|
+
<script setup lang="ts">
|
|
6
6
|
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
|
|
8
|
+
//Methods
|
|
9
|
+
function updateComment(comment: CommentPodcast): void {
|
|
10
|
+
console.log(comment);
|
|
11
|
+
}
|
|
12
|
+
//Expose
|
|
13
|
+
defineExpose({
|
|
14
|
+
updateComment
|
|
14
15
|
});
|
|
15
16
|
</script>
|