@saooti/octopus-sdk 39.1.1-beta → 39.1.2-SNAPSHOT

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/index.ts +30 -4
  2. package/package.json +4 -2
  3. package/src/App.vue +2 -3
  4. package/src/assets/general.scss +4 -1
  5. package/src/assets/videoPlayer.scss +16 -0
  6. package/src/components/display/categories/CategoryChooser.vue +1 -1
  7. package/src/components/display/categories/CategoryFilter.vue +1 -1
  8. package/src/components/display/categories/CategoryList.vue +2 -2
  9. package/src/components/display/comments/CommentInput.vue +3 -3
  10. package/src/components/display/comments/CommentList.vue +56 -9
  11. package/src/components/display/comments/CommentName.vue +1 -1
  12. package/src/components/display/comments/CommentPlayer.vue +2 -2
  13. package/src/components/display/comments/CommentSection.vue +5 -6
  14. package/src/components/display/comments/item/CommentBasicView.vue +19 -6
  15. package/src/components/display/comments/item/CommentItem.vue +26 -92
  16. package/src/components/display/comments/item/CommentMoreActions.vue +25 -7
  17. package/src/components/display/comments/{button/CommentLikeButton.vue → like/LikeButton.vue} +32 -13
  18. package/src/components/display/comments/like/LikeSection.vue +173 -0
  19. package/src/components/display/comments/modal/CheckIdentityModal.vue +1 -1
  20. package/src/components/display/comments/modal/EditCommentModal.vue +1 -2
  21. package/src/components/display/comments/modal/ReportAbuseModal.vue +28 -5
  22. package/src/components/display/emission/EmissionInlineList.vue +4 -5
  23. package/src/components/display/emission/EmissionItem.vue +4 -5
  24. package/src/components/display/emission/EmissionList.vue +5 -6
  25. package/src/components/display/emission/EmissionPlayerItem.vue +6 -7
  26. package/src/components/display/emission/EmissionPresentationItem.vue +69 -0
  27. package/src/components/display/emission/EmissionPresentationList.vue +160 -0
  28. package/src/components/display/filter/CategorySearchFilter.vue +1 -1
  29. package/src/components/display/filter/ProductorSearch.vue +1 -1
  30. package/src/components/display/filter/RubriqueFilter.vue +1 -1
  31. package/src/components/display/list/ListPaginate.vue +1 -1
  32. package/src/components/display/live/CountDown.vue +8 -47
  33. package/src/components/display/live/CountdownOctopus.vue +210 -0
  34. package/src/components/display/live/LiveHorizontalList.vue +4 -5
  35. package/src/components/display/live/LiveList.vue +2 -2
  36. package/src/components/display/live/RadioCurrently.vue +2 -2
  37. package/src/components/display/live/RadioImage.vue +2 -2
  38. package/src/components/display/live/RadioItem.vue +1 -1
  39. package/src/components/display/live/RadioList.vue +1 -1
  40. package/src/components/display/live/RadioPlanning.vue +1 -1
  41. package/src/components/display/organisation/OrganisationChooser.vue +5 -6
  42. package/src/components/display/organisation/OrganisationChooserLight.vue +1 -1
  43. package/src/components/display/participant/ParticipantItem.vue +4 -5
  44. package/src/components/display/participant/ParticipantList.vue +5 -6
  45. package/src/components/display/playlist/PlaylistItem.vue +1 -1
  46. package/src/components/display/playlist/PlaylistList.vue +5 -6
  47. package/src/components/display/podcasts/AnimatorsItem.vue +1 -1
  48. package/src/components/display/podcasts/ParticipantDescription.vue +1 -1
  49. package/src/components/display/podcasts/PodcastInlineListClassic.vue +5 -6
  50. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +1 -1
  51. package/src/components/display/podcasts/PodcastItem.vue +1 -1
  52. package/src/components/display/podcasts/PodcastList.vue +5 -6
  53. package/src/components/display/podcasts/PodcastModuleBox.vue +33 -72
  54. package/src/components/display/podcasts/PodcastPlayBar.vue +1 -1
  55. package/src/components/display/podcasts/PodcastPlayButton.vue +5 -1
  56. package/src/components/display/podcasts/PodcastRawTranscript.vue +160 -0
  57. package/src/components/display/podcasts/PodcastSwiperList.vue +5 -6
  58. package/src/components/display/podcasts/VideoModuleBox.vue +57 -0
  59. package/src/components/display/rubriques/RubriqueList.vue +1 -1
  60. package/src/components/display/sharing/QrCode.vue +1 -1
  61. package/src/components/display/sharing/ShareButtons.vue +1 -1
  62. package/src/components/display/sharing/ShareDistribution.vue +5 -5
  63. package/src/components/display/sharing/SharePlayer.vue +1 -1
  64. package/src/components/display/sharing/SharePlayerRadio.vue +1 -1
  65. package/src/components/display/sharing/SubscribeButtons.vue +6 -6
  66. package/src/components/form/ClassicCheckbox.vue +7 -8
  67. package/src/components/form/ClassicInputText.vue +10 -1
  68. package/src/components/form/ClassicSelect.vue +4 -6
  69. package/src/components/form/ClassicWysiwyg.vue +20 -0
  70. package/src/components/misc/ClassicNav.vue +7 -1
  71. package/src/components/misc/ClassicPopover.vue +3 -0
  72. package/src/components/misc/FooterSection.vue +2 -2
  73. package/src/components/misc/MobileMenu.vue +1 -1
  74. package/src/components/misc/ProgressBar.vue +1 -1
  75. package/src/components/misc/TopBar.vue +1 -1
  76. package/src/components/misc/TopBarMainContent.vue +1 -1
  77. package/src/components/misc/modal/NewsletterModal.vue +1 -1
  78. package/src/components/misc/player/PlayerCompact.vue +6 -6
  79. package/src/components/misc/player/PlayerComponent.vue +7 -4
  80. package/src/components/misc/player/PlayerLarge.vue +1 -2
  81. package/src/components/misc/player/ads/AdsProgressBar.vue +1 -1
  82. package/src/components/misc/player/ads/AdsSkipButton.vue +1 -1
  83. package/src/components/misc/player/chaptering/ChapteringModal.vue +1 -1
  84. package/src/components/misc/player/chaptering/PlayerChaptering.vue +1 -1
  85. package/src/components/misc/player/elements/PlayerImage.vue +9 -3
  86. package/src/components/misc/player/elements/PlayerPlayButton.vue +5 -3
  87. package/src/components/misc/player/elements/PlayerSpeedButton.vue +66 -0
  88. package/src/components/misc/player/elements/PlayerTitle.vue +14 -16
  89. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +2 -2
  90. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +1 -1
  91. package/src/components/misc/player/radio/RadioHistory.vue +1 -1
  92. package/src/components/misc/player/radio/RadioProgressBar.vue +1 -1
  93. package/src/components/misc/player/video/PlayerVideo.vue +6 -3
  94. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +14 -26
  95. package/src/components/misc/player/video/PlayerVideoHls.vue +8 -2
  96. package/src/components/mixins/debounce.ts +1 -1
  97. package/src/components/mixins/handle403.ts +2 -6
  98. package/src/components/mixins/init.ts +1 -1
  99. package/src/components/mixins/orgaComputed.ts +1 -1
  100. package/src/components/mixins/organisationFilter.ts +2 -2
  101. package/src/components/mixins/player/playerDisplayTime.ts +2 -2
  102. package/src/components/mixins/player/playerLive.ts +1 -1
  103. package/src/components/mixins/player/playerLogic.ts +3 -4
  104. package/src/components/mixins/player/playerLogicProgress.ts +1 -1
  105. package/src/components/mixins/player/playerStitching.ts +3 -3
  106. package/src/components/mixins/player/playerTranscript.ts +2 -2
  107. package/src/components/mixins/player/playerVast.ts +2 -2
  108. package/src/components/mixins/podcast/countdown.ts +45 -0
  109. package/src/components/mixins/podcast/podcastView.ts +53 -0
  110. package/src/components/mixins/resizePhone.ts +1 -1
  111. package/src/components/pages/CategoryPage.vue +2 -2
  112. package/src/components/pages/EmissionPage.vue +1 -1
  113. package/src/components/pages/EmissionsPage.vue +1 -1
  114. package/src/components/pages/Error403Page.vue +1 -1
  115. package/src/components/pages/HomePage.vue +2 -2
  116. package/src/components/pages/LivesPage.vue +1 -1
  117. package/src/components/pages/PageNotFound.vue +2 -2
  118. package/src/components/pages/PlaylistPage.vue +1 -1
  119. package/src/components/pages/PodcastPage.vue +9 -2
  120. package/src/components/pages/PodcastsPage.vue +1 -1
  121. package/src/components/pages/RadioPage.vue +1 -1
  122. package/src/components/pages/VideoPage.vue +331 -0
  123. package/src/helper/dom.ts +5 -0
  124. package/src/helper/duration.ts +18 -5
  125. package/src/locale/de.ts +13 -0
  126. package/src/locale/en.ts +13 -0
  127. package/src/locale/es.ts +13 -0
  128. package/src/locale/fr.ts +13 -0
  129. package/src/locale/it.ts +13 -0
  130. package/src/locale/sl.ts +13 -0
  131. package/src/router/router.ts +10 -0
  132. package/src/stores/CommentStore.ts +123 -52
  133. package/src/stores/GeneralStore.ts +5 -3
  134. package/src/stores/ParamSdkStore.ts +22 -22
  135. package/src/stores/PlayerStore.ts +48 -35
  136. package/src/stores/SaveFetchStore.ts +56 -39
  137. package/src/stores/VastStore.ts +45 -38
  138. package/src/stores/class/general/comment.ts +27 -0
  139. package/src/stores/class/general/listReturn.ts +7 -0
  140. package/src/websocket/commentWebsocket.ts +1 -1
  141. package/src/stores/ApiStore.ts +0 -68
  142. /package/src/components/display/comments/{button → like}/ThumbIcon.vue +0 -0
