@saooti/octopus-sdk 30.0.17 → 30.0.21

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.
@@ -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>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
  <ClassicRadio
118
118
  v-model:textInit="sort"
119
- id-select="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'}]:
@@ -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
 
@@ -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
  "
@@ -1,105 +1,97 @@
1
1
  <template>
2
2
  <div
3
- class="top-bar-dropdown"
3
+ class="d-flex align-items-center"
4
4
  >
5
- <div
5
+ <button
6
6
  v-if="authenticated"
7
- class="dropdown split-dropdown btn-group"
7
+ class="btn btn-primary m-1"
8
+ @click="goToUrl('/main/priv/backoffice')"
9
+ >
10
+ {{ $t('My space') }}
11
+ </button>
12
+ <div
13
+ class="dropdown btn-group"
8
14
  >
9
15
  <button
10
- class="btn btn-primary main-button-dropdown"
11
- @click="goToUrl('/main/priv/backoffice')"
12
- >
13
- {{ $t('My space') }}
14
- </button>
15
- <button
16
- class="btn dropdown-toggle btn-primary data-selenium-dropdown-topbar dropdown-toggle-split"
16
+ class="btn dropdown-toggle m-1 admin-button dropdown-toggle-no-caret saooti-user-octopus"
17
17
  data-bs-toggle="dropdown"
18
18
  aria-expanded="false"
19
+ :title="$t('User menu')"
19
20
  />
20
21
  <div class="dropdown-menu dropdown-menu-right px-4">
21
- <router-link
22
- v-if="isContribution && !isPodcastmaker"
23
- class="btn btn-primary w-100"
24
- to="/main/priv/upload"
25
- >
26
- {{ $t('Upload') }}
27
- </router-link>
28
- <template v-if="!isPodcastmaker">
29
- <router-link
30
- to="/main/priv/backoffice"
31
- class="show-phone dropdown-item"
32
- >
33
- {{ $t('My space') }}
34
- </router-link>
35
- <router-link
22
+ <template v-if="!authenticated">
23
+ <a
36
24
  class="dropdown-item"
37
- to="/main/priv/edit/profile"
25
+ href="/sso/login"
38
26
  >
39
- {{ $t('Edit my profile') }}
40
- </router-link>
27
+ {{ $t('Login') }}
28
+ </a>
41
29
  <router-link
42
- v-if="isOrganisation"
30
+ v-if="!isPodcastmaker"
43
31
  class="dropdown-item"
44
- to="/main/priv/edit/organisation"
32
+ to="/main/pub/create"
45
33
  >
46
- {{ $t('Edit my organisation') }}
34
+ {{ $t('Create an account') }}
47
35
  </router-link>
48
36
  </template>
49
- <template v-if="!isEducation">
50
- <hr class="dropdown-divider">
51
- <a
52
- href="https://help.octopus.saooti.com/Aide/"
53
- class="dropdown-item"
54
- rel="noopener"
55
- target="_blank"
56
- >
57
- {{ $t('Help') }}
58
- </a>
59
- <a
60
- href="https://help.octopus.saooti.com/"
61
- class="dropdown-item"
62
- rel="noopener"
63
- target="_blank"
64
- >
65
- {{ $t('TutoMag') }}
66
- </a>
67
- <hr class="dropdown-divider">
68
- <a
69
- class="dropdown-item"
70
- href="/sso/logout"
37
+ <template v-else>
38
+ <router-link
39
+ v-if="isContribution && !isPodcastmaker"
40
+ class="btn btn-primary w-100"
41
+ to="/main/priv/upload"
71
42
  >
72
- {{ $t('Logout') }}
73
- </a>
43
+ {{ $t('Upload') }}
44
+ </router-link>
45
+ <template v-if="!isPodcastmaker">
46
+ <router-link
47
+ to="/main/priv/backoffice"
48
+ class="show-phone dropdown-item"
49
+ >
50
+ {{ $t('My space') }}
51
+ </router-link>
52
+ <router-link
53
+ class="dropdown-item"
54
+ to="/main/priv/edit/profile"
55
+ >
56
+ {{ $t('Edit my profile') }}
57
+ </router-link>
58
+ <router-link
59
+ v-if="isOrganisation"
60
+ class="dropdown-item"
61
+ to="/main/priv/edit/organisation"
62
+ >
63
+ {{ $t('Edit my organisation') }}
64
+ </router-link>
65
+ </template>
66
+ <template v-if="!isEducation">
67
+ <hr class="dropdown-divider">
68
+ <a
69
+ href="https://help.octopus.saooti.com/Aide/"
70
+ class="dropdown-item"
71
+ rel="noopener"
72
+ target="_blank"
73
+ >
74
+ {{ $t('Help') }}
75
+ </a>
76
+ <a
77
+ href="https://help.octopus.saooti.com/"
78
+ class="dropdown-item"
79
+ rel="noopener"
80
+ target="_blank"
81
+ >
82
+ {{ $t('TutoMag') }}
83
+ </a>
84
+ <hr class="dropdown-divider">
85
+ <a
86
+ class="dropdown-item"
87
+ href="/sso/logout"
88
+ >
89
+ {{ $t('Logout') }}
90
+ </a>
91
+ </template>
74
92
  </template>
