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 26, 2023
2 parents d044fa3 + 87b891b commit 7143ed0
Show file tree
Hide file tree
Showing 24 changed files with 156 additions and 368 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ and make all components available globally.
import { createApp } from "vue";
import { createI18n } from "vue-i18n"; // v9.x
import { makeBIMDataApiClient } from "@bimdata/typescript-fetch-api-client"; // v8.2+
import DesignSystem from "@bimdata/design-system/vue3-plugin.js"; // v2+
import BIMDataComponents from "@bimdata/components/vue3-plugin.js"; // v1+

// Import Vue 3 plugin factory
import BIMDataBcfComponents from "@bimdata/bcf-components/vue3-plugin.js";
import BcfComponents from "@bimdata/bcf-components/vue3-plugin.js";

// Instanciate i18n plugin
const i18nPlugin = createI18n({ ... });
Expand All @@ -34,8 +37,10 @@ const apiClient = makeBIMDataApiClient({ ... });

const app = createApp()
.use(i18nPlugin)
.use(DesignSystem())
.use(BIMDataComponents())
// Provide both i18n plugin and API client as plugin config
.use(BIMDataBcfComponents({ i18nPlugin, apiClient }));
.use(BcfComponents({ i18nPlugin, apiClient }));
...
```

Expand Down
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.1",
"version": "6.0.2-rc.6",
"files": [
"src",
"vue3-plugin.js"
Expand Down
19 changes: 0 additions & 19 deletions src/components/bcf-filters/BcfFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@
<script>
import { computed, ref, toRaw, watch } from "vue";
import { useBcfFilter } from "../../composables/filter.js";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconClose,
BIMDataIconFilterList,
BIMDataIconSearch,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
import BIMDataSelect from "@bimdata/design-system/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue";
import BIMDataText from "@bimdata/design-system/src/BIMDataComponents/BIMDataText/BIMDataText.vue";
function getSelectOptions(list) {
return Array.from(new Set(list)).sort((a, b) =>
Expand All @@ -131,15 +121,6 @@ function getSelectOptions(list) {
}
export default {
components: {
BIMDataButton,
BIMDataIconClose,
BIMDataIconFilterList,
BIMDataIconSearch,
BIMDataInput,
BIMDataSelect,
BIMDataText
},
props: {
topics: {
type: Array,
Expand Down
17 changes: 4 additions & 13 deletions src/components/bcf-settings/BcfSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,12 @@

<script>
import { EXTENSION_TYPES } from "../../config.js";
import { useService } from "../../service.js";
import service from "../../service.js";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconArrow,
BIMDataIconClose,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import SettingCard from "./setting-card/SettingCard.vue";
export default {
components: {
BIMDataButton,
BIMDataIconArrow,
BIMDataIconClose,
SettingCard,
},
props: {
Expand All @@ -81,12 +72,12 @@ export default {
emits: ["back", "close", "extension-created", "extension-updated", "extension-deleted"],
setup(props, { emit }) {
const createExtension = async (event) => {
const ext = await useService().createExtension(props.project, event.extensionType, event.data);
const ext = await service.createExtension(props.project, event.extensionType, event.data);
emit("extension-created", ext);
};
const updateExtension = async (event) => {
const ext = await useService().updateExtension(
const ext = await service.updateExtension(
props.project,
event.extensionType,
event.extension,
Expand All @@ -96,7 +87,7 @@ export default {
};
const deleteExtension = async (event) => {
await useService().deleteExtension(props.project, event.extensionType, event.extension);
await service.deleteExtension(props.project, event.extensionType, event.extension);
emit("extension-deleted", event.extension);
};
Expand Down
10 changes: 0 additions & 10 deletions src/components/bcf-settings/setting-card/SettingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,10 @@
import { computed, ref } from "vue";
import { getAvailableExtensions } from "../../../utils/extensions.js";
// Compopnents
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconChevron,
BIMDataIconPlus,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
import SettingCardItem from "./SettingCardItem.vue";
export default {
components: {
BIMDataButton,
BIMDataIconChevron,
BIMDataIconPlus,
BIMDataInput,
SettingCardItem,
},
props: {
Expand Down
15 changes: 0 additions & 15 deletions src/components/bcf-settings/setting-card/SettingCardItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,8 @@ import { adjustBorderColor } from "@bimdata/design-system/src/BIMDataComponents/
import { ref, watch } from "vue";
import { EXTENSION_WITH_COLOR } from "../../../config.js";
import { getExtensionField } from "../../../utils/extensions.js";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import BIMDataColorSelector from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.vue";
import {
BIMDataIconDelete,
BIMDataIconClose,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
export default {
components: {
BIMDataButton,
BIMDataColorSelector,
BIMDataIconDelete,
BIMDataIconClose,
BIMDataInput,
},
props: {
extensionType: {
type: String,
Expand Down
7 changes: 0 additions & 7 deletions src/components/bcf-statistics/BcfStatistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,8 @@
import { computed } from "vue";
import { DEFAULT_PRIORITY_COLOR } from "../../config.js";
import { getAvailableExtensions, getExtensionField } from "../../utils/extensions.js";
// Components
import BIMDataPaginatedList from "@bimdata/design-system/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue";
import BIMDataSimplePieChart from "@bimdata/design-system/src/BIMDataComponents/BIMDataSimplePieChart/BIMDataSimplePieChart.vue";
export default {
components: {
BIMDataPaginatedList,
BIMDataSimplePieChart,
},
props: {
detailedExtensions: {
type: Object,
Expand Down
10 changes: 0 additions & 10 deletions src/components/bcf-topic-card/BcfTopicCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,11 @@ import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BI
import { computed, ref } from "vue";
import { getPriorityColor, getStatusColor } from "../../utils/topic.js";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconInformation,
BIMDataIconModel3D,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
import BcfTopicDefaultImage from "./BcfTopicDefaultImage.vue";
export default {
components: {
BcfTopicDefaultImage,
BIMDataButton,
BIMDataIconInformation,
BIMDataIconModel3D,
BIMDataTextbox,
},
props: {
detailedExtensions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@

<script>
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import BIMDataIconPlus from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconPlus.vue";
import BcfTopicCreationCardImage from "./BcfTopicCreationCardImage.vue";
export default {
components: {
BcfTopicCreationCardImage,
BIMDataButton,
BIMDataIconPlus,
},
emits: ["create-topic"],
};
Expand Down
30 changes: 1 addition & 29 deletions src/components/bcf-topic-form/BcfTopicForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,10 @@

<script>
import { computed, ref, watch } from "vue";
import { useService } from "../../service.js";
import service from "../../service.js";
import { getViewerList } from "../../utils/viewer.js";
import { setViewpointDefaults } from "../../utils/viewpoints.js";
// Components
import BIMDataSafeZoneModal from "@bimdata/components/src/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue";
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import BIMDataDatePicker from "@bimdata/design-system/src/BIMDataComponents/BIMDataDatePicker/BIMDataDatePicker.vue";
import {
BIMDataIconArrow,
BIMDataIconClose,
BIMDataIconPlus,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue";
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
import BIMDataSelect from "@bimdata/design-system/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue";
import BIMDataTextarea from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue";
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
import BIMDataTooltip from "@bimdata/design-system/src/BIMDataComponents/BIMDataTooltip/BIMDataTooltip.vue";
import BcfTopicImages from "./bcf-topic-images/BcfTopicImages.vue";
import BcfTopicSnapshots from "./bcf-topic-snapshots/BcfTopicSnapshots.vue";
import BcfTopicSnapshotsActions from "./bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue";
Expand All @@ -224,18 +210,6 @@ export default {
BcfTopicImages,
BcfTopicSnapshots,
BcfTopicSnapshotsActions,
BIMDataButton,
BIMDataDatePicker,
BIMDataIconArrow,
BIMDataIconClose,
BIMDataIconPlus,
BIMDataInput,
BIMDataLoading,
BIMDataSafeZoneModal,
BIMDataSelect,
BIMDataTextarea,
BIMDataTextbox,
BIMDataTooltip,
},
props: {
uiConfig: {
Expand Down Expand Up @@ -417,8 +391,6 @@ export default {
};
const submit = async () => {
const service = useService();
if (!topicTitle.value) {
hasErrorTitle.value = true;
return;
Expand Down
13 changes: 0 additions & 13 deletions src/components/bcf-topic-form/bcf-topic-images/BcfTopicImages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,8 @@

<script>
import { isTabletOrMobile } from "../../../utils/browser.js";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconDelete,
BIMDataIconCamera,
BIMDataIconUnarchive,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
export default {
components: {
BIMDataButton,
BIMDataIconDelete,
BIMDataIconCamera,
BIMDataIconUnarchive,
},
props: {
viewpoints: {
type: Array,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default {
},
emits: ["create-viewpoint", "upload-viewpoint"],
setup(props) {
// Computed filtering viewpoints on isUpload = false
const snapshotedViewpoints = computed(() =>
props.viewpoints.filter((viewpoint) => !viewpoint.isUpload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,10 @@

<script>
import BcfTopicSnapshotsActions from "../bcf-topic-snapshots-actions/BcfTopicSnapshotsActions.vue";
// Components
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {
BIMDataIconDelete,
BIMDataIconCamera,
} from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
export default {
components: {
BcfTopicSnapshotsActions,
BIMDataButton,
BIMDataIconDelete,
BIMDataIconCamera,
},
props: {
viewpoints: {
Expand Down
16 changes: 3 additions & 13 deletions src/components/bcf-topic-overview/BcfTopicOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,9 @@
<script>
import { adjustTextColor } from "@bimdata/design-system/src/BIMDataComponents/BIMDataColorSelector/colors.js";
import { computed, onMounted, ref } from "vue";
import { useService } from "../../service.js";
import service from "../../service.js";
import { getPriorityColor } from "../../utils/topic.js";
// Components
import BIMDataSafeZoneModal from "@bimdata/components/src/BIMDataSafeZoneModal/BIMDataSafeZoneModal.vue";
import BIMDataButton from "@bimdata/design-system/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue";
import {BIMDataIconArrow,BIMDataIconEdit, BIMDataIconDelete, BIMDataIconClose, BIMDataIconModel3D } from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js";
import BIMDataLoading from "@bimdata/design-system/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue";
import BIMDataTextbox from "@bimdata/design-system/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue";
import BcfTopicComments from "./bcf-topic-comments/BcfTopicComments.vue";
import BcfTopicDefaultImage from "../bcf-topic-card/BcfTopicDefaultImage.vue";
import BcfTopicViewpoints from "./bcf-topic-viewpoints/BcfTopicViewpoints.vue";
Expand All @@ -249,11 +244,6 @@ export default {
BcfTopicComments,
BcfTopicDefaultImage,
BcfTopicViewpoints,
BIMDataButton,
BIMDataIconArrow,BIMDataIconEdit, BIMDataIconDelete, BIMDataIconClose, BIMDataIconModel3D,
BIMDataLoading,
BIMDataSafeZoneModal,
BIMDataTextbox,
},
props: {
uiConfig: {
Expand Down Expand Up @@ -310,14 +300,14 @@ export default {
const currentUserEmail = ref("");
const loadCurrentUserEmail = async () => {
currentUserEmail.value = (await useService().fetchCurrentUser()).email ?? "";
currentUserEmail.value = (await service.fetchCurrentUser()).email ?? "";
};
const deleteTopic = async () => {
try {
showDeleteModal.value = false;
loading.value = true;
await useService().deleteTopic(props.project, props.topic);
await service.deleteTopic(props.project, props.topic);
emit("topic-deleted", props.topic);
} catch (error) {
console.error(error);
Expand Down
Loading

0 comments on commit 7143ed0

Please sign in to comment.