diff --git a/app/package-lock.json b/app/package-lock.json index d9ce5b7..b14b0af 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "aalai-beta", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aalai-beta", - "version": "0.1.0", + "version": "0.1.1", "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", diff --git a/app/package.json b/app/package.json index ffeff66..c7590c0 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "aalai-beta", - "version": "0.1.0", + "version": "0.1.1", "private": true, "dependencies": { "@dnd-kit/core": "^6.3.1", @@ -56,7 +56,7 @@ "prepare": "husky", "prestart": "tsc scripts/git-prompt.ts && node scripts/git-prompt.js", "start": "react-scripts start", - "build": "GENERATE_SOURCEMAP=false react-scripts build", + "build": "cross-env GENERATE_SOURCEMAP=false react-scripts build", "test": "jest" }, "eslintConfig": { diff --git a/app/src/components/Dashboard/TutorialCard.tsx b/app/src/components/Dashboard/TutorialCard.tsx index 1d30ca6..0ed3db5 100644 --- a/app/src/components/Dashboard/TutorialCard.tsx +++ b/app/src/components/Dashboard/TutorialCard.tsx @@ -1,21 +1,39 @@ import { getUserData } from "../../functions/getUserData"; import { ALPHA_ORG } from "../../pages/Dashboard"; import { DeleteIcon } from "../icons/ContextMenuIcons"; +import RenameInput from "../ui/inputs/RenameInput"; -export const TutorialCard: React.FC<{ tutorial: Tutorial; onClick: (tutorial: Tutorial) => void }> = ({ tutorial, onClick }) => { +export const TutorialCard: React.FC<{ + tutorial: Tutorial; + onClick: (tutorial: Tutorial) => void; +}> = ({ tutorial, onClick }) => { const { organization } = getUserData(); return (
onClick(tutorial)}>
-
+
{ + e.stopPropagation(); + }} + >
-
{tutorial.projectName}
-
{new Date(tutorial.createdAt).toLocaleDateString()}
+
+ +
+
+ {new Date(tutorial.createdAt).toLocaleDateString()} +
{organization === ALPHA_ORG && (
diff --git a/app/src/components/ui/analysis/ProductionCapacity.tsx b/app/src/components/ui/analysis/ProductionCapacity.tsx index d5b0951..47c1898 100644 --- a/app/src/components/ui/analysis/ProductionCapacity.tsx +++ b/app/src/components/ui/analysis/ProductionCapacity.tsx @@ -3,7 +3,7 @@ import { Line } from "react-chartjs-2"; import { Chart as ChartJS, LineElement, CategoryScale, LinearScale, PointElement } from "chart.js"; import { PowerIcon, ProductionCapacityIcon } from "../../icons/analysis"; import SkeletonUI from "../../templates/SkeletonUI"; -import { useInputValues, useMachineUptime, useProductionCapacityData, useThroughPutData } from "../../../store/builder/store"; +import { useInputValues, useMachineUptime, useProductionCapacityData } from "../../../store/builder/store"; ChartJS.register(LineElement, CategoryScale, LinearScale, PointElement); @@ -28,7 +28,6 @@ const ThroughputSummary: React.FC = () => { ]; const { productionCapacityData } = useProductionCapacityData(); - const { throughputData: data } = useThroughPutData(); const chartOptions = { responsive: true, diff --git a/app/src/components/ui/analysis/ROISummary.tsx b/app/src/components/ui/analysis/ROISummary.tsx index 5e52cc0..f856270 100644 --- a/app/src/components/ui/analysis/ROISummary.tsx +++ b/app/src/components/ui/analysis/ROISummary.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from "react"; import { CostBreakDownIcon, - LightBulpIcon, ROISummaryIcon, ROISummaryProductName, SonarCrownIcon, diff --git a/app/src/components/ui/analysis/ThroughputSummary.tsx b/app/src/components/ui/analysis/ThroughputSummary.tsx index 52fa9f4..d0b23d2 100644 --- a/app/src/components/ui/analysis/ThroughputSummary.tsx +++ b/app/src/components/ui/analysis/ThroughputSummary.tsx @@ -1,99 +1,111 @@ import { useEffect, useState } from "react"; -import { useInputValues, useMachineCount, useMachineUptime, useMaterialCycle, useProductionCapacityData, useThroughPutData } from "../../../store/builder/store"; import { - ThroughputSummaryIcon, -} from "../../icons/analysis"; + useInputValues, + useMachineUptime, + useMaterialCycle, + useThroughPutData, +} from "../../../store/builder/store"; +import { ThroughputSummaryIcon } from "../../icons/analysis"; import SkeletonUI from "../../templates/SkeletonUI"; const ProductionCapacity = ({ - avgProcessTime = "28.4 Secs/unit", - machineUtilization = "78%", - throughputValue = 128, - timeRange = { startTime: "08:00 AM", endTime: "09:00 AM" }, + avgProcessTime = "28.4 Secs/unit", + machineUtilization = "78%", + throughputValue = 128, + timeRange = { startTime: "08:00 AM", endTime: "09:00 AM" }, }) => { - const { machineActiveTime } = useMachineUptime(); - const { materialCycleTime } = useMaterialCycle(); - const { throughputData } = useThroughPutData() - const { inputValues } = useInputValues(); + const { machineActiveTime } = useMachineUptime(); + const { materialCycleTime } = useMaterialCycle(); + const { throughputData } = useThroughPutData(); + const { inputValues } = useInputValues(); - const progressPercent = machineActiveTime; + const progressPercent = machineActiveTime; - const shiftLength = parseFloat(inputValues["Shift length"]); + const shiftLength = parseFloat(inputValues["Shift length"]); - const totalBars = 6; - const barsToFill = Math.floor((progressPercent / 100) * totalBars); - const partialFillPercent = ((progressPercent / 1000) * totalBars - barsToFill) * 100; + const totalBars = 6; + const barsToFill = Math.floor((progressPercent / 100) * totalBars); + const partialFillPercent = ((progressPercent / 1000) * totalBars - barsToFill) * 100; - const [isLoading, setIsLoading] = useState(true); + const [isLoading, setIsLoading] = useState(true); - useEffect(() => { - if (throughputData > 0) { - setIsLoading(false); - } else { - setIsLoading(false); - } - }, [throughputData]) + useEffect(() => { + if (throughputData > 0) { + setIsLoading(false); + } else { + setIsLoading(false); + } + }, [throughputData]); - const Units_per_hour = ((shiftLength * 60) / (materialCycleTime / 60) / shiftLength) + const Units_per_hour = (shiftLength * 60) / (materialCycleTime / 60) / shiftLength; - return ( - <> - {!isLoading &&
-
-
-
-
Throughput Summary
-
- {timeRange.startTime} - {timeRange.endTime} -
-
-
- -
-
- {!isLoading ? ( - <> -
-
- {(Units_per_hour).toFixed(2) === "Infinity"? 0 : (Units_per_hour).toFixed(2) } Units/hour -
+ return ( + <> + {!isLoading && ( +
+
+
+
+
Throughput Summary
+
+ {timeRange.startTime} - {timeRange.endTime} +
+
+
+ +
+
+ {!isLoading ? ( + <> +
+
+ + {Units_per_hour.toFixed(2) === "Infinity" + ? 0 + : Units_per_hour.toFixed(2)} + {" "} + Units/hour +
- {/* Dynamic Progress Bar */} -
- {[...Array(totalBars)].map((_, i) => ( -
- {i < barsToFill ? ( -
- ) : i === barsToFill ? ( -
- ) : null} + {/* Dynamic Progress Bar */} +
+ {[...Array(totalBars)].map((_, i) => ( +
+ {i < barsToFill ? ( +
+ ) : i === barsToFill ? ( +
+ ) : null} +
+ ))} +
+
+ +
+
+ Avg. Process Time + + {materialCycleTime} secs/unit{" "} + +
+
+ Machine Utilization + {machineActiveTime} + {/* {machineActiveTime} */} +
+
+ + ) : ( + + )}
- ))}
-
- -
-
- Avg. Process Time - {materialCycleTime} secs/unit -
-
- Machine Utilization - {machineActiveTime} - {/* {machineActiveTime} */} -
-
- - ) : ( - - )} -
-
} - - ); + )} + + ); }; export default ProductionCapacity; diff --git a/app/src/components/ui/inputs/RenameInput.tsx b/app/src/components/ui/inputs/RenameInput.tsx index d1679b9..aa1460a 100644 --- a/app/src/components/ui/inputs/RenameInput.tsx +++ b/app/src/components/ui/inputs/RenameInput.tsx @@ -1,10 +1,5 @@ import React, { useState, useRef, useEffect } from "react"; -// interface RenameInputProps { -// value: string; -// onRename?: (newText: string) => void; -// } - interface RenameInputProps { value: string; onRename?: (newText: string) => void; diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index fd879bc..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Dwinzo_Demo", - "lockfileVersion": 3, - "requires": true, - "packages": {} -}