@bimdata/bcf-components 6.1.0 → 6.2.0-rc.1
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/package.json +1 -1
- package/src/components/bcf-topic-overview/BcfTopicOverview.vue +5 -9
- package/src/components/bcf-topic-overview/bcf-topic-comments/BcfTopicComments.vue +1 -1
- package/src/components/bcf-topic-overview/bcf-topic-comments/topic-comment/TopicComment.vue +10 -2
- package/src/i18n/lang/de.json +1 -1
package/package.json
CHANGED
|
@@ -268,6 +268,10 @@ export default {
|
|
|
268
268
|
type: Object,
|
|
269
269
|
required: true,
|
|
270
270
|
},
|
|
271
|
+
currentUserEmail: {
|
|
272
|
+
type: String,
|
|
273
|
+
required: false,
|
|
274
|
+
},
|
|
271
275
|
},
|
|
272
276
|
emits: [
|
|
273
277
|
"back",
|
|
@@ -293,11 +297,6 @@ export default {
|
|
|
293
297
|
|
|
294
298
|
const topicLabels = computed(() => Array.from(props.topic.labels ?? []).sort());
|
|
295
299
|
|
|
296
|
-
const currentUserEmail = ref("");
|
|
297
|
-
const loadCurrentUserEmail = async () => {
|
|
298
|
-
currentUserEmail.value = (await service.fetchCurrentUser()).email ?? "";
|
|
299
|
-
};
|
|
300
|
-
|
|
301
300
|
const deleteTopic = async () => {
|
|
302
301
|
try {
|
|
303
302
|
showDeleteModal.value = false;
|
|
@@ -312,11 +311,8 @@ export default {
|
|
|
312
311
|
}
|
|
313
312
|
};
|
|
314
313
|
|
|
315
|
-
onMounted(() => loadCurrentUserEmail())
|
|
316
|
-
|
|
317
314
|
return {
|
|
318
315
|
// References
|
|
319
|
-
currentUserEmail,
|
|
320
316
|
loading,
|
|
321
317
|
priorityColor,
|
|
322
318
|
showDeleteModal,
|
|
@@ -330,4 +326,4 @@ export default {
|
|
|
330
326
|
};
|
|
331
327
|
</script>
|
|
332
328
|
|
|
333
|
-
<style scoped lang="scss" src="./BcfTopicOverview.scss"></style>
|
|
329
|
+
<style scoped lang="scss" src="./BcfTopicOverview.scss"></style>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<div class="topic-comment__header__right">
|
|
29
|
-
<template v-if="
|
|
29
|
+
<template v-if="canEditComment(comment)">
|
|
30
30
|
<div class="topic-comment__header__right__actions flex">
|
|
31
31
|
<template v-if="showMenu">
|
|
32
32
|
<BIMDataButton ghost rounded icon @click="onOpenEdit">
|
|
@@ -163,7 +163,7 @@ export default {
|
|
|
163
163
|
},
|
|
164
164
|
currentUserEmail: {
|
|
165
165
|
type: String,
|
|
166
|
-
required:
|
|
166
|
+
required: false,
|
|
167
167
|
},
|
|
168
168
|
},
|
|
169
169
|
emits: ["comment-updated", "comment-deleted", "view-comment-snapshot"],
|
|
@@ -221,6 +221,13 @@ export default {
|
|
|
221
221
|
viewpoint.value = await viewer.getViewpoint();
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
+
const canEditComment = comment => {
|
|
225
|
+
if (!props.currentUserEmail) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
return currentUserEmail === comment.author;
|
|
229
|
+
}
|
|
230
|
+
|
|
224
231
|
const submitUpdate = async () => {
|
|
225
232
|
try {
|
|
226
233
|
if (props.comment.comment === text.value && !viewpoint.value) {
|
|
@@ -307,6 +314,7 @@ export default {
|
|
|
307
314
|
closeMenu,
|
|
308
315
|
createViewpoint,
|
|
309
316
|
deleteViewpoint,
|
|
317
|
+
canEditComment,
|
|
310
318
|
highlightViewer,
|
|
311
319
|
onOpenDelete,
|
|
312
320
|
onOpenEdit,
|
package/src/i18n/lang/de.json
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"descriptionLabel": "Beschreibung",
|
|
62
62
|
"labelsLabel": "Tags",
|
|
63
63
|
"createButton": "Bestätigen",
|
|
64
|
-
"updateButton": "
|
|
64
|
+
"updateButton": "Änderungen übernehmen",
|
|
65
65
|
"modalText": "Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.",
|
|
66
66
|
"cancelButton": "Änderungen verwerfen",
|
|
67
67
|
"continueButton": "Änderungen fortsetzen",
|