75
93
  </div>
76
94
  </div>
77
- <div
78
- v-else
79
- class="dropdown btn-group"
80
- >
81
- <button
82
- class="btn dropdown-toggle m-1 admin-button dropdown-toggle-no-caret saooti-user-octopus"
83
- data-bs-toggle="dropdown"
84
- aria-expanded="false"
85
- title="Profile"
86
- />
87
- <div class="dropdown-menu dropdown-menu-right px-4">
88
- <a
89
- class="dropdown-item"
90
- href="/sso/login"
91
- >
92
- {{ $t('Login') }}
93
- </a>
94
- <router-link
95
- v-if="!isPodcastmaker"
96
- class="dropdown-item"
97
- to="/main/pub/create"
98
- >
99
- {{ $t('Create an account') }}
100
- </router-link>
101
- </div>
102
- </div>
103
95
  </div>
104
96
  </template>
105
97
 
@@ -136,37 +128,4 @@ export default defineComponent({
136
128
  },
137
129
  },
138
130
  })
139
- </script>
140
-
141
- <style lang="scss">
142
- .top-bar-dropdown {
143
- display: flex;
144
- align-items: center;
145
-
146
- .main-button-dropdown {
147
- padding-bottom: 0.4rem;
148
- width: 140px;
149
- text-align: left;
150
- padding-left: 15px;
151
- margin-right: 30px;
152
- @media (max-width: 650px) {
153
- display: none;
154
- }
155
- }
156
- .btn-group .dropdown-toggle-split {
157
- align-items: center;
158
- border-radius: 50%;
159
- width: 40px !important;
160
- height: 40px !important;
161
- justify-content: center;
162
- position: absolute;
163
- right: 5px;
164
- border: 4px solid white !important;
165
- z-index: 2;
166
- @media (max-width: 650px) {
167
- position: relative;
168
- right: auto;
169
- }
170
- }
171
- }
172
- </style>
131
+ </script>
@@ -23,7 +23,7 @@
23
23
  />
24
24
  </div>
25
25
  <div
26
- v-if="(isPlaying || isPaused) && (media || isStop)"
26
+ v-if="isPlaying || isPaused"
27
27
  class="play-button-box primary-bg text-light"
28
28
  @click="stopPlayer"
29
29
  >
@@ -61,9 +61,6 @@ export default defineComponent({
61
61
  if (this.$store.state.player.podcast) return this.$store.state.player.podcast.imageUrl;
62
62
  return '';
63
63
  },
64
- isStop(): boolean{
65
- return this.$store.state.player.stop;
66
- },
67
64
  media(): undefined|Media{
68
65
  return this.$store.state.player.media;
69
66
  },
@@ -34,7 +34,7 @@
34
34
  :reset="reset"
35
35
  @selected="onOrganisationSelected"
36
36
  />
37
- <div class="d-flex justify-content-center flex-grow-1">
37
+ <div class="d-flex justify-content-end flex-grow-1">
38
38
  <router-link
39
39
  v-if="
40
40
  isLiveTab &&
@@ -233,12 +233,8 @@ export default defineComponent({
233
233
  this.$emit('emissionTitle', this.name);
234
234
  this.loaded = true;
235
235
  if (!this.emission.annotations) return;
236
- if (this.emission.annotations.RSS) {
237
- this.rssEmission = true;
238
- }
239
- if (this.emission.annotations.FTP) {
240
- this.ftpEmission = true;
241
- }
236
+ this.rssEmission = this.emission.annotations.RSS? true: false;
237
+ this.ftpEmission = this.emission.annotations.FTP? true: false;
242
238
  if (this.emission.annotations.exclusive) {
243
239
  this.exclusive =
244
240
  'true' === this.emission.annotations.exclusive ? true : false;