Skip to content

Commit

Permalink
Merge branch 'release' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jan 15, 2025
2 parents aa19c10 + c25f912 commit 8e312dd
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 25 deletions.
26 changes: 9 additions & 17 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VUE_APP_BACKEND_BASE_URL=http://localhost:8000
# Authentication settings
VUE_APP_IAM_BASE_URL=https://iam.bimdata.io
VUE_APP_OIDC_CLIENT_ID=<YOUR CLIENT ID>
# can be a comma separated list of identity providers
# Comma separated list of identity providers
VUE_APP_AUTHORIZED_IDENTITY_PROVIDERS=bimdataconnect

# Maptiler auth token used by maplibre
Expand All @@ -23,37 +23,29 @@ VUE_APP_URL_DOCUMENTATION=https://developers.bimdata.io
VUE_APP_URL_MARKETPLACE=https://marketplace.bimdata.io
VUE_APP_URL_OLD_PLATFORM=https://platform-old.bimdata.io

# Guided Tour config
VUE_APP_GUIDED_TOUR_ENABLED=false

# Subscription config
# Subscription feature will be enabled if "true"
VUE_APP_SUBSCRIPTION_ENABLED=false
# Paddle "sandbox" mode will be enabled if "true"
VUE_APP_PADDLE_SANDBOX=false

# Translate IFC entities will be enabled if "true"
VUE_APP_TRANSLATE_IFC_TYPE=false

# Notifications config
VUE_APP_NOTIFICATION_ENABLED=true

# Vendor ID from Paddle
VUE_APP_PADDLE_VENDOR_ID=
# Plans/Product IDs from Paddle
VUE_APP_PRO_PLAN_ID=
VUE_APP_DATAPACK_PLAN_ID=

# Amount of storage available with free plan
# => 300 MB = 300 * 1024^2
# Amount of storage available with free plan in bytes (e.g. 300 MB = 300 * 1024^2)
VUE_APP_FREE_PLAN_STORAGE=314572800

# Amount of base storage available with pro plan
# => 10 GB = 10 * 1024^3
# Amount of base storage available with pro plan in bytes (e.g. 10 GB = 10 * 1024^3)
VUE_APP_PRO_PLAN_STORAGE=10737418240

# Projects config
# Number of days for which a project is considered "New" after its creation
VUE_APP_PROJECT_STATUS_LIMIT_NEW=5
# Number of days since last update for which a project is considered "Active"
VUE_APP_PROJECT_STATUS_LIMIT_ACTIVE=15

# Features
VUE_APP_GUIDED_TOUR_ENABLED=false
VUE_APP_TRANSLATE_IFC_TYPE=false
VUE_APP_NOTIFICATION_ENABLED=true
VUE_APP_AVOID_SPACE_DELETION=false
1 change: 1 addition & 0 deletions etc/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ declare -A vars_to_placeholders=(
[VUE_APP_GUIDED_TOUR_ENABLED]="ENV.VUE_APP_GUIDED_TOUR_ENABLED"
[VUE_APP_TRANSLATE_IFC_TYPE]="ENV.VUE_APP_TRANSLATE_IFC_TYPE"
[VUE_APP_NOTIFICATION_ENABLED]="ENV.VUE_APP_NOTIFICATION_ENABLED"
[VUE_APP_AVOID_SPACE_DELETION]="ENV.VUE_APP_AVOID_SPACE_DELETION"
)

# Function to compute the hash of a resource
Expand Down
2 changes: 1 addition & 1 deletion src/components/specific/app/app-modal/AppModalContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ onBeforeRouteLeave(() => closeModal());
position: relative;
min-width: 400px;
min-height: 400px;
padding: calc(var(--spacing-unit) * 3);
padding: calc(var(--spacing-unit) * 2);
background-color: var(--color-white);
&__btn-close {
Expand Down
61 changes: 61 additions & 0 deletions src/components/specific/app/warning-modal/WarningModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template>
<div class="warning-modal">
<BIMDataButton class="warning-modal__btn-close" ghost rounded icon @click="closeModal">
<BIMDataIconClose size="xxs" fill color="granite" />
</BIMDataButton>
<BIMDataIconWarning class="warning-modal__icon" size="xl" fill color="warning" />
<div class="warning-modal__title">
{{ $t("WarningModal.title") }}
</div>
<div class="warning-modal__text">
{{ $t("WarningModal.text1") }}
</div>
<div class="warning-modal__text">
{{ $t("WarningModal.text2") }}
</div>
</div>
</template>

<script setup>
import { onBeforeRouteLeave } from "vue-router";
import { useAppModal } from "../app-modal/app-modal.js";
const { closeModal } = useAppModal();
onBeforeRouteLeave(() => closeModal());
</script>

<style scoped>
.warning-modal {
position: relative;
width: 500px;
min-height: 400px;
padding: calc(var(--spacing-unit) * 3);
background-color: var(--color-white);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: var(--spacing-unit);
.warning-modal__title {
font-size: 1.5rem;
font-weight: bold;
color: var(--color-warning);
}
.warning-modal__text {
text-align: center;
}
.warning-modal__btn-close {
position: absolute;
top: calc(var(--spacing-unit) / 2);
right: calc(var(--spacing-unit) / 2);
&:hover {
background-color: rgba(216, 216, 216, 0.1);
}
}
}
</style>
10 changes: 8 additions & 2 deletions src/components/specific/files/files-manager/FilesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
:fileStructure="fileStructure"
:files="selection"
:initialFolder="currentFolder"
@delete-files="openFileDeleteModal"
@delete-files="openWarningModal"
@delete-visas="openVisaDeleteModal"
@download="downloadFiles"
@move="moveFiles"
Expand Down Expand Up @@ -209,7 +209,8 @@ import { fileUploadInput } from "../../../../utils/upload.js";
// Components
import AllFilesTable from "../all-files-table/AllFilesTable.vue";
import AppSidePanelContent from "../../../specific/app/app-side-panel/AppSidePanelContent.vue";
import AppSidePanelContent from "../../app/app-side-panel/AppSidePanelContent.vue";
import WarningModal from "../../app/warning-modal/WarningModal.vue";
import DocumentViewer from "../document-viewer/DocumentViewer.vue";
import FilesActionBar from "./files-action-bar/FilesActionBar.vue";
import FilesDeleteModal from "./files-delete-modal/FilesDeleteModal.vue";
Expand Down Expand Up @@ -462,6 +463,10 @@ export default {
closeModal();
};
const openWarningModal = () => {
openModal({ component: WarningModal });
};
const moveFiles = async (event) => {
await move(props.project, event.files, event.dest);
};
Expand Down Expand Up @@ -790,6 +795,7 @@ export default {
openVisaDeleteModal,
openSidePanel,
openSubscriptionModal,
openWarningModal,
onTabChange,
openTagManager,
openVersioningManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
:project="project"
:models="selection"
@archive="archiveModels"
@delete="openDeleteModal"
@delete="openWarningModal"
@download="downloadModels"
@open="openModels"
@unarchive="unarchiveModels"
Expand Down Expand Up @@ -90,6 +90,7 @@
<script>
import { computed, ref, watch, watchEffect } from "vue";
import { useRouter } from "vue-router";
import { useAppModal } from "../../../app/app-modal/app-modal.js";
import { MODEL_CONFIG } from "../../../../../config/models.js";
import { WINDOWS } from "../../../../../config/viewer.js";
import { useFiles } from "../../../../../state/files.js";
Expand All @@ -100,6 +101,7 @@ import { isModel, openInViewer } from "../../../../../utils/models.js";
import { fileUploadInput } from "../../../../../utils/upload.js";
// Components
import WarningModal from "../../../app/warning-modal/WarningModal.vue";
import ModelsActionBar from "../models-action-bar/ModelsActionBar.vue";
import ModelsDeleteModal from "../models-delete-modal/ModelsDeleteModal.vue";
import ModelsTable from "../../models-table/ModelsTable.vue";
Expand Down Expand Up @@ -192,6 +194,11 @@ export default {
showDeleteModal.value = false;
};
const { openModal } = useAppModal();
const openWarningModal = () => {
openModal({ component: WarningModal });
};
const downloadModels = async models => {
await download(
props.project,
Expand Down Expand Up @@ -250,6 +257,7 @@ export default {
onUploadCanceled,
openDeleteModal,
openModels,
openWarningModal,
selectTab,
unarchiveModels,
uploadModels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ defineEmits(["close"]);
.content {
height: 100%;
}
&:deep(.bimdata-tree) {
height: calc(100% - 44px);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{{ $t("SpaceCardActionMenu.removeImageButtonText") }}
</BIMDataButton>
<BIMDataButton
v-if="isSpaceAdmin(space)"
v-if="IS_SPACE_DELETION_ENABLED && isSpaceAdmin(space)"
data-test-id="btn-open-delete"
color="high"
ghost
Expand Down
8 changes: 7 additions & 1 deletion src/config/spaces.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const AVOID_SPACE_DELETION = ENV.VUE_APP_AVOID_SPACE_DELETION;
const IS_SPACE_DELETION_ENABLED = AVOID_SPACE_DELETION !== "true";

const SPACE_ROLE = Object.freeze({
ADMIN: 100,
USER: 50
});

export { SPACE_ROLE };
export {
IS_SPACE_DELETION_ENABLED,
SPACE_ROLE
};
5 changes: 5 additions & 0 deletions src/i18n/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -897,5 +897,10 @@
"VisasDeleteModal": {
"title": "Delete {visasCount} visas",
"message": "You are about to delete the visas on the following files:"
},
"WarningModal": {
"title": "Ongoing optimisation",
"text1": "We are currently working on optimizing the data deletion process to ensure greater efficiency and stability. This feature will be reactivated as soon as the improvements have been finalized.",
"text2": "If you wish to delete your data immediately, please contact us directly. Thank you for your patience and understanding."
}
}
5 changes: 5 additions & 0 deletions src/i18n/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -898,5 +898,10 @@
"VisasDeleteModal": {
"title": "Suppression de {visasCount} visas",
"message": "Vous êtes sur le point de supprimer les visas sur les fichiers suivants :"
},
"WarningModal": {
"title": "Optimisation en cours",
"text1": "Nous travaillons actuellement à optimiser le processus de suppression des données pour garantir une meilleure efficacité et stabilité. Cette fonctionnalité sera remise en service dès que les améliorations auront été finalisées.",
"text2": "Si vous souhaitez procéder à la suppression de vos données dans l'immédiat, n'hésitez pas à nous contacter directement. Merci pour votre patience et votre compréhension."
}
}
12 changes: 10 additions & 2 deletions src/services/UserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ class UserService {
}
}

fetchUserFavorites() {
return backendClient.get("/fav/");
async fetchUserFavorites() {
try {
return await backendClient.get("/fav/");
} catch (error) {
console.error(error);
return {
cloud_ids: [],
project_ids: []
};
}
}

addFavoriteSpace(space) {
Expand Down

0 comments on commit 8e312dd

Please sign in to comment.