@bimdata/bcf-components 6.0.1 → 6.0.2-rc.2
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 +7 -2
- package/package.json +1 -1
- package/src/components/bcf-filters/BcfFilters.vue +0 -19
- package/src/components/bcf-settings/BcfSettings.vue +4 -13
- package/src/components/bcf-settings/setting-card/SettingCard.vue +0 -10
- package/src/components/bcf-settings/setting-card/SettingCardItem.vue +0 -15
- package/src/components/bcf-statistics/BcfStatistics.vue +0 -7
- package/src/components/bcf-topic-card/BcfTopicCard.vue +0 -10
- package/src/components/bcf-topic-creation-card/BcfTopicCreationCard.vue +0 -4
- package/src/components/bcf-topic-form/BcfTopicForm.vue +1 -29
- package/src/components/bcf-topic-form/bcf-topic-images/BcfTopicImages.vue +0 -13
- package/src/components/bcf-topic-form/bcf-topic-snapshots/BcfTopicSnapshots.vue +0 -9
- package/src/components/bcf-topic-form/bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue +0 -1
- package/src/components/bcf-topic-overview/BcfTopicOverview.vue +3 -13
- package/src/components/bcf-topic-overview/bcf-topic-comments/BcfTopicComments.vue +2 -17
- package/src/components/bcf-topic-overview/bcf-topic-comments/topic-comment/TopicComment.vue +6 -34
- package/src/components/bcf-topic-overview/bcf-topic-viewpoints/BcfTopicViewpoints.vue +0 -6
- package/src/components/bcf-topics-table/BcfTopicsTable.vue +0 -6
- package/src/components/bcf-topics-table/bcf-topic-actions-cell/BcfTopicActionsCell.vue +0 -8
- package/src/components/user-avatar/UserAvatar.vue +0 -5
- package/src/index.js +5 -16
- package/src/service.js +93 -119
- package/vue3-plugin.js +3 -7
package/README.md
CHANGED
|
@@ -24,8 +24,11 @@ and make all components available globally.
|
|
|
24
24
|
import { createApp } from "vue";
|
|
25
25
|
import { createI18n } from "vue-i18n"; // v9.x
|
|
26
26
|
import { makeBIMDataApiClient } from "@bimdata/typescript-fetch-api-client"; // v8.2+
|
|
27
|
+
import DesignSystem from "@bimdata/design-system/vue3-plugin.js"; // v2+
|
|
28
|
+
import BIMDataComponents from "@bimdata/components/vue3-plugin.js"; // v1+
|
|
29
|
+
|
|
27
30
|
// Import Vue 3 plugin factory
|
|
28
|
-
import
|
|
31
|
+
import BcfComponents from "@bimdata/bcf-components/vue3-plugin.js";
|
|
29
32
|
|
|
30
33
|
// Instanciate i18n plugin
|
|
31
34
|
const i18nPlugin = createI18n({ ... });
|
|
@@ -34,8 +37,10 @@ const apiClient = makeBIMDataApiClient({ ... });
|
|
|
34
37
|
|
|
35
38
|
const app = createApp()
|
|
36
39
|
.use(i18nPlugin)
|
|
40
|
+
.use(DesignSystem())
|
|
41
|
+
.use(BIMDataComponents())
|
|
37
42
|
// Provide both i18n plugin and API client as plugin config
|
|
38
|
-
.use(
|
|
43
|
+
.use(BcfComponents({ i18nPlugin, apiClient }));
|
|
39
44
|
...
|
|
40
45
|
```
|
|
41
46
|
|
package/package.json
CHANGED
|
@@ -113,16 +113,6 @@
|
|
|
113
113
|
<script>
|
|
114
114
|
import { computed, ref, toRaw, watch } from "vue";
|
|
115
115
|
import { useBcfFilter } from "../../composables/filter.js";
|
|
116
|
-
// Components
|
|
117
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
118
|
-
import {
|
|
119
|
-
BIMDataIconClose,
|
|
120
|
-
BIMDataIconFilterList,
|
|
121
|
-
BIMDataIconSearch,
|
|
122
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
123
|
-
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
|
|
124
|
-
import BIMDataSelect from "@bimdata/design-system/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue";
|
|
125
|
-
import BIMDataText from "@bimdata/design-system/src/BIMDataComponents/BIMDataText/BIMDataText.vue";
|
|
126
116
|
|
|
127
117
|
function getSelectOptions(list) {
|
|
128
118
|
return Array.from(new Set(list)).sort((a, b) =>
|
|
@@ -131,15 +121,6 @@ function getSelectOptions(list) {
|
|
|
131
121
|
}
|
|
132
122
|
|
|
133
123
|
export default {
|
|
134
|
-
components: {
|
|
135
|
-
BIMDataButton,
|
|
136
|
-
BIMDataIconClose,
|
|
137
|
-
BIMDataIconFilterList,
|
|
138
|
-
BIMDataIconSearch,
|
|
139
|
-
BIMDataInput,
|
|
140
|
-
BIMDataSelect,
|
|
141
|
-
BIMDataText
|
|
142
|
-
},
|
|
143
124
|
props: {
|
|
144
125
|
topics: {
|
|
145
126
|
type: Array,
|
|
@@ -44,21 +44,12 @@
|
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
46
|
import { EXTENSION_TYPES } from "../../config.js";
|
|
47
|
-
import
|
|
47
|
+
import service from "../../service.js";
|
|
48
48
|
// Components
|
|
49
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
50
|
-
|
|
51
|
-
import {
|
|
52
|
-
BIMDataIconArrow,
|
|
53
|
-
BIMDataIconClose,
|
|
54
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
55
49
|
import SettingCard from "./setting-card/SettingCard.vue";
|
|
56
50
|
|
|
57
51
|
export default {
|
|
58
52
|
components: {
|
|
59
|
-
BIMDataButton,
|
|
60
|
-
BIMDataIconArrow,
|
|
61
|
-
BIMDataIconClose,
|
|
62
53
|
SettingCard,
|
|
63
54
|
},
|
|
64
55
|
props: {
|
|
@@ -81,12 +72,12 @@ export default {
|
|
|
81
72
|
emits: ["back", "close", "extension-created", "extension-updated", "extension-deleted"],
|
|
82
73
|
setup(props, { emit }) {
|
|
83
74
|
const createExtension = async (event) => {
|
|
84
|
-
const ext = await
|
|
75
|
+
const ext = await service.createExtension(props.project, event.extensionType, event.data);
|
|
85
76
|
emit("extension-created", ext);
|
|
86
77
|
};
|
|
87
78
|
|
|
88
79
|
const updateExtension = async (event) => {
|
|
89
|
-
const ext = await
|
|
80
|
+
const ext = await service.updateExtension(
|
|
90
81
|
props.project,
|
|
91
82
|
event.extensionType,
|
|
92
83
|
event.extension,
|
|
@@ -96,7 +87,7 @@ export default {
|
|
|
96
87
|
};
|
|
97
88
|
|
|
98
89
|
const deleteExtension = async (event) => {
|
|
99
|
-
await
|
|
90
|
+
await service.deleteExtension(props.project, event.extensionType, event.extension);
|
|
100
91
|
emit("extension-deleted", event.extension);
|
|
101
92
|
};
|
|
102
93
|
|
|
@@ -60,20 +60,10 @@
|
|
|
60
60
|
import { computed, ref } from "vue";
|
|
61
61
|
import { getAvailableExtensions } from "../../../utils/extensions.js";
|
|
62
62
|
// Compopnents
|
|
63
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
64
|
-
import {
|
|
65
|
-
BIMDataIconChevron,
|
|
66
|
-
BIMDataIconPlus,
|
|
67
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
68
|
-
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
|
|
69
63
|
import SettingCardItem from "./SettingCardItem.vue";
|
|
70
64
|
|
|
71
65
|
export default {
|
|
72
66
|
components: {
|
|
73
|
-
BIMDataButton,
|
|
74
|
-
BIMDataIconChevron,
|
|
75
|
-
BIMDataIconPlus,
|
|
76
|
-
BIMDataInput,
|
|
77
67
|
SettingCardItem,
|
|
78
68
|
},
|
|
79
69
|
props: {
|
|
@@ -62,23 +62,8 @@ import { adjustBorderColor } from "@bimdata/design-system/src/BIMDataComponents/
|
|
|
62
62
|
import { ref, watch } from "vue";
|
|
63
63
|
import { EXTENSION_WITH_COLOR } from "../../../config.js";
|
|
64
64
|
import { getExtensionField } from "../../../utils/extensions.js";
|
|
65
|
-
// Components
|
|
66
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
67
|
-
import BIMDataColorSelector from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.vue";
|
|
68
|
-
import {
|
|
69
|
-
BIMDataIconDelete,
|
|
70
|
-
BIMDataIconClose,
|
|
71
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
72
|
-
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
|
|
73
65
|
|
|
74
66
|
export default {
|
|
75
|
-
components: {
|
|
76
|
-
BIMDataButton,
|
|
77
|
-
BIMDataColorSelector,
|
|
78
|
-
BIMDataIconDelete,
|
|
79
|
-
BIMDataIconClose,
|
|
80
|
-
BIMDataInput,
|
|
81
|
-
},
|
|
82
67
|
props: {
|
|
83
68
|
extensionType: {
|
|
84
69
|
type: String,
|
|
@@ -53,15 +53,8 @@
|
|
|
53
53
|
import { computed } from "vue";
|
|
54
54
|
import { DEFAULT_PRIORITY_COLOR } from "../../config.js";
|
|
55
55
|
import { getAvailableExtensions, getExtensionField } from "../../utils/extensions.js";
|
|
56
|
-
// Components
|
|
57
|
-
import BIMDataPaginatedList from "@bimdata/design-system/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue";
|
|
58
|
-
import BIMDataSimplePieChart from "@bimdata/design-system/src/BIMDataComponents/BIMDataSimplePieChart/BIMDataSimplePieChart.vue";
|
|
59
56
|
|
|
60
57
|
export default {
|
|
61
|
-
components: {
|
|
62
|
-
BIMDataPaginatedList,
|
|
63
|
-
BIMDataSimplePieChart,
|
|
64
|
-
},
|
|
65
58
|
props: {
|
|
66
59
|
detailedExtensions: {
|
|
67
60
|
type: Object,
|
|
@@ -85,21 +85,11 @@ import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BI
|
|
|
85
85
|
import { computed, ref } from "vue";
|
|
86
86
|
import { getPriorityColor, getStatusColor } from "../../utils/topic.js";
|
|
87
87
|
// Components
|
|
88
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
89
|
-
import {
|
|
90
|
-
BIMDataIconInformation,
|
|
91
|
-
BIMDataIconModel3D,
|
|
92
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
93
|
-
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
94
88
|
import BcfTopicDefaultImage from "./BcfTopicDefaultImage.vue";
|
|
95
89
|
|
|
96
90
|
export default {
|
|
97
91
|
components: {
|
|
98
92
|
BcfTopicDefaultImage,
|
|
99
|
-
BIMDataButton,
|
|
100
|
-
BIMDataIconInformation,
|
|
101
|
-
BIMDataIconModel3D,
|
|
102
|
-
BIMDataTextbox,
|
|
103
93
|
},
|
|
104
94
|
props: {
|
|
105
95
|
detailedExtensions: {
|
|
@@ -20,15 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
22
|
// Components
|
|
23
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
24
|
-
import BIMDataIconPlus from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconPlus.vue";
|
|
25
23
|
import BcfTopicCreationCardImage from "./BcfTopicCreationCardImage.vue";
|
|
26
24
|
|
|
27
25
|
export default {
|
|
28
26
|
components: {
|
|
29
27
|
BcfTopicCreationCardImage,
|
|
30
|
-
BIMDataButton,
|
|
31
|
-
BIMDataIconPlus,
|
|
32
28
|
},
|
|
33
29
|
emits: ["create-topic"],
|
|
34
30
|
};
|
|
@@ -197,24 +197,10 @@
|
|
|
197
197
|
|
|
198
198
|
<script>
|
|
199
199
|
import { computed, ref, watch } from "vue";
|
|
200
|
-
import
|
|
200
|
+
import service from "../../service.js";
|
|
201
201
|
import { getViewerList } from "../../utils/viewer.js";
|
|
202
202
|
import { setViewpointDefaults } from "../../utils/viewpoints.js";
|
|
203
203
|
// Components
|
|
204
|
-
import BIMDataSafeZoneModal from "@bimdata/components/src/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue";
|
|
205
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
206
|
-
import BIMDataDatePicker from "@bimdata/design-system/src/BIMDataComponents/BIMDataDatePicker/BIMDataDatePicker.vue";
|
|
207
|
-
import {
|
|
208
|
-
BIMDataIconArrow,
|
|
209
|
-
BIMDataIconClose,
|
|
210
|
-
BIMDataIconPlus,
|
|
211
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
212
|
-
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
|
|
213
|
-
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
|
|
214
|
-
import BIMDataSelect from "@bimdata/design-system/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue";
|
|
215
|
-
import BIMDataTextarea from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue";
|
|
216
|
-
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
217
|
-
import BIMDataTooltip from "@bimdata/design-system/src/BIMDataComponents/BIMDataTooltip/BIMDataTooltip.vue";
|
|
218
204
|
import BcfTopicImages from "./bcf-topic-images/BcfTopicImages.vue";
|
|
219
205
|
import BcfTopicSnapshots from "./bcf-topic-snapshots/BcfTopicSnapshots.vue";
|
|
220
206
|
import BcfTopicSnapshotsActions from "./bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue";
|
|
@@ -224,18 +210,6 @@ export default {
|
|
|
224
210
|
BcfTopicImages,
|
|
225
211
|
BcfTopicSnapshots,
|
|
226
212
|
BcfTopicSnapshotsActions,
|
|
227
|
-
BIMDataButton,
|
|
228
|
-
BIMDataDatePicker,
|
|
229
|
-
BIMDataIconArrow,
|
|
230
|
-
BIMDataIconClose,
|
|
231
|
-
BIMDataIconPlus,
|
|
232
|
-
BIMDataInput,
|
|
233
|
-
BIMDataLoading,
|
|
234
|
-
BIMDataSafeZoneModal,
|
|
235
|
-
BIMDataSelect,
|
|
236
|
-
BIMDataTextarea,
|
|
237
|
-
BIMDataTextbox,
|
|
238
|
-
BIMDataTooltip,
|
|
239
213
|
},
|
|
240
214
|
props: {
|
|
241
215
|
uiConfig: {
|
|
@@ -417,8 +391,6 @@ export default {
|
|
|
417
391
|
};
|
|
418
392
|
|
|
419
393
|
const submit = async () => {
|
|
420
|
-
const service = useService();
|
|
421
|
-
|
|
422
394
|
if (!topicTitle.value) {
|
|
423
395
|
hasErrorTitle.value = true;
|
|
424
396
|
return;
|
|
@@ -67,21 +67,8 @@
|
|
|
67
67
|
|
|
68
68
|
<script>
|
|
69
69
|
import { isTabletOrMobile } from "../../../utils/browser.js";
|
|
70
|
-
// Components
|
|
71
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
72
|
-
import {
|
|
73
|
-
BIMDataIconDelete,
|
|
74
|
-
BIMDataIconCamera,
|
|
75
|
-
BIMDataIconUnarchive,
|
|
76
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
77
70
|
|
|
78
71
|
export default {
|
|
79
|
-
components: {
|
|
80
|
-
BIMDataButton,
|
|
81
|
-
BIMDataIconDelete,
|
|
82
|
-
BIMDataIconCamera,
|
|
83
|
-
BIMDataIconUnarchive,
|
|
84
|
-
},
|
|
85
72
|
props: {
|
|
86
73
|
viewpoints: {
|
|
87
74
|
type: Array,
|
|
@@ -44,19 +44,10 @@
|
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
46
|
import BcfTopicSnapshotsActions from "../bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue";
|
|
47
|
-
// Components
|
|
48
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
49
|
-
import {
|
|
50
|
-
BIMDataIconDelete,
|
|
51
|
-
BIMDataIconCamera,
|
|
52
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
53
47
|
|
|
54
48
|
export default {
|
|
55
49
|
components: {
|
|
56
50
|
BcfTopicSnapshotsActions,
|
|
57
|
-
BIMDataButton,
|
|
58
|
-
BIMDataIconDelete,
|
|
59
|
-
BIMDataIconCamera,
|
|
60
51
|
},
|
|
61
52
|
props: {
|
|
62
53
|
viewpoints: {
|
|
@@ -232,14 +232,9 @@
|
|
|
232
232
|
<script>
|
|
233
233
|
import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/colors.js";
|
|
234
234
|
import { computed, onMounted, ref } from "vue";
|
|
235
|
-
import
|
|
235
|
+
import service from "../../service.js";
|
|
236
236
|
import { getPriorityColor } from "../../utils/topic.js";
|
|
237
237
|
// Components
|
|
238
|
-
import BIMDataSafeZoneModal from "@bimdata/components/src/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue";
|
|
239
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
240
|
-
import {BIMDataIconArrow,BIMDataIconEdit, BIMDataIconDelete, BIMDataIconClose, BIMDataIconModel3D } from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
241
|
-
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
|
|
242
|
-
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
243
238
|
import BcfTopicComments from "./bcf-topic-comments/BcfTopicComments.vue";
|
|
244
239
|
import BcfTopicDefaultImage from "../bcf-topic-card/BcfTopicDefaultImage.vue";
|
|
245
240
|
import BcfTopicViewpoints from "./bcf-topic-viewpoints/BcfTopicViewpoints.vue";
|
|
@@ -249,11 +244,6 @@ export default {
|
|
|
249
244
|
BcfTopicComments,
|
|
250
245
|
BcfTopicDefaultImage,
|
|
251
246
|
BcfTopicViewpoints,
|
|
252
|
-
BIMDataButton,
|
|
253
|
-
BIMDataIconArrow,BIMDataIconEdit, BIMDataIconDelete, BIMDataIconClose, BIMDataIconModel3D,
|
|
254
|
-
BIMDataLoading,
|
|
255
|
-
BIMDataSafeZoneModal,
|
|
256
|
-
BIMDataTextbox,
|
|
257
247
|
},
|
|
258
248
|
props: {
|
|
259
249
|
uiConfig: {
|
|
@@ -310,14 +300,14 @@ export default {
|
|
|
310
300
|
|
|
311
301
|
const currentUserEmail = ref("");
|
|
312
302
|
const loadCurrentUserEmail = async () => {
|
|
313
|
-
currentUserEmail.value = (await
|
|
303
|
+
currentUserEmail.value = (await service.fetchCurrentUser()).email ?? "";
|
|
314
304
|
};
|
|
315
305
|
|
|
316
306
|
const deleteTopic = async () => {
|
|
317
307
|
try {
|
|
318
308
|
showDeleteModal.value = false;
|
|
319
309
|
loading.value = true;
|
|
320
|
-
await
|
|
310
|
+
await service.deleteTopic(props.project, props.topic);
|
|
321
311
|
emit("topic-deleted", props.topic);
|
|
322
312
|
} catch (error) {
|
|
323
313
|
console.error(error);
|
|
@@ -94,28 +94,14 @@
|
|
|
94
94
|
|
|
95
95
|
<script>
|
|
96
96
|
import { onMounted, inject, ref, watch, onBeforeUnmount } from "vue";
|
|
97
|
-
import
|
|
97
|
+
import service from "../../../service.js";
|
|
98
98
|
import { getViewerOptions, highlightViewer, unhighlightViewer } from "../../../utils/viewer.js";
|
|
99
99
|
|
|
100
100
|
// Components
|
|
101
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
102
|
-
import BIMDataDropdownList from "@bimdata/design-system/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue";
|
|
103
|
-
import {
|
|
104
|
-
BIMDataIconCamera,
|
|
105
|
-
BIMDataIconDelete,
|
|
106
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
107
|
-
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
|
|
108
|
-
import BIMDataTextarea from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue";
|
|
109
101
|
import TopicComment from "./topic-comment/TopicComment.vue";
|
|
110
102
|
|
|
111
103
|
export default {
|
|
112
104
|
components: {
|
|
113
|
-
BIMDataButton,
|
|
114
|
-
BIMDataDropdownList,
|
|
115
|
-
BIMDataIconCamera,
|
|
116
|
-
BIMDataIconDelete,
|
|
117
|
-
BIMDataLoading,
|
|
118
|
-
BIMDataTextarea,
|
|
119
105
|
TopicComment,
|
|
120
106
|
},
|
|
121
107
|
props: {
|
|
@@ -156,7 +142,7 @@ export default {
|
|
|
156
142
|
const viewerSelectOptions = ref([]);
|
|
157
143
|
|
|
158
144
|
const loadComments = async () => {
|
|
159
|
-
comments.value = await
|
|
145
|
+
comments.value = await service.fetchTopicComments(props.project, props.topic);
|
|
160
146
|
};
|
|
161
147
|
|
|
162
148
|
const setCommentViewpoint = async () => {
|
|
@@ -179,7 +165,6 @@ export default {
|
|
|
179
165
|
|
|
180
166
|
const submitComment = async () => {
|
|
181
167
|
try {
|
|
182
|
-
const service = useService();
|
|
183
168
|
loading.value = true;
|
|
184
169
|
if (viewpoint.value) {
|
|
185
170
|
viewpoint.value = await service.createViewpoint(
|
|
@@ -138,42 +138,14 @@
|
|
|
138
138
|
|
|
139
139
|
<script>
|
|
140
140
|
import { inject, onMounted, ref, onBeforeUnmount } from "vue";
|
|
141
|
-
import
|
|
141
|
+
import service from "../../../../service.js";
|
|
142
142
|
import { getViewerOptions, highlightViewer, unhighlightViewer } from "../../../../utils/viewer.js";
|
|
143
143
|
|
|
144
|
-
// Components
|
|
145
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
146
|
-
import {
|
|
147
|
-
BIMDataIconCamera,
|
|
148
|
-
BIMDataIconClose,
|
|
149
|
-
BIMDataIconDelete,
|
|
150
|
-
BIMDataIconEdit,
|
|
151
|
-
BIMDataIconEllipsis,
|
|
152
|
-
BIMDataIconUndo,
|
|
153
|
-
BIMDataIconUser,
|
|
154
|
-
BIMDataIconValidate,
|
|
155
|
-
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
|
|
156
|
-
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
|
|
157
|
-
import BIMDataTextarea from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue";
|
|
158
|
-
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
159
|
-
|
|
160
144
|
// TODO: should be imported from DS
|
|
161
145
|
import UserAvatar from "../../../user-avatar/UserAvatar.vue";
|
|
162
146
|
|
|
163
147
|
export default {
|
|
164
148
|
components: {
|
|
165
|
-
BIMDataButton,
|
|
166
|
-
BIMDataIconCamera,
|
|
167
|
-
BIMDataIconClose,
|
|
168
|
-
BIMDataIconDelete,
|
|
169
|
-
BIMDataIconEdit,
|
|
170
|
-
BIMDataIconEllipsis,
|
|
171
|
-
BIMDataIconUndo,
|
|
172
|
-
BIMDataIconUser,
|
|
173
|
-
BIMDataIconValidate,
|
|
174
|
-
BIMDataLoading,
|
|
175
|
-
BIMDataTextarea,
|
|
176
|
-
BIMDataTextbox,
|
|
177
149
|
UserAvatar,
|
|
178
150
|
},
|
|
179
151
|
props: {
|
|
@@ -217,7 +189,7 @@ export default {
|
|
|
217
189
|
const toggleMenu = () => (showMenu.value = !showMenu.value);
|
|
218
190
|
|
|
219
191
|
const loadViewpoint = async () => {
|
|
220
|
-
viewpoint.value = await
|
|
192
|
+
viewpoint.value = await service.fetchTopicCommentViewpoint(
|
|
221
193
|
props.project,
|
|
222
194
|
props.topic,
|
|
223
195
|
props.comment
|
|
@@ -234,7 +206,7 @@ export default {
|
|
|
234
206
|
};
|
|
235
207
|
const deleteViewpoint = async () => {
|
|
236
208
|
if (viewpoint.value.guid) {
|
|
237
|
-
await
|
|
209
|
+
await service.deleteViewpoint(props.project, props.topic, viewpoint.value);
|
|
238
210
|
}
|
|
239
211
|
viewpoint.value = null;
|
|
240
212
|
};
|
|
@@ -260,7 +232,7 @@ export default {
|
|
|
260
232
|
return;
|
|
261
233
|
}
|
|
262
234
|
if (viewpoint.value && !viewpoint.value.guid) {
|
|
263
|
-
viewpoint.value = await
|
|
235
|
+
viewpoint.value = await service.createViewpoint(
|
|
264
236
|
props.project,
|
|
265
237
|
props.topic,
|
|
266
238
|
viewpoint.value
|
|
@@ -272,7 +244,7 @@ export default {
|
|
|
272
244
|
) {
|
|
273
245
|
loading.value = true;
|
|
274
246
|
|
|
275
|
-
const newComment = await
|
|
247
|
+
const newComment = await service.updateComment(
|
|
276
248
|
props.project,
|
|
277
249
|
props.topic,
|
|
278
250
|
props.comment,
|
|
@@ -293,7 +265,7 @@ export default {
|
|
|
293
265
|
const submitDelete = async () => {
|
|
294
266
|
try {
|
|
295
267
|
loading.value = true;
|
|
296
|
-
await
|
|
268
|
+
await service.deleteComment(props.project, props.topic, props.comment);
|
|
297
269
|
emit("comment-deleted", props.comment);
|
|
298
270
|
isDeleting.value = false;
|
|
299
271
|
} finally {
|
|
@@ -35,17 +35,11 @@ import { computed } from "vue";
|
|
|
35
35
|
import { getStatusColor } from "../../../utils/topic.js";
|
|
36
36
|
import { getViewpointConfig } from "../../../utils/viewpoints.js";
|
|
37
37
|
// Components
|
|
38
|
-
import BIMDataCarousel from "@bimdata/design-system/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.vue";
|
|
39
|
-
import BIMDataIconInformation from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconInformation.vue";
|
|
40
|
-
import BIMDataIcon from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue";
|
|
41
38
|
import BcfTopicDefaultImage from "../../bcf-topic-card/BcfTopicDefaultImage.vue";
|
|
42
39
|
|
|
43
40
|
export default {
|
|
44
41
|
components: {
|
|
45
42
|
BcfTopicDefaultImage,
|
|
46
|
-
BIMDataCarousel,
|
|
47
|
-
BIMDataIcon,
|
|
48
|
-
BIMDataIconInformation,
|
|
49
43
|
},
|
|
50
44
|
props: {
|
|
51
45
|
detailedExtensions: {
|
|
@@ -66,9 +66,6 @@
|
|
|
66
66
|
import { computed } from "vue";
|
|
67
67
|
import columnsDef from "./columns.js";
|
|
68
68
|
// Components
|
|
69
|
-
import BIMDataTable from "@bimdata/design-system/src/BIMDataComponents/BIMDataTable/BIMDataTable.vue";
|
|
70
|
-
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
|
|
71
|
-
import BIMDataTooltip from "@bimdata/design-system/src/BIMDataComponents/BIMDataTooltip/BIMDataTooltip.vue";
|
|
72
69
|
import BcfTopicActionsCell from "./bcf-topic-actions-cell/BcfTopicActionsCell.vue";
|
|
73
70
|
import BcfTopicIndexCell from "./bcf-topic-index-cell/BcfTopicIndexCell.vue";
|
|
74
71
|
import BcfTopicPriorityCell from "./bcf-topic-priority-cell/BcfTopicPriorityCell.vue";
|
|
@@ -83,9 +80,6 @@ export default {
|
|
|
83
80
|
BcfTopicIndexCell,
|
|
84
81
|
BcfTopicPriorityCell,
|
|
85
82
|
BcfTopicStatusCell,
|
|
86
|
-
BIMDataTable,
|
|
87
|
-
BIMDataTextbox,
|
|
88
|
-
BIMDataTooltip,
|
|
89
83
|
UserAvatar
|
|
90
84
|
},
|
|
91
85
|
props: {
|
|
@@ -13,15 +13,7 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
-
// Components
|
|
17
|
-
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
|
|
18
|
-
import BIMDataIconShow from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconShow.vue";
|
|
19
|
-
|
|
20
16
|
export default {
|
|
21
|
-
components: {
|
|
22
|
-
BIMDataButton,
|
|
23
|
-
BIMDataIconShow,
|
|
24
|
-
},
|
|
25
17
|
props: {
|
|
26
18
|
topic: {
|
|
27
19
|
type: Object,
|
|
@@ -23,12 +23,7 @@
|
|
|
23
23
|
<script>
|
|
24
24
|
import { computed } from "vue";
|
|
25
25
|
|
|
26
|
-
import BIMDataIconUser from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconUser.vue";
|
|
27
|
-
|
|
28
26
|
export default {
|
|
29
|
-
components: {
|
|
30
|
-
BIMDataIconUser,
|
|
31
|
-
},
|
|
32
27
|
props: {
|
|
33
28
|
user: {
|
|
34
29
|
type: Object,
|
package/src/index.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import * as config from "./config.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getPriorityColor, getStatusColor } from "./utils/topic.js";
|
|
3
|
+
import { getViewpointConfig } from "./utils/viewpoints.js";
|
|
3
4
|
|
|
4
5
|
import { useBcfFilter } from "./composables/filter.js";
|
|
5
6
|
import { useBcfSearch } from "./composables/search.js";
|
|
6
7
|
import { useBcfSort } from "./composables/sort.js";
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
-
getPriorityColor,
|
|
10
|
-
getStatusColor
|
|
11
|
-
} from "./utils/topic.js";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
getViewpointConfig
|
|
15
|
-
} from "./utils/viewpoints.js";
|
|
16
|
-
|
|
17
9
|
import BcfFilters from "./components/bcf-filters/BcfFilters.vue";
|
|
18
10
|
import BcfSettings from "./components/bcf-settings/BcfSettings.vue";
|
|
19
11
|
import BcfStatistics from "./components/bcf-statistics/BcfStatistics.vue";
|
|
@@ -36,15 +28,12 @@ const components = {
|
|
|
36
28
|
|
|
37
29
|
export {
|
|
38
30
|
config,
|
|
39
|
-
createService,
|
|
40
|
-
setService,
|
|
41
|
-
useService,
|
|
42
|
-
useBcfFilter,
|
|
43
|
-
useBcfSearch,
|
|
44
|
-
useBcfSort,
|
|
45
31
|
getPriorityColor,
|
|
46
32
|
getStatusColor,
|
|
47
33
|
getViewpointConfig,
|
|
34
|
+
useBcfFilter,
|
|
35
|
+
useBcfSearch,
|
|
36
|
+
useBcfSort,
|
|
48
37
|
components,
|
|
49
38
|
|
|
50
39
|
// Export components individually
|
package/src/service.js
CHANGED
|
@@ -4,22 +4,29 @@ import { getExtensionField } from "./utils/extensions.js";
|
|
|
4
4
|
import { getPriorityColor } from "./utils/topic.js";
|
|
5
5
|
import { downloadBlobAs } from "./utils/download.js";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
class Service {
|
|
8
|
+
setup({ apiClient, fetchUsers }) {
|
|
9
|
+
this.apiClient = apiClient;
|
|
10
|
+
this.fetchUsers = fetchUsers;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
_getUsers() {
|
|
14
|
+
return this.fetchUsers
|
|
15
|
+
? (project) => this.fetchUsers(project)
|
|
16
|
+
: (project) => this.apiClient.collaborationApi.getProjectUsers(project.cloud.id, project.id);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
fetchCurrentUser() {
|
|
20
|
+
return this.apiClient.bcfApi.getUser();
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
// --- BCF Topics API ---
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
const _extensions = extensions ?? (await apiClient.bcfApi.getDetailedExtensions(project.id));
|
|
20
|
-
const _users = users ?? (await
|
|
25
|
+
async fetchTopics(project, { extensions, users } = {}) {
|
|
26
|
+
const _extensions = extensions ?? (await this.apiClient.bcfApi.getDetailedExtensions(project.id));
|
|
27
|
+
const _users = users ?? (await this._getUsers(project));
|
|
21
28
|
|
|
22
|
-
const topics = await apiClient.bcfApi.getTopics(project.id);
|
|
29
|
+
const topics = await this.apiClient.bcfApi.getTopics(project.id);
|
|
23
30
|
topics.sort((a, b) => b.index - a.index);
|
|
24
31
|
topics.forEach((topic) => {
|
|
25
32
|
topic.color = getPriorityColor(topic, _extensions);
|
|
@@ -27,180 +34,147 @@ function createService(apiClient, { fetchUsers }) {
|
|
|
27
34
|
});
|
|
28
35
|
|
|
29
36
|
return topics;
|
|
30
|
-
}
|
|
37
|
+
}
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
const extensions = await apiClient.bcfApi.getDetailedExtensions(project.id);
|
|
34
|
-
const topic = await apiClient.bcfApi.getFullTopic(guid, project.id, "url");
|
|
39
|
+
async fecthTopicByGuid(project, guid) {
|
|
40
|
+
const extensions = await this.apiClient.bcfApi.getDetailedExtensions(project.id);
|
|
41
|
+
const topic = await this.apiClient.bcfApi.getFullTopic(guid, project.id, "url");
|
|
35
42
|
topic.color = getPriorityColor(topic, extensions);
|
|
36
43
|
return topic;
|
|
37
|
-
}
|
|
44
|
+
}
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
return apiClient.bcfApi.createTopic(project.id, topic);
|
|
41
|
-
}
|
|
46
|
+
createTopic(project, topic) {
|
|
47
|
+
return this.apiClient.bcfApi.createTopic(project.id, topic);
|
|
48
|
+
}
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
return apiClient.bcfApi.updateTopic(topic.guid, project.id, topic);
|
|
45
|
-
}
|
|
50
|
+
updateTopic(project, topic) {
|
|
51
|
+
return this.apiClient.bcfApi.updateTopic(topic.guid, project.id, topic);
|
|
52
|
+
}
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
return apiClient.bcfApi.deleteTopic(topic.guid, project.id);
|
|
49
|
-
}
|
|
54
|
+
deleteTopic(project, topic) {
|
|
55
|
+
return this.apiClient.bcfApi.deleteTopic(topic.guid, project.id);
|
|
56
|
+
}
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
async importBcf(project, file) {
|
|
52
59
|
const formData = new FormData();
|
|
53
60
|
formData.append("name", file.name);
|
|
54
61
|
formData.append("file", file);
|
|
55
|
-
await fetch(`${apiClient.config.basePath}/bcf/2.1/projects/${project.id}/import`, {
|
|
62
|
+
await fetch(`${this.apiClient.config.basePath}/bcf/2.1/projects/${project.id}/import`, {
|
|
56
63
|
method: "POST",
|
|
57
64
|
credentials: "include",
|
|
58
65
|
headers: {
|
|
59
|
-
...apiClient.authHeader,
|
|
66
|
+
...this.apiClient.authHeader,
|
|
60
67
|
},
|
|
61
68
|
body: formData,
|
|
62
69
|
});
|
|
63
|
-
}
|
|
70
|
+
}
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
const response = await apiClient.bcfApi.downloadBcfExport(
|
|
72
|
+
async exportBcf(project, topics) {
|
|
73
|
+
const response = await this.apiClient.bcfApi.downloadBcfExport(
|
|
67
74
|
project.id,
|
|
68
75
|
undefined, // Format
|
|
69
76
|
topics.map((t) => t.guid).join(",")
|
|
70
77
|
);
|
|
71
78
|
downloadBlobAs(`${project.name}.bcf`, response);
|
|
72
|
-
}
|
|
79
|
+
}
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
const response = await apiClient.bcfApi.downloadBcfExportXlsx(
|
|
81
|
+
async exportBcfXLSX(project, topics) {
|
|
82
|
+
const response = await this.apiClient.bcfApi.downloadBcfExportXlsx(
|
|
76
83
|
project.id,
|
|
77
84
|
undefined, // Format
|
|
78
85
|
undefined, // Locale
|
|
79
86
|
topics.map((t) => t.guid).join(",")
|
|
80
87
|
);
|
|
81
88
|
downloadBlobAs(`${project.name}.xlsx`, response);
|
|
82
|
-
}
|
|
89
|
+
}
|
|
83
90
|
|
|
84
91
|
// --- BCF Topic Viewpoints API ---
|
|
85
92
|
|
|
86
|
-
|
|
87
|
-
await eachLimit(topics, 10, (topic,
|
|
93
|
+
async loadTopicsViewpoints(project, topics) {
|
|
94
|
+
await eachLimit(topics, 10, (topic, done) => {
|
|
88
95
|
fetchTopicViewpoints(project, topic).then(viewpoints => {
|
|
89
96
|
topic.viewpoints = viewpoints;
|
|
90
|
-
|
|
91
|
-
},
|
|
97
|
+
done();
|
|
98
|
+
}, done);
|
|
92
99
|
});
|
|
93
100
|
return topics;
|
|
94
|
-
}
|
|
101
|
+
}
|
|
95
102
|
|
|
96
|
-
|
|
97
|
-
return apiClient.bcfApi.getTopicViewpoints(project.id, topic.guid, "url");
|
|
98
|
-
}
|
|
103
|
+
fetchTopicViewpoints(project, topic) {
|
|
104
|
+
return this.apiClient.bcfApi.getTopicViewpoints(project.id, topic.guid, "url");
|
|
105
|
+
}
|
|
99
106
|
|
|
100
|
-
|
|
101
|
-
return apiClient.bcfApi.getViewpoint(comment.viewpoint_guid, project.id, topic.guid);
|
|
102
|
-
}
|
|
107
|
+
fetchTopicCommentViewpoint(project, topic, comment) {
|
|
108
|
+
return this.apiClient.bcfApi.getViewpoint(comment.viewpoint_guid, project.id, topic.guid);
|
|
109
|
+
}
|
|
103
110
|
|
|
104
|
-
|
|
105
|
-
return apiClient.bcfApi.createViewpoint(project.id, topic.guid, "url", viewpoint);
|
|
106
|
-
}
|
|
111
|
+
createViewpoint(project, topic, viewpoint) {
|
|
112
|
+
return this.apiClient.bcfApi.createViewpoint(project.id, topic.guid, "url", viewpoint);
|
|
113
|
+
}
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
return apiClient.bcfApi.updateViewpoint(viewpoint.guid, project.id, topic.guid, "url", viewpoint);
|
|
110
|
-
}
|
|
115
|
+
updateViewpoint(project, topic, viewpoint) {
|
|
116
|
+
return this.apiClient.bcfApi.updateViewpoint(viewpoint.guid, project.id, topic.guid, "url", viewpoint);
|
|
117
|
+
}
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
return apiClient.bcfApi.deleteViewpoint(viewpoint.guid, project.id, topic.guid);
|
|
114
|
-
}
|
|
119
|
+
deleteViewpoint(project, topic, viewpoint) {
|
|
120
|
+
return this.apiClient.bcfApi.deleteViewpoint(viewpoint.guid, project.id, topic.guid);
|
|
121
|
+
}
|
|
115
122
|
|
|
116
123
|
// --- BCF Topic Comments API ---
|
|
117
124
|
|
|
118
|
-
|
|
119
|
-
const users = await
|
|
125
|
+
async fetchTopicComments(project, topic) {
|
|
126
|
+
const users = await this._getUsers(project);
|
|
120
127
|
|
|
121
|
-
const comments = await apiClient.bcfApi.getComments(project.id, topic.guid);
|
|
128
|
+
const comments = await this.apiClient.bcfApi.getComments(project.id, topic.guid);
|
|
122
129
|
comments.sort((a, b) => (a.date > b.date ? -1 : 1));
|
|
123
130
|
comments.forEach((c) => {
|
|
124
131
|
c.user = users.find((u) => u.email === c.author);
|
|
125
132
|
});
|
|
126
133
|
|
|
127
134
|
return comments;
|
|
128
|
-
}
|
|
135
|
+
}
|
|
129
136
|
|
|
130
|
-
|
|
131
|
-
return apiClient.bcfApi.createComment(project.id, topic.guid, data);
|
|
132
|
-
}
|
|
137
|
+
createComment(project, topic, data) {
|
|
138
|
+
return this.apiClient.bcfApi.createComment(project.id, topic.guid, data);
|
|
139
|
+
}
|
|
133
140
|
|
|
134
|
-
|
|
135
|
-
return apiClient.bcfApi.updateComment(comment.guid, project.id, topic.guid, data);
|
|
136
|
-
}
|
|
141
|
+
updateComment(project, topic, comment, data) {
|
|
142
|
+
return this.apiClient.bcfApi.updateComment(comment.guid, project.id, topic.guid, data);
|
|
143
|
+
}
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
return apiClient.bcfApi.deleteComment(comment.guid, project.id, topic.guid);
|
|
140
|
-
}
|
|
145
|
+
deleteComment(project, topic, comment) {
|
|
146
|
+
return this.apiClient.bcfApi.deleteComment(comment.guid, project.id, topic.guid);
|
|
147
|
+
}
|
|
141
148
|
|
|
142
149
|
// --- BCF Extensions API ---
|
|
143
150
|
|
|
144
|
-
|
|
145
|
-
return apiClient.bcfApi.getExtensions(project.id);
|
|
146
|
-
}
|
|
151
|
+
fetchExtensions(project) {
|
|
152
|
+
return this.apiClient.bcfApi.getExtensions(project.id);
|
|
153
|
+
}
|
|
147
154
|
|
|
148
|
-
|
|
149
|
-
return apiClient.bcfApi.getDetailedExtensions(project.id);
|
|
150
|
-
}
|
|
155
|
+
fetchDetailedExtensions(project) {
|
|
156
|
+
return this.apiClient.bcfApi.getDetailedExtensions(project.id);
|
|
157
|
+
}
|
|
151
158
|
|
|
152
|
-
|
|
153
|
-
return
|
|
159
|
+
createExtension(project, type, data) {
|
|
160
|
+
return this.apiClient.bcfApi[`createExtension${type}`](project.id, {
|
|
154
161
|
[getExtensionField(type)]: data.value,
|
|
155
162
|
color: getRandomHexColor(),
|
|
156
163
|
});
|
|
157
|
-
}
|
|
164
|
+
}
|
|
158
165
|
|
|
159
|
-
|
|
160
|
-
return
|
|
166
|
+
updateExtension(project, type, extension, data) {
|
|
167
|
+
return this.apiClient.bcfApi[`updateExtension${type}`](extension.id, project.id, {
|
|
161
168
|
[getExtensionField(type)]: data.value,
|
|
162
169
|
color: data.color,
|
|
163
170
|
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const deleteExtension = async (project, type, extension) => {
|
|
167
|
-
await apiClient.bcfApi[`deleteExtension${type}`](extension.id, project.id);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
return {
|
|
171
|
-
fetchCurrentUser,
|
|
172
|
-
fetchTopics,
|
|
173
|
-
fecthTopicByGuid,
|
|
174
|
-
createTopic,
|
|
175
|
-
updateTopic,
|
|
176
|
-
deleteTopic,
|
|
177
|
-
importBcf,
|
|
178
|
-
exportBcf,
|
|
179
|
-
exportBcfXLSX,
|
|
180
|
-
loadTopicsViewpoints,
|
|
181
|
-
fetchTopicViewpoints,
|
|
182
|
-
fetchTopicCommentViewpoint,
|
|
183
|
-
createViewpoint,
|
|
184
|
-
updateViewpoint,
|
|
185
|
-
deleteViewpoint,
|
|
186
|
-
fetchTopicComments,
|
|
187
|
-
createComment,
|
|
188
|
-
updateComment,
|
|
189
|
-
deleteComment,
|
|
190
|
-
fetchExtensions,
|
|
191
|
-
fetchDetailedExtensions,
|
|
192
|
-
createExtension,
|
|
193
|
-
updateExtension,
|
|
194
|
-
deleteExtension,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
171
|
+
}
|
|
197
172
|
|
|
198
|
-
|
|
199
|
-
|
|
173
|
+
deleteExtension(project, type, extension) {
|
|
174
|
+
return this.apiClient.bcfApi[`deleteExtension${type}`](extension.id, project.id);
|
|
175
|
+
}
|
|
200
176
|
}
|
|
201
177
|
|
|
202
|
-
|
|
203
|
-
return libService;
|
|
204
|
-
}
|
|
178
|
+
const service = new Service();
|
|
205
179
|
|
|
206
|
-
export
|
|
180
|
+
export default service;
|
package/vue3-plugin.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
components,
|
|
3
|
-
createService,
|
|
4
|
-
setService,
|
|
5
|
-
} from "./src/index.js";
|
|
1
|
+
import { components } from "./src/index.js";
|
|
6
2
|
import messages from "./src/i18n/index.js";
|
|
3
|
+
import service from "./src/service.js";
|
|
7
4
|
|
|
8
5
|
/**
|
|
9
6
|
* BCF Components library plugin for Vue 3.
|
|
@@ -28,8 +25,7 @@ const pluginFactory = ({
|
|
|
28
25
|
return {
|
|
29
26
|
install(app) {
|
|
30
27
|
if (apiClient) {
|
|
31
|
-
|
|
32
|
-
setService(service);
|
|
28
|
+
service.setup({ apiClient, fetchUsers });
|
|
33
29
|
} else {
|
|
34
30
|
console.error(
|
|
35
31
|
"[BCF Components Plugin] No api client provided. " +
|