From 6780e73dd189d988c3276f200abffb90e539d090 Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Thu, 5 Jun 2025 15:37:49 +0530 Subject: [PATCH] Refactor product identifier from 'productId' to 'productUuid' across simulation stores and related types for consistency and clarity --- .../layout/scenes/ComparisonScene.tsx | 2 +- .../components/layout/scenes/MainScene.tsx | 2 +- .../properties/GlobalProperties.tsx | 8 +- .../eventProperties/EventProperties.tsx | 7 +- .../components/ActionsList.tsx | 15 +- .../mechanics/conveyorMechanics.tsx | 59 +- .../mechanics/machineMechanics.tsx | 38 +- .../mechanics/roboticArmMechanics.tsx | 512 +++++----- .../mechanics/storageMechanics.tsx | 40 +- .../mechanics/vehicleMechanics.tsx | 52 +- .../eventProperties/trigger/Trigger.tsx | 872 ++++++++---------- .../sidebarRight/simulation/Simulations.tsx | 480 +++++----- .../IotInputCards/BarChartInput.tsx | 8 +- .../IotInputCards/LineGrapInput.tsx | 8 +- .../IotInputCards/PieChartInput.tsx | 8 +- .../IotInputCards/Progress1Input.tsx | 8 +- .../IotInputCards/Progress2Input.tsx | 8 +- .../templates/CollaborationPopup.tsx | 2 +- .../ui/compareVersion/CompareLayOut.tsx | 4 +- .../builder/asset/functions/addAssetModel.ts | 853 ++++++++--------- .../builder/asset/models/model/model.tsx | 2 +- .../selectionControls/moveControls.tsx | 22 +- .../selectionControls/rotateControls.tsx | 16 +- .../selectionControls/selectionControls.tsx | 3 +- .../transformControls/transformControls.tsx | 17 +- .../conveyor/actionHandler/useSpawnHandler.ts | 10 +- .../actionHandler/useProcessHandler.ts | 2 +- .../actionHandler/usePickAndPlaceHandler.ts | 4 +- .../actionHandler/useRetrieveHandler.ts | 14 +- .../actionHandler/useStoreHandler.ts | 2 +- .../vehicle/actionHandler/useTravelHandler.ts | 4 +- .../analysis/throughPut/throughPutData.tsx | 2 +- .../conveyorInstance/conveyorInstance.tsx | 4 +- .../events/points/creator/pointsCreator.tsx | 28 +- .../functions/handleAddEventToProduct.ts | 19 +- .../triggerConnections/triggerConnector.tsx | 58 +- .../machineInstance/machineInstance.tsx | 2 +- .../instances/instance/materialInstance.tsx | 12 +- .../modules/simulation/products/products.tsx | 49 +- .../armInstance/roboticArmInstance.tsx | 8 +- .../checkActiveRoboticArmsInSubsequence.ts | 6 +- .../getConveyorSequencesInProduct.ts | 4 +- .../simulation/simulator/simulator.tsx | 4 +- .../simulation/spatialUI/arm/armBotUI.tsx | 27 +- .../spatialUI/arm/useDraggableGLTF.ts | 2 +- .../spatialUI/vehicle/vehicleUI.tsx | 724 +++++++-------- .../triggerHandler/useTriggerHandler.ts | 42 +- .../instances/instance/vehicleInstance.tsx | 10 +- .../widgets/2d/charts/BarGraphComponent.tsx | 4 +- .../2d/charts/DoughnutGraphComponent.tsx | 4 +- .../widgets/2d/charts/LineGraphComponent.tsx | 4 +- .../widgets/2d/charts/PieGraphComponent.tsx | 4 +- .../2d/charts/PolarAreaGraphComponent.tsx | 4 +- .../widgets/2d/charts/ProgressCard1.tsx | 4 +- .../widgets/2d/charts/ProgressCard2.tsx | 4 +- app/src/pages/Project.tsx | 4 +- app/src/services/dashboard/createProject.ts | 4 +- app/src/services/dashboard/getAllProjects.ts | 4 +- app/src/services/dashboard/getTrash.ts | 4 +- app/src/services/dashboard/updateProject.ts | 4 +- .../assest/floorAsset/getFloorItemsApi.ts | 4 +- .../assest/floorAsset/setFloorItemApi.ts | 4 +- .../assest/wallAsset/getWallItemsApi.ts | 4 +- .../factoryBuilder/camera/getCameraApi.ts | 4 +- .../environment/findEnvironment.ts | 4 +- .../environment/setEnvironment.ts | 4 +- .../factoryBuilder/lines/getLinesApi.ts | 4 +- .../factoryBuilder/zones/getZonesApi.ts | 4 +- .../products/UpsertProductOrEventApi.ts | 5 +- .../simulation/products/deleteEventDataApi.ts | 5 +- .../simulation/products/deleteProductApi.ts | 11 +- .../simulation/products/getProductApi.ts | 9 +- .../simulation/products/getallProductsApi.ts | 7 +- .../simulation/products/renameProductApi.ts | 10 +- .../services/visulization/zone/add3dWidget.ts | 4 +- .../visulization/zone/addFloatingWidgets.ts | 4 +- .../services/visulization/zone/addWidgets.ts | 4 +- .../services/visulization/zone/clearPanel.ts | 4 +- .../visulization/zone/delete3dWidget.ts | 4 +- .../visulization/zone/deleteFloatingWidget.ts | 4 +- .../services/visulization/zone/deletePanel.ts | 4 +- .../visulization/zone/deleteTemplate.ts | 4 +- .../visulization/zone/deleteWidgetApi.ts | 4 +- .../visulization/zone/duplicateWidget.ts | 4 +- .../visulization/zone/get3dWidgetData.ts | 4 +- .../visulization/zone/getFloatingData.ts | 4 +- .../visulization/zone/getSelect2dZoneData.ts | 4 +- .../services/visulization/zone/getTemplate.ts | 4 +- .../services/visulization/zone/getZoneData.ts | 4 +- .../services/visulization/zone/getZones.ts | 4 +- .../visulization/zone/loadTemplate.ts | 4 +- app/src/services/visulization/zone/panel.ts | 4 +- .../visulization/zone/saveTempleteApi.ts | 4 +- .../visulization/zone/update3dWidget.ts | 8 +- .../visulization/zone/zoneCameraUpdation.ts | 4 +- app/src/store/simulation/useArmBotStore.ts | 14 +- app/src/store/simulation/useConveyorStore.ts | 14 +- app/src/store/simulation/useMachineStore.ts | 14 +- app/src/store/simulation/useProductStore.ts | 188 ++-- .../store/simulation/useSimulationStore.ts | 28 +- .../store/simulation/useStorageUnitStore.ts | 14 +- app/src/store/simulation/useVehicleStore.ts | 14 +- app/src/types/simulationTypes.d.ts | 12 +- 103 files changed, 2199 insertions(+), 2397 deletions(-) diff --git a/app/src/components/layout/scenes/ComparisonScene.tsx b/app/src/components/layout/scenes/ComparisonScene.tsx index 237ab7f..635ebec 100644 --- a/app/src/components/layout/scenes/ComparisonScene.tsx +++ b/app/src/components/layout/scenes/ComparisonScene.tsx @@ -21,7 +21,7 @@ function ComparisonScene() { const handleSelectLayout = (option: string) => { const product = products.find((product) => product.productName === option); if (product) { - setComparisonProduct(product.productId, product.productName); + setComparisonProduct(product.productUuid, product.productName); setIsPlaying(true); setIsPaused(true); } diff --git a/app/src/components/layout/scenes/MainScene.tsx b/app/src/components/layout/scenes/MainScene.tsx index c56fa0a..b15f28f 100644 --- a/app/src/components/layout/scenes/MainScene.tsx +++ b/app/src/components/layout/scenes/MainScene.tsx @@ -43,7 +43,7 @@ function MainScene() { const handleSelectLayout = (option: string) => { const product = products.find((product) => product.productName === option); if (product) { - setMainProduct(product.productId, product.productName); + setMainProduct(product.productUuid, product.productName); } }; diff --git a/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx b/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx index 3ad8acd..b07192c 100644 --- a/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx +++ b/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx @@ -43,7 +43,7 @@ const GlobalProperties: React.FC = () => { const email = localStorage.getItem("email"); const organization = email?.split("@")[1]?.split(".")[0] || "defaultOrg"; - const data = await setEnvironment( + setEnvironment( organization, localStorage.getItem("userId")!, wallVisibility, @@ -62,7 +62,7 @@ const GlobalProperties: React.FC = () => { const organization = email?.split("@")[1]?.split(".")[0] || "defaultOrg"; if (limitDistance) { - let data = await setEnvironment( + setEnvironment( organization, localStorage.getItem("userId")!, wallVisibility, @@ -74,7 +74,7 @@ const GlobalProperties: React.FC = () => { ); setRenderDistance(75); } else { - let data = await setEnvironment( + setEnvironment( organization, localStorage.getItem("userId")!, wallVisibility, @@ -163,7 +163,7 @@ const GlobalProperties: React.FC = () => { roofVisibility, shadows, renderDistance, - limitDistance,projectId + limitDistance, projectId ); // diff --git a/app/src/components/layout/sidebarRight/properties/eventProperties/EventProperties.tsx b/app/src/components/layout/sidebarRight/properties/eventProperties/EventProperties.tsx index c47a169..dd8d7ae 100644 --- a/app/src/components/layout/sidebarRight/properties/eventProperties/EventProperties.tsx +++ b/app/src/components/layout/sidebarRight/properties/eventProperties/EventProperties.tsx @@ -13,6 +13,7 @@ import { AddIcon } from "../../../../icons/ExportCommonIcons"; import { handleAddEventToProduct } from "../../../../../modules/simulation/events/points/functions/handleAddEventToProduct"; import { useEventsStore } from "../../../../../store/simulation/useEventsStore"; import { useProductContext } from "../../../../../modules/simulation/products/productContext"; +import { useParams } from "react-router-dom"; const EventProperties: React.FC = () => { const { selectedEventData } = useSelectedEventData(); @@ -25,6 +26,7 @@ const EventProperties: React.FC = () => { const [assetType, setAssetType] = useState(null); const { products, addEvent } = useProductStore(); const { selectedEventSphere } = useSelectedEventSphere(); + const { projectId } = useParams(); useEffect(() => { const event = getCurrentEventData(); @@ -39,7 +41,7 @@ const EventProperties: React.FC = () => { if (!selectedEventData?.data || !selectedProduct) return null; return ( getEventByModelUuid( - selectedProduct.productId, + selectedProduct.productUuid, selectedEventData.data.modelUuid ) ?? null ); @@ -96,7 +98,7 @@ const EventProperties: React.FC = () => { {products.map((product) => ( - -
-
-
- {triggers.map((trigger) => ( -
setSelectedTrigger(trigger)} - > - - {triggers.length > 1 && ( - - )} -
- ))} -
- -
- - {selectedTrigger && ( -
-
{selectedTrigger.triggerName}
- - -
- option.modelName)]} - onSelect={(option) => { - handleModelSelect(option, selectedTrigger.triggerUuid); - }} - /> - `Point ${option.uuid.slice(0, 4)}` - ), - ]} - onSelect={(option) => { - handlePointSelect(option, selectedTrigger.triggerUuid); - }} - /> - option.actionName), - ]} - onSelect={(option) => { - handleActionSelect(option, selectedTrigger.triggerUuid); - }} - />
-
- )} -
- - ); +
+
+
+ {triggers.map((trigger) => ( +
setSelectedTrigger(trigger)} + > + + {triggers.length > 1 && ( + + )} +
+ ))} +
+ +
+ + {selectedTrigger && ( +
+
{selectedTrigger.triggerName}
+ + +
+ option.modelName)]} + onSelect={(option) => { + handleModelSelect(option, selectedTrigger.triggerUuid); + }} + /> + `Point ${option.uuid.slice(0, 4)}` + ), + ]} + onSelect={(option) => { + handlePointSelect(option, selectedTrigger.triggerUuid); + }} + /> + option.actionName), + ]} + onSelect={(option) => { + handleActionSelect(option, selectedTrigger.triggerUuid); + }} + /> +
+
+ )} +
+ + ); }; export default Trigger; diff --git a/app/src/components/layout/sidebarRight/simulation/Simulations.tsx b/app/src/components/layout/sidebarRight/simulation/Simulations.tsx index 8e10a28..c6c76b1 100644 --- a/app/src/components/layout/sidebarRight/simulation/Simulations.tsx +++ b/app/src/components/layout/sidebarRight/simulation/Simulations.tsx @@ -1,15 +1,8 @@ import React, { useEffect, useRef, useState } from "react"; -import { - AddIcon, - ArrowIcon, - RemoveIcon, - ResizeHeightIcon, -} from "../../../icons/ExportCommonIcons"; +import { AddIcon, ArrowIcon, RemoveIcon, ResizeHeightIcon, } from "../../../icons/ExportCommonIcons"; import RenameInput from "../../../ui/inputs/RenameInput"; import { handleResize } from "../../../../functions/handleResizePannel"; -import { - useSelectedAsset, -} from "../../../../store/simulation/useSimulationStore"; +import { useSelectedAsset } from "../../../../store/simulation/useSimulationStore"; import { useProductStore } from "../../../../store/simulation/useProductStore"; import { generateUUID } from "three/src/math/MathUtils"; import RenderOverlay from "../../../templates/Overlay"; @@ -22,273 +15,264 @@ import { deleteProductApi } from "../../../../services/simulation/products/delet import { renameProductApi } from "../../../../services/simulation/products/renameProductApi"; import { determineExecutionMachineSequences } from "../../../../modules/simulation/simulator/functions/determineExecutionMachineSequences"; import ComparePopUp from "../../../ui/compareVersion/Compare"; -import { - useCompareStore, - useSaveVersion, -} from "../../../../store/builder/store"; -import CompareLayOut from "../../../ui/compareVersion/CompareLayOut"; +import { useCompareStore, useSaveVersion, } from "../../../../store/builder/store"; import { useToggleStore } from "../../../../store/useUIToggleStore"; import { useProductContext } from "../../../../modules/simulation/products/productContext"; +import { useParams } from "react-router-dom"; interface Event { - modelName: string; - modelId: string; + modelName: string; + modelId: string; } interface ListProps { - val: Event; + val: Event; } const List: React.FC = ({ val }) => { - return ( -
-
{val.modelName}
-
- ); + return ( +
+
{val.modelName}
+
+ ); }; const Simulations: React.FC = () => { - const productsContainerRef = useRef(null); - const { - products, - addProduct, - removeProduct, - renameProduct, - addEvent, - removeEvent, - getProductById, - } = useProductStore(); - const { selectedProductStore } = useProductContext(); - const { selectedProduct, setSelectedProduct } = selectedProductStore(); - const { getEventByModelUuid } = useEventsStore(); - const { selectedAsset, clearSelectedAsset } = useSelectedAsset(); - const email = localStorage.getItem("email"); - const organization = email!.split("@")[1].split(".")[0]; - const [openObjects, setOpenObjects] = useState(true); - const [processes, setProcesses] = useState(); - const { setToggleUI } = useToggleStore(); + const productsContainerRef = useRef(null); + const { products, addProduct, removeProduct, renameProduct, addEvent, removeEvent, getProductById, } = useProductStore(); + const { selectedProductStore } = useProductContext(); + const { selectedProduct, setSelectedProduct } = selectedProductStore(); + const { getEventByModelUuid } = useEventsStore(); + const { selectedAsset, clearSelectedAsset } = useSelectedAsset(); + const [openObjects, setOpenObjects] = useState(true); + const [processes, setProcesses] = useState(); + const { setToggleUI } = useToggleStore(); + const { projectId } = useParams(); - const { comparePopUp, setComparePopUp } = useCompareStore(); - const { isVersionSaved, setIsVersionSaved } = useSaveVersion(); + const { comparePopUp, setComparePopUp } = useCompareStore(); + const { setIsVersionSaved } = useSaveVersion(); - const handleSaveVersion = () => { - setIsVersionSaved(true); - setComparePopUp(false); - setToggleUI(false, false); - }; + const handleSaveVersion = () => { + setIsVersionSaved(true); + setComparePopUp(false); + setToggleUI(false, false); + }; - const handleAddProduct = () => { - const id = generateUUID(); - const name = `Product ${products.length + 1}`; - addProduct(name, id); - upsertProductOrEventApi({ - productName: name, - productId: id, - organization: organization, - }); - }; + const handleAddProduct = () => { + const id = generateUUID(); + const name = `Product ${products.length + 1}`; + addProduct(name, id); + upsertProductOrEventApi({ + productName: name, + productUuid: id, + projectId: projectId, + }); + }; - const handleRemoveProduct = (productId: string) => { - const currentIndex = products.findIndex((p) => p.productId === productId); - const isSelected = selectedProduct.productId === productId; + const handleRemoveProduct = (productUuid: string) => { + const currentIndex = products.findIndex((p) => p.productUuid === productUuid); + const isSelected = selectedProduct.productUuid === productUuid; - const updatedProducts = products.filter((p) => p.productId !== productId); + const updatedProducts = products.filter((p) => p.productUuid !== productUuid); - if (isSelected) { - if (updatedProducts.length > 0) { - let newSelectedIndex = currentIndex; - if (currentIndex >= updatedProducts.length) { - newSelectedIndex = updatedProducts.length - 1; + if (isSelected) { + if (updatedProducts.length > 0) { + let newSelectedIndex = currentIndex; + if (currentIndex >= updatedProducts.length) { + newSelectedIndex = updatedProducts.length - 1; + } + setSelectedProduct( + updatedProducts[newSelectedIndex].productUuid, + updatedProducts[newSelectedIndex].productName + ); + } else { + setSelectedProduct("", ""); + } } - setSelectedProduct( - updatedProducts[newSelectedIndex].productId, - updatedProducts[newSelectedIndex].productName - ); - } else { - setSelectedProduct("", ""); - } - } - removeProduct(productId); - deleteProductApi(productId, organization); - }; + removeProduct(productUuid); + deleteProductApi({ + productUuid, + projectId + }); + }; - const handleRenameProduct = (productId: string, newName: string) => { - renameProduct(productId, newName); - renameProductApi({ productName: newName, productId, organization }); - if (selectedProduct.productId === productId) { - setSelectedProduct(productId, newName); - } - }; - - const handleRemoveEventFromProduct = () => { - if (selectedAsset) { - const email = localStorage.getItem("email"); - const organization = email!.split("@")[1].split(".")[0]; - deleteEventDataApi({ - productId: selectedProduct.productId, - modelUuid: selectedAsset.modelUuid, - organization: organization, - }); - removeEvent(selectedProduct.productId, selectedAsset.modelUuid); - clearSelectedAsset(); - } - }; - - useEffect(() => { - const processes: Event[][] = []; - const selectedProductData = getProductById(selectedProduct.productId); - - if (selectedProductData) { - determineExecutionMachineSequences([selectedProductData]).then( - (sequences) => { - sequences.forEach((sequence) => { - const events: Event[] = - sequence.map((event) => ({ - modelName: event.modelName, - modelId: event.modelUuid, - })) || []; - processes.push(events); - }); - setProcesses(processes); + const handleRenameProduct = (productUuid: string, newName: string) => { + renameProduct(productUuid, newName); + renameProductApi({ productName: newName, productUuid, projectId: projectId || '' }); + if (selectedProduct.productUuid === productUuid) { + setSelectedProduct(productUuid, newName); } - ); - } - }, [selectedProduct.productId, products]); + }; - return ( -
-
Simulations
-
-
-
-
Products
- -
-
-
- {products.map((product, index) => ( -
- {/* eslint-disable-next-line */} -
- setSelectedProduct(product.productId, product.productName) - } - > - - - handleRenameProduct(product.productId, newName) - } - /> -
- {products.length > 1 && ( - +
+
- - - )} +
+ {products.map((product, index) => ( +
+ {/* eslint-disable-next-line */} +
+ setSelectedProduct(product.productUuid, product.productName) + } + > + + + handleRenameProduct(product.productUuid, newName) + } + /> +
+ {products.length > 1 && ( + + )} +
+ ))} +
+ +
+
+ +
+ + {openObjects && + processes?.map((process, index) => ( +
+ {process.map((event, index) => ( + + ))} +
+ ))} +
+ +
+
+ Need to Compare Layout? +
+
+ Click 'Compare' to review and analyze the layout + differences between them. +
+
- ))}
- -
+ + {selectedAsset && ( + + { + if (option === "Add to Product") { + handleAddEventToProduct({ + event: getEventByModelUuid(selectedAsset.modelUuid), + addEvent, + selectedProduct, + clearSelectedAsset, + projectId: projectId || '' + }); + } else { + handleRemoveEventFromProduct(); + } + }} + /> + + )} + + {comparePopUp && ( + + + + )}
- -
- - {openObjects && - processes?.map((process, index) => ( -
- {process.map((event, index) => ( - - ))} -
- ))} -
- -
-
- Need to Compare Layout? -
-
- Click 'Compare' to review and analyze the layout - differences between them. -
- -
-
- - {selectedAsset && ( - - { - if (option === "Add to Product") { - handleAddEventToProduct({ - event: getEventByModelUuid(selectedAsset.modelUuid), - addEvent, - selectedProduct, - clearSelectedAsset, - }); - } else { - handleRemoveEventFromProduct(); - } - }} - /> - - )} - - {comparePopUp && ( - - - - )} - - ); + ); }; export default Simulations; diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx index 9ec8196..b0b328d 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx @@ -56,9 +56,9 @@ const BarChartInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/data?widgetID=${selectedChartId.id}&zoneUuid=${selectedZone.zoneUuid}&projectId=${projectId}`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, } @@ -97,9 +97,9 @@ const BarChartInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, }, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx index 63cc3be..912b7d1 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx @@ -171,9 +171,9 @@ const LineGrapInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/data?widgetID=${selectedChartId.id}&zoneUuid=${selectedZone.zoneUuid}&projectId=${projectId}`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, } @@ -212,9 +212,9 @@ const LineGrapInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, }, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx index 98167b7..8136c70 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx @@ -56,9 +56,9 @@ const PieChartInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/data?widgetID=${selectedChartId.id}&zoneUuid=${selectedZone.zoneUuid}&projectId=${projectId}`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, } @@ -97,9 +97,9 @@ const PieChartInput = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, }, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx index b873e4e..8647df7 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx @@ -56,9 +56,9 @@ const Progress1Input = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/data?widgetID=${selectedChartId.id}&zoneUuid=${selectedZone.zoneUuid}&projectId=${projectId}`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, } @@ -97,9 +97,9 @@ const Progress1Input = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, }, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx index efbdd6d..8765751 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx @@ -56,9 +56,9 @@ const Progress2Input = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/data?widgetID=${selectedChartId.id}&zoneUuid=${selectedZone.zoneUuid}&projectId=${projectId}`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, } @@ -97,9 +97,9 @@ const Progress2Input = (props: Props) => { `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, { headers: { - Authorization: "Bearer ", // Replace with actual token + Authorization: "Bearer ", "Content-Type": "application/json", - token: localStorage.getItem("token") || "", // Coerce null to empty string + token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, }, diff --git a/app/src/components/templates/CollaborationPopup.tsx b/app/src/components/templates/CollaborationPopup.tsx index ec62fb5..9e35427 100644 --- a/app/src/components/templates/CollaborationPopup.tsx +++ b/app/src/components/templates/CollaborationPopup.tsx @@ -140,7 +140,7 @@ const CollaborationPopup: React.FC = ({
-
{userName[0]}
+
{userName[0].toUpperCase()}
{userName}
you
diff --git a/app/src/components/ui/compareVersion/CompareLayOut.tsx b/app/src/components/ui/compareVersion/CompareLayOut.tsx index 6196ca0..7cdba4b 100644 --- a/app/src/components/ui/compareVersion/CompareLayOut.tsx +++ b/app/src/components/ui/compareVersion/CompareLayOut.tsx @@ -111,7 +111,7 @@ const CompareLayOut = () => { const handleSelectLayout = (option: string) => { const product = products.find((product) => product.productName === option); if (product) { - setComparisonProduct(product.productId, product.productName); + setComparisonProduct(product.productUuid, product.productName); setLoadingProgress(1); setIsPlaying(true); setIsPaused(true); @@ -162,7 +162,7 @@ const CompareLayOut = () => {
{products.map((layout) => (