@saooti/octopus-sdk 30.0.19 → 30.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +2 -2
- package/src/assets/bootstrap-diff.scss +30 -84
- package/src/assets/form.scss +6 -3
- package/src/assets/general.scss +14 -3
- package/src/assets/share.scss +17 -43
- package/src/components/display/aggregator/RssSection.vue +1 -3
- package/src/components/display/categories/CategoryChooser.vue +1 -3
- package/src/components/display/categories/CategoryFilter.vue +5 -4
- package/src/components/display/categories/CategoryList.vue +4 -15
- package/src/components/display/comments/AddCommentModal.vue +35 -50
- package/src/components/display/comments/CommentBasicView.vue +96 -0
- package/src/components/display/comments/CommentInput.vue +22 -28
- package/src/components/display/comments/CommentItem.vue +56 -148
- package/src/components/display/comments/CommentList.vue +56 -112
- package/src/components/display/comments/CommentParentInfo.vue +17 -57
- package/src/components/display/comments/CommentPlayer.vue +2 -7
- package/src/components/display/comments/CommentSection.vue +9 -24
- package/src/components/display/edit/EditBox.vue +0 -2
- package/src/components/display/edit/EditCommentBox.vue +123 -23
- package/src/components/display/emission/EmissionChooser.vue +1 -3
- package/src/components/display/emission/EmissionInlineList.vue +2 -2
- package/src/components/display/emission/EmissionItem.vue +1 -2
- package/src/components/display/emission/EmissionList.vue +5 -2
- package/src/components/display/filter/AdvancedSearch.vue +2 -2
- package/src/components/display/filter/CategoryFilter.vue +0 -2
- package/src/components/display/filter/MonetizableFilter.vue +1 -3
- package/src/components/display/filter/ProductorSearch.vue +2 -2
- package/src/components/display/filter/RubriqueChoice.vue +1 -3
- package/src/components/display/filter/RubriqueFilter.vue +1 -3
- package/src/components/display/live/CountDown.vue +1 -3
- package/src/components/display/live/LiveHorizontalList.vue +6 -5
- package/src/components/display/organisation/OrganisationChooser.vue +1 -3
- package/src/components/display/playlist/PlaylistItem.vue +2 -4
- package/src/components/display/playlist/PlaylistList.vue +6 -5
- package/src/components/display/playlist/PodcastList.vue +5 -2
- package/src/components/display/podcasts/ParticipantDescription.vue +1 -3
- package/src/components/display/podcasts/PodcastFilterList.vue +1 -3
- package/src/components/display/podcasts/PodcastImage.vue +1 -1
- package/src/components/display/podcasts/PodcastInlineList.vue +5 -7
- package/src/components/display/podcasts/PodcastList.vue +6 -5
- package/src/components/display/podcasts/PodcastModuleBox.vue +1 -3
- package/src/components/display/podcasts/TagList.vue +2 -1
- package/src/components/display/rubriques/RubriqueChooser.vue +1 -3
- package/src/components/display/rubriques/RubriqueList.vue +1 -1
- package/src/components/display/sharing/QrCode.vue +1 -3
- package/src/components/display/sharing/ShareDistribution.vue +1 -6
- package/src/components/display/sharing/SharePlayer.vue +1 -1
- package/src/components/display/sharing/SubscribeButtons.vue +3 -5
- package/src/components/display/studio/RecordingItemButton.vue +1 -3
- package/src/components/form/ClassicSearch.vue +21 -19
- package/src/components/misc/HomeDropdown.vue +74 -115
- package/src/components/misc/PlayerButtons.vue +1 -4
- package/src/components/misc/TopBar.vue +2 -2
- package/src/components/misc/modal/MessageModal.vue +2 -4
- package/src/components/misc/modal/QrCodeModal.vue +1 -3
- package/src/components/pages/Emission.vue +2 -6
- package/src/components/pages/Rubrique.vue +1 -3
- package/src/locale/en.ts +2 -0
- package/src/locale/fr.ts +2 -0
- package/src/sass/_variables.scss +10 -7
- package/src/store/AppStore.ts +0 -3
- package/src/store/typeAppStore.ts +0 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@click="changeIdentity"
|
|
10
10
|
>{{ knownIdentity }}</b>
|
|
11
11
|
<div
|
|
12
|
-
v-if="
|
|
12
|
+
v-if="editName"
|
|
13
13
|
class="d-flex"
|
|
14
14
|
>
|
|
15
15
|
<input
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
:class="{ 'border border-danger': temporaryName.length < 2 }"
|
|
20
20
|
>
|
|
21
21
|
<button
|
|
22
|
-
class="btn
|
|
22
|
+
class="btn"
|
|
23
23
|
@click="editName = false"
|
|
24
24
|
>
|
|
25
25
|
{{ $t('Cancel') }}
|
|
26
26
|
</button>
|
|
27
27
|
<button
|
|
28
|
-
class="btn btn-primary
|
|
28
|
+
class="btn btn-primary"
|
|
29
29
|
:disabled="temporaryName.length < 2"
|
|
30
30
|
@click="validEdit"
|
|
31
31
|
>
|
|
@@ -142,28 +142,23 @@ export default defineComponent({
|
|
|
142
142
|
if (this.comment && this.comment.comId) return this.$t('Answer a comment').toString();
|
|
143
143
|
return this.$t('Write a comment').toString();
|
|
144
144
|
},
|
|
145
|
-
organisationId(): string|undefined {
|
|
146
|
-
return state.generalParameters.organisationId;
|
|
147
|
-
},
|
|
148
|
-
authenticated(): boolean {
|
|
149
|
-
return (state.generalParameters.authenticated as boolean);
|
|
150
|
-
},
|
|
151
145
|
isCertified(): boolean {
|
|
152
146
|
if (
|
|
153
147
|
(state.generalParameters.isCommments &&
|
|
154
|
-
|
|
148
|
+
state.generalParameters.organisationId === this.podcastOrga) ||
|
|
155
149
|
state.generalParameters.isAdmin
|
|
156
|
-
)
|
|
150
|
+
){
|
|
157
151
|
return true;
|
|
152
|
+
}
|
|
158
153
|
return false;
|
|
159
154
|
},
|
|
160
155
|
userId(): string|undefined {
|
|
161
|
-
if (
|
|
156
|
+
if (state.generalParameters.authenticated) return this.$store.state.profile.userId;
|
|
162
157
|
return undefined;
|
|
163
158
|
},
|
|
164
159
|
phase(): string|undefined {
|
|
165
160
|
if(undefined === this.podcast){
|
|
166
|
-
return this.comment ? this.comment.phase :
|
|
161
|
+
return this.comment ? this.comment.phase : undefined;
|
|
167
162
|
}
|
|
168
163
|
if (
|
|
169
164
|
!this.podcast.conferenceId ||
|
|
@@ -233,11 +228,7 @@ export default defineComponent({
|
|
|
233
228
|
cancelAction(): void {
|
|
234
229
|
this.$emit('cancelAction');
|
|
235
230
|
},
|
|
236
|
-
|
|
237
|
-
if (name) {
|
|
238
|
-
this.setCookie('comment-octopus-name', name);
|
|
239
|
-
this.$emit('update:knownIdentity', name);
|
|
240
|
-
}
|
|
231
|
+
defineTimelineValue(): number{
|
|
241
232
|
let timeline = 0;
|
|
242
233
|
if (
|
|
243
234
|
undefined !== this.podcast &&(
|
|
@@ -261,16 +252,20 @@ export default defineComponent({
|
|
|
261
252
|
timeline = 0;
|
|
262
253
|
}
|
|
263
254
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
255
|
+
return timeline;
|
|
256
|
+
},
|
|
257
|
+
async postComment(name?: string): Promise<void> {
|
|
258
|
+
if (name) {
|
|
259
|
+
this.setCookie('comment-octopus-name', name);
|
|
260
|
+
this.$emit('update:knownIdentity', name);
|
|
267
261
|
}
|
|
262
|
+
const sendName = name ? name: this.knownIdentity;
|
|
268
263
|
const commentPodcastId = this.comment ? this.comment.podcastId : 0;
|
|
269
264
|
const comment: CommentPodcast = {
|
|
270
265
|
content: this.newComment,
|
|
271
266
|
name: sendName ? sendName : '',
|
|
272
267
|
podcastId: this.podcast ? this.podcast.podcastId : commentPodcastId,
|
|
273
|
-
timeline:
|
|
268
|
+
timeline: this.defineTimelineValue(),
|
|
274
269
|
organisationId: this.podcastOrga,
|
|
275
270
|
commentIdReferer: this.comment ? this.comment.comId : undefined,
|
|
276
271
|
certified: this.isCertified,
|
|
@@ -287,11 +282,10 @@ export default defineComponent({
|
|
|
287
282
|
}
|
|
288
283
|
this.$emit('newComment', data);
|
|
289
284
|
this.newComment = '';
|
|
290
|
-
this.checkIdentityModal = false;
|
|
291
285
|
} catch (error) {
|
|
292
|
-
this.checkIdentityModal = false;
|
|
293
286
|
this.postError = true;
|
|
294
287
|
}
|
|
288
|
+
this.checkIdentityModal = false;
|
|
295
289
|
},
|
|
296
290
|
},
|
|
297
291
|
})
|
|
@@ -315,10 +309,10 @@ export default defineComponent({
|
|
|
315
309
|
overflow: hidden !important;
|
|
316
310
|
box-shadow: unset !important;
|
|
317
311
|
background: transparent !important;
|
|
318
|
-
height:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
312
|
+
height: 50px;
|
|
313
|
+
&.short{
|
|
314
|
+
max-height: 38px;
|
|
315
|
+
}
|
|
322
316
|
}
|
|
323
317
|
}
|
|
324
318
|
</style>
|
|
@@ -1,78 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="d-flex flex-column mt-2 mb-1 item-comment">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
class="recording-bg me-1 text-light p-1"
|
|
11
|
-
>{{ $t('Live') }}</b>
|
|
12
|
-
<b
|
|
13
|
-
v-if="editRight || comment.status == 'Valid'"
|
|
14
|
-
class="me-2"
|
|
15
|
-
>{{
|
|
16
|
-
comment.name
|
|
17
|
-
}}</b>
|
|
18
|
-
<template v-else>
|
|
19
|
-
<b
|
|
20
|
-
:id="'popover-comment' + comment.comId"
|
|
21
|
-
tabindex="-1"
|
|
22
|
-
class="mr-2 text-danger"
|
|
23
|
-
>{{
|
|
24
|
-
comment.name
|
|
25
|
-
}}</b>
|
|
26
|
-
<Popover
|
|
27
|
-
:target="'popover-comment' + comment.comId"
|
|
28
|
-
>
|
|
29
|
-
{{ $t('Comment waiting') }}
|
|
30
|
-
</Popover>
|
|
31
|
-
</template>
|
|
32
|
-
</template>
|
|
33
|
-
<template v-else>
|
|
34
|
-
<input
|
|
35
|
-
v-model="temporaryName"
|
|
36
|
-
class="form-input me-2 mb-2 width-auto"
|
|
37
|
-
type="text"
|
|
38
|
-
:class="{ 'border border-danger': temporaryName.length < 2 }"
|
|
39
|
-
>
|
|
40
|
-
</template>
|
|
41
|
-
<img
|
|
42
|
-
v-if="comment.certified"
|
|
43
|
-
class="icon-certified"
|
|
44
|
-
src="/img/certified.png"
|
|
45
|
-
:data-selenium="'certified-icon-' + seleniumFormat(comment.name)"
|
|
46
|
-
:title="$t('Certified account')"
|
|
47
|
-
>
|
|
48
|
-
<div class="me-2">
|
|
49
|
-
{{ date }}
|
|
50
|
-
</div>
|
|
51
|
-
<span
|
|
52
|
-
v-if="editRight"
|
|
53
|
-
:class="'status-' + comment.status"
|
|
54
|
-
:data-selenium="'status-comment-' + seleniumFormat(comment.name)"
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
<template v-if="!isEditing">
|
|
58
|
-
<!-- eslint-disable vue/no-v-html -->
|
|
59
|
-
<div v-html="urlify(contentDisplay)" />
|
|
60
|
-
<!-- eslint-enable -->
|
|
61
|
-
<a
|
|
62
|
-
v-if="comment.content.length > 300"
|
|
63
|
-
class="c-hand font-italic"
|
|
64
|
-
@click="summary = !summary"
|
|
65
|
-
>{{ readMore }}</a>
|
|
66
|
-
</template>
|
|
3
|
+
<CommentBasicView
|
|
4
|
+
v-if="!isEditing"
|
|
5
|
+
:comment="comment"
|
|
6
|
+
:edit-right="editRight"
|
|
7
|
+
:recording-in-live="recordingInLive"
|
|
8
|
+
/>
|
|
67
9
|
<template v-else>
|
|
10
|
+
<input
|
|
11
|
+
v-model="temporaryName"
|
|
12
|
+
class="form-input me-2 mb-2 width-auto"
|
|
13
|
+
type="text"
|
|
14
|
+
:class="{ 'border border-danger': temporaryName.length < 2 }"
|
|
15
|
+
>
|
|
68
16
|
<textarea
|
|
69
17
|
v-model="temporaryContent"
|
|
18
|
+
:class="{ 'border border-danger': 0===temporaryContent.length }"
|
|
70
19
|
class="form-input"
|
|
71
20
|
type="text"
|
|
72
21
|
/>
|
|
73
22
|
<div class="d-flex justify-content-end">
|
|
74
23
|
<button
|
|
75
|
-
class="btn
|
|
24
|
+
class="btn m-1"
|
|
76
25
|
@click="isEditing = false"
|
|
77
26
|
>
|
|
78
27
|
{{ $t('Cancel') }}
|
|
@@ -86,12 +35,10 @@
|
|
|
86
35
|
</button>
|
|
87
36
|
</div>
|
|
88
37
|
</template>
|
|
89
|
-
<div
|
|
90
|
-
class="mb-0 d-flex align-items-center mt-1"
|
|
91
|
-
>
|
|
38
|
+
<div class="d-flex align-items-center mt-1">
|
|
92
39
|
<button
|
|
93
|
-
v-if="null === comment.commentIdReferer && 'Valid'
|
|
94
|
-
class="btn py-1 px-3
|
|
40
|
+
v-if="null === comment.commentIdReferer && 'Valid'=== comment.status"
|
|
41
|
+
class="btn py-1 px-3 me-2"
|
|
95
42
|
:data-selenium="'answer-button-comment-' + seleniumFormat(comment.name)"
|
|
96
43
|
@click="answerComment"
|
|
97
44
|
>
|
|
@@ -102,40 +49,29 @@
|
|
|
102
49
|
(!isFlat && comment.relatedComments) ||
|
|
103
50
|
(isFlat && comment.commentIdReferer)
|
|
104
51
|
"
|
|
105
|
-
|
|
106
|
-
class="primary-color c-hand d-flex align-items-center small-text input-no-outline"
|
|
107
|
-
type="button"
|
|
108
|
-
data-bs-toggle="collapse"
|
|
109
|
-
:data-bs-target="'#commentItemDetail'+comment.comId"
|
|
110
|
-
aria-expanded="false"
|
|
111
|
-
:aria-controls="'commentItemDetail'+comment.comId"
|
|
52
|
+
class="d-flex align-items-center small-text primary-darker c-hand"
|
|
112
53
|
@click="collapseVisible=!collapseVisible"
|
|
113
54
|
>
|
|
114
|
-
<div
|
|
115
|
-
<
|
|
55
|
+
<div v-if="comment.relatedComments">
|
|
56
|
+
<template v-if="!collapseVisible">
|
|
116
57
|
{{ $t('Display answers', { nb: comment.relatedComments }) }}
|
|
117
58
|
<i v-if="editRight">{{
|
|
118
59
|
$t('(nb valid comment answers)', {
|
|
119
60
|
nb: comment.relatedValidComments,
|
|
120
61
|
})
|
|
121
62
|
}}</i>
|
|
122
|
-
</
|
|
123
|
-
<
|
|
124
|
-
{{ $t('In response to') }}
|
|
125
|
-
</div>
|
|
126
|
-
<span class="saooti-arrow_down" />
|
|
127
|
-
</div>
|
|
128
|
-
<div class="d-flex align-items-center when-opened">
|
|
129
|
-
<div v-if="comment.relatedComments">
|
|
63
|
+
</template>
|
|
64
|
+
<template v-else>
|
|
130
65
|
{{ $t('Hide answers') }}
|
|
131
|
-
</
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<span
|
|
136
|
-
class="saooti-arrow_down arrow-transform me-2"
|
|
137
|
-
/>
|
|
66
|
+
</template>
|
|
67
|
+
</div>
|
|
68
|
+
<div v-else>
|
|
69
|
+
{{ $t('In response to') }}
|
|
138
70
|
</div>
|
|
71
|
+
<span
|
|
72
|
+
:class="collapseVisible? 'arrow-transform': ''"
|
|
73
|
+
class="saooti-arrow_down"
|
|
74
|
+
/>
|
|
139
75
|
</div>
|
|
140
76
|
<EditCommentBox
|
|
141
77
|
v-if="editRight"
|
|
@@ -148,11 +84,11 @@
|
|
|
148
84
|
/>
|
|
149
85
|
</div>
|
|
150
86
|
<div
|
|
151
|
-
|
|
152
|
-
|
|
87
|
+
v-if="collapseVisible"
|
|
88
|
+
class="ms-4"
|
|
153
89
|
>
|
|
154
90
|
<CommentInput
|
|
155
|
-
v-if="!isFlat || (isFlat && !comment.commentIdReferer)
|
|
91
|
+
v-if="!isFlat || (isFlat && !comment.commentIdReferer)"
|
|
156
92
|
v-model:knownIdentity="knownIdentity"
|
|
157
93
|
:focus="focus"
|
|
158
94
|
:podcast="podcast"
|
|
@@ -162,11 +98,12 @@
|
|
|
162
98
|
@newComment="newComment"
|
|
163
99
|
/>
|
|
164
100
|
<CommentParentInfo
|
|
165
|
-
v-if="isFlat && comment.commentIdReferer
|
|
101
|
+
v-if="isFlat && comment.commentIdReferer"
|
|
166
102
|
:com-id="comment.commentIdReferer"
|
|
103
|
+
:edit-right="editRight"
|
|
167
104
|
/>
|
|
168
105
|
<CommentList
|
|
169
|
-
v-if="comment.relatedComments
|
|
106
|
+
v-if="!isFlat && comment.relatedComments"
|
|
170
107
|
ref="commentList"
|
|
171
108
|
:podcast="podcast"
|
|
172
109
|
:fetch-conference="fetchConference"
|
|
@@ -184,10 +121,8 @@ import { displayMethods, selenium } from '../../mixins/functions';
|
|
|
184
121
|
import { CommentPodcast } from '@/store/class/general/comment';
|
|
185
122
|
import { Podcast } from '@/store/class/general/podcast';
|
|
186
123
|
import { Conference } from '@/store/class/conference/conference';
|
|
187
|
-
import
|
|
188
|
-
import Popover from '../../misc/Popover.vue';
|
|
124
|
+
import CommentBasicView from './CommentBasicView.vue';
|
|
189
125
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
|
190
|
-
import EditBoxVue from '../edit/EditBox.vue';
|
|
191
126
|
const CommentInput = defineAsyncComponent(() => import('./CommentInput.vue'));
|
|
192
127
|
const CommentParentInfo = defineAsyncComponent(() => import('./CommentParentInfo.vue'));
|
|
193
128
|
const EditCommentBox = defineAsyncComponent(() => import('@/components/display/edit/EditCommentBox.vue'));
|
|
@@ -200,10 +135,11 @@ export default defineComponent({
|
|
|
200
135
|
CommentParentInfo,
|
|
201
136
|
EditCommentBox,
|
|
202
137
|
CommentList,
|
|
203
|
-
|
|
138
|
+
CommentBasicView
|
|
204
139
|
},
|
|
205
140
|
|
|
206
141
|
mixins:[displayMethods, selenium],
|
|
142
|
+
|
|
207
143
|
props: {
|
|
208
144
|
comment: { default: ()=>({}), type: Object as ()=>CommentPodcast },
|
|
209
145
|
podcast: { default: undefined, type: Object as ()=>Podcast },
|
|
@@ -211,11 +147,11 @@ export default defineComponent({
|
|
|
211
147
|
organisation: { default: undefined, type: String},
|
|
212
148
|
isFlat: { default: false, type: Boolean },
|
|
213
149
|
},
|
|
150
|
+
|
|
214
151
|
emits: ['deleteComment', 'updateComment', 'update:comment'],
|
|
215
152
|
|
|
216
153
|
data() {
|
|
217
154
|
return {
|
|
218
|
-
summary: true as boolean,
|
|
219
155
|
collapseVisible: false as boolean,
|
|
220
156
|
focus: false as boolean,
|
|
221
157
|
isEditing: false as boolean,
|
|
@@ -224,36 +160,19 @@ export default defineComponent({
|
|
|
224
160
|
};
|
|
225
161
|
},
|
|
226
162
|
computed: {
|
|
227
|
-
|
|
228
|
-
if (this.comment.date)
|
|
229
|
-
return moment(this.comment.date).format('D MMMM YYYY HH[h]mm');
|
|
230
|
-
return '';
|
|
231
|
-
},
|
|
232
|
-
limitContent(): string {
|
|
233
|
-
if (!this.comment.content) return '';
|
|
234
|
-
if (this.comment.content.length <= 300) return this.comment.content;
|
|
235
|
-
return this.comment.content.substring(0, 300) + '...';
|
|
236
|
-
},
|
|
237
|
-
readMore(): string {
|
|
238
|
-
if (this.summary) return this.$t('Read more').toString();
|
|
239
|
-
return this.$t('Read less').toString();
|
|
240
|
-
},
|
|
241
|
-
contentDisplay(): string {
|
|
242
|
-
if (this.summary) return this.limitContent;
|
|
243
|
-
return this.comment.content;
|
|
244
|
-
},
|
|
245
|
-
organisationId(): string|undefined {
|
|
163
|
+
myOrganisationId(): string|undefined {
|
|
246
164
|
return state.generalParameters.organisationId;
|
|
247
165
|
},
|
|
248
166
|
editRight(): boolean {
|
|
249
167
|
if (
|
|
250
168
|
(state.generalParameters.isCommments &&
|
|
251
169
|
((this.podcast &&
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
170
|
+
this.myOrganisationId === this.podcast.organisation.id) ||
|
|
171
|
+
this.myOrganisationId === this.organisation)) ||
|
|
254
172
|
state.generalParameters.isAdmin
|
|
255
|
-
)
|
|
173
|
+
){
|
|
256
174
|
return true;
|
|
175
|
+
}
|
|
257
176
|
return false;
|
|
258
177
|
},
|
|
259
178
|
knownIdentity: {
|
|
@@ -301,25 +220,19 @@ export default defineComponent({
|
|
|
301
220
|
}
|
|
302
221
|
},
|
|
303
222
|
editComment(): void {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
if (this.comment.content && null !== this.comment.content) {
|
|
308
|
-
this.temporaryContent = this.comment.content;
|
|
309
|
-
}
|
|
223
|
+
this.temporaryName = this.comment.name && null !== this.comment.name ? this.comment.name : '';
|
|
224
|
+
this.temporaryContent = this.comment.content && null !== this.comment.content ? this.comment.content : '';
|
|
310
225
|
this.isEditing = true;
|
|
311
226
|
},
|
|
312
227
|
validEdit(): void {
|
|
313
228
|
const comment = this.comment;
|
|
314
229
|
comment.content = this.temporaryContent;
|
|
315
230
|
comment.name = this.temporaryName;
|
|
316
|
-
(this.$refs.editBox as InstanceType<typeof
|
|
231
|
+
(this.$refs.editBox as InstanceType<typeof EditCommentBox>).updateComment(comment);
|
|
317
232
|
},
|
|
318
233
|
updateStatus(data: string): void {
|
|
319
234
|
const updatedComment = this.comment;
|
|
320
|
-
if(undefined === updatedComment.relatedValidComments){
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
235
|
+
if(undefined === updatedComment.relatedValidComments){return;}
|
|
323
236
|
if ('Valid' === data) {
|
|
324
237
|
updatedComment.relatedValidComments += 1;
|
|
325
238
|
} else {
|
|
@@ -329,9 +242,7 @@ export default defineComponent({
|
|
|
329
242
|
},
|
|
330
243
|
receiveCommentEvent(event: {type?: string; comment: CommentPodcast; status?: string; oldStatus?:string }): void {
|
|
331
244
|
switch (event.type) {
|
|
332
|
-
case 'Create':
|
|
333
|
-
this.newComment(event.comment, true);
|
|
334
|
-
break;
|
|
245
|
+
case 'Create':this.newComment(event.comment, true);break;
|
|
335
246
|
case 'Update':
|
|
336
247
|
if (this.$refs.commentList) {
|
|
337
248
|
(this.$refs.commentList as InstanceType<typeof CommentList>).updateComment({ comment: event.comment });
|
|
@@ -344,7 +255,6 @@ export default defineComponent({
|
|
|
344
255
|
updatedComment.relatedValidComments += 1;
|
|
345
256
|
}
|
|
346
257
|
}
|
|
347
|
-
|
|
348
258
|
this.$emit('update:comment', updatedComment);
|
|
349
259
|
}
|
|
350
260
|
break;
|
|
@@ -352,14 +262,14 @@ export default defineComponent({
|
|
|
352
262
|
if (this.$refs.commentList) {
|
|
353
263
|
(this.$refs.commentList as InstanceType<typeof CommentList>).deleteComment(event.comment);
|
|
354
264
|
} else {
|
|
355
|
-
const
|
|
356
|
-
if(undefined !==
|
|
357
|
-
|
|
265
|
+
const deletedComment = this.comment;
|
|
266
|
+
if(undefined !== deletedComment.relatedComments){
|
|
267
|
+
deletedComment.relatedComments -= 1;
|
|
358
268
|
}
|
|
359
|
-
if (undefined !==
|
|
360
|
-
|
|
269
|
+
if (undefined !== deletedComment.relatedValidComments && 'Valid' === event.comment.status) {
|
|
270
|
+
deletedComment.relatedValidComments -= 1;
|
|
361
271
|
}
|
|
362
|
-
this.$emit('update:comment',
|
|
272
|
+
this.$emit('update:comment', deletedComment);
|
|
363
273
|
}
|
|
364
274
|
break;
|
|
365
275
|
default:
|
|
@@ -369,5 +279,3 @@ export default defineComponent({
|
|
|
369
279
|
},
|
|
370
280
|
})
|
|
371
281
|
</script>
|
|
372
|
-
|
|
373
|
-
<style lang="scss"></style>
|