Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Oct 24, 2023
2 parents a5e772c + fc32935 commit c6e3e5e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bimdata/bcf-components",
"version": "6.0.0",
"version": "6.0.1-rc.1",
"files": [
"src",
"vue3-plugin.js"
Expand Down
8 changes: 3 additions & 5 deletions src/components/bcf-settings/BcfSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ export default {
},
emits: ["back", "close", "extension-created", "extension-updated", "extension-deleted"],
setup(props, { emit }) {
const service = useService();
const createExtension = async (event) => {
const ext = await service.createExtension(props.project, event.extensionType, event.data);
const ext = await useService().createExtension(props.project, event.extensionType, event.data);
emit("extension-created", ext);
};
const updateExtension = async (event) => {
const ext = await service.updateExtension(
const ext = await useService().updateExtension(
props.project,
event.extensionType,
event.extension,
Expand All @@ -98,7 +96,7 @@ export default {
};
const deleteExtension = async (event) => {
await service.deleteExtension(props.project, event.extensionType, event.extension);
await useService().deleteExtension(props.project, event.extensionType, event.extension);
emit("extension-deleted", event.extension);
};
Expand Down
7 changes: 3 additions & 4 deletions src/components/bcf-topic-form/BcfTopicForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<template v-if="uiConfig.viewerMode">
<BcfTopicSnapshots
:viewpoints="viewpointsToDisplay"
:getViewers="getViewers"
@create-viewpoint="createViewpoints"
@upload-viewpoint="uploadViewpoints"
@delete-viewpoint="deleteViewpoint"
Expand All @@ -39,7 +38,6 @@
<BcfTopicSnapshotsActions
v-if="viewpointsToDisplay.length > 0"
:viewpoints="viewpointsToDisplay"
:getViewers="getViewers"
@create-viewpoint="createViewpoints"
@upload-viewpoint="uploadViewpoints"
/>
Expand Down Expand Up @@ -307,8 +305,6 @@ export default {
"topic-update-error",
],
setup(props, { emit }) {
const service = useService();
const isCreation = computed(() => !props.topic);
const nextIndex = computed(() => Math.max(0, ...props.topics.map((t) => t.index)) + 1);
Expand Down Expand Up @@ -421,6 +417,8 @@ export default {
};
const submit = async () => {
const service = useService();
if (!topicTitle.value) {
hasErrorTitle.value = true;
return;
Expand Down Expand Up @@ -505,6 +503,7 @@ export default {
emit("topic-updated", newTopic);
}
} catch (error) {
console.error(error);
emit(isCreation.value ? "topic-create-error" : "topic-update-error", error);
} finally {
loading.value = false;
Expand Down
6 changes: 2 additions & 4 deletions src/components/bcf-topic-overview/BcfTopicOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ export default {
"view-topic-viewpoint",
],
setup(props, { emit }) {
const service = useService();
const loading = ref(false);
const showDeleteModal = ref(false);
Expand All @@ -312,14 +310,14 @@ export default {
const currentUserEmail = ref("");
const loadCurrentUserEmail = async () => {
currentUserEmail.value = (await service.fetchCurrentUser()).email ?? "";
currentUserEmail.value = (await useService().fetchCurrentUser()).email ?? "";
};
const deleteTopic = async () => {
try {
showDeleteModal.value = false;
loading.value = true;
await service.deleteTopic(props.project, props.topic);
await useService().deleteTopic(props.project, props.topic);
emit("topic-deleted", props.topic);
} catch (error) {
console.error(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default {
setup(props, { emit }) {
let pluginCreatedSub, pluginDestroyedSub;
const service = useService();
const $viewer = inject("$viewer", null);
const loading = ref(false);
Expand All @@ -157,7 +156,7 @@ export default {
const viewerSelectOptions = ref([]);
const loadComments = async () => {
comments.value = await service.fetchTopicComments(props.project, props.topic);
comments.value = await useService().fetchTopicComments(props.project, props.topic);
};
const setCommentViewpoint = async () => {
Expand All @@ -180,6 +179,7 @@ export default {
const submitComment = async () => {
try {
const service = useService();
loading.value = true;
if (viewpoint.value) {
viewpoint.value = await service.createViewpoint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ export default {
setup(props, { emit }) {
let pluginCreatedSub, pluginDestroyedSub;
const service = useService();
const $viewer = inject("$viewer", null);
const loading = ref(false);
Expand All @@ -218,7 +217,7 @@ export default {
const toggleMenu = () => (showMenu.value = !showMenu.value);
const loadViewpoint = async () => {
viewpoint.value = await service.fetchTopicCommentViewpoint(
viewpoint.value = await useService().fetchTopicCommentViewpoint(
props.project,
props.topic,
props.comment
Expand All @@ -235,7 +234,7 @@ export default {
};
const deleteViewpoint = async () => {
if (viewpoint.value.guid) {
await service.deleteViewpoint(props.project, props.topic, viewpoint.value);
await useService().deleteViewpoint(props.project, props.topic, viewpoint.value);
}
viewpoint.value = null;
};
Expand All @@ -261,7 +260,7 @@ export default {
return;
}
if (viewpoint.value && !viewpoint.value.guid) {
viewpoint.value = await service.createViewpoint(
viewpoint.value = await useService().createViewpoint(
props.project,
props.topic,
viewpoint.value
Expand All @@ -273,7 +272,7 @@ export default {
) {
loading.value = true;
const newComment = await service.updateComment(
const newComment = await useService().updateComment(
props.project,
props.topic,
props.comment,
Expand All @@ -294,7 +293,7 @@ export default {
const submitDelete = async () => {
try {
loading.value = true;
await service.deleteComment(props.project, props.topic, props.comment);
await useService().deleteComment(props.project, props.topic, props.comment);
emit("comment-deleted", props.comment);
isDeleting.value = false;
} finally {
Expand Down Expand Up @@ -347,7 +346,6 @@ export default {
submitDelete,
submitUpdate,
toggleMenu,
loadViewpoint,
unhighlightViewer,
};
},
Expand Down

0 comments on commit c6e3e5e

Please sign in to comment.