-
Rotation
+
{heading}
-
Rotate :
+
{label}
onChange(e.target.value)}
placeholder={placeholder}
value={value}
+ disabled={disabled}
+ min={min}
+ max={max}
+ step={step}
/>
diff --git a/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx b/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
index c343805..ca2317d 100644
--- a/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
+++ b/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
@@ -21,24 +21,25 @@ interface TextureItem {
texture: string;
}
+export const aisleTextureList: TextureItem[] = [
+ { color: "yellow", id: "#FBE50E", brief: "pedestrian walkways", texture: "" },
+ { color: "gray", id: "#6F6F7A", brief: "basic", texture: "" },
+ { color: "green", id: "#43C06D", brief: "pedestrian walkways", texture: "" },
+ { color: "orange", id: "#FF711B", brief: "material flow", texture: "" },
+ { color: "blue", id: "#488EF6", brief: "vehicle paths", texture: "" },
+ { color: "purple", id: "#AF52DE", brief: "material flow", texture: "" },
+ { color: "red", id: "#FF3B30", brief: "safety zone", texture: "" },
+ { color: "bright green", id: "#66FF00", brief: "safety zone", texture: "" },
+ { color: "yellow-black", id: "yellow-black", brief: "utility aisles", texture: "" },
+ { color: "white-black", id: "white-black", brief: "utility aisles", texture: "" },
+];
+
const AisleProperties: React.FC = () => {
const [collapsePresets, setCollapsePresets] = useState(false);
const [collapseTexture, setCollapseTexture] = useState(true);
const { aisleType, aisleWidth, aisleColor, dashLength, gapLength, dotRadius, aisleLength, isFlipped, setAisleType, setAisleColor, setAisleWidth, setDashLength, setGapLength, setDotRadius, setAisleLength, setIsFlipped } = useBuilderStore();
- const aisleTextureList: TextureItem[] = [
- { color: "yellow", id: "yellow", brief: "pedestrian walkways", texture: "" },
- { color: "gray", id: "gray", brief: "basic", texture: "" },
- { color: "green", id: "green", brief: "pedestrian walkways", texture: "" },
- { color: "orange", id: "orange", brief: "material flow", texture: "" },
- { color: "blue", id: "blue", brief: "vehicle paths", texture: "" },
- { color: "purple", id: "purple", brief: "material flow", texture: "" },
- { color: "red", id: "red", brief: "safety zone", texture: "" },
- { color: "bright green", id: "#66FF00", brief: "safety zone", texture: "" },
- { color: "yellow-black", id: "yellow-black", brief: "utility aisles", texture: "" },
- { color: "white-black", id: "white-black", brief: "utility aisles", texture: "" },
- ];
const aisleTypes: {
name: string;
@@ -285,7 +286,12 @@ const AisleProperties: React.FC = () => {
onClick={() => setAisleColor(val.id)}
aria-pressed={aisleColor === val.id}
>
-
{val.texture}
+
+ {val.texture}
+
{val.color}
{`( ${val.brief} )`}
diff --git a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
index a62abda..3a36e6c 100644
--- a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
+++ b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
@@ -32,9 +32,9 @@ const AssetProperties: React.FC = () => {
setUserData([]);
};
- const handleUserDataChange = (id: number, newValue: string) => {};
+ const handleUserDataChange = (id: number, newValue: string) => { };
- const handleRemoveUserData = (id: number) => {};
+ const handleRemoveUserData = (id: number) => { };
const handleAnimationClick = (animation: string) => {
if (selectedFloorItem) {
@@ -57,14 +57,16 @@ const AssetProperties: React.FC = () => {
{objectPosition && (
{}}
+ disabled={true}
+ onChange={() => { }}
value1={parseFloat(objectPosition.x.toFixed(5))}
value2={parseFloat(objectPosition.z.toFixed(5))}
/>
)}
{objectRotation && (
{}}
+ disabled={true}
+ onChange={() => { }}
value={parseFloat(objectRotation.y.toFixed(5))}
/>
)}
@@ -107,7 +109,7 @@ const AssetProperties: React.FC = () => {
if (asset.modelUuid !== selectedFloorItem.uuid || !asset.animations)
return (
i === 0 && (
-
+
Looks like there are no preset animations yet. Stay tuned for
future additions!
diff --git a/app/src/components/layout/sidebarRight/properties/DecalProperties.tsx b/app/src/components/layout/sidebarRight/properties/DecalProperties.tsx
deleted file mode 100644
index 4163ea5..0000000
--- a/app/src/components/layout/sidebarRight/properties/DecalProperties.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import {
- LayeringBottomIcon,
- LayeringTopIcon,
-} from "../../../icons/ExportCommonIcons";
-import InputRange from "../../../ui/inputs/InputRange";
-import RotationInput from "../customInput/RotationInput";
-import Vector3Input from "../customInput/Vector3Input";
-
-const DecalProperties = () => {
- return (
-
-
Decal Propertis
-
- {}}
- value={10}
- />
- console.log(value)}
- header="Scale"
- value={[0, 0, 0] as [number, number, number]}
- />
-
-
-
- console.log(value)}
- key={"6"}
- />
-
-
-
Layering
-
-
-
-
-
-
-
-
- );
-};
-
-export default DecalProperties;
diff --git a/app/src/components/layout/sidebarRight/properties/SelectedAisleProperties.tsx b/app/src/components/layout/sidebarRight/properties/SelectedAisleProperties.tsx
new file mode 100644
index 0000000..3dc2540
--- /dev/null
+++ b/app/src/components/layout/sidebarRight/properties/SelectedAisleProperties.tsx
@@ -0,0 +1,529 @@
+import React, { useEffect, useState } from "react";
+import { useParams } from "react-router-dom";
+import InputWithDropDown from "../../../ui/inputs/InputWithDropDown";
+import { ArrowIcon } from "../../../icons/ExportCommonIcons";
+
+// image imports
+import Arc from "../../../../assets/image/aisleTypes/Arc.png";
+import Arrow from "../../../../assets/image/aisleTypes/Arrow.png";
+import Arrows from "../../../../assets/image/aisleTypes/Arrows.png";
+import Circle from "../../../../assets/image/aisleTypes/Circle.png";
+import Dashed from "../../../../assets/image/aisleTypes/Dashed.png";
+import Directional from "../../../../assets/image/aisleTypes/Directional.png";
+import Dotted from "../../../../assets/image/aisleTypes/Dotted.png";
+import Solid from "../../../../assets/image/aisleTypes/Solid.png";
+import InputToggle from "../../../ui/inputs/InputToggle";
+import { useBuilderStore } from "../../../../store/builder/useBuilderStore";
+import { useSceneContext } from "../../../../modules/scene/sceneContext";
+import { useVersionContext } from "../../../../modules/builder/version/versionContext";
+import { useSocketStore } from "../../../../store/builder/store";
+import { getUserData } from "../../../../functions/getUserData";
+import { aisleTextureList } from "./AisleProperties";
+
+const SelectedAisleProperties: React.FC = () => {
+ const [collapsePresets, setCollapsePresets] = useState(false);
+ const [collapseTexture, setCollapseTexture] = useState(true);
+ const { aisleStore } = useSceneContext();
+ const { getAisleById, updateAisle, setDashedAisleProperties, setDottedAisleProperties, setArrowsAisleProperties, setArcAisleWidth, setColor } = aisleStore();
+ const { selectedVersionStore } = useVersionContext();
+ const { selectedVersion } = selectedVersionStore();
+ const { socket } = useSocketStore();
+ const { userId, organization } = getUserData();
+ const { projectId } = useParams();
+ const [selectedAisleData, setSelectedAisleData] = useState
();
+
+ const { selectedAisle, setSelectedAisle } = useBuilderStore();
+
+ useEffect(() => {
+ const aisleData = getAisleById(selectedAisle?.aisleMesh?.uuid || "");
+ setSelectedAisleData(aisleData);
+ }, [selectedAisle, getAisleById]);
+
+ if (!selectedAisleData) return null;
+
+ const updateBackend = (updatedAisle: Aisle) => {
+ if (updatedAisle && projectId) {
+
+ // API
+
+ // upsertAisleApi(updatedAisle.aisleUuid, updatedAisle.points, updatedAisle.type, projectId, selectedVersion?.versionId || '');
+
+ // SOCKET
+
+ const data = {
+ projectId: projectId,
+ versionId: selectedVersion?.versionId || '',
+ userId: userId,
+ organization: organization,
+ aisleUuid: updatedAisle.aisleUuid,
+ points: updatedAisle.points,
+ type: updatedAisle.type
+ }
+
+ socket.emit('v1:model-aisle:add', data);
+ }
+ }
+
+ const aisleTypes: {
+ name: string;
+ type: AisleTypes;
+ id: string;
+ thumbnail: string;
+ }[] = [
+ { name: "Solid", type: "solid-aisle", id: "1", thumbnail: Solid },
+ { name: "Dotted", type: "dotted-aisle", id: "2", thumbnail: Dotted },
+ { name: "Dashed", type: "dashed-aisle", id: "3", thumbnail: Dashed },
+ { name: "Arrow", type: "arrow-aisle", id: "4", thumbnail: Arrow },
+ { name: "Continuous Arrows", type: "arrows-aisle", id: "5", thumbnail: Arrows },
+ { name: "Directional", type: "junction-aisle", id: "6", thumbnail: Directional },
+ { name: "Arc", type: "arc-aisle", id: "7", thumbnail: Arc },
+ { name: "Circle", type: "circle-aisle", id: "8", thumbnail: Circle },
+ ];
+
+ const createAisleTypeObject = (newType: AisleTypes, currentType: AisleType): AisleType => {
+ switch (newType) {
+ case 'solid-aisle':
+ return {
+ aisleType: 'solid-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1
+ } as SolidAisle;
+
+ case 'dashed-aisle':
+ return {
+ aisleType: 'dashed-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1,
+ dashLength: 'dashLength' in currentType ? (currentType as DashedAisle).dashLength : 0.5,
+ gapLength: 'gapLength' in currentType ? (currentType as DashedAisle).gapLength : 0.3
+ } as DashedAisle;
+
+ case 'dotted-aisle':
+ return {
+ aisleType: 'dotted-aisle',
+ aisleColor: currentType.aisleColor,
+ dotRadius: 'dotRadius' in currentType ? (currentType as DottedAisle).dotRadius : 0.1,
+ gapLength: 'gapLength' in currentType ? (currentType as DottedAisle).gapLength : 0.3
+ } as DottedAisle;
+
+ case 'arrow-aisle':
+ return {
+ aisleType: 'arrow-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1
+ } as ArrowAisle;
+
+ case 'arrows-aisle':
+ return {
+ aisleType: 'arrows-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1,
+ aisleLength: 'aisleLength' in currentType ? (currentType as ArrowsAisle).aisleLength : 0.6,
+ gapLength: 'gapLength' in currentType ? (currentType as ArrowsAisle).gapLength : 0.3
+ } as ArrowsAisle;
+
+ case 'arc-aisle':
+ return {
+ aisleType: 'arc-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1,
+ isFlipped: 'isFlipped' in currentType ? (currentType as ArcAisle).isFlipped : false
+ } as ArcAisle;
+
+ case 'circle-aisle':
+ return {
+ aisleType: 'circle-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1
+ } as CircleAisle;
+
+ case 'junction-aisle':
+ return {
+ aisleType: 'junction-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 'aisleWidth' in currentType ? currentType.aisleWidth : 0.1,
+ isFlipped: 'isFlipped' in currentType ? (currentType as JunctionAisle).isFlipped : false
+ } as JunctionAisle;
+
+ default:
+ return {
+ aisleType: 'solid-aisle',
+ aisleColor: currentType.aisleColor,
+ aisleWidth: 0.1
+ } as SolidAisle;
+ }
+ };
+
+ const handleAisleTypeChange = (newType: AisleTypes) => {
+ if (!selectedAisle?.aisleData) return;
+ const newAisleType = createAisleTypeObject(newType, selectedAisleData.type);
+
+ const updatedAisle = updateAisle(selectedAisleData.aisleUuid, {
+ type: newAisleType
+ });
+
+ setSelectedAisle({ aisleData: selectedAisle.aisleData, aisleMesh: null });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: newAisleType
+ });
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ };
+
+ const handleColorChange = (value: AisleColors) => {
+ const updatedAisle = setColor(selectedAisleData.aisleUuid, value);
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...selectedAisleData.type,
+ aisleColor: value
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ };
+
+ const handleAisleWidthChange = (value: string) => {
+ const width = parseFloat(value);
+ if (!isNaN(width) && selectedAisleData.type.aisleType !== 'dotted-aisle') {
+ const updatedAisle = updateAisle(selectedAisleData.aisleUuid, {
+ type: {
+ ...selectedAisleData.type,
+ aisleWidth: width
+ }
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...selectedAisleData.type,
+ aisleWidth: width
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ };
+
+ const handleDashLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length) && selectedAisleData.type.aisleType === 'dashed-aisle') {
+ const updatedAisle = setDashedAisleProperties(selectedAisleData.aisleUuid, {
+ dashLength: length
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as DashedAisle),
+ dashLength: length
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ };
+
+ const handleGapLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length) && (selectedAisleData.type.aisleType === 'dashed-aisle' || selectedAisleData.type.aisleType === 'dotted-aisle' || selectedAisleData.type.aisleType === 'arrows-aisle')) {
+ if (selectedAisleData.type.aisleType === 'dashed-aisle') {
+ const updatedAisle = setDashedAisleProperties(selectedAisleData.aisleUuid, {
+ gapLength: length
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as DashedAisle),
+ gapLength: length
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ } else if (selectedAisleData.type.aisleType === 'dotted-aisle') {
+ const updatedAisle = setDottedAisleProperties(selectedAisleData.aisleUuid, {
+ gapLength: length
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as DottedAisle),
+ gapLength: length
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ } else if (selectedAisleData.type.aisleType === 'arrows-aisle') {
+ const updatedAisle = setArrowsAisleProperties(selectedAisleData.aisleUuid, {
+ gapLength: length
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as ArrowsAisle),
+ gapLength: length
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ }
+ };
+
+ const handleDotRadiusChange = (value: string) => {
+ const radius = parseFloat(value);
+ if (!isNaN(radius) && selectedAisleData.type.aisleType === 'dotted-aisle') {
+ const updatedAisle = setDottedAisleProperties(selectedAisleData.aisleUuid, {
+ dotRadius: radius
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as DottedAisle),
+ dotRadius: radius
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ };
+
+ const handleAisleLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length) && selectedAisleData.type.aisleType === 'arrows-aisle') {
+ const updatedAisle = setArrowsAisleProperties(selectedAisleData.aisleUuid, {
+ aisleLength: length
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...(selectedAisleData.type as ArrowsAisle),
+ aisleLength: length
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ };
+
+ const handleIsFlippedChange = () => {
+ if (selectedAisleData.type.aisleType === 'arc-aisle' || selectedAisleData.type.aisleType === 'junction-aisle') {
+ const currentType = selectedAisleData.type as ArcAisle | JunctionAisle;
+ const currentFlipped = currentType.isFlipped || false;
+ const updatedAisle = setArcAisleWidth(selectedAisleData.aisleUuid, {
+ isFlipped: !currentFlipped
+ });
+
+ setSelectedAisleData({
+ ...selectedAisleData,
+ type: {
+ ...currentType,
+ isFlipped: !currentFlipped
+ }
+ })
+
+ if (updatedAisle) {
+ updateBackend(updatedAisle);
+ }
+ }
+ };
+
+ const renderAdvancedProperties = () => {
+ switch (selectedAisleData.type.aisleType) {
+ case 'dashed-aisle':
+ const dashedType = selectedAisleData.type as DashedAisle;
+ return (
+ <>
+
+
+ >
+ );
+ case 'dotted-aisle':
+ const dottedType = selectedAisleData.type as DottedAisle;
+ return (
+ <>
+
+
+ >
+ );
+ case 'arrows-aisle':
+ const arrowsType = selectedAisleData.type as ArrowsAisle;
+ return (
+ <>
+
+
+ >
+ );
+ case 'junction-aisle':
+ case 'arc-aisle':
+ const flippedType = selectedAisleData.type as ArcAisle | JunctionAisle;
+ return (
+
+ );
+ default:
+ return null;
+ }
+ };
+
+ return (
+
+
Properties
+
+ {/* Basic Properties */}
+
+ {selectedAisleData.type.aisleType !== 'dotted-aisle' &&
+
+ }
+ {renderAdvancedProperties()}
+
+
+ {/* Presets */}
+
+
+ {!collapsePresets && (
+
+ {aisleTypes.map((val) => (
+
+
+
+ ))}
+
+ )}
+
+
+ {/* Texture */}
+
+
+
+ {collapseTexture && (
+
+ {aisleTextureList.map((val) => (
+
+ ))}
+
+ )}
+
+
+ );
+};
+
+export default SelectedAisleProperties;
\ No newline at end of file
diff --git a/app/src/components/layout/sidebarRight/properties/SelectedDecalProperties.tsx b/app/src/components/layout/sidebarRight/properties/SelectedDecalProperties.tsx
new file mode 100644
index 0000000..e605363
--- /dev/null
+++ b/app/src/components/layout/sidebarRight/properties/SelectedDecalProperties.tsx
@@ -0,0 +1,188 @@
+import { useParams } from "react-router-dom";
+import { useVersionContext } from "../../../../modules/builder/version/versionContext";
+import { useSceneContext } from "../../../../modules/scene/sceneContext";
+import { useBuilderStore } from "../../../../store/builder/useBuilderStore";
+import { LayeringBottomIcon, LayeringTopIcon } from "../../../icons/ExportCommonIcons";
+import { useSocketStore } from "../../../../store/builder/store";
+import InputRange from "../../../ui/inputs/InputRange";
+
+import { getUserData } from "../../../../functions/getUserData";
+// import { upsertWallApi } from "../../../../services/factoryBuilder/wall/upsertWallApi";
+// import { upsertFloorApi } from "../../../../services/factoryBuilder/floor/upsertFloorApi";
+
+const SelectedDecalProperties = () => {
+ const { selectedDecal, setSelectedDecal } = useBuilderStore();
+ const { wallStore, floorStore } = useSceneContext();
+ const { updateDecal: updateDecalInWall } = wallStore();
+ const { updateDecal: updateDecalInFloor } = floorStore();
+ const { userId, organization } = getUserData();
+ const { selectedVersionStore } = useVersionContext();
+ const { selectedVersion } = selectedVersionStore();
+ const { projectId } = useParams();
+ const { socket } = useSocketStore();
+
+ const updateBackend = (updatedData: Wall | Floor) => {
+ if ('wallUuid' in updatedData) {
+ if (projectId && updatedData) {
+ // API
+
+ // upsertWallApi(projectId, selectedVersion?.versionId || '', updatedData);
+
+ // SOCKET
+
+ const data = {
+ wallData: updatedData,
+ projectId: projectId,
+ versionId: selectedVersion?.versionId || '',
+ userId: userId,
+ organization: organization
+ }
+
+ socket.emit('v1:model-Wall:add', data);
+ }
+ } else if ('floorUuid' in updatedData) {
+ if (projectId && updatedData) {
+ // API
+
+ // upsertFloorApi(projectId, selectedVersion?.versionId || '', updatedData);
+
+ // SOCKET
+
+ const data = {
+ floorData: updatedData,
+ projectId: projectId,
+ versionId: selectedVersion?.versionId || '',
+ userId: userId,
+ organization: organization
+ }
+
+ socket.emit('v1:model-Floor:add', data);
+ }
+ }
+ }
+
+ const handleRotationChange = (value: number) => {
+ if (!selectedDecal) return;
+ const updatedDecal = { ...selectedDecal.decalData, decalRotation: value };
+ setSelectedDecal({ ...selectedDecal, decalData: updatedDecal });
+
+ if ('wallUuid' in selectedDecal.decalData.decalType) {
+ const updatedWall = updateDecalInWall(updatedDecal.decalUuid, updatedDecal);
+ if (updatedWall) updateBackend(updatedWall);
+ } else if ('floorUuid' in selectedDecal.decalData.decalType) {
+ const updatedFloor = updateDecalInFloor(updatedDecal.decalUuid, updatedDecal);
+ if (updatedFloor) updateBackend(updatedFloor);
+ }
+ }
+
+ const handleScaleChange = (value: number) => {
+ if (!selectedDecal) return;
+ const updatedDecal = { ...selectedDecal.decalData, decalScale: value };
+ setSelectedDecal({ ...selectedDecal, decalData: updatedDecal });
+
+ if ('wallUuid' in selectedDecal.decalData.decalType) {
+ const updatedWall = updateDecalInWall(updatedDecal.decalUuid, updatedDecal);
+ if (updatedWall) updateBackend(updatedWall);
+ } else if ('floorUuid' in selectedDecal.decalData.decalType) {
+ const updatedFloor = updateDecalInFloor(updatedDecal.decalUuid, updatedDecal);
+ if (updatedFloor) updateBackend(updatedFloor);
+ }
+ }
+
+ const handleOpacityChange = (value: number) => {
+ if (!selectedDecal) return;
+ const updatedDecal = { ...selectedDecal.decalData, decalOpacity: value };
+ setSelectedDecal({ ...selectedDecal, decalData: updatedDecal });
+
+ if ('wallUuid' in selectedDecal.decalData.decalType) {
+ const updatedWall = updateDecalInWall(updatedDecal.decalUuid, updatedDecal);
+ if (updatedWall) updateBackend(updatedWall);
+ } else if ('floorUuid' in selectedDecal.decalData.decalType) {
+ const updatedFloor = updateDecalInFloor(updatedDecal.decalUuid, updatedDecal);
+ if (updatedFloor) updateBackend(updatedFloor);
+ }
+ }
+
+ const handleLayerChange = (direction: "up" | "down") => {
+ if (!selectedDecal) return;
+
+ const position: [number, number, number] = [...(selectedDecal.decalData.decalPosition || [0, 0, 0]),];
+
+ if (direction === "up") {
+ position[2] = Math.abs(position[2]);
+ } else {
+ position[2] = -Math.abs(position[2]);
+ }
+
+ const updatedDecal: Decal = { ...selectedDecal.decalData, decalPosition: position, };
+
+ setSelectedDecal({ ...selectedDecal, decalData: updatedDecal });
+
+ if ("wallUuid" in selectedDecal.decalData.decalType) {
+ const updatedWall = updateDecalInWall(updatedDecal.decalUuid, updatedDecal);
+ if (updatedWall) updateBackend(updatedWall);
+ } else if ("floorUuid" in selectedDecal.decalData.decalType) {
+ const updatedFloor = updateDecalInFloor(updatedDecal.decalUuid, updatedDecal);
+ if (updatedFloor) updateBackend(updatedFloor);
+ }
+ };
+
+ if (!selectedDecal) return null;
+
+ return (
+
+
Decal Properties
+
+ handleRotationChange(value)}
+ />
+
+ handleScaleChange(value)}
+ />
+
+
+
+ handleOpacityChange(value)}
+ />
+
+
+
Layering
+
+
+
+
+
+
+
+
+ );
+};
+
+export default SelectedDecalProperties;
diff --git a/app/src/components/layout/sidebarRight/resourceManagement/hrm/assetManagement/AssetManagement.tsx b/app/src/components/layout/sidebarRight/resourceManagement/hrm/assetManagement/AssetManagement.tsx
index faa6015..718915c 100644
--- a/app/src/components/layout/sidebarRight/resourceManagement/hrm/assetManagement/AssetManagement.tsx
+++ b/app/src/components/layout/sidebarRight/resourceManagement/hrm/assetManagement/AssetManagement.tsx
@@ -1,18 +1,19 @@
import { useEffect, useState } from 'react'
// import NavigateCatagory from '../../NavigateCatagory'
-import { EyeIcon, ForkLiftIcon, KebabIcon, LocationPinIcon, RightHalfFillCircleIcon } from '../../../../../icons/ExportCommonIcons';
+import { EyeIcon, KebabIcon, LocationPinIcon, RightHalfFillCircleIcon } from '../../../../../icons/ExportCommonIcons';
import assetImage from "../../../../../../assets/image/asset-image.png"
import { useSceneContext } from '../../../../../../modules/scene/sceneContext';
import { useProductContext } from '../../../../../../modules/simulation/products/productContext';
import RenameInput from '../../../../../ui/inputs/RenameInput';
import { useResourceManagementId } from '../../../../../../store/builder/store';
+import { TypeBasedAssetIcons } from '../../../../../icons/AssetTypeIcons';
const AssetManagement = () => {
// const [selectedCategory, setSelectedCategory] = useState("All Assets");
const [expandedAssetId, setExpandedAssetId] = useState(null);
const [assets, setAssets] = useState([]);
const { productStore } = useSceneContext();
- const { products, getProductById } = productStore();
+ const { getProductById } = productStore();
const { selectedProductStore } = useProductContext();
const { selectedProduct } = selectedProductStore();
const { setResourceManagementId } = useResourceManagementId();
@@ -30,6 +31,7 @@ const AssetManagement = () => {
grouped[asset.modelName] = {
id: asset.modelUuid,
name: asset.modelName,
+ type: asset.type,
model: asset.modelCode || "N/A",
status: asset.status || "Online",
usageRate: asset.usageRate || 15,
@@ -46,6 +48,7 @@ const AssetManagement = () => {
setAssets(Object.values(grouped));
}
+ // eslint-disable-next-line
}, [selectedProduct]);
function handleRenameAsset(newName: string) {
@@ -130,7 +133,7 @@ const AssetManagement = () => {
>
:
-
+
}
@@ -210,16 +213,10 @@ const AssetManagement = () => {
{expandedAssetId === asset.id ? "View Less" : "View More"}
-
-
-
-
)}
-
-
))}