@saooti/octopus-sdk 1.0.0 → 29.0.2

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 (230) hide show
  1. package/README.md +73 -0
  2. package/index.d.ts +4 -0
  3. package/index.ts +12 -0
  4. package/package.json +61 -39
  5. package/public/css/fonts/saooti-ui.eot +0 -0
  6. package/public/css/fonts/saooti-ui.svg +30 -19
  7. package/public/css/fonts/saooti-ui.ttf +0 -0
  8. package/public/css/fonts/saooti-ui.woff +0 -0
  9. package/public/css/fonts/style.css +48 -5
  10. package/public/img/ACPM.png +0 -0
  11. package/public/img/article.png +0 -0
  12. package/src/App.vue +97 -31
  13. package/src/api/comments.ts +3 -1
  14. package/src/api/emissions.ts +5 -2
  15. package/src/api/initialize.ts +3 -2
  16. package/src/api/podcasts.ts +5 -2
  17. package/src/api/profile.ts +4 -2
  18. package/src/api/studio.ts +12 -1
  19. package/src/assets/bootstrap-diff.scss +265 -0
  20. package/src/assets/form.scss +23 -0
  21. package/src/assets/general.scss +47 -20
  22. package/src/assets/modal.scss +9 -10
  23. package/src/assets/multiselect.scss +19 -2
  24. package/src/assets/octopus-library.scss +16 -4
  25. package/src/assets/share.scss +343 -0
  26. package/src/components/display/aggregator/RssSection.vue +4 -4
  27. package/src/components/display/categories/CategoryChooser.vue +152 -105
  28. package/src/components/display/categories/CategoryFilter.vue +108 -0
  29. package/src/components/display/categories/CategoryList.vue +138 -109
  30. package/src/components/display/comments/AddCommentModal.vue +104 -87
  31. package/src/components/display/comments/CommentInput.vue +137 -118
  32. package/src/components/display/comments/CommentItem.vue +155 -137
  33. package/src/components/display/comments/CommentList.vue +142 -120
  34. package/src/components/display/comments/CommentParentInfo.vue +39 -35
  35. package/src/components/display/comments/CommentPlayer.vue +54 -48
  36. package/src/components/display/comments/CommentSection.vue +57 -58
  37. package/src/components/display/edit/EditBox.vue +4 -4
  38. package/src/components/display/edit/EditCommentBox.vue +25 -31
  39. package/src/components/display/emission/EmissionChooser.vue +82 -80
  40. package/src/components/display/emission/EmissionInlineList.vue +118 -105
  41. package/src/components/display/emission/EmissionItem.vue +66 -167
  42. package/src/components/display/emission/EmissionList.vue +96 -122
  43. package/src/components/display/emission/EmissionPlayerItem.vue +131 -126
  44. package/src/components/display/filter/AdvancedSearch.vue +306 -372
  45. package/src/components/display/filter/CategoryFilter.vue +117 -0
  46. package/src/components/display/filter/MonetizableFilter.vue +24 -10
  47. package/src/components/display/filter/ProductorSearch.vue +131 -135
  48. package/src/components/display/filter/RubriqueChoice.vue +104 -0
  49. package/src/components/display/filter/RubriqueFilter.vue +235 -0
  50. package/src/components/display/live/CountDown.vue +30 -29
  51. package/src/components/display/live/LiveHorizontalList.vue +40 -34
  52. package/src/components/display/live/LiveItem.vue +146 -158
  53. package/src/components/display/live/LiveList.vue +167 -154
  54. package/src/components/display/organisation/OrganisationChooser.vue +125 -124
  55. package/src/components/display/organisation/OrganisationChooserLight.vue +40 -47
  56. package/src/components/display/participant/ParticipantItem.vue +92 -108
  57. package/src/components/display/participant/ParticipantList.vue +76 -69
  58. package/src/components/display/playlist/PlaylistItem.vue +45 -56
  59. package/src/components/display/playlist/PlaylistList.vue +57 -48
  60. package/src/components/display/playlist/PodcastList.vue +94 -70
  61. package/src/components/display/podcasts/AnimatorsItem.vue +26 -23
  62. package/src/components/display/podcasts/ParticipantDescription.vue +115 -0
  63. package/src/components/display/podcasts/PodcastFilterList.vue +84 -85
  64. package/src/components/display/podcasts/PodcastImage.vue +244 -208
  65. package/src/components/display/podcasts/PodcastInlineList.vue +145 -207
  66. package/src/components/display/podcasts/PodcastItem.vue +150 -132
  67. package/src/components/display/podcasts/PodcastList.vue +89 -110
  68. package/src/components/display/podcasts/TagList.vue +23 -16
  69. package/src/components/display/rubriques/RubriqueChooser.vue +137 -123
  70. package/src/components/display/rubriques/RubriqueList.vue +227 -0
  71. package/src/components/display/sharing/PlayerParameters.vue +154 -106
  72. package/src/components/display/sharing/QrCode.vue +58 -0
  73. package/src/components/display/sharing/ShareButtons.vue +214 -92
  74. package/src/components/display/sharing/ShareDistribution.vue +110 -121
  75. package/src/components/display/sharing/SharePlayer.vue +245 -190
  76. package/src/components/display/sharing/SubscribeButtons.vue +130 -66
  77. package/src/components/display/studio/RecordingItemButton.vue +4 -4
  78. package/src/components/misc/ErrorMessage.vue +21 -16
  79. package/src/components/misc/Footer.vue +131 -66
  80. package/src/components/misc/HomeDropdown.vue +166 -123
  81. package/src/components/misc/LeftMenu.vue +151 -134
  82. package/src/components/misc/Player.vue +332 -328
  83. package/src/components/misc/Snackbar.vue +27 -29
  84. package/src/components/misc/TopBar.vue +204 -174
  85. package/src/components/misc/modal/ClipboardModal.vue +46 -26
  86. package/src/components/misc/modal/MessageModal.vue +67 -51
  87. package/src/components/misc/modal/NewsletterModal.vue +179 -136
  88. package/src/components/misc/modal/QrCodeModal.vue +83 -0
  89. package/src/components/misc/modal/ShareModalPlayer.vue +133 -74
  90. package/src/components/mixins/functions.ts +21 -18
  91. package/src/components/mixins/init.ts +24 -0
  92. package/src/components/mixins/organisationFilter.ts +24 -0
  93. package/src/components/pages/Category.vue +26 -26
  94. package/src/components/pages/Emission.vue +120 -92
  95. package/src/components/pages/Emissions.vue +109 -86
  96. package/src/components/pages/Home.vue +70 -16
  97. package/src/components/pages/Lives.vue +57 -47
  98. package/src/components/pages/Participant.vue +93 -77
  99. package/src/components/pages/Participants.vue +44 -31
  100. package/src/components/pages/Playlist.vue +63 -52
  101. package/src/components/pages/Playlists.vue +41 -39
  102. package/src/components/pages/Podcast.vue +265 -251
  103. package/src/components/pages/Podcasts.vue +135 -104
  104. package/src/components/pages/Rubrique.vue +25 -19
  105. package/src/components/pages/Search.vue +71 -67
  106. package/src/helper/dom.ts +2 -2
  107. package/src/helper/duration.ts +18 -8
  108. package/src/locale/educationen.ts +14 -0
  109. package/src/locale/en.ts +299 -1
  110. package/src/locale/fr.ts +25 -10
  111. package/src/locale/messages.ts +3 -2
  112. package/src/main.ts +54 -32
  113. package/src/router/router.ts +184 -159
  114. package/src/shims-tsx.d.ts +13 -0
  115. package/src/shims-vue-recaptcha-v3.d.ts +9 -0
  116. package/src/shims-vue.d.ts +5 -6
  117. package/src/store/AppStore.ts +36 -171
  118. package/src/store/class/category.ts +8 -0
  119. package/src/store/class/comment.ts +17 -0
  120. package/src/store/class/conference.ts +27 -0
  121. package/src/store/class/customPlayer.ts +8 -0
  122. package/src/store/class/emission.ts +20 -0
  123. package/src/store/class/fetchParam.ts +16 -0
  124. package/src/store/class/media.ts +13 -0
  125. package/src/store/class/organisation.ts +19 -0
  126. package/src/store/class/participant.ts +12 -0
  127. package/src/store/class/person.ts +13 -0
  128. package/src/store/class/player.ts +12 -0
  129. package/src/store/class/playlist.ts +15 -0
  130. package/src/store/class/podcast.ts +37 -0
  131. package/src/store/class/rubriquage.ts +9 -0
  132. package/src/store/class/rubriquageFilter.ts +5 -0
  133. package/src/store/class/rubrique.ts +8 -0
  134. package/src/store/paramStore.ts +70 -29
  135. package/src/store/typeAppStore.ts +171 -237
  136. package/src/vuex-shim.d.ts +8 -0
  137. package/tsconfig.json +4 -0
  138. package/vue.config.js +14 -0
  139. package/public/img/ACPM.PNG +0 -0
  140. package/src/assets/bootstrap_scss/_alert.scss +0 -51
  141. package/src/assets/bootstrap_scss/_badge.scss +0 -54
  142. package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
  143. package/src/assets/bootstrap_scss/_button-group.scss +0 -164
  144. package/src/assets/bootstrap_scss/_buttons.scss +0 -291
  145. package/src/assets/bootstrap_scss/_card.scss +0 -278
  146. package/src/assets/bootstrap_scss/_carousel.scss +0 -197
  147. package/src/assets/bootstrap_scss/_close.scss +0 -41
  148. package/src/assets/bootstrap_scss/_code.scss +0 -48
  149. package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
  150. package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
  151. package/src/assets/bootstrap_scss/_forms.scss +0 -352
  152. package/src/assets/bootstrap_scss/_functions.scss +0 -134
  153. package/src/assets/bootstrap_scss/_grid.scss +0 -69
  154. package/src/assets/bootstrap_scss/_images.scss +0 -42
  155. package/src/assets/bootstrap_scss/_input-group.scss +0 -191
  156. package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
  157. package/src/assets/bootstrap_scss/_list-group.scss +0 -158
  158. package/src/assets/bootstrap_scss/_media.scss +0 -8
  159. package/src/assets/bootstrap_scss/_mixins.scss +0 -47
  160. package/src/assets/bootstrap_scss/_modal.scss +0 -243
  161. package/src/assets/bootstrap_scss/_nav.scss +0 -120
  162. package/src/assets/bootstrap_scss/_navbar.scss +0 -324
  163. package/src/assets/bootstrap_scss/_pagination.scss +0 -74
  164. package/src/assets/bootstrap_scss/_popover.scss +0 -170
  165. package/src/assets/bootstrap_scss/_print.scss +0 -141
  166. package/src/assets/bootstrap_scss/_progress.scss +0 -46
  167. package/src/assets/bootstrap_scss/_reboot.scss +0 -482
  168. package/src/assets/bootstrap_scss/_root.scss +0 -20
  169. package/src/assets/bootstrap_scss/_spinners.scss +0 -55
  170. package/src/assets/bootstrap_scss/_tables.scss +0 -185
  171. package/src/assets/bootstrap_scss/_toasts.scss +0 -44
  172. package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
  173. package/src/assets/bootstrap_scss/_transitions.scss +0 -20
  174. package/src/assets/bootstrap_scss/_type.scss +0 -125
  175. package/src/assets/bootstrap_scss/_utilities.scss +0 -17
  176. package/src/assets/bootstrap_scss/_variables.scss +0 -1145
  177. package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
  178. package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
  179. package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
  180. package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
  181. package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
  182. package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
  183. package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
  184. package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
  185. package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
  186. package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
  187. package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
  188. package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
  189. package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
  190. package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
  191. package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
  192. package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
  193. package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
  194. package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
  195. package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
  196. package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
  197. package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
  198. package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
  199. package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
  200. package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
  201. package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
  202. package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
  203. package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
  204. package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
  205. package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
  206. package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
  207. package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
  208. package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
  209. package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
  210. package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
  211. package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
  212. package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
  213. package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
  214. package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
  215. package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
  216. package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
  217. package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
  218. package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
  219. package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
  220. package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
  221. package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
  222. package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
  223. package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
  224. package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
  225. package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
  226. package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
  227. package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
  228. package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
  229. package/src/shims-vuex.d.ts +0 -7
  230. package/src/views/Home.vue +0 -18