package/index.ts CHANGED
@@ -14,6 +14,7 @@ export const getCategory = () => import("./src/components/pages/CategoryPage.vue
14
14
  export const getRubrique = () => import("./src/components/pages/RubriquePage.vue");
15
15
  export const getError403Page = () => import("./src/components/pages/Error403Page.vue");
16
16
  export const getRadio = () => import("./src/components/pages/RadioPage.vue");
17
+ export const getVideo = () => import("./src/components/pages/VideoPage.vue");
17
18
 
18
19
  //Misc
19
20
  export const getAccordion = () => import("./src/components/misc/ClassicAccordion.vue");
@@ -33,6 +34,7 @@ export const getClassicModal = () => import("./src/components/misc/modal/Classic
33
34
  export const getClassicLazy = () => import("./src/components/misc/ClassicLazy.vue");
34
35
 
35
36
 
37
+
36
38
  //Display
37
39
  export const getCategoryChooser = () => import("./src/components/display/categories/CategoryChooser.vue");
38
40
  export const getCategoryList = () => import("./src/components/display/categories/CategoryList.vue");
@@ -49,6 +51,9 @@ export const getCommentList = () => import("./src/components/display/comments/Co
49
51
  export const getCommentInput = () => import("./src/components/display/comments/CommentInput.vue");
50
52
  export const getPodcastPlaylistInlineList = () => import("./src/components/display/playlist/PodcastPlaylistInlineList.vue");
51
53
  export const getLiveList = () => import("./src/components/display/live/LiveList.vue");
54
+ export const getEmissionPresentationList = () => import("./src/components/display/emission/EmissionPresentationList.vue");
55
+ export const getPodcastPlayButton = () => import("./src/components/display/podcasts/PodcastPlayButton.vue");
56
+
52
57
 
53
58
 
54
59
  //Radio
@@ -87,10 +92,23 @@ import orgaFilter from "./src/components/mixins/organisationFilter.ts";
87
92
  import initSDK from "./src/components/mixins/init.ts";
88
93
  import tagOfMixins from "./src/components/mixins/tagOfMixins.ts";
89
94
  import resizePhone from "./src/components/mixins/resizePhone.ts";
90
- import commentWebsocket from "./src/websocket/commentWebsocket.ts";
95
+ import debounce from "./src/components/mixins/debounce.ts";
96
+
97
+
98
+ //helper
99
+ import domHelper from "./src/helper/dom.ts";
100
+ import durationHelper from "./src/helper/duration.ts";
101
+ import stringHelper from "./src/helper/string.ts";
102
+
91
103
 
104
+ //stores
105
+ import {useVastStore} from "./src/stores/VastStore.ts";
106
+ import {useSaveFetchStore} from "./src/stores/SaveFetchStore.ts";
107
+ import {usePlayerStore} from "./src/stores/PlayerStore.ts";
108
+ import {useGeneralStore} from "./src/stores/GeneralStore.ts";
109
+ import {useFilterStore} from "./src/stores/FilterStore.ts";
110
+ import {useCommentStore} from "./src/stores/CommentStore.ts";
92
111
 
93
- import TopBar from "./src/components/misc/TopBar.vue";
94
112
 
95
113
  export {
96
114
  selenium,
@@ -101,6 +119,14 @@ export {
101
119
  initSDK,
102
120
  tagOfMixins,
103
121
  resizePhone,
104
- commentWebsocket,
105
- TopBar
122
+ debounce,
123
+ useVastStore,
124
+ useSaveFetchStore,
125
+ usePlayerStore,
126
+ useGeneralStore,
127
+ useFilterStore,
128
+ useCommentStore,
129
+ domHelper,
130
+ durationHelper,
131
+ stringHelper
106
132
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "39.1.1-beta",
3
+ "version": "39.1.2-SNAPSHOT",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -14,9 +14,11 @@
14
14
  "test": "jest --coverage"
15
15
  },
16
16
  "dependencies": {
17
+ "@multiformats/murmur3": "^2.1.8",
17
18
  "@popperjs/core": "^2.11.8",
18
19
  "@saooti/octopus-api": "^0.39.2",
19
20
  "@stomp/stompjs": "^7.0.0",
21
+ "@tiptap/extension-hard-break": "^2.8.0",
20
22
  "@tiptap/extension-link": "^2.4.0",
21
23
  "@tiptap/extension-underline": "^2.4.0",
22
24
  "@tiptap/pm": "^2.4.0",
@@ -54,8 +56,8 @@
54
56
  "vue3-swatches": "^1.2.4"
55
57
  },
56
58
  "devDependencies": {
57
- "@types/vue-select": "^3.16.8",
58
59
  "@types/sockjs-client": "^1.5.4",
60
+ "@types/vue-select": "^3.16.8",
59
61
  "@typescript-eslint/eslint-plugin": "^7.14.1",
60
62
  "@typescript-eslint/parser": "^7.14.1",
61
63
  "@vitejs/plugin-vue": "^5.0.5",
package/src/App.vue CHANGED
@@ -12,7 +12,6 @@
12
12
  </template>
13
13
  </div>
14
14
  </template>
15
-
16
15
  <script lang="ts">
17
16
  import TopBar from "@/components/misc/TopBar.vue";
18
17
  import PlayerComponent from "@/components/misc/player/PlayerComponent.vue";
@@ -22,8 +21,8 @@ import { Rubriquage } from "./stores/class/rubrique/rubriquage";
22
21
  import { RubriquageFilter } from "./stores/class/rubrique/rubriquageFilter";
23
22
  import { Rubrique } from "./stores/class/rubrique/rubrique";
24
23
  import initSDK from "./components/mixins/init";
25
- import { useFilterStore } from "@/stores/FilterStore";
26
- import { useGeneralStore } from "@/stores/GeneralStore";
24
+ import { useFilterStore } from "./stores/FilterStore";
25
+ import { useGeneralStore } from "./stores/GeneralStore";
27
26
  import { mapState, mapActions } from "pinia";
28
27
  import { defineAsyncComponent, defineComponent } from "vue";
29
28
  import { Category } from "./stores/class/general/category";
@@ -73,6 +73,9 @@ body{
73
73
  .really-light-primary-bg{
74
74
  background-color: $primaryColorReallyTransparent !important;
75
75
  }
76
+ .blue-bg{
77
+ background-color: $blue-octopus;
78
+ }
76
79
  .width-fit-content{
77
80
  width: fit-content !important;
78
81
  }
@@ -81,7 +84,7 @@ body{
81
84
  }
82
85
  .page-box{
83
86
  background-color: $octopus-background;
84
- padding: 1rem 5rem 5rem 5rem;
87
+ padding: 1rem 3rem 3rem 3rem;
85
88
  flex-grow: 1;
86
89
  display: flex;
87
90
  flex-direction: column;
@@ -0,0 +1,16 @@
1
+ .octopus-app {
2
+ .video-responsive-wrapper {
3
+ position:relative;
4
+ padding-bottom:56.25%;
5
+ height:0;
6
+ width: 100%;
7
+ iframe, #video-element-hls {
8
+ position:absolute;
9
+ top:0;
10
+ left:0;
11
+ width:100% !important;
12
+ height:100%;
13
+ margin:0 !important;
14
+ }
15
+ }
16
+ }
@@ -19,7 +19,7 @@
19
19
  </template>
20
20
 
21
21
  <script lang="ts">
22
- import { useGeneralStore } from "@/stores/GeneralStore";
22
+ import { useGeneralStore } from "../../../stores/GeneralStore";
23
23
  import { mapState } from "pinia";
24
24
  import ClassicMultiselect from "../../form/ClassicMultiselect.vue";
25
25
  import { Category } from "@/stores/class/general/category";
@@ -65,7 +65,7 @@
65
65
  import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
66
66
  import { RubriquageFilter } from "@/stores/class/rubrique/rubriquageFilter";
67
67
  import { Rubrique } from "@/stores/class/rubrique/rubrique";
68
- import { useFilterStore } from "@/stores/FilterStore";
68
+ import { useFilterStore } from "../../../stores/FilterStore";
69
69
  import { state } from "../../../stores/ParamSdkStore";
70
70
  import { mapState, mapActions } from "pinia";
71
71
  import { defineComponent, defineAsyncComponent } from "vue";
@@ -43,8 +43,8 @@ import octopusApi from "@saooti/octopus-api";
43
43
  import { state } from "../../../stores/ParamSdkStore";
44
44
  import ClassicPopover from "../../misc/ClassicPopover.vue";
45
45
  import { Category } from "@/stores/class/general/category";
46
- import { useFilterStore } from "@/stores/FilterStore";
47
- import { useGeneralStore } from "@/stores/GeneralStore";
46
+ import { useFilterStore } from "../../../stores/FilterStore";
47
+ import { useGeneralStore } from "../../../stores/GeneralStore";
48
48
  import { mapState, mapActions } from "pinia";
49
49
  import { defineComponent } from "vue";
50
50
  export default defineComponent({
@@ -58,8 +58,8 @@ import { CommentCreate, CommentPodcast } from "@/stores/class/general/comment";
58
58
  import Constants from "../../../../public/config";
59
59
  import { mapState } from "pinia";
60
60
  import { defineComponent, defineAsyncComponent } from "vue";
61
- import { useCommentStore } from "@/stores/CommentStore";
62
- import { usePlayerStore } from "@/stores/PlayerStore";
61
+ import { useCommentStore } from "../../../stores/CommentStore";
62
+ import { usePlayerStore } from "../../../stores/PlayerStore";
63
63
  const CheckIdentityModal = defineAsyncComponent(
64
64
  () => import("./modal/CheckIdentityModal.vue"),
65
65
  );
@@ -160,7 +160,7 @@ export default defineComponent({
160
160
  };
161
161
  try {
162
162
  var commentReceived;
163
- if (this.authenticated) {
163
+ if (!this.authenticated) {
164
164
  commentReceived = await octopusApi.postDataPublic<CommentPodcast>(
165
165
  2,
166
166
  "comment/",
@@ -2,9 +2,39 @@
2
2
  <div class="d-flex flex-column">
3
3
  <div
4
4
  v-if="isNotAnAnswerList && 0 !== totalCount"
5
- class="text-secondary mb-2"
5
+ class="d-flex align-items-center mb-2"
6
6
  >
7
- {{ $t("Number comments", { nb: totalCount }) }}
7
+ <div class="text-secondary me-3">
8
+ {{ $t("Number comments", { nb: totalCount }) }}
9
+ </div>
10
+ <button
11
+ id="sort-by-comments"
12
+ class="btn btn-transparent d-flex align-items-center"
13
+ >
14
+ <svg
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ width="32"
17
+ height="32"
18
+ viewBox="0 0 24 24"
19
+ >
20
+ <path
21
+ fill="currentColor"
22
+ d="M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"
23
+ />
24
+ </svg>
25
+ <p class="ms-1">{{ $t("Sort by") }}</p>
26
+ </button>
27
+ <ClassicPopover target="sort-by-comments" :only-click="true">
28
+ <button
29
+ v-for="sortOption in sortChoice"
30
+ :key="sortOption"
31
+ class="me-3 octopus-dropdown-item"
32
+ :disabled="sortOption.value === sortType"
33
+ @mousedown="changeSort(sortOption.value)"
34
+ >
35
+ {{ sortOption.title }}
36
+ </button>
37
+ </ClassicPopover>
8
38
  </div>
9
39
  <div v-if="!loading && !error && 0 === totalCount" class="text-center">
10
40
  {{ $t("No comments") }}
@@ -49,15 +79,20 @@ import {
49
79
  CommentMessage,
50
80
  CommentsConfig,
51
81
  } from "@/stores/class/config/commentsConfig";
82
+ import { ListClassicReturn } from "@/stores/class/general/listReturn";
52
83
  /* eslint-disable */
53
84
  const CommentItem: any = defineAsyncComponent(() => import('./item/CommentItem.vue'));
54
85
  /* eslint-enable */
86
+ const ClassicPopover = defineAsyncComponent(
87
+ () => import("../../misc/ClassicPopover.vue"),
88
+ );
55
89
  export default defineComponent({
56
90
  name: "CommentsList",
57
91
 
58
92
  components: {
59
93
  ClassicLoading,
60
94
  CommentItem,
95
+ ClassicPopover,
61
96
  },
62
97
  mixins: [handle403],
63
98
 
@@ -77,13 +112,14 @@ export default defineComponent({
77
112
 
78
113
  data() {
79
114
  return {
80
- loading: true as boolean,
115
+ loading: false as boolean,
81
116
  error: false as boolean,
82
117
  dfirst: 0 as number,
83
118
  dsize: this.size,
84
119
  totalCount: 0 as number,
85
120
  comments: [] as Array<CommentPodcast>,
86
121
  scrollableSection: undefined as HTMLElement | undefined,
122
+ sortType: "DATE_DESC" as string,
87
123
  };
88
124
  },
89
125
 
@@ -94,6 +130,12 @@ export default defineComponent({
94
130
  isNotAnAnswerList(): boolean {
95
131
  return undefined === this.answerToComment;
96
132
  },
133
+ sortChoice() {
134
+ return [
135
+ { title: this.$t("The most recent"), value: "DATE_DESC" },
136
+ { title: this.$t("Top comments"), value: "LIKE_DESC" },
137
+ ];
138
+ },
97
139
  },
98
140
  watch: {
99
141
  totalCount() {
@@ -148,6 +190,10 @@ export default defineComponent({
148
190
  }
149
191
  },
150
192
  methods: {
193
+ changeSort(sortType: string) {
194
+ this.sortType = sortType;
195
+ this.fetchContent(true);
196
+ },
151
197
  handleScroll() {
152
198
  if (
153
199
  this.scrollableSection &&
@@ -183,6 +229,9 @@ export default defineComponent({
183
229
  }
184
230
  },
185
231
  async fetchContent(reset: boolean): Promise<void> {
232
+ if (this.loading) {
233
+ return;
234
+ }
186
235
  this.loading = true;
187
236
  if (reset) {
188
237
  this.dfirst = 0;
@@ -192,18 +241,16 @@ export default defineComponent({
192
241
  first: this.dfirst,
193
242
  size: this.dsize,
194
243
  podcastId: this.podcast?.podcastId,
195
- sort: "DATE_DESC",
244
+ sort: this.sortType,
196
245
  answerTo: this.answerToComment,
197
246
  hideAnswers: !this.isFlatList,
198
247
  state: this.stateFilter.length ? this.stateFilter : undefined,
199
248
  organisationId: this.organisationId,
200
249
  };
201
250
  try {
202
- const data = await octopusApi.fetchDataPublicWithParams<{
203
- count: number;
204
- result: Array<CommentPodcast>;
205
- sort: string;
206
- }>(2, "comment/list", param);
251
+ const data = await octopusApi.fetchDataPublicWithParams<
252
+ ListClassicReturn<CommentPodcast>
253
+ >(2, "comment/list", param);
207
254
  if (reset) {
208
255
  this.comments.length = 0;
209
256
  }
@@ -42,7 +42,7 @@ import Constants from "../../../../public/config";
42
42
  import { useAuthStore } from "@/stores/AuthStore";
43
43
  import { mapActions, mapState } from "pinia";
44
44
  import { defineComponent } from "vue";
45
- import { useCommentStore } from "@/stores/CommentStore";
45
+ import { useCommentStore } from "../../../stores/CommentStore";
46
46
  export default defineComponent({
47
47
  name: "CommentName",
48
48
  emits: [],
@@ -35,10 +35,10 @@
35
35
  <script lang="ts">
36
36
  import { CommentPodcast } from "@/stores/class/general/comment";
37
37
  import selenium from "../../mixins/selenium";
38
- import { usePlayerStore } from "@/stores/PlayerStore";
38
+ import { usePlayerStore } from "../../../stores/PlayerStore";
39
39
  import { mapActions, mapState } from "pinia";
40
40
  import { defineComponent } from "vue";
41
- import { useCommentStore } from "@/stores/CommentStore";
41
+ import { useCommentStore } from "../../../stores/CommentStore";
42
42
  export default defineComponent({
43
43
  name: "CommentPlayer",
44
44
  mixins: [selenium],
@@ -30,7 +30,7 @@ import cookies from "../../mixins/cookies";
30
30
  import { Podcast } from "@/stores/class/general/podcast";
31
31
  import { defineAsyncComponent, defineComponent } from "vue";
32
32
  import { mapActions, mapState } from "pinia";
33
- import { useCommentStore } from "@/stores/CommentStore";
33
+ import { useCommentStore } from "../../../stores/CommentStore";
34
34
  import {
35
35
  CommentMessage,
36
36
  CommentsConfig,
@@ -69,9 +69,10 @@ export default defineComponent({
69
69
  return this.canPostComment || this.nbComments > 0;
70
70
  },
71
71
  canPostComment(): boolean {
72
- return (
73
- this.getCanPostComment(this.configPodcast, this.podcast) &&
74
- this.authenticated
72
+ return this.getCanPostComment(
73
+ this.configPodcast,
74
+ this.podcast,
75
+ this.authenticated,
75
76
  );
76
77
  },
77
78
  eventActive(): boolean {
@@ -93,14 +94,12 @@ export default defineComponent({
93
94
  },
94
95
  },
95
96
  created() {
96
- this.initCommentUser();
97
97
  this.fetchPodcastCommentsConfig();
98
98
  },
99
99
  methods: {
100
100
  ...mapActions(useCommentStore, [
101
101
  "getCommentsConfig",
102
102
  "getCanPostComment",
103
- "initCommentUser",
104
103
  "commentEventHandled",
105
104
  "initialize",
106
105
  "initComments",
@@ -63,6 +63,8 @@ export default defineComponent({
63
63
  data() {
64
64
  return {
65
65
  displayPreview: true as boolean,
66
+ dateInterval: undefined as ReturnType<typeof setTimeout> | undefined,
67
+ date: "" as string,
66
68
  };
67
69
  },
68
70
  computed: {
@@ -75,12 +77,6 @@ export default defineComponent({
75
77
  isValidComment() {
76
78
  return "VALIDATED" === this.comment.state;
77
79
  },
78
- date(): string {
79
- if (!this.comment.date) {
80
- return "";
81
- }
82
- return dayjs(this.comment.date).fromNow();
83
- },
84
80
  readMore(): string {
85
81
  return this.displayPreview ? this.$t("Read more") : this.$t("Read less");
86
82
  },
@@ -91,6 +87,23 @@ export default defineComponent({
91
87
  return this.comment.content.substring(0, 300) + "...";
92
88
  },
93
89
  },
90
+ mounted() {
91
+ this.defineDateFromNow();
92
+ this.dateInterval = setInterval(() => {
93
+ this.defineDateFromNow();
94
+ }, 60000);
95
+ },
96
+ unmounted() {
97
+ clearInterval(this.dateInterval as unknown as number);
98
+ },
99
+ methods: {
100
+ defineDateFromNow() {
101
+ if (!this.comment.date) {
102
+ this.date = "";
103
+ }
104
+ this.date = dayjs(this.comment.date).fromNow();
105
+ },
106
+ },
94
107
  });
95
108
  </script>
96
109
  <style lang="scss">
@@ -3,37 +3,25 @@
3
3
  class="d-flex flex-column flex-grow-1 w-100 really-light-secondary-bg"
4
4
  :class="isAnAnswer && !isFlatList ? 'my-1 p-0' : 'my-3 p-2'"
5
5
  >
6
- <CheckIdentityModal
7
- v-if="isCheckIdentityActions"
8
- :title="$t('Welcome, thanks for your interaction')"
9
- @validate="likeActions(isCheckIdentityActions)"
10
- @close="isCheckIdentityActions = undefined"
11
- />
12
- <div class="d-flex justify-content-between align-items-center">
6
+ <div class="d-flex flex-nowrap justify-content-between align-items-center">
13
7
  <CommentBasicView :comment="comment" :edit-right="editRight" />
14
8
  <CommentMoreActions
15
9
  v-model:comment="commentForVmodel"
16
10
  :edit-right="editRight"
17
11
  :podcast="podcast"
12
+ :config="config"
18
13
  @delete-comment="emitDeleteComment"
19
14
  />
20
15
  </div>
21
16
  <template v-if="isValidComment">
22
17
  <div class="d-flex align-items-center mt-1">
23
- <template v-for="section in feelingSection" :key="section.name">
24
- <template v-if="section.condition">
25
- <CommentLikeButton
26
- :like="'like' === section.name"
27
- :is-active="section.name === userFeeling"
28
- @like-action="initiateLikeActions"
29
- />
30
- <span v-if="section.counter" class="ms-1 me-2">{{
31
- transformInThousands(section.counter)
32
- }}</span>
33
- </template>
34
- </template>
18
+ <LikeSection
19
+ v-model:comment="commentForVmodel"
20
+ :edit-right="editRight"
21
+ :podcast="podcast"
22
+ />
35
23
  <button
36
- v-if="!comment.answerTo"
24
+ v-if="!comment.answerTo && canPostComment"
37
25
  class="btn btn-transparent"
38
26
  @click="answerComment"
39
27
  >
@@ -52,7 +40,7 @@
52
40
  </button>
53
41
  </div>
54
42
  <CommentInput
55
- v-if="isAnsweringComment"
43
+ v-if="isAnsweringComment && canPostComment"
56
44
  class="ms-4"
57
45
  :focus="focus"
58
46
  :podcast="podcast"
@@ -98,16 +86,12 @@
98
86
  <script lang="ts">
99
87
  import selenium from "../../../mixins/selenium";
100
88
  import displayMethods from "../../../mixins/displayMethods";
101
- import {
102
- CommentFeelings,
103
- CommentPodcast,
104
- } from "@/stores/class/general/comment";
89
+ import { CommentPodcast } from "@/stores/class/general/comment";
105
90
  import { Podcast } from "../../../../stores/class/general/podcast";
106
91
  import CommentBasicView from "./CommentBasicView.vue";
107
- import { useCommentStore } from "@/stores/CommentStore";
108
- import { mapState } from "pinia";
92
+ import { useCommentStore } from "../../../../stores/CommentStore";
93
+ import { mapActions, mapState } from "pinia";
109
94
  import { defineComponent, defineAsyncComponent } from "vue";
110
- import octopusApi from "@saooti/octopus-api";
111
95
  import {
112
96
  CommentMessage,
113
97
  CommentsConfig,
@@ -117,11 +101,8 @@ const CommentInput = defineAsyncComponent(() => import("../CommentInput.vue"));
117
101
  const CommentParentInfo = defineAsyncComponent(
118
102
  () => import("../CommentParentInfo.vue"),
119
103
  );
120
- const CheckIdentityModal = defineAsyncComponent(
121
- () => import("../modal/CheckIdentityModal.vue"),
122
- );
123
- const CommentLikeButton = defineAsyncComponent(
124
- () => import("../button/CommentLikeButton.vue"),
104
+ const LikeSection = defineAsyncComponent(
105
+ () => import("../like/LikeSection.vue"),
125
106
  );
126
107
  const CommentMoreActions = defineAsyncComponent(
127
108
  () => import("./CommentMoreActions.vue"),
@@ -135,8 +116,7 @@ export default defineComponent({
135
116
  CommentList,
136
117
  CommentParentInfo,
137
118
  CommentBasicView,
138
- CheckIdentityModal,
139
- CommentLikeButton,
119
+ LikeSection,
140
120
  CommentMoreActions,
141
121
  },
142
122
 
@@ -157,28 +137,12 @@ export default defineComponent({
157
137
  isAnsweringComment: false as boolean,
158
138
  showAnswers: false as boolean,
159
139
  focus: false as boolean,
160
- isCheckIdentityActions: undefined as string | undefined,
161
- userFeeling: undefined as string | undefined,
162
140
  showParentComment: false as boolean,
163
141
  eventToHandle: undefined as CommentMessage | undefined,
164
142
  };
165
143
  },
166
144
  computed: {
167
145
  ...mapState(useCommentStore, ["commentUser"]),
168
- feelingSection() {
169
- return [
170
- {
171
- name: "like",
172
- counter: this.comment.likes,
173
- condition: this.config?.commentLikes.likeEnabled ?? false,
174
- },
175
- {
176
- name: "dislike",
177
- counter: this.editRight ? this.comment.dislikes : 0,
178
- condition: this.config?.commentLikes.dislikeEnabled ?? false,
179
- },
180
- ];
181
- },
182
146
  commentForVmodel: {
183
147
  get(): CommentPodcast {
184
148
  return this.comment;
@@ -206,42 +170,22 @@ export default defineComponent({
206
170
  isValidComment() {
207
171
  return "VALIDATED" === this.comment.state;
208
172
  },
173
+ authenticated(): boolean {
174
+ return state.generalParameters.authenticated as boolean;
175
+ },
176
+ canPostComment(): boolean {
177
+ return this.getCanPostComment(
178
+ this.config,
179
+ this.podcast,
180
+ this.authenticated,
181
+ );
182
+ },
209
183
  eventActive(): boolean {
210
184
  return undefined !== this.podcast?.conferenceId;
211
185
  },
212
186
  },
213
187
  methods: {
214
- transformInThousands(nb: number) {
215
- if (nb >= 1000) {
216
- return Math.round(nb / 100) / 10 + "k";
217
- }
218
- return nb.toString();
219
- },
220
- async initiateLikeActions(actionName: string) {
221
- if (!this.commentUser?.name) {
222
- this.isCheckIdentityActions = actionName;
223
- return;
224
- }
225
- this.likeActions(actionName);
226
- },
227
- async likeActions(actionName: string) {
228
- const data = await octopusApi.putDataPublic<{
229
- [key: number]: CommentFeelings;
230
- }>(2, "comment/" + actionName, {
231
- ids: [this.comment.commentId],
232
- name: this.commentUser?.name,
233
- uuid: this.commentUser?.uuid,
234
- });
235
- this.$emit("update:comment", {
236
- ...this.comment,
237
- ...{
238
- likes: data[this.comment.commentId].likesCount,
239
- dislikes: data[this.comment.commentId].dislikesCount,
240
- },
241
- });
242
- this.userFeeling = this.userFeeling ? undefined : actionName;
243
- this.isCheckIdentityActions = undefined;
244
- },
188
+ ...mapActions(useCommentStore, ["getCanPostComment"]),
245
189
  answerComment(): void {
246
190
  this.isAnsweringComment = true;
247
191
  this.focus = !this.focus;
@@ -288,13 +232,3 @@ export default defineComponent({
288
232
  },
289
233
  });
290
234
  </script>
291
- <style lang="scss">
292
- .octopus-app {
293
- .answers-section {
294
- .btn.btn-primary {
295
- align-self: start !important;
296
- margin: 0.5rem 0 0 0 !important;
297
- }
298
- }
299
- }
300
- </style>