Skip to content

Commit 8651cb3

Browse files
authored
Merge pull request #25 from GizzZmo/copilot/fix-yaml-loading-error
Fix CI failures: Vite/Node 18 incompatibility, ReactDOMTestUtils.act filter, getUserMedia guard, defaultProps deprecation
2 parents 1804004 + f7152c4 commit 8651cb3

5 files changed

Lines changed: 11 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18.x, 20.x]
15+
node-version: [20.x, 22.x]
1616

1717
steps:
1818
- name: Checkout code

jest.setup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const originalConsoleError = console.error;
1111
console.error = (...args) => {
1212
if (
1313
typeof args[0] === 'string' &&
14-
args[0].includes('ReactDOMTestUtils.act is deprecated')
14+
args[0].includes('ReactDOMTestUtils.act') &&
15+
args[0].includes('deprecated')
1516
) {
1617
return;
1718
}

package-lock.json

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Dashboard.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
33
import { formatUptime, formatTimestamp } from "../utils";
44

55
// Dashboard viser sanntidsstatistikk og nøkkeltall for ledelse/bruker
6-
const Dashboard = memo(function Dashboard({ anomalies, uptime, users, lastReport }) {
6+
const Dashboard = memo(function Dashboard({ anomalies, uptime, users, lastReport = null }) {
77
return (
88
<section className="dashboard bg-gray-900 text-teal-300 p-6 rounded-lg shadow-lg mb-4">
99
<h2 className="text-2xl mb-4 font-bold tracking-wide">Dashboard</h2>
@@ -38,8 +38,4 @@ Dashboard.propTypes = {
3838
lastReport: PropTypes.string,
3939
};
4040

41-
Dashboard.defaultProps = {
42-
lastReport: null,
43-
};
44-
4541
export default Dashboard;

src/components/FaceRecognition.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const FaceRecognition = memo(function FaceRecognition({ onDetect, tolerance, kno
2727

2828
// Request camera with validated constraints
2929
const constraints = validateCameraConstraints();
30+
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
31+
throw new Error('Camera API not available in this environment');
32+
}
3033
const stream = await navigator.mediaDevices.getUserMedia(constraints);
3134
streamRef.current = stream;
3235

0 commit comments

Comments
 (0)