Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ VUE_APP_GUIDED_TOUR_ENABLED=false
VUE_APP_TRANSLATE_IFC_TYPE=false
VUE_APP_NOTIFICATION_ENABLED=true
VUE_APP_AVOID_SPACE_DELETION=false
VUE_APP_DELETION_TEMP_WORKAROUND_ENABLED=false
1 change: 0 additions & 1 deletion etc/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ declare -A vars_to_placeholders=(
[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"
[VUE_APP_DELETION_TEMP_WORKAROUND_ENABLED]="ENV.VUE_APP_DELETION_TEMP_WORKAROUND_ENABLED"
[VUE_APP_PDF_BACKEND_BASE_URL]="ENV.VUE_APP_PDF_BACKEND_BASE_URL"
)

Expand Down
964 changes: 464 additions & 500 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@bimdata/bcf-components": "6.7.6",
"@bimdata/components": "1.10.1",
"@bimdata/design-system": "2.3.0",
"@bimdata/typescript-fetch-api-client": "10.31.1",
"@bimdata/typescript-fetch-api-client": "10.32.0",
"@bimdata/viewer": "2.16.2",
"@paddle/paddle-js": "^1.6.2",
"async": "^3.2.6",
Expand Down Expand Up @@ -49,4 +49,4 @@
"vite": "^7.3.1",
"vite-plugin-environment": "^1.1.3"
}
}
}
12 changes: 1 addition & 11 deletions src/components/specific/files/files-manager/FilesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
:fileStructure="fileStructure"
:files="selection"
:initialFolder="currentFolder"
@delete-files="openFileDeleteModalOrWarningModal"
@delete-files="openFileDeleteModal"
@delete-visas="openVisaDeleteModal"
@download="downloadFiles"
@move="moveFiles"
Expand Down Expand Up @@ -194,7 +194,6 @@ import { useListFilter } from "../../../../composables/list-filter.js";
import { useStandardBreakpoints } from "../../../../composables/responsive.js";
import { FILE_TYPE } from "../../../../config/files.js";
import { MODEL_TYPE } from "../../../../config/models.js";
import { IS_DELETION_TEMP_WORKAROUND_ENABLED } from "../../../../config/projects.js";
import { VISA_STATUS } from "../../../../config/visa.js";
import FileService from "../../../../services/FileService.js";
import TagService from "../../../../services/TagService";
Expand Down Expand Up @@ -418,14 +417,6 @@ export default {
closeModal();
};

const openFileDeleteModalOrWarningModal = (files) => {
if (IS_DELETION_TEMP_WORKAROUND_ENABLED) {
openModal({ component: WarningModal });
} else {
openFileDeleteModal(files);
}
};

const moveFiles = async (event) => {
await move(props.project, event.files, event.dest);
};
Expand Down Expand Up @@ -769,7 +760,6 @@ export default {
onFileSelected,
openAccessManager,
openFileDeleteModal,
openFileDeleteModalOrWarningModal,
openVisaDeleteModal,
openSidePanel,
openSubscriptionModal,
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="openDeleteModalOrWarningModal"
@delete="openDeleteModal"
@download="downloadModels"
@open="openModels"
@unarchive="unarchiveModels"
Expand Down Expand Up @@ -92,7 +92,6 @@
import { computed, ref, watch, watchEffect } from "vue";
import { useRouter } from "vue-router";
import { MODEL_CONFIG } from "../../../../../config/models.js";
import { IS_DELETION_TEMP_WORKAROUND_ENABLED } from "../../../../../config/projects.js";
import { WINDOWS } from "../../../../../config/viewer.js";
import { useFiles } from "../../../../../state/files.js";
import { useModels } from "../../../../../state/models.js";
Expand Down Expand Up @@ -198,16 +197,7 @@ export default {
showDeleteModal.value = false;
};

const openDeleteModalOrWarningModal = models => {
if (IS_DELETION_TEMP_WORKAROUND_ENABLED) {
const { openModal } = useAppModal();
openModal({ component: WarningModal });
} else {
openDeleteModal(models);
}
};

const downloadModels = async models => {
const downloadModels = async (models) => {
await download(
props.project,
models.map(({ document }) => document)
Expand Down Expand Up @@ -268,7 +258,6 @@ export default {
onFileUploaded,
onUploadCanceled,
openDeleteModal,
openDeleteModalOrWarningModal,
openModels,
selectTab,
unarchiveModels,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
color="high"
ghost
squared
@click="openDeleteGuardOrWarningModal"
@click="openDeleteGuard"
>
{{ $t("t.delete") }}
</BIMDataButton>
Expand All @@ -83,7 +83,6 @@
<script>
import { provide, ref } from "vue";
import { useToggle } from "../../../../../composables/toggle.js";
import { IS_DELETION_TEMP_WORKAROUND_ENABLED } from "../../../../../config/projects.js";
import { useUser } from "../../../../../state/user.js";
// Components
import ProjectCardDeleteGuard from "../project-card-delete-guard/ProjectCardDeleteGuard.vue";
Expand Down Expand Up @@ -148,15 +147,6 @@ export default {
emit("close");
};

const openDeleteGuardOrWarningModal = () => {
if (IS_DELETION_TEMP_WORKAROUND_ENABLED) {
const { openModal } = useAppModal();
openModal({ component: WarningModal });
} else {
openDeleteGuard();
}
};

return {
// References
loading,
Expand All @@ -170,7 +160,7 @@ export default {
closeLeaveGuard,
isProjectAdmin,
isFavoriteProject,
openDeleteGuardOrWarningModal,
openDeleteGuard,
openUpdateForm,
openLeaveGuard,
resetMenu,
Expand Down
6 changes: 1 addition & 5 deletions src/config/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ const PROJECT_ROLE = Object.freeze({

const DEFAULT_PROJECT_VIEW = "overview";

const DELETION_TEMP_WORKAROUND_ENABLED = ENV.VUE_APP_DELETION_TEMP_WORKAROUND_ENABLED;
const IS_DELETION_TEMP_WORKAROUND_ENABLED = DELETION_TEMP_WORKAROUND_ENABLED === "true";

export {
statusLimitNew,
statusLimitActive,
PROJECT_ROLE,
DEFAULT_PROJECT_VIEW,
IS_DELETION_TEMP_WORKAROUND_ENABLED
DEFAULT_PROJECT_VIEW
};
26 changes: 10 additions & 16 deletions src/services/FileService.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,12 @@ class FileService {
}

async deleteFolders(project, folders) {
if (folders.length === 0) return;
try {
return await Promise.all(
folders.map(folder =>
apiClient.collaborationApi.deleteFolder(
project.cloud.id,
folder.id,
project.id
)
)
return await apiClient.collaborationApi.bulkDeleteFolders(
project.cloud.id,
project.id,
folders.map(folder => folder.id)
);
} catch (error) {
throw new RuntimeError(ERRORS.FILE_DELETE_ERROR, error);
Expand Down Expand Up @@ -143,15 +140,12 @@ class FileService {
}

async deleteDocuments(project, documents) {
if (documents.length === 0) return;
try {
return await eachLimit(
documents,
5,
document => apiClient.collaborationApi.deleteAllDocumentHistory(
project.cloud.id,
document.id,
project.id
)
return await apiClient.collaborationApi.bulkDeleteDocumentHistory(
project.cloud.id,
project.id,
documents.map(doc => doc.id)
);
} catch (error) {
throw new RuntimeError(ERRORS.FILE_DELETE_ERROR, error);
Expand Down