@@ -1,90 +1,76 @@
1
1
  <template>
2
2
  <div
3
- class="d-flex flex-column mt-3 module-box comment-item-container"
4
3
  v-if="isComments"
4
+ class="d-flex flex-column mt-3 module-box comment-item-container"
5
5
  >
6
6
  <div class="d-flex align-items-center">
7
- <h2 class="mb-0 mr-2">
7
+ <h2
8
+ class="mb-0 me-2"
9
+ data-selenium="episode-comment-counter"
10
+ >
8
11
  {{ $t("Podcast's comments") }}
9
- <template v-if="loaded && totalCount > 0">{{
10
- $t('()', { nb: totalCount })
11
- }}</template>
12
+ <template v-if="loaded && totalCount > 0">
13
+ {{
14
+ $t('()', { nb: totalCount })
15
+ }}
16
+ </template>
12
17
  </h2>
13
18
  <button
19
+ v-if="!isLive"
20
+ :aria-label="$t('Refresh')"
14
21
  class="saooti-refresh-stud btn btn-reload primary-color"
15
22
  @click="reloadComments"
16
- v-if="!isLive"
17
- ></button>
23
+ />
18
24
  </div>
19
25
  <CommentInput
20
- :podcast="podcast"
21
26
  v-model:knownIdentity="knownIdentity"
22
- :fetchConference="fetchConference"
27
+ :podcast="podcast"
28
+ :fetch-conference="fetchConference"
23
29
  @newComment="newComment"
24
30
  />
25
31
  <CommentList
26
32
  ref="commentList"
27
33
  :podcast="podcast"
28
34
  :reload="reload"
29
- :isFlat="isLive"
30
- :fetchConference="fetchConference"
35
+ :is-flat="isLive"
36
+ :fetch-conference="fetchConference"
31
37
  @fetch="updateFetch"
32
38
  />
33
39
  </div>
34
40
  </template>
35
41
 
36
- <style lang="scss">
37
- @import '../../../sass/_variables.scss';
38
- .btn-reload {
39
- width: 40px;
40
- height: 40px;
41
- padding: 0;
42
- font-size: 1rem;
43
- font-weight: bold;
44
- }
45
- </style>
46
-
47
42
  <script lang="ts">
48
43
  import CommentList from './CommentList.vue';
49
44
  import CommentInput from './CommentInput.vue';
50
45
  import { cookies } from '../../mixins/functions';
46
+ import { Podcast } from '@/store/class/podcast';
47
+ import { Conference } from '@/store/class/conference';
51
48
 
52
- import { defineComponent, ref } from 'vue'
49
+ import { defineComponent } from 'vue'
53
50
  export default defineComponent({
54
51
  name: 'CommentSection',
55
52
 
56
- props: {
57
- podcast: { default: undefined as any },
58
- fetchConference: { default: undefined as any },
59
- },
60
-
61
- mixins: [cookies],
62
-
63
53
  components: {
64
54
  CommentList,
65
55
  CommentInput,
66
56
  },
67
- setup() {
68
- const commentList : any = ref(null);
69
- return {
70
- commentList,
71
- };
72
- },
57
+ mixins:[cookies],
73
58
 
74
- created() {
75
- this.knownIdentity = this.getCookie('comment-octopus-name');
59
+ props: {
60
+ podcast: { default: undefined, type: Object as ()=>Podcast },
61
+ fetchConference: { default: undefined, type: Object as ()=>Conference },
76
62
  },
77
-
63
+
78
64
  data() {
79
65
  return {
80
- totalCount: 0,
81
- loaded: false,
82
- reload: false,
66
+ totalCount: 0 as number,
67
+ loaded: false as boolean,
68
+ reload: false as boolean,
83
69
  };
84
70
  },
85
71
 
86
72
  computed: {
87
- isComments():boolean {
73
+ isComments(): boolean {
88
74
  if (!this.podcast) return true;
89
75
  let podcastComment = 'INHERIT';
90
76
  if (this.podcast.annotations && this.podcast.annotations.COMMENTS) {
@@ -106,55 +92,58 @@ export default defineComponent({
106
92
  );
107
93
  },
108
94
  knownIdentity: {
109
- get():any {
95
+ get(): string|null {
110
96
  return this.$store.state.comments.knownIdentity;
111
97
  },
112
- set(value: any) {
98
+ set(value: string|null) {
113
99
  this.$store.commit('setCommentIdentity', value);
114
100
  },
115
101
  },
116
- isLive():boolean {
102
+ isLive(): boolean {
117
103
  return (
118
- this.fetchConference &&
119
- 'null' !== this.fetchConference &&
104
+ undefined!==this.fetchConference &&
105
+ -1 !== this.fetchConference.conferenceId &&
120
106
  'PUBLISHING' !== this.fetchConference.status &&
121
107
  'DEBRIEFING' !== this.fetchConference.status
122
108
  );
123
109
  },
124
110
  },
125
111
 
112
+ created() {
113
+ this.knownIdentity = this.getCookie('comment-octopus-name');
114
+ },
126
115
  methods: {
127
- updateFetch(value: { count: number; }) {
116
+ updateFetch(value: { count: number }): void {
128
117
  this.loaded = true;
129
118
  this.$store.commit('setCommentLoaded', {
130
119
  ...value,
131
- podcastId: this.podcast.podcastId,
120
+ podcastId: this.podcast? this.podcast.podcastId: undefined,
132
121
  });
133
122
  this.totalCount = value.count;
134
123
  },
135
- reloadComments() {
124
+ reloadComments(): void {
136
125
  this.reload = !this.reload;
137
126
  },
138
- newComment(comment: any) {
139
- this.commentList.addNewComment(comment, true);
127
+ newComment(comment: Comment): void {
128
+ (this.$refs.commentList as any).addNewComment(comment, true);
140
129
  },
141
- receiveCommentEvent(event: { type: any; comment: { status: any; }; oldStatus: any; }) {
130
+ receiveCommentEvent(event: any): void {
142
131
  let statusUpdated = undefined;
143
132
  switch (event.type) {
144
133
  case 'Create':
145
- this.commentList.addNewComment(event.comment);
134
+ (this.$refs.commentList as any).addNewComment(event.comment);
146
135
  break;
147
136
  case 'Update':
148
137
  if (event.comment.status !== event.oldStatus) {
149
138
  statusUpdated = event.comment.status;
150
139
  }
151
- this.commentList.updateComment({
140
+ (this.$refs.commentList as any).updateComment({
152
141
  comment: event.comment,
153
142
  status: statusUpdated,
154
143
  });
155
144
  break;
156
145
  case 'Delete':
157
- this.commentList.deleteComment(event.comment);
146
+ (this.$refs.commentList as any).deleteComment(event.comment);
158
147
  break;
159
148
  default:
160
149
  console.log('Event not handle');
@@ -162,5 +151,15 @@ export default defineComponent({
162
151
  }
163
152
  },
164
153
  },
165
- });
154
+ })
166
155
  </script>
156
+
157
+ <style lang="scss">
158
+ .btn-reload {
159
+ width: 40px;
160
+ height: 40px;
161
+ padding: 0;
162
+ font-size: 1rem;
163
+ font-weight: bold;
164
+ }
165
+ </style>
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <div></div>
2
+ <div />
3
3
  </template>
4
4
 
5
- <style lang="scss"></style>
6
-
7
5
  <script lang="ts">
8
6
  import { defineComponent } from 'vue'
9
- export default defineComponent({});
7
+ export default defineComponent({})
10
8
  </script>
9
+
10
+ <style lang="scss"></style>
@@ -1,67 +1,61 @@
1
1
  <template>
2
2
  <div class="d-flex">
3
3
  <button
4
- class="btn btn-circle primary-color mr-1"
4
+ class="btn btn-circle primary-color me-1"
5
5
  aria-label="edit"
6
6
  @click="editComment"
7
7
  >
8
- <span class="saooti-edit-bounty"></span>
8
+ <span class="saooti-edit-bounty" />
9
9
  </button>
10
10
  <button
11
- class="btn btn-circle primary-color mr-1"
12
- aria-label="valid"
13
11
  v-if="'Pending' === comment.status || 'Invalid' === comment.status"
12
+ class="btn btn-circle primary-color me-1"
13
+ aria-label="valid"
14
14
  @click="validComment"
15
15
  >
16
- <span class="saooti-valid-stud"></span>
16
+ <span class="saooti-valid-stud" />
17
17
  </button>
18
18
  <button
19
- class="btn btn-circle primary-color mr-1"
20
- aria-label="invalid"
21
19
  v-if="'Pending' === comment.status || 'Valid' === comment.status"
20
+ class="btn btn-circle primary-color me-1"
21
+ aria-label="invalid"
22
22
  @click="invalidComment"
23
23
  >
24
- <span class="saooti-cross"></span>
24
+ <span class="saooti-cross" />
25
25
  </button>
26
26
  <button
27
- class="btn btn-circle primary-color mr-1"
27
+ class="btn btn-circle primary-color me-1"
28
28
  aria-label="delete"
29
29
  @click="deleteComment"
30
30
  >
31
- <span class="saooti-bin"></span>
31
+ <span class="saooti-bin" />
32
32
  </button>
33
33
  </div>
34
34
  </template>
35
35
 
36
- <style lang="scss">
37
- @import '../../../sass/_variables.scss';
38
- .comment-item-container {
39
- .btn-circle {
40
- width: 32px;
41
- height: 32px;
42
- background: $octopus-secondary-color;
43
- padding: 0;
44
- display: flex;
45
- align-items: center;
46
- justify-content: center;
47
- }
48
- }
49
- </style>
50
-
51
36
  <script lang="ts">
37
+ import { CommentPodcast } from '@/store/class/comment';
52
38
  import { defineComponent } from 'vue'
53
39
  export default defineComponent({
54
- props: ['comment'],
55
-
40
+ props: {
41
+ comment: { default: undefined, type: Object as ()=>CommentPodcast},
42
+ },
56
43
  emits: ['editComment'],
57
44
 
58
45
  methods: {
59
46
  editComment() {
60
47
  this.$emit('editComment');
61
48
  },
62
- validComment() {},
63
- invalidComment() {},
64
- deleteComment() {},
49
+ validComment() {
50
+ console.log('valid');
51
+ },
52
+ invalidComment() {
53
+ console.log('invalid');
54
+ },
55
+ deleteComment() {
56
+ console.log('delete');
57
+ },
65
58
  },
66
- });
59
+ })
67
60
  </script>
61
+ <style lang="scss"></style>
@@ -8,14 +8,14 @@
8
8
  for="emissionChooser"
9
9
  class="d-inline"
10
10
  aria-label="select emission"
11
- ></label>
12
- <Multiselect
13
- v-model="emission"
11
+ />
12
+ <VueMultiselect
14
13
  id="emissionChooser"
14
+ ref="multiselectRef"
15
+ v-model="emission"
15
16
  label="name"
16
17
  track-by="emissionId"
17
18
  :placeholder="$t('Type string to filter by emission')"
18
- ref="multiselectRef"
19
19
  :options="emissions"
20
20
  :multiple="false"
21
21
  :searchable="true"
@@ -33,30 +33,31 @@
33
33
  @close="onClose"
34
34
  @select="onEmissionSelected"
35
35
  >
36
- <template v-slot:clear="props" >
36
+ <template #clear="{ props }">
37
37
  <div
38
+ v-if="emission"
38
39
  class="multiselect__clear"
39
- v-if="emission.length"
40
40
  @mousedown.prevent.stop="clearAll(props.search)"
41
- ></div>
41
+ />
42
42
  </template>
43
- <template v-slot:singleLabel="props" >
43
+ <template #singleLabel="{ option }">
44
44
  <div class="multiselect-octopus-proposition">
45
- <span class="option__title">{{ props.option.name }}</span>
45
+ <span class="option__title">{{ option.name }}</span>
46
46
  </div>
47
47
  </template>
48
- <template v-slot:option="props" >
48
+ <template #option="{ option }">
49
49
  <div class="multiselect-octopus-proposition">
50
- <span class="option__title">{{ props.option.name }}</span>
50
+ <span class="option__title">{{ option.name }}</span>
51
51
  </div>
52
52
  </template>
53
- <template v-slot:noResult>
54
- <span>{{
55
- $t('No elements found. Consider changing the search query.')
56
- }}</span>
53
+ <template #noResult="">
54
+ <span>{{ $t('No elements found. Consider changing the search query.') }}</span>
57
55
  </template>
58
- <template v-slot:afterList>
59
- <div v-if="remainingElements" class="multiselect-remaining-elements">
56
+ <template #afterList="">
57
+ <div
58
+ v-if="remainingElements"
59
+ class="multiselect-remaining-elements"
60
+ >
60
61
  {{
61
62
  $t(
62
63
  'Count more elements matched your query, please make a more specific search.',
@@ -65,101 +66,106 @@
65
66
  }}
66
67
  </div>
67
68
  </template>
68
- <template v-slot:noOptions>{{ $t('List is empty') }}</template>
69
- <template v-slot:caret>
69
+ <template #noOptions="">
70
+ {{ $t('List is empty') }}
71
+ </template>
72
+ <template #caret="">
70
73
  <div class="position-relative">
71
74
  <span
72
75
  class="saooti-arrow_down octopus-arrow-down-2 octopus-arrow-down-top"
73
- ></span>
76
+ />
74
77
  </div>
75
78
  </template>
76
- </Multiselect>
79
+ </VueMultiselect>
77
80
  </div>
78
81
  </template>
79
82
 
80
- <style lang="scss">
81
- .default-multiselect-width {
82
- width: 100%;
83
- }
84
- </style>
85
83
  <script lang="ts">
86
- import Multiselect from 'vue-multiselect';
84
+ //@ts-ignore
85
+ import VueMultiselect from 'vue-multiselect';
87
86
  const octopusApi = require('@saooti/octopus-api');
88
87
 
89
88
  const ELEMENTS_COUNT = 50;
90
89
  const DEFAULT_EMISSION_ID = 0;
91
90
 
92
- const getDefaultEmission = (defaultName: any) => {
91
+ const getDefaultEmission = (defaultName: string) => {
92
+ if(''=== defaultName){
93
+ return undefined;
94
+ }
93
95
  return {
94
96
  name: defaultName,
95
- id: DEFAULT_EMISSION_ID,
97
+ emissionId: DEFAULT_EMISSION_ID,
98
+ imageUrl:'',
99
+ description:'',
100
+ monetisable:'UNDEFINED',
101
+ orga :{
102
+ id:'',
103
+ imageUrl:'',
104
+ name:''
105
+ },
106
+ rubriqueIds:[],
96
107
  };
97
108
  };
98
109
 
99
- import { defineComponent, ref } from 'vue'
110
+ import { Emission } from '@/store/class/emission';
111
+ import { defineComponent } from 'vue'
100
112
  export default defineComponent({
101
113
  components: {
102
- Multiselect,
114
+ VueMultiselect
103
115
  },
104
116
 
105
117
  props: {
106
- width: { default: '100%' },
107
- defaultanswer: { default: undefined as any },
108
- organisationId: { default: undefined as any },
109
- emissionChosen: { default: undefined as any },
110
- displayArrow: { default: true },
111
- distributedBy: { default: undefined as any },
112
- organisationDistributedBy: { default: undefined as any },
113
- reset: { default: false },
118
+ width: { default: '100%', type: String },
119
+ defaultanswer: { default: '', type: String },
120
+ organisationId: { default: undefined, type: String},
121
+ emissionChosen: { default: undefined, type: Object as ()=>Emission},
122
+ displayArrow: { default: true, type: Boolean },
123
+ distributedBy: { default: undefined, type: String},
124
+ organisationDistributedBy: { default: undefined, type: String},
125
+ reset: { default: false, type: Boolean },
114
126
  },
115
127
 
116
128
  emits: ['selected'],
117
129
 
118
130
  data() {
119
- let _return:any = {
120
- emission: '',
121
- emissions: [] as any,
122
- remainingElements: 0,
123
- isLoading: false,
131
+ return{
132
+ emission: getDefaultEmission(this.defaultanswer) as Emission | undefined,
133
+ emissions: [] as Array<Emission>,
134
+ remainingElements: 0 as number,
135
+ isLoading: false as boolean,
124
136
  };
125
- if (this.defaultanswer) {
126
- _return['emission'] = getDefaultEmission(this.defaultanswer);
127
- }
128
- return _return;
129
137
  },
130
-
131
- setup() {
132
- const multiselectRef : any = ref(null);
133
- return {
134
- multiselectRef,
135
- };
138
+ watch: {
139
+ emissionChosen(): void {
140
+ this.emission = this.emissionChosen;
141
+ },
142
+ reset(): void {
143
+ this.emission = getDefaultEmission(this.defaultanswer);
144
+ },
136
145
  },
137
146
 
138
- methods: {
139
- onOpen() {
140
- this.multiselectRef.$refs.search.setAttribute(
147
+ methods: {
148
+ onOpen(): void {
149
+ (this.$refs.multiselectRef as any).$refs.search.setAttribute(
141
150
  'autocomplete',
142
151
  'off'
143
152
  );
144
153
  this.clearAll();
145
154
  this.onSearchEmission();
146
155
  },
147
-
148
- onClose() {
156
+ onClose(): void {
149
157
  if (this.emission) return;
150
158
  this.emission = this.defaultanswer
151
159
  ? getDefaultEmission(this.defaultanswer)
152
- : '';
160
+ : undefined;
153
161
  this.$emit('selected', this.emission);
154
162
  },
155
-
156
- onEmissionSelected(emission: any) {
163
+ onEmissionSelected(emission: Emission): void {
157
164
  this.$emit('selected', emission);
158
165
  },
159
-
160
- async onSearchEmission(query: undefined) {
166
+ async onSearchEmission(query?: string): Promise<void> {
161
167
  this.isLoading = true;
162
- let standardParam:any = {
168
+ let standardParam: any = {
163
169
  query: query,
164
170
  first: 0,
165
171
  size: ELEMENTS_COUNT,
@@ -180,28 +186,24 @@ export default defineComponent({
180
186
  }
181
187
  const response = await octopusApi.fetchEmissions(standardParam);
182
188
  if (this.defaultanswer) {
183
- this.emissions = [getDefaultEmission(this.defaultanswer)].concat(
184
- response.result
185
- );
189
+ const emissionDefault = getDefaultEmission(this.defaultanswer);
190
+ if(emissionDefault){
191
+ this.emissions = [emissionDefault].concat(
192
+ response.result
193
+ );
194
+ }
186
195
  } else {
187
196
  this.emissions = response.result.concat();
188
197
  }
189
198
  this.isLoading = false;
190
199
  this.remainingElements = Math.max(0, response.count - ELEMENTS_COUNT);
191
200
  },
192
-
193
- clearAll() {
194
- this.emission = '';
201
+ clearAll(): void {
202
+ this.emission = undefined;
195
203
  this.emissions.length = 0;
196
204
  },
197
205
  },
198
- watch: {
199
- emissionChosen(newVal) {
200
- this.emission = getDefaultEmission(newVal);
201
- },
202
- reset() {
203
- this.emission = getDefaultEmission(this.defaultanswer);
204
- },
205
- },
206
- });
206
+ })
207
207
  </script>
208
+
209
+ <style lang="scss"></style>