From 9daf1be2e3e4cd7a3104e75544efd6da0aea0570 Mon Sep 17 00:00:00 2001 From: Nicolas Richel Date: Wed, 8 Jan 2025 15:40:44 +0100 Subject: [PATCH 1/4] PATCH: fix: add AVOID_SPACE_DELETION env var (default to false) (#500) --- .env.example | 26 +++++++------------ etc/env.sh | 1 + .../SpaceCardActionMenu.vue | 3 ++- src/config/spaces.js | 8 +++++- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.env.example b/.env.example index 4942b028c..2ecd5afb5 100644 --- a/.env.example +++ b/.env.example @@ -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= -# 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 @@ -23,33 +23,19 @@ 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 @@ -57,3 +43,9 @@ VUE_APP_PRO_PLAN_STORAGE=10737418240 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 diff --git a/etc/env.sh b/etc/env.sh index 1189fa1dd..2afde2402 100755 --- a/etc/env.sh +++ b/etc/env.sh @@ -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 diff --git a/src/components/specific/spaces/space-card/space-card-action-menu/SpaceCardActionMenu.vue b/src/components/specific/spaces/space-card/space-card-action-menu/SpaceCardActionMenu.vue index a1fd8e339..e34d9e7fe 100644 --- a/src/components/specific/spaces/space-card/space-card-action-menu/SpaceCardActionMenu.vue +++ b/src/components/specific/spaces/space-card/space-card-action-menu/SpaceCardActionMenu.vue @@ -1,6 +1,7 @@ + + diff --git a/src/components/specific/files/files-manager/FilesManager.vue b/src/components/specific/files/files-manager/FilesManager.vue index e566c1209..4ab81cf56 100644 --- a/src/components/specific/files/files-manager/FilesManager.vue +++ b/src/components/specific/files/files-manager/FilesManager.vue @@ -39,7 +39,7 @@ :fileStructure="fileStructure" :files="selection" :initialFolder="currentFolder" - @delete-files="openFileDeleteModal" + @delete-files="openWarningModal" @delete-visas="openVisaDeleteModal" @download="downloadFiles" @move="moveFiles" @@ -206,7 +206,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"; @@ -454,6 +455,10 @@ export default { closeModal(); }; + const openWarningModal = () => { + openModal({ component: WarningModal }); + }; + const moveFiles = async (event) => { await move(props.project, event.files, event.dest); }; @@ -781,6 +786,7 @@ export default { openVisaDeleteModal, openSidePanel, openSubscriptionModal, + openWarningModal, onTabChange, openTagManager, openVersioningManager, diff --git a/src/components/specific/models/models-manager/generic-models-manager/GenericModelsManager.vue b/src/components/specific/models/models-manager/generic-models-manager/GenericModelsManager.vue index 2159be658..dea33333c 100644 --- a/src/components/specific/models/models-manager/generic-models-manager/GenericModelsManager.vue +++ b/src/components/specific/models/models-manager/generic-models-manager/GenericModelsManager.vue @@ -44,7 +44,7 @@ :project="project" :models="selection" @archive="archiveModels" - @delete="openDeleteModal" + @delete="openWarningModal" @download="downloadModels" @open="openModels" @unarchive="unarchiveModels" @@ -88,6 +88,7 @@