@saooti/octopus-sdk 30.0.18 → 30.0.22

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 (33) hide show
  1. package/README.md +5 -1
  2. package/package.json +3 -3
  3. package/src/assets/bootstrap-diff.scss +10 -52
  4. package/src/assets/general.scss +1 -1
  5. package/src/assets/share.scss +17 -37
  6. package/src/components/display/categories/CategoryFilter.vue +4 -1
  7. package/src/components/display/comments/AddCommentModal.vue +35 -50
  8. package/src/components/display/comments/CommentBasicView.vue +96 -0
  9. package/src/components/display/comments/CommentInput.vue +22 -28
  10. package/src/components/display/comments/CommentItem.vue +56 -148
  11. package/src/components/display/comments/CommentList.vue +56 -112
  12. package/src/components/display/comments/CommentParentInfo.vue +17 -57
  13. package/src/components/display/comments/CommentPlayer.vue +2 -7
  14. package/src/components/display/comments/CommentSection.vue +9 -24
  15. package/src/components/display/edit/EditCommentBox.vue +123 -23
  16. package/src/components/display/emission/EmissionList.vue +5 -2
  17. package/src/components/display/filter/AdvancedSearch.vue +1 -1
  18. package/src/components/display/live/LiveHorizontalList.vue +5 -2
  19. package/src/components/display/live/LiveList.vue +3 -3
  20. package/src/components/display/playlist/PlaylistList.vue +5 -2
  21. package/src/components/display/playlist/PodcastList.vue +5 -2
  22. package/src/components/display/podcasts/PodcastImage.vue +1 -1
  23. package/src/components/display/podcasts/PodcastInlineList.vue +2 -2
  24. package/src/components/display/podcasts/PodcastList.vue +5 -2
  25. package/src/components/misc/HomeDropdown.vue +74 -115
  26. package/src/components/misc/PlayerButtons.vue +1 -4
  27. package/src/components/misc/TopBar.vue +1 -1
  28. package/src/components/misc/modal/MessageModal.vue +1 -1
  29. package/src/components/pages/Emission.vue +2 -6
  30. package/src/locale/en.ts +1 -0
  31. package/src/locale/fr.ts +1 -0
  32. package/src/store/AppStore.ts +0 -3
  33. package/src/store/typeAppStore.ts +0 -1
@@ -1,79 +1,41 @@
1
1
  <template>
2
2
  <div class="mt-2">
3
- <div
4
- v-if="loading"
5
- class="d-flex"
6
- >
7
- <div class="spinner-border me-3" />
8
- <div class="mt-2">
9
- {{ $t('Loading content ...') }}
10
- </div>
11
- </div>
12
- <div v-else>
13
- <div class="d-flex small-text">
14
- <b class="me-2">{{ comment.name }}</b>
15
- <img
16
- v-if="comment.certified"
17
- class="icon-certified"
18
- src="/img/certified.png"
19
- :title="$t('Certified account')"
20
- >
21
- <div class="me-2">
22
- {{ date }}
23
- </div>
24
- </div>
25
- <div>{{ contentDisplay }}</div>
26
- <a
27
- v-if="comment.content.length > 300"
28
- class="c-hand font-italic"
29
- @click="summary = !summary"
30
- >{{ readMore }}</a>
31
- </div>
3
+ <ClassicLoading
4
+ :loading-text="loading?$t('Loading content ...'):undefined"
5
+ />
6
+ <CommentBasicView
7
+ v-if="!loading"
8
+ :comment="comment"
9
+ :edit-right="editRight"
10
+ />
32
11
  </div>
33
12
  </template>
34
13
 
35
14
  <script lang="ts">
36
15
  import octopusApi from '@saooti/octopus-api';
37
- import moment from 'moment';
16
+ import CommentBasicView from './CommentBasicView.vue';
17
+ import ClassicLoading from '../../form/ClassicLoading.vue';
38
18
  import { CommentPodcast } from '@/store/class/general/comment';
39
19
  import { defineComponent } from 'vue'
40
20
  export default defineComponent({
41
21
  name: 'CommentParentInfo',
42
22
 
23
+ components:{
24
+ CommentBasicView,
25
+ ClassicLoading
26
+ },
27
+
43
28
  props: {
44
29
  comId: { default: undefined, type: Number },
30
+ editRight: { default: false, type: Boolean},
45
31
  },
46
32
 
47
33
  data() {
48
34
  return {
49
35
  loading: true as boolean,
50
- summary: true as boolean,
51
36
  comment: undefined as CommentPodcast|undefined,
52
37
  };
53
38
  },
54
-
55
-
56
- computed: {
57
- date(): string {
58
- if (this.comment && this.comment.date)
59
- return moment(this.comment.date).format('D MMMM YYYY HH[h]mm');
60
- return '';
61
- },
62
- limitContent(): string {
63
- if (!this.comment || !this.comment.content) return '';
64
- if (this.comment.content.length <= 300) return this.comment.content;
65
- return this.comment.content.substring(0, 300) + '...';
66
- },
67
- readMore(): string {
68
- if (this.summary) return this.$t('Read more').toString();
69
- return this.$t('Read less').toString();
70
- },
71
- contentDisplay(): string {
72
- if (this.summary) return this.limitContent;
73
- return this.comment && this.comment.content? this.comment.content : '';
74
- },
75
- },
76
-
77
39
  async created() {
78
40
  if(this.comId){
79
41
  this.comment = await octopusApi.fetchComment(this.comId);
@@ -81,6 +43,4 @@ export default defineComponent({
81
43
  this.loading = false;
82
44
  },
83
45
  })
84
- </script>
85
-
86
- <style lang="scss"></style>
46
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="comment-player-container comment-item-container">
2
+ <div class="comment-player-container">
3
3
  <div
4
4
  v-for="c in comments"
5
5
  :key="c.comId"
@@ -20,7 +20,7 @@
20
20
  </div>
21
21
  <div
22
22
  v-if="displayContent"
23
- class="comment-content"
23
+ class="small-text mt-auto"
24
24
  >
25
25
  <div class="primary-color flex-shrink-0">
26
26
  {{ displayContent.name }}
@@ -95,10 +95,5 @@ export default defineComponent({
95
95
  margin-top: 20px;
96
96
  position: absolute;
97
97
  }
98
- .comment-content {
99
- margin-top: auto;
100
- font-size: 0.7rem;
101
- display: flex;
102
- }
103
98
  }
104
99
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="isComments"
4
- class="d-flex flex-column mt-3 module-box comment-item-container"
4
+ class="module-box"
5
5
  >
6
6
  <div class="d-flex align-items-center">
7
7
  <h2
@@ -18,7 +18,7 @@
18
18
  <button
19
19
  v-if="!isLive"
20
20
  :title="$t('Refresh')"
21
- class="saooti-refresh-stud btn btn-reload primary-color"
21
+ class="btn admin-button primary-color saooti-refresh-stud"
22
22
  @click="reloadComments"
23
23
  />
24
24
  </div>
@@ -115,7 +115,7 @@ export default defineComponent({
115
115
  this.knownIdentity = this.getCookie('comment-octopus-name');
116
116
  },
117
117
  methods: {
118
- updateFetch(value: { count: number }): void {
118
+ updateFetch(value: { count: number, comments: Array<CommentPodcast> }): void {
119
119
  this.loaded = true;
120
120
  this.$store.commit('setCommentLoaded', {
121
121
  ...value,
@@ -130,38 +130,23 @@ export default defineComponent({
130
130
  (this.$refs.commentList as InstanceType<typeof CommentListVue>).addNewComment(comment, true);
131
131
  },
132
132
  receiveCommentEvent(event: {type?: string; comment: CommentPodcast; status?: string; oldStatus?:string }): void {
133
+ const commentList = (this.$refs.commentList as InstanceType<typeof CommentListVue>);
133
134
  let statusUpdated = undefined;
134
135
  switch (event.type) {
135
- case 'Create':
136
- (this.$refs.commentList as InstanceType<typeof CommentListVue>).addNewComment(event.comment);
137
- break;
136
+ case 'Create':commentList.addNewComment(event.comment);break;
138
137
  case 'Update':
139
138
  if (event.comment.status !== event.oldStatus) {
140
139
  statusUpdated = event.comment.status;
141
140
  }
142
- (this.$refs.commentList as InstanceType<typeof CommentListVue>).updateComment({
141
+ commentList.updateComment({
143
142
  comment: event.comment,
144
143
  status: statusUpdated,
145
144
  });
146
145
  break;
147
- case 'Delete':
148
- (this.$refs.commentList as InstanceType<typeof CommentListVue>).deleteComment(event.comment);
149
- break;
150
- default:
151
- console.log('Event not handle');
152
- break;
146
+ case 'Delete':commentList.deleteComment(event.comment);break;
147
+ default:break;
153
148
  }
154
149
  },
155
150
  },
156
151
  })
157
- </script>
158
-
159
- <style lang="scss">
160
- .btn-reload {
161
- width: 40px;
162
- height: 40px;
163
- padding: 0;
164
- font-size: 1rem;
165
- font-weight: bold;
166
- }
167
- </style>
152
+ </script>
@@ -1,53 +1,153 @@
1
1
  <template>
2
2
  <div class="d-flex">
3
3
  <button
4
- class="btn btn-comment-edit saooti-edit-bounty"
4
+ class="btn admin-button primary-color me-1"
5
5
  title="edit"
6
6
  @click="editComment"
7
- />
7
+ >
8
+ <span
9
+ class="saooti-edit-bounty"
10
+ :data-selenium="'Edit-Comment-' + seleniumFormat(comment.name)"
11
+ />
12
+ </button>
8
13
  <button
9
14
  v-if="'Pending' === comment.status || 'Invalid' === comment.status"
10
- class="btn btn-comment-edit saooti-valid-stud"
15
+ class="btn admin-button primary-color me-1"
11
16
  title="valid"
12
- @click="validComment"
13
- />
17
+ @click="commentModal('Valid')"
18
+ >
19
+ <span
20
+ class="saooti-valid-stud"
21
+ :data-selenium="'Validate-Comment-' + seleniumFormat(comment.name)"
22
+ />
23
+ </button>
14
24
  <button
15
25
  v-if="'Pending' === comment.status || 'Valid' === comment.status"
16
- class="btn btn-comment-edit saooti-cross"
26
+ class="btn admin-button primary-color me-1"
17
27
  title="invalid"
18
- @click="invalidComment"
19
- />
28
+ @click="commentModal('Invalid')"
29
+ >
30
+ <span
31
+ class="saooti-cross"
32
+ :data-selenium="'Invalidate-Comment-' + seleniumFormat(comment.name)"
33
+ />
34
+ </button>
35
+ <button
36
+ v-if="organisation"
37
+ class="btn admin-button primary-color me-1"
38
+ :title="$t('See more')"
39
+ @click="seeMore = true"
40
+ >
41
+ <span
42
+ class="saooti-more_vert"
43
+ :data-selenium="'More-Info-Comment-' + seleniumFormat(comment.name)"
44
+ />
45
+ </button>
20
46
  <button
21
- class="btn btn-comment-edit saooti-bin"
47
+ class="btn admin-button primary-color me-1"
22
48
  title="delete"
23
- @click="deleteComment"
49
+ @click="commentModal('Delete')"
50
+ >
51
+ <span
52
+ class="saooti-bin"
53
+ :data-selenium="'Trash-Comment-' + seleniumFormat(comment.name)"
54
+ />
55
+ </button>
56
+ <MessageModal
57
+ v-if="displayModal"
58
+ :validatetext="validateText"
59
+ :canceltext="canceltext"
60
+ :closable="false"
61
+ :title="modalTitle"
62
+ :message="modalMessage"
63
+ @cancel="displayModal = false"
64
+ @validate="deleteComment"
65
+ @close="displayModal = false"
24
66
  />
25
67
  </div>
26
68
  </template>
27
69
 
28
70
  <script lang="ts">
71
+ import { selenium } from '../../mixins/functions';
29
72
  import { CommentPodcast } from '@/store/class/general/comment';
30
- import { defineComponent } from 'vue'
73
+ import { defineComponent, defineAsyncComponent } from 'vue';
74
+ const MessageModal = defineAsyncComponent(
75
+ () => import('@/components/misc/modal/MessageModal.vue')
76
+ );
31
77
  export default defineComponent({
78
+ components: {
79
+ MessageModal,
80
+ },
81
+ mixins: [selenium],
82
+
32
83
  props: {
33
- comment: { default: undefined, type: Object as ()=>CommentPodcast},
84
+ comment: { default: () => ({}), type: Object as () => CommentPodcast },
85
+ organisation: { default: undefined, type: String },
86
+ },
87
+ emits: ['editComment', 'updateComment', 'deleteComment'],
88
+
89
+ data() {
90
+ return {
91
+ displayModal: false as boolean,
92
+ isDeleting: false as boolean,
93
+ type: 'update' as string,
94
+ seeMore: false as boolean,
95
+ };
96
+ },
97
+
98
+ computed: {
99
+ validateText(): string | undefined {
100
+ if ('Error' === this.type || 'Error403' === this.type)
101
+ return this.$t('Close').toString();
102
+ if (this.isDeleting) return undefined;
103
+ return this.$t('Yes').toString();
104
+ },
105
+ canceltext(): string | undefined {
106
+ if ('Error' === this.type || 'Error403' === this.type) return undefined;
107
+ return this.$t('No').toString();
108
+ },
109
+ modalMessage(): string {
110
+ switch (this.type) {
111
+ case 'Delete':
112
+ if (this.isDeleting)
113
+ return this.$t('Deleting in progress ...').toString();
114
+ return this.$t('Confirm comment deletion text', {
115
+ name: this.comment.name,
116
+ }).toString();
117
+ case 'Error':
118
+ return this.$t('Error occurs while updating your comment').toString();
119
+ case 'Error403':
120
+ return this.$t('403 error forbidden').toString();
121
+ default:
122
+ return '';
123
+ }
124
+ },
125
+ modalTitle(): string {
126
+ switch (this.type) {
127
+ case 'Delete':
128
+ return this.$t('Delete comment').toString();
129
+ case 'Error403':
130
+ case 'Error':
131
+ return this.$t('Error').toString();
132
+ default:
133
+ return this.$t('Update comment').toString();
134
+ }
135
+ },
34
136
  },
35
- emits: ['editComment'],
36
137
 
37
138
  methods: {
38
- editComment() {
139
+ editComment(): void {
39
140
  this.$emit('editComment');
40
141
  },
41
- validComment() {
42
- console.log('valid');
142
+ commentModal(type: string): void {
143
+ console.log('commentModal'+ type);
43
144
  },
44
- invalidComment() {
45
- console.log('invalid');
145
+ async updateComment(newComment?: CommentPodcast | undefined): Promise<void> {
146
+ console.log('updateComment' + newComment);
46
147
  },
47
- deleteComment() {
48
- console.log('delete');
148
+ async deleteComment(): Promise<void> {
149
+ console.log('deleteComment');
49
150
  },
50
151
  },
51
- })
52
- </script>
53
- <style lang="scss"></style>
152
+ });
153
+ </script>
@@ -41,7 +41,7 @@
41
41
  <button
42
42
  v-show="!allFetched"
43
43
  class="btn"
44
- :class="buttonPlus ? 'btn-link-plus' : 'btn-more'"
44
+ :class="buttonPlus ? 'btn-link' : 'btn-more'"
45
45
  :disabled="loading"
46
46
  :title="$t('See more')"
47
47
  @click="fetchContent(false)"
@@ -49,7 +49,10 @@
49
49
  <template v-if="buttonPlus">
50
50
  {{ $t('See more') }}
51
51
  </template>
52
- <div class="saooti-plus" />
52
+ <div
53
+ :class="buttonPlus?'ms-1':''"
54
+ class="saooti-plus"
55
+ />
53
56
  </button>
54
57
  </template>
55
58
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
  <ClassicRadio
118
118
  v-model:textInit="sort"
119
- idRadio="sort-radio"
119
+ id-radio="sort-radio"
120
120
  :options="isSearchBar? [{title:$t('Sort score'), value:'SCORE'},
121
121
  {title:$t('Sort last'), value:isEmission?'LAST_PODCAST_DESC':'DATE'},
122
122
  {title:$t('Sort name'), value:'NAME'}]:
@@ -16,7 +16,7 @@
16
16
  <button
17
17
  v-show="!allFetched"
18
18
  class="btn"
19
- :class="buttonPlus ? 'btn-link-plus mt-3' : 'btn-more'"
19
+ :class="buttonPlus ? 'btn-link mt-3' : 'btn-more'"
20
20
  :disabled="inFetching"
21
21
  :title="$t('See more')"
22
22
  @click="displayMore"
@@ -24,7 +24,10 @@
24
24
  <template v-if="buttonPlus">
25
25
  {{ $t('See more') }}
26
26
  </template>
27
- <div class="saooti-plus" />
27
+ <div
28
+ :class="buttonPlus?'ms-1':''"
29
+ class="saooti-plus"
30
+ />
28
31
  </button>
29
32
  </div>
30
33
  </template>
@@ -12,12 +12,12 @@
12
12
  {{ displayNextLiveMessage }}
13
13
  </h3>
14
14
  </div>
15
- <div
15
+ <template
16
16
  v-for="(live, indexLive) in livesArray"
17
17
  :key="live.status"
18
18
  >
19
19
  <template v-if="live.lives.length">
20
- <hr>
20
+ <hr class="w-100">
21
21
  <p class="live-list-category">
22
22
  {{ live.title }}
23
23
  </p>
@@ -30,7 +30,7 @@
30
30
  @deleteItem="deleteLive(indexLive, $event)"
31
31
  />
32
32
  </template>
33
- </div>
33
+ </template>
34
34
  </div>
35
35
  </template>
36
36
 
@@ -19,7 +19,7 @@
19
19
  <button
20
20
  v-show="!allFetched && loaded"
21
21
  class="btn"
22
- :class="buttonPlus ? 'btn-link-plus':'btn-more'"
22
+ :class="buttonPlus ? 'btn-link':'btn-more'"
23
23
  :disabled="inFetching"
24
24
  :title="$t('See more')"
25
25
  @click="displayMore"
@@ -27,7 +27,10 @@
27
27
  <template v-if="buttonPlus">
28
28
  {{ $t('See more') }}
29
29
  </template>
30
- <div class="saooti-plus" />
30
+ <div
31
+ :class="buttonPlus?'ms-1':''"
32
+ class="saooti-plus"
33
+ />
31
34
  </button>
32
35
  </div>
33
36
  </template>
@@ -40,14 +40,17 @@
40
40
  <button
41
41
  v-show="size < podcasts.length && loaded"
42
42
  class="btn"
43
- :class="buttonPlus ? 'btn-link-plus':'btn-more'"
43
+ :class="buttonPlus ? 'btn-link':'btn-more'"
44
44
  :title="$t('See more')"
45
45
  @click="displayMore"
46
46
  >
47
47
  <template v-if="buttonPlus">
48
48
  {{ $t('See more') }}
49
49
  </template>
50
- <div class="saooti-plus" />
50
+ <div
51
+ :class="buttonPlus?'ms-1':''"
52
+ class="saooti-plus"
53
+ />
51
54
  </button>
52
55
  </div>
53
56
  </template>
@@ -13,7 +13,7 @@
13
13
  v-if="fetchConference"
14
14
  class="live-image-status"
15
15
  :class="
16
- fetchConference && 'null' !== fetchConference
16
+ fetchConference && 'null' !== fetchConference && fetchConference.status
17
17
  ? fetchConference.status.toLowerCase() + '-bg'
18
18
  : ''
19
19
  "
@@ -63,13 +63,13 @@
63
63
  </transition-group>
64
64
  <router-link
65
65
  class="btn btn-link"
66
- :class="buttonPlus ? 'btn-link-plus' : ''"
66
+ :class="buttonPlus ? 'btn-link' : ''"
67
67
  :to="refTo"
68
68
  >
69
69
  {{ buttonText }}
70
70
  <div
71
71
  v-if="buttonPlus"
72
- class="saooti-plus"
72
+ class="ms-1 saooti-plus"
73
73
  />
74
74
  </router-link>
75
75
  </div>
@@ -23,7 +23,7 @@
23
23
  <button
24
24
  v-show="!allFetched && loaded"
25
25
  class="btn"
26
- :class="buttonPlus ? 'btn-link-plus' : 'btn-more'"
26
+ :class="buttonPlus ? 'btn-link' : 'btn-more'"
27
27
  :disabled="inFetching"
28
28
  :title="$t('See more')"
29
29
  @click="displayMore"
@@ -31,7 +31,10 @@
31
31
  <template v-if="buttonPlus">
32
32
  {{ $t('See more') }}
33
33
  </template>
34
- <div class="saooti-plus" />
34
+ <div
35
+ :class="buttonPlus?'ms-1':''"
36
+ class="saooti-plus"
37
+ />
35
38
  </button>
36
39
  </div>
37
40
  </template>