diff --git a/app/package-lock.json b/app/package-lock.json index 2c1f714..5d92f68 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -48,6 +48,7 @@ "zustand": "^5.0.0-rc.2" }, "devDependencies": { + "@types/html2canvas": "^1.0.0", "@types/node": "^22.9.1", "@types/three": "^0.169.0", "axios": "^1.8.4", @@ -6490,6 +6491,17 @@ "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", "integrity": "sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==" }, + "node_modules/@types/html2canvas": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/html2canvas/-/html2canvas-1.0.0.tgz", + "integrity": "sha512-BJpVf+FIN9UERmzhbtUgpXj6XBZpG67FMgBLLoj9HZKd9XifcCpSV+UnFcwTZfEyun4U/KmCrrVOG7829L589w==", + "deprecated": "This is a stub types definition. html2canvas provides its own type definitions, so you do not need this installed.", + "dev": true, + "license": "MIT", + "dependencies": { + "html2canvas": "*" + } + }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", diff --git a/app/package.json b/app/package.json index ce5c7d3..e555d5f 100644 --- a/app/package.json +++ b/app/package.json @@ -70,6 +70,7 @@ ] }, "devDependencies": { + "@types/html2canvas": "^1.0.0", "@types/node": "^22.9.1", "@types/three": "^0.169.0", "axios": "^1.8.4", diff --git a/app/src/components/layout/sidebarLeft/visualization/Templates.tsx b/app/src/components/layout/sidebarLeft/visualization/Templates.tsx index efcbcaf..e796101 100644 --- a/app/src/components/layout/sidebarLeft/visualization/Templates.tsx +++ b/app/src/components/layout/sidebarLeft/visualization/Templates.tsx @@ -26,9 +26,14 @@ const Templates = () => { templateData(); }, []); - const handleDeleteTemplate = async (id: string) => { + const handleDeleteTemplate = async ( + e: React.MouseEvent, + id: string + ) => { try { + e.stopPropagation(); const email = localStorage.getItem("email") || ""; + const organization = email?.split("@")[1]?.split(".")[0]; let deleteTemplate = { organization: organization, @@ -49,7 +54,6 @@ const Templates = () => { const handleLoadTemplate = async (template: any) => { try { if (selectedZone.zoneName === "") return; - const email = localStorage.getItem("email") || ""; const organization = email?.split("@")[1]?.split(".")[0]; @@ -91,10 +95,10 @@ const Templates = () => {
handleLoadTemplate(template)} + > {template?.snapshot && ( -
+
handleLoadTemplate(template)}> {`${template.name} {