@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
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
class="d-flex align-items-center mb-2"
|
|
6
6
|
>
|
|
7
7
|
<div class="text-secondary me-3">
|
|
8
|
-
{{
|
|
8
|
+
{{ t("Number comments", { nb: totalCount }) }}
|
|
9
9
|
</div>
|
|
10
10
|
<button
|
|
11
11
|
id="sort-by-comments"
|
|
12
12
|
class="btn btn-transparent d-flex align-items-center"
|
|
13
13
|
>
|
|
14
14
|
<SortVariantIcon :size="30" />
|
|
15
|
-
<p class="ms-1">{{
|
|
15
|
+
<p class="ms-1">{{ t("Sort by") }}</p>
|
|
16
16
|
</button>
|
|
17
17
|
<ClassicPopover target="sort-by-comments" :only-click="true">
|
|
18
18
|
<button
|
|
19
19
|
v-for="sortOption in sortChoice"
|
|
20
|
-
:key="sortOption"
|
|
20
|
+
:key="sortOption.value"
|
|
21
21
|
class="me-3 octopus-dropdown-item"
|
|
22
22
|
:disabled="sortOption.value === sortType"
|
|
23
23
|
@mousedown="changeSort(sortOption.value)"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</ClassicPopover>
|
|
29
29
|
</div>
|
|
30
30
|
<div v-if="!loading && !error && 0 === totalCount" class="text-center">
|
|
31
|
-
{{
|
|
31
|
+
{{ t("No comments") }}
|
|
32
32
|
</div>
|
|
33
33
|
<div
|
|
34
34
|
ref="scrollComponent"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
>
|
|
37
37
|
<CommentItem
|
|
38
38
|
v-for="(c, indexCom) in comments"
|
|
39
|
-
:
|
|
39
|
+
:id="'comItem' + c.commentId"
|
|
40
40
|
:key="c.commentId"
|
|
41
41
|
v-model:comment="comments[indexCom]"
|
|
42
42
|
:podcast="podcast"
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
@delete-comment="deleteComment(c.commentId)"
|
|
47
47
|
/>
|
|
48
48
|
<ClassicLoading
|
|
49
|
-
:loading-text="loading ?
|
|
50
|
-
:error-text="error ?
|
|
49
|
+
:loading-text="loading ? t('Loading content ...') : undefined"
|
|
50
|
+
:error-text="error ? t(`Comments loading error`) : undefined"
|
|
51
51
|
/>
|
|
52
52
|
<button
|
|
53
53
|
v-if="!isNotAnAnswerList && dfirst + dsize < totalCount"
|
|
54
54
|
class="btn share-btn mx-2"
|
|
55
|
-
:title="
|
|
55
|
+
:title="t('See more')"
|
|
56
56
|
>
|
|
57
57
|
<PlusIcon />
|
|
58
58
|
</button>
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
</div>
|
|
61
61
|
</template>
|
|
62
62
|
|
|
63
|
-
<script lang="ts">
|
|
63
|
+
<script setup lang="ts">
|
|
64
64
|
import SortVariantIcon from "vue-material-design-icons/SortVariant.vue";
|
|
65
65
|
import PlusIcon from "vue-material-design-icons/Plus.vue";
|
|
66
66
|
import ClassicLoading from "../../form/ClassicLoading.vue";
|
|
67
67
|
import {useErrorHandler} from "../../composable/useErrorHandler";
|
|
68
68
|
import classicApi from "../../../api/classicApi";
|
|
69
|
-
import { defineAsyncComponent,
|
|
69
|
+
import { computed, defineAsyncComponent, onMounted, onUnmounted, Ref, ref, useTemplateRef, watch } from "vue";
|
|
70
70
|
import { AxiosError } from "axios";
|
|
71
71
|
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
72
72
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
@@ -75,201 +75,179 @@ import {
|
|
|
75
75
|
CommentsConfig,
|
|
76
76
|
} from "@/stores/class/config/commentsConfig";
|
|
77
77
|
import { ListClassicReturn } from "@/stores/class/general/listReturn";
|
|
78
|
+
import { useI18n } from "vue-i18n";
|
|
78
79
|
/* eslint-disable */
|
|
79
80
|
const CommentItem: any = defineAsyncComponent(() => import('./item/CommentItem.vue'));
|
|
80
81
|
/* eslint-enable */
|
|
81
82
|
const ClassicPopover = defineAsyncComponent(
|
|
82
83
|
() => import("../../misc/ClassicPopover.vue"),
|
|
83
84
|
);
|
|
84
|
-
export default defineComponent({
|
|
85
|
-
name: "CommentsList",
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
},
|
|
86
|
+
//Props
|
|
87
|
+
const props = defineProps({
|
|
88
|
+
size: { default: 10, type: Number },
|
|
89
|
+
podcast: { default: undefined, type: Object as () => Podcast },
|
|
90
|
+
reload: { default: false, type: Boolean },
|
|
91
|
+
answerToComment: { default: undefined, type: Number },
|
|
92
|
+
isFlatList: { default: false, type: Boolean },
|
|
93
|
+
stateFilter: { default: "", type: String },
|
|
94
|
+
organisationId: { default: undefined, type: String },
|
|
95
|
+
nbComments: { default: 0, type: Number },
|
|
96
|
+
config: { default: undefined, type: Object as () => CommentsConfig },
|
|
97
|
+
eventToHandle: { default: undefined, type: Object as () => CommentMessage },
|
|
98
|
+
})
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
podcast: { default: undefined, type: Object as () => Podcast },
|
|
98
|
-
reload: { default: false, type: Boolean },
|
|
99
|
-
answerToComment: { default: undefined, type: Number },
|
|
100
|
-
isFlatList: { default: false, type: Boolean },
|
|
101
|
-
stateFilter: { default: "", type: String },
|
|
102
|
-
organisationId: { default: undefined, type: String },
|
|
103
|
-
nbComments: { default: 0, type: Number },
|
|
104
|
-
config: { default: undefined, type: Object as () => CommentsConfig },
|
|
105
|
-
eventToHandle: { default: undefined, type: Object as () => CommentMessage },
|
|
106
|
-
},
|
|
107
|
-
emits: ["update:nbComments", "commentDeleted"],
|
|
100
|
+
//Emits
|
|
101
|
+
const emit = defineEmits(["update:nbComments", "commentDeleted"]);
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
//Data
|
|
104
|
+
const loading = ref(false);
|
|
105
|
+
const error = ref(false);
|
|
106
|
+
const dfirst = ref(0);
|
|
107
|
+
const dsize = ref(props.size);
|
|
108
|
+
const totalCount = ref(0);
|
|
109
|
+
const sortType = ref("DATE_DESC");
|
|
110
|
+
const comments: Ref<Array<CommentPodcast>> = ref([]);
|
|
111
|
+
const scrollableSection: Ref<HTMLElement | undefined> = ref(undefined);
|
|
112
|
+
const scrollComponentRef = useTemplateRef('scrollComponent');
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
error: false as boolean,
|
|
118
|
-
dfirst: 0 as number,
|
|
119
|
-
dsize: this.size,
|
|
120
|
-
totalCount: 0 as number,
|
|
121
|
-
comments: [] as Array<CommentPodcast>,
|
|
122
|
-
scrollableSection: undefined as HTMLElement | undefined,
|
|
123
|
-
sortType: "DATE_DESC" as string,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
114
|
+
//Composables
|
|
115
|
+
const { t } = useI18n();
|
|
116
|
+
const {handle403} = useErrorHandler();
|
|
126
117
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{ title: this.$t("The most recent"), value: "DATE_DESC" },
|
|
137
|
-
{ title: this.$t("Top comments"), value: "LIKE_DESC" },
|
|
138
|
-
];
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
watch: {
|
|
142
|
-
totalCount() {
|
|
143
|
-
this.$emit("update:nbComments", this.totalCount);
|
|
144
|
-
},
|
|
145
|
-
changed(): void {
|
|
146
|
-
this.fetchContent(true);
|
|
147
|
-
},
|
|
148
|
-
eventToHandle: {
|
|
149
|
-
deep: true,
|
|
150
|
-
handler() {
|
|
151
|
-
if (!this.eventToHandle) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (this.answerToComment === this.eventToHandle.comment.answerTo) {
|
|
155
|
-
switch (this.eventToHandle.type) {
|
|
156
|
-
case "CREATE":
|
|
157
|
-
this.createComment(this.eventToHandle.comment);
|
|
158
|
-
break;
|
|
159
|
-
case "UPDATE":
|
|
160
|
-
this.updateComment(this.eventToHandle.comment);
|
|
161
|
-
break;
|
|
162
|
-
case "DELETE":
|
|
163
|
-
this.deleteComment(this.eventToHandle.comment.commentId);
|
|
164
|
-
break;
|
|
165
|
-
default:
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
if (undefined !== this.eventToHandle.comment.answerTo) {
|
|
171
|
-
(
|
|
172
|
-
this.$refs["comItem" + this.eventToHandle.comment.answerTo] as
|
|
173
|
-
| Array<InstanceType<typeof CommentItem>>
|
|
174
|
-
| undefined
|
|
175
|
-
)?.[0]?.receiveEvent(this.eventToHandle);
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
},
|
|
118
|
+
//Computed
|
|
119
|
+
const changed = computed(() => `${props.size}|${props.reload}|${dsize.value}|${props.stateFilter}|${props.podcast?.podcastId}|${props.organisationId}`);
|
|
120
|
+
const isNotAnAnswerList = computed(() => undefined === props.answerToComment);
|
|
121
|
+
const sortChoice = computed(() =>{
|
|
122
|
+
return [
|
|
123
|
+
{ title: t("The most recent"), value: "DATE_DESC" },
|
|
124
|
+
{ title: t("Top comments"), value: "LIKE_DESC" },
|
|
125
|
+
];
|
|
126
|
+
});
|
|
180
127
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
128
|
+
//Watch
|
|
129
|
+
watch(totalCount, () => {emit("update:nbComments", totalCount.value)});
|
|
130
|
+
watch(changed, () => {fetchContent(true);});
|
|
131
|
+
watch(()=>props.eventToHandle, async () => {
|
|
132
|
+
if (!props.eventToHandle) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (props.answerToComment === props.eventToHandle.comment.answerTo) {
|
|
136
|
+
switch (props.eventToHandle.type) {
|
|
137
|
+
case "CREATE":
|
|
138
|
+
createComment(props.eventToHandle.comment);
|
|
139
|
+
break;
|
|
140
|
+
case "UPDATE":
|
|
141
|
+
updateComment(props.eventToHandle.comment);
|
|
142
|
+
break;
|
|
143
|
+
case "DELETE":
|
|
144
|
+
deleteComment(props.eventToHandle.comment.commentId);
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
break;
|
|
186
148
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (undefined !== props.eventToHandle.comment.answerTo) {
|
|
152
|
+
const comItem = scrollComponentRef?.value?.querySelector('#comItem' + props.eventToHandle.comment.answerTo) as InstanceType<typeof CommentItem>;
|
|
153
|
+
comItem?.receiveEvent(props.eventToHandle);
|
|
154
|
+
}
|
|
155
|
+
}, {deep: true});
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
onMounted(()=>{
|
|
159
|
+
fetchContent(true);
|
|
160
|
+
if (isNotAnAnswerList.value) {
|
|
161
|
+
scrollableSection.value = scrollComponentRef?.value as HTMLElement;
|
|
162
|
+
scrollableSection.value.addEventListener("scroll", handleScroll);
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
onUnmounted(()=>{
|
|
167
|
+
if (isNotAnAnswerList.value) {
|
|
168
|
+
scrollableSection.value?.removeEventListener("scroll", handleScroll);
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
//Methods
|
|
174
|
+
function changeSort(sortTypeUpdate: string) {
|
|
175
|
+
sortType.value = sortTypeUpdate;
|
|
176
|
+
fetchContent(true);
|
|
177
|
+
}
|
|
178
|
+
function handleScroll() {
|
|
179
|
+
if (
|
|
180
|
+
scrollableSection.value &&
|
|
181
|
+
totalCount.value > comments.value.length &&
|
|
182
|
+
scrollableSection.value.scrollTop +
|
|
183
|
+
scrollableSection.value.clientHeight >=
|
|
184
|
+
scrollableSection.value.scrollHeight
|
|
185
|
+
) {
|
|
186
|
+
fetchContent(false);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function findCommentInCommentsLoaded(commentId: number) {
|
|
190
|
+
return comments.value.findIndex(
|
|
191
|
+
(element: CommentPodcast) => element.commentId === commentId,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function createComment(comment: CommentPodcast) {
|
|
195
|
+
comments.value.unshift(comment);
|
|
196
|
+
totalCount.value += 1;
|
|
197
|
+
}
|
|
198
|
+
function updateComment(comment: CommentPodcast) {
|
|
199
|
+
const commentIndex = findCommentInCommentsLoaded(comment.commentId);
|
|
200
|
+
if (-1 !== commentIndex) {
|
|
201
|
+
comments.value.splice(commentIndex, 1, comment);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function deleteComment(commentIdToDelete: number) {
|
|
205
|
+
const commentIndex = findCommentInCommentsLoaded(commentIdToDelete);
|
|
206
|
+
if (-1 !== commentIndex) {
|
|
207
|
+
comments.value.splice(commentIndex, 1);
|
|
208
|
+
totalCount.value -= 1;
|
|
209
|
+
emit("commentDeleted", commentIdToDelete);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async function fetchContent(reset: boolean): Promise<void> {
|
|
213
|
+
if (loading.value) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
loading.value = true;
|
|
217
|
+
if (reset) {
|
|
218
|
+
dfirst.value = 0;
|
|
219
|
+
comments.value.length = 0;
|
|
220
|
+
}
|
|
221
|
+
const param = {
|
|
222
|
+
first: dfirst.value,
|
|
223
|
+
size: dsize.value,
|
|
224
|
+
podcastId: props.podcast?.podcastId,
|
|
225
|
+
sort: sortType.value,
|
|
226
|
+
answerTo: props.answerToComment,
|
|
227
|
+
hideAnswers: !props.isFlatList,
|
|
228
|
+
state: props.stateFilter.length ? props.stateFilter : undefined,
|
|
229
|
+
organisationId: props.organisationId,
|
|
230
|
+
};
|
|
231
|
+
try {
|
|
232
|
+
const data = await classicApi.fetchData<
|
|
233
|
+
ListClassicReturn<CommentPodcast>
|
|
234
|
+
>({
|
|
235
|
+
api: 2,
|
|
236
|
+
path: "comment/list",
|
|
237
|
+
parameters: param,
|
|
238
|
+
});
|
|
239
|
+
if (reset) {
|
|
240
|
+
comments.value.length = 0;
|
|
191
241
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
this.totalCount > this.comments.length &&
|
|
202
|
-
this.scrollableSection.scrollTop +
|
|
203
|
-
this.scrollableSection.clientHeight >=
|
|
204
|
-
this.scrollableSection.scrollHeight
|
|
205
|
-
) {
|
|
206
|
-
this.fetchContent(false);
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
findCommentInCommentsLoaded(commentId: number) {
|
|
210
|
-
return this.comments.findIndex(
|
|
211
|
-
(element: CommentPodcast) => element.commentId === commentId,
|
|
212
|
-
);
|
|
213
|
-
},
|
|
214
|
-
createComment(comment: CommentPodcast) {
|
|
215
|
-
this.comments.unshift(comment);
|
|
216
|
-
this.totalCount += 1;
|
|
217
|
-
},
|
|
218
|
-
updateComment(comment: CommentPodcast) {
|
|
219
|
-
const commentIndex = this.findCommentInCommentsLoaded(comment.commentId);
|
|
220
|
-
if (-1 !== commentIndex) {
|
|
221
|
-
this.comments.splice(commentIndex, 1, comment);
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
deleteComment(commentIdToDelete: number) {
|
|
225
|
-
const commentIndex = this.findCommentInCommentsLoaded(commentIdToDelete);
|
|
226
|
-
if (-1 !== commentIndex) {
|
|
227
|
-
this.comments.splice(commentIndex, 1);
|
|
228
|
-
this.totalCount -= 1;
|
|
229
|
-
this.$emit("commentDeleted", commentIdToDelete);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
async fetchContent(reset: boolean): Promise<void> {
|
|
233
|
-
if (this.loading) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
this.loading = true;
|
|
237
|
-
if (reset) {
|
|
238
|
-
this.dfirst = 0;
|
|
239
|
-
this.comments.length = 0;
|
|
240
|
-
}
|
|
241
|
-
const param = {
|
|
242
|
-
first: this.dfirst,
|
|
243
|
-
size: this.dsize,
|
|
244
|
-
podcastId: this.podcast?.podcastId,
|
|
245
|
-
sort: this.sortType,
|
|
246
|
-
answerTo: this.answerToComment,
|
|
247
|
-
hideAnswers: !this.isFlatList,
|
|
248
|
-
state: this.stateFilter.length ? this.stateFilter : undefined,
|
|
249
|
-
organisationId: this.organisationId,
|
|
250
|
-
};
|
|
251
|
-
try {
|
|
252
|
-
const data = await classicApi.fetchData<
|
|
253
|
-
ListClassicReturn<CommentPodcast>
|
|
254
|
-
>({
|
|
255
|
-
api: 2,
|
|
256
|
-
path: "comment/list",
|
|
257
|
-
parameters: param,
|
|
258
|
-
});
|
|
259
|
-
if (reset) {
|
|
260
|
-
this.comments.length = 0;
|
|
261
|
-
}
|
|
262
|
-
this.comments.push(...data.result);
|
|
263
|
-
this.totalCount = data.count;
|
|
264
|
-
this.dfirst += this.dsize;
|
|
265
|
-
this.loading = false;
|
|
266
|
-
} catch (error) {
|
|
267
|
-
this.handle403(error as AxiosError);
|
|
268
|
-
this.error = true;
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
});
|
|
242
|
+
comments.value.push(...data.result);
|
|
243
|
+
totalCount.value = data.count;
|
|
244
|
+
dfirst.value += dsize.value;
|
|
245
|
+
loading.value = false;
|
|
246
|
+
} catch (errorWs) {
|
|
247
|
+
handle403(errorWs as AxiosError);
|
|
248
|
+
error.value = true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
273
251
|
</script>
|
|
274
252
|
<style lang="scss">
|
|
275
253
|
.octopus-app {
|
|
@@ -7,74 +7,64 @@
|
|
|
7
7
|
class="h6 fw-bold"
|
|
8
8
|
:class="canEditName ? 'btn btn-transparent p-1' : ''"
|
|
9
9
|
@click="startEditingName"
|
|
10
|
-
>{{ commentUser
|
|
10
|
+
>{{ commentStore.commentUser?.name }}</component
|
|
11
11
|
>
|
|
12
12
|
<template v-else>
|
|
13
13
|
<ClassicInputText
|
|
14
14
|
v-model:text-init="temporaryName"
|
|
15
15
|
v-model:error-variable="errorName"
|
|
16
16
|
input-id="comment-name-input"
|
|
17
|
-
:label="
|
|
18
|
-
:max-length="
|
|
19
|
-
autocomplete="name"
|
|
17
|
+
:label="t('Your name')"
|
|
18
|
+
:max-length="Constants.MAX_COMMENT_NAME"
|
|
19
|
+
autocomplete-type="name"
|
|
20
20
|
class="me-3"
|
|
21
21
|
/>
|
|
22
22
|
<button class="btn m-1" @click="isEditing = false">
|
|
23
|
-
{{
|
|
23
|
+
{{ t("Cancel") }}
|
|
24
24
|
</button>
|
|
25
25
|
<button
|
|
26
26
|
class="btn btn-primary m-1"
|
|
27
27
|
:disabled="errorName"
|
|
28
28
|
@click="validEdit"
|
|
29
29
|
>
|
|
30
|
-
{{
|
|
30
|
+
{{ t("Yes") }}
|
|
31
31
|
</button>
|
|
32
32
|
</template>
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script lang="ts">
|
|
36
|
+
<script setup lang="ts">
|
|
37
37
|
import ClassicInputText from "../../form/ClassicInputText.vue";
|
|
38
38
|
import Constants from "../../../../public/config";
|
|
39
39
|
import { useAuthStore } from "../../../stores/AuthStore";
|
|
40
|
-
import {
|
|
41
|
-
import { defineComponent } from "vue";
|
|
40
|
+
import { computed, ref } from "vue";
|
|
42
41
|
import { useCommentStore } from "../../../stores/CommentStore";
|
|
43
|
-
|
|
44
|
-
name: "CommentName",
|
|
45
|
-
components:{
|
|
46
|
-
ClassicInputText
|
|
47
|
-
},
|
|
48
|
-
emits: [],
|
|
49
|
-
data() {
|
|
50
|
-
return {
|
|
51
|
-
isEditing: false as boolean,
|
|
52
|
-
temporaryName: "" as string,
|
|
53
|
-
errorName: true as boolean,
|
|
54
|
-
maxName: Constants.MAX_COMMENT_NAME as number,
|
|
55
|
-
};
|
|
56
|
-
},
|
|
42
|
+
import { useI18n } from "vue-i18n";
|
|
57
43
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
44
|
+
//Data
|
|
45
|
+
const isEditing = ref(false);
|
|
46
|
+
const temporaryName = ref("");
|
|
47
|
+
const errorName = ref(true);
|
|
48
|
+
|
|
49
|
+
//Composables
|
|
50
|
+
const { t } = useI18n();
|
|
51
|
+
const commentStore = useCommentStore();
|
|
52
|
+
const authStore = useAuthStore();
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
//Computed
|
|
56
|
+
const canEditName = computed(() => undefined !== authStore.authProfile);
|
|
57
|
+
|
|
58
|
+
//Methods
|
|
59
|
+
function startEditingName(): void {
|
|
60
|
+
if (!canEditName.value) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
temporaryName.value = commentStore.commentUser?.name ?? "";
|
|
64
|
+
isEditing.value = true;
|
|
65
|
+
}
|
|
66
|
+
function validEdit(): void {
|
|
67
|
+
commentStore.setCommentUser(temporaryName.value);
|
|
68
|
+
isEditing.value = false;
|
|
69
|
+
}
|
|
80
70
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="mt-2">
|
|
3
3
|
<ClassicLoading
|
|
4
|
-
:loading-text="loading ?
|
|
4
|
+
:loading-text="loading ? t('Loading content ...') : undefined"
|
|
5
5
|
/>
|
|
6
6
|
<CommentBasicView
|
|
7
7
|
v-if="!loading && comment"
|
|
@@ -11,44 +11,38 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script lang="ts">
|
|
14
|
+
<script setup lang="ts">
|
|
15
15
|
import classicApi from "../../../api/classicApi";
|
|
16
16
|
import CommentBasicView from "./item/CommentBasicView.vue";
|
|
17
17
|
import ClassicLoading from "../../form/ClassicLoading.vue";
|
|
18
18
|
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
name: "CommentParentInfo",
|
|
19
|
+
import { onBeforeMount, Ref, ref } from "vue";
|
|
20
|
+
import { useI18n } from "vue-i18n";
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
22
|
+
//Props
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
commentId: { default: undefined, type: Number },
|
|
25
|
+
editRight: { default: false, type: Boolean },
|
|
26
|
+
})
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
28
|
+
//Data
|
|
29
|
+
const loading = ref(true);
|
|
30
|
+
const comment: Ref<CommentPodcast | undefined> = ref(undefined);
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
this.loading = false;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
32
|
+
//Composables
|
|
33
|
+
const { t } = useI18n();
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
onBeforeMount(()=>fetchComment())
|
|
37
|
+
|
|
38
|
+
//Methods
|
|
39
|
+
async function fetchComment(): Promise<void> {
|
|
40
|
+
if (props.commentId) {
|
|
41
|
+
comment.value = await classicApi.fetchData<CommentPodcast>({
|
|
42
|
+
api: 2,
|
|
43
|
+
path: `comment/${props.commentId}`,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
loading.value = false;
|
|
47
|
+
}
|
|
54
48
|
</script>
|