chore: added copyright strings and removed template page
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.logopepper {
|
.logopepper {
|
||||||
height: 8em;
|
height: 8em;
|
||||||
padding: 1.5em;
|
padding: 1.5em;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { Routes, Route, Link } from 'react-router'
|
import { Routes, Route, Link } from 'react-router'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
import TemplatePage from './pages/TemplatePage/Template.tsx'
|
|
||||||
import Home from './pages/Home/Home.tsx'
|
import Home from './pages/Home/Home.tsx'
|
||||||
import Robot from './pages/Robot/Robot.tsx';
|
import Robot from './pages/Robot/Robot.tsx';
|
||||||
import ConnectedRobots from './pages/ConnectedRobots/ConnectedRobots.tsx'
|
import ConnectedRobots from './pages/ConnectedRobots/ConnectedRobots.tsx'
|
||||||
@@ -15,6 +17,7 @@ function App(){
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header>
|
<header>
|
||||||
|
<span>© Utrecht University (ICS)</span>
|
||||||
<Link to={"/"}>Home</Link>
|
<Link to={"/"}>Home</Link>
|
||||||
<button onClick={() => setShowLogs(!showLogs)}>Developer Logs</button>
|
<button onClick={() => setShowLogs(!showLogs)}>Developer Logs</button>
|
||||||
</header>
|
</header>
|
||||||
@@ -22,7 +25,6 @@ function App(){
|
|||||||
<main className={"flex-col align-center flex-1 scroll-y"}>
|
<main className={"flex-col align-center flex-1 scroll-y"}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<Home />} />
|
<Route path="/" element={<Home />} />
|
||||||
<Route path="/template" element={<TemplatePage />} />
|
|
||||||
<Route path="/editor" element={<VisProg />} />
|
<Route path="/editor" element={<VisProg />} />
|
||||||
<Route path="/robot" element={<Robot />} />
|
<Route path="/robot" element={<Robot />} />
|
||||||
<Route path="/ConnectedRobots" element={<ConnectedRobots />} />
|
<Route path="/ConnectedRobots" element={<ConnectedRobots />} />
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.filter-root {
|
.filter-root {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useEffect, useRef, useState} from "react";
|
import {useEffect, useRef, useState} from "react";
|
||||||
|
|
||||||
import type {LogFilterPredicate} from "./useLogs.ts";
|
import type {LogFilterPredicate} from "./useLogs.ts";
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.logging-container {
|
.logging-container {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {type ComponentType, useEffect, useRef, useState} from "react";
|
import {type ComponentType, useEffect, useRef, useState} from "react";
|
||||||
import formatDuration from "../../utils/formatDuration.ts";
|
import formatDuration from "../../utils/formatDuration.ts";
|
||||||
import {type LogFilterPredicate, type LogRecord, useLogs} from "./useLogs.ts";
|
import {type LogFilterPredicate, type LogRecord, useLogs} from "./useLogs.ts";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useCallback, useEffect, useRef, useState} from "react";
|
import {useCallback, useEffect, useRef, useState} from "react";
|
||||||
|
|
||||||
import {applyPriorityPredicates, type PriorityFilterPredicate} from "../../utils/priorityFiltering.ts";
|
import {applyPriorityPredicates, type PriorityFilterPredicate} from "../../utils/priorityFiltering.ts";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import styles from "./TextField.module.css";
|
import styles from "./TextField.module.css";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useEffect, useRef} from "react";
|
import {useEffect, useRef} from "react";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.text-field {
|
.text-field {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 5pt;
|
border-radius: 5pt;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import styles from "./TextField.module.css";
|
import styles from "./TextField.module.css";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { StrictMode } from 'react'
|
import { StrictMode } from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import { BrowserRouter } from 'react-router'
|
import { BrowserRouter } from 'react-router'
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.read_the_docs {
|
.read_the_docs {
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
import pepperLogo from '../../assets/pepper_transp2_small.svg'
|
import pepperLogo from '../../assets/pepper_transp2_small.svg'
|
||||||
import styles from './Home.module.css'
|
import styles from './Home.module.css'
|
||||||
@@ -21,7 +24,6 @@ function Home() {
|
|||||||
<div className={styles.links}>
|
<div className={styles.links}>
|
||||||
<Link to={"/robot"}>Robot Interaction →</Link>
|
<Link to={"/robot"}>Robot Interaction →</Link>
|
||||||
<Link to={"/editor"}>Editor →</Link>
|
<Link to={"/editor"}>Editor →</Link>
|
||||||
<Link to={"/template"}>Template →</Link>
|
|
||||||
<Link to={"/ConnectedRobots"}>Connected Robots →</Link>
|
<Link to={"/ConnectedRobots"}>Connected Robots →</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.dashboardContainer {
|
.dashboardContainer {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2fr 1fr; /* Left = content, Right = logs */
|
grid-template-columns: 2fr 1fr; /* Left = content, Right = logs */
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import styles from './MonitoringPage.module.css';
|
import styles from './MonitoringPage.module.css';
|
||||||
|
|
||||||
@@ -15,7 +18,7 @@ import {
|
|||||||
type CondNormsStateUpdate,
|
type CondNormsStateUpdate,
|
||||||
type PhaseUpdate
|
type PhaseUpdate
|
||||||
} from "./MonitoringPageAPI";
|
} from "./MonitoringPageAPI";
|
||||||
import { graphReducer, runProgramm } from '../VisProgPage/VisProgLogic.ts';
|
import { graphReducer, runProgram } from '../VisProgPage/VisProgLogic.ts';
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import type { NormNodeData } from '../VisProgPage/visualProgrammingUI/nodes/NormNode';
|
import type { NormNodeData } from '../VisProgPage/visualProgrammingUI/nodes/NormNode';
|
||||||
@@ -132,7 +135,7 @@ function useExperimentLogic() {
|
|||||||
setGoalIndex(0);
|
setGoalIndex(0);
|
||||||
setIsFinished(false);
|
setIsFinished(false);
|
||||||
|
|
||||||
await runProgramm();
|
await runProgram();
|
||||||
console.log("Experiment & UI successfully reset.");
|
console.log("Experiment & UI successfully reset.");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to reset program:", err);
|
console.error("Failed to reset program:", err);
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
const API_BASE = "http://localhost:8000";
|
const API_BASE = "http://localhost:8000";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import styles from './MonitoringPage.module.css';
|
import styles from './MonitoringPage.module.css';
|
||||||
import { sendAPICall } from './MonitoringPageAPI';
|
import { sendAPICall } from './MonitoringPageAPI';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useState, useEffect, useRef } from 'react'
|
import { useState, useEffect, useRef } from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import Counter from '../../components/components.tsx'
|
|
||||||
|
|
||||||
function TemplatePage() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Counter />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TemplatePage
|
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
/* editor UI */
|
/* editor UI */
|
||||||
|
|
||||||
.inner-editor-container {
|
.inner-editor-container {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
Background,
|
Background,
|
||||||
Controls,
|
Controls,
|
||||||
@@ -20,7 +23,7 @@ import styles from './VisProg.module.css'
|
|||||||
import {NodeTypes} from './visualProgrammingUI/NodeRegistry.ts';
|
import {NodeTypes} from './visualProgrammingUI/NodeRegistry.ts';
|
||||||
import SaveLoadPanel from './visualProgrammingUI/components/SaveLoadPanel.tsx';
|
import SaveLoadPanel from './visualProgrammingUI/components/SaveLoadPanel.tsx';
|
||||||
import MonitoringPage from '../MonitoringPage/MonitoringPage.tsx';
|
import MonitoringPage from '../MonitoringPage/MonitoringPage.tsx';
|
||||||
import { graphReducer, runProgramm } from './VisProgLogic.ts';
|
import {graphReducer, runProgram} from './VisProgLogic.ts';
|
||||||
|
|
||||||
// --| config starting params for flow |--
|
// --| config starting params for flow |--
|
||||||
|
|
||||||
@@ -218,7 +221,7 @@ function VisProgPage() {
|
|||||||
const phases = graphReducer(); // reduce graph
|
const phases = graphReducer(); // reduce graph
|
||||||
setProgramState({ phases }); // <-- save to store
|
setProgramState({ phases }); // <-- save to store
|
||||||
setShowSimpleProgram(true); // show SimpleProgram
|
setShowSimpleProgram(true); // show SimpleProgram
|
||||||
runProgramm(); // send to backend if needed
|
runProgram(); // send to backend if needed
|
||||||
};
|
};
|
||||||
|
|
||||||
if (showSimpleProgram) {
|
if (showSimpleProgram) {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import useProgramStore from "../../utils/programStore";
|
import useProgramStore from "../../utils/programStore";
|
||||||
import orderPhaseNodeArray from "../../utils/orderPhaseNodes";
|
import orderPhaseNodeArray from "../../utils/orderPhaseNodes";
|
||||||
import useFlowStore from './visualProgrammingUI/VisProgStores';
|
import useFlowStore from './visualProgrammingUI/VisProgStores';
|
||||||
@@ -20,7 +23,7 @@ export function graphReducer() {
|
|||||||
/**
|
/**
|
||||||
* Outputs the prepared program to the console and sends it to the backend
|
* Outputs the prepared program to the console and sends it to the backend
|
||||||
*/
|
*/
|
||||||
export function runProgramm() {
|
export function runProgram() {
|
||||||
const phases = graphReducer();
|
const phases = graphReducer();
|
||||||
const program = {phases}
|
const program = {phases}
|
||||||
console.log(JSON.stringify(program, null, 2));
|
console.log(JSON.stringify(program, null, 2));
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
import useProgramStore from "../../utils/programStore";
|
|
||||||
import orderPhaseNodeArray from "../../utils/orderPhaseNodes";
|
|
||||||
import useFlowStore from './visualProgrammingUI/VisProgStores';
|
|
||||||
import { NodeReduces } from './visualProgrammingUI/NodeRegistry';
|
|
||||||
import type { PhaseNode } from "./visualProgrammingUI/nodes/PhaseNode";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reduces the graph into its phases' information and recursively calls their reducing function
|
|
||||||
*/
|
|
||||||
export function graphReducer() {
|
|
||||||
const { nodes } = useFlowStore.getState();
|
|
||||||
return orderPhaseNodeArray(nodes.filter((n) => n.type == 'phase') as PhaseNode [])
|
|
||||||
.map((n) => {
|
|
||||||
const reducer = NodeReduces['phase'];
|
|
||||||
return reducer(n, nodes)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Outputs the prepared program to the console and sends it to the backend
|
|
||||||
*/
|
|
||||||
export function runProgram() {
|
|
||||||
const phases = graphReducer();
|
|
||||||
const program = {phases}
|
|
||||||
console.log(JSON.stringify(program, null, 2));
|
|
||||||
fetch(
|
|
||||||
"http://localhost:8000/program",
|
|
||||||
{
|
|
||||||
method: "POST",
|
|
||||||
headers: {"Content-Type": "application/json"},
|
|
||||||
body: JSON.stringify(program),
|
|
||||||
}
|
|
||||||
).then((res) => {
|
|
||||||
if (!res.ok) throw new Error("Failed communicating with the backend.")
|
|
||||||
console.log("Successfully sent the program to the backend.");
|
|
||||||
|
|
||||||
// store reduced program in global program store for further use in the UI
|
|
||||||
// when the program was sent to the backend successfully:
|
|
||||||
useProgramStore.getState().setProgramState(structuredClone(program));
|
|
||||||
}).catch(() => console.log("Failed to send program to the backend."));
|
|
||||||
console.log(program);
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type {Edge, Node} from "@xyflow/react";
|
import type {Edge, Node} from "@xyflow/react";
|
||||||
import type {StateCreator, StoreApi } from 'zustand/vanilla';
|
import type {StateCreator, StoreApi } from 'zustand/vanilla';
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {type Connection} from "@xyflow/react";
|
import {type Connection} from "@xyflow/react";
|
||||||
import {useEffect} from "react";
|
import {useEffect} from "react";
|
||||||
import useFlowStore from "./VisProgStores.tsx";
|
import useFlowStore from "./VisProgStores.tsx";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type HandleRule,
|
type HandleRule,
|
||||||
ruleResult
|
ruleResult
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import EndNode, {
|
import EndNode, {
|
||||||
EndConnectionTarget,
|
EndConnectionTarget,
|
||||||
EndConnectionSource,
|
EndConnectionSource,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import {
|
import {
|
||||||
applyNodeChanges,
|
applyNodeChanges,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
// VisProgTypes.ts
|
// VisProgTypes.ts
|
||||||
import type {
|
import type {
|
||||||
Edge,
|
Edge,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useDraggable } from '@neodrag/react';
|
import { useDraggable } from '@neodrag/react';
|
||||||
import { useReactFlow, type XYPosition } from '@xyflow/react';
|
import { useReactFlow, type XYPosition } from '@xyflow/react';
|
||||||
import { type ReactNode, useCallback, useRef, useState } from 'react';
|
import { type ReactNode, useCallback, useRef, useState } from 'react';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
/* contains all logic for the VisProgEditor warning system
|
/* contains all logic for the VisProgEditor warning system
|
||||||
*
|
*
|
||||||
* Missing but desirable features:
|
* Missing but desirable features:
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.gestureEditor {
|
.gestureEditor {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useState, useRef } from "react";
|
import { useState, useRef } from "react";
|
||||||
import styles from './GestureValueEditor.module.css'
|
import styles from './GestureValueEditor.module.css'
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {NodeToolbar, useReactFlow} from '@xyflow/react';
|
import {NodeToolbar, useReactFlow} from '@xyflow/react';
|
||||||
import '@xyflow/react/dist/style.css';
|
import '@xyflow/react/dist/style.css';
|
||||||
import {type JSX, useState} from "react";
|
import {type JSX, useState} from "react";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { Plan, PlanElement } from "./Plan";
|
import type { Plan, PlanElement } from "./Plan";
|
||||||
|
|
||||||
export const defaultPlan: Plan = {
|
export const defaultPlan: Plan = {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { type Node } from "@xyflow/react"
|
import { type Node } from "@xyflow/react"
|
||||||
import { GoalReduce } from "../nodes/GoalNode"
|
import { GoalReduce } from "../nodes/GoalNode"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
// This file is to avoid sharing both functions and components which eslint dislikes. :)
|
// This file is to avoid sharing both functions and components which eslint dislikes. :)
|
||||||
import type { GoalNode } from "../nodes/GoalNode"
|
import type { GoalNode } from "../nodes/GoalNode"
|
||||||
import type { Goal, Plan } from "./Plan"
|
import type { Goal, Plan } from "./Plan"
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.planDialog {
|
.planDialog {
|
||||||
overflow:visible;
|
overflow:visible;
|
||||||
width: 80vw;
|
width: 80vw;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useRef, useState} from "react";
|
import {useRef, useState} from "react";
|
||||||
import useFlowStore from "../VisProgStores.tsx";
|
import useFlowStore from "../VisProgStores.tsx";
|
||||||
import styles from './PlanEditor.module.css';
|
import styles from './PlanEditor.module.css';
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
:global(.react-flow__handle.source){
|
:global(.react-flow__handle.source){
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
Handle,
|
Handle,
|
||||||
type HandleProps,
|
type HandleProps,
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.save-load-panel {
|
.save-load-panel {
|
||||||
border-radius: 0 0 5pt 5pt;
|
border-radius: 0 0 5pt 5pt;
|
||||||
background-color: canvas;
|
background-color: canvas;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {type ChangeEvent, useRef, useState} from "react";
|
import {type ChangeEvent, useRef, useState} from "react";
|
||||||
import useFlowStore from "../VisProgStores";
|
import useFlowStore from "../VisProgStores";
|
||||||
import visProgStyles from "../../VisProg.module.css";
|
import visProgStyles from "../../VisProg.module.css";
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.warnings-sidebar {
|
.warnings-sidebar {
|
||||||
min-width: auto;
|
min-width: auto;
|
||||||
max-width: 340px;
|
max-width: 340px;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useReactFlow, useStoreApi} from "@xyflow/react";
|
import {useReactFlow, useStoreApi} from "@xyflow/react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { BasicBeliefNodeData } from "./BasicBeliefNode.tsx";
|
import type { BasicBeliefNodeData } from "./BasicBeliefNode.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {getOutgoers, type Node} from '@xyflow/react';
|
import {getOutgoers, type Node} from '@xyflow/react';
|
||||||
import {type HandleRule, type RuleResult, ruleResult} from "../HandleRuleLogic.ts";
|
import {type HandleRule, type RuleResult, ruleResult} from "../HandleRuleLogic.ts";
|
||||||
import useFlowStore from "../VisProgStores.tsx";
|
import useFlowStore from "../VisProgStores.tsx";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { EndNodeData } from "./EndNode";
|
import type { EndNodeData } from "./EndNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { GoalNodeData } from "./GoalNode";
|
import type { GoalNodeData } from "./GoalNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { InferredBeliefNodeData } from "./InferredBeliefNode.tsx";
|
import type { InferredBeliefNodeData } from "./InferredBeliefNode.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{/*
|
||||||
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
University within the Software Project course.
|
||||||
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
|
*/}
|
||||||
.operator-switch {
|
.operator-switch {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {getConnectedEdges, type Node, type NodeProps, Position, useNodeConnections} from '@xyflow/react';
|
import {getConnectedEdges, type Node, type NodeProps, Position, useNodeConnections} from '@xyflow/react';
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import styles from '../../VisProg.module.css';
|
import styles from '../../VisProg.module.css';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { NormNodeData } from "./NormNode";
|
import type { NormNodeData } from "./NormNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { PhaseNodeData } from "./PhaseNode";
|
import type { PhaseNodeData } from "./PhaseNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { StartNodeData } from "./StartNode";
|
import type { StartNodeData } from "./StartNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type { TriggerNodeData } from "./TriggerNode";
|
import type { TriggerNodeData } from "./TriggerNode";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {
|
import {
|
||||||
type NodeProps,
|
type NodeProps,
|
||||||
Position,
|
Position,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {type Edge, type Node } from "@xyflow/react";
|
import {type Edge, type Node } from "@xyflow/react";
|
||||||
|
|
||||||
export type SavedProject = {
|
export type SavedProject = {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {useSyncExternalStore} from "react";
|
import {useSyncExternalStore} from "react";
|
||||||
|
|
||||||
type Unsub = () => void;
|
type Unsub = () => void;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
/**
|
/**
|
||||||
* Find the indices of all elements that occur more than once.
|
* Find the indices of all elements that occur more than once.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
/**
|
/**
|
||||||
* Format a time duration like `HH:MM:SS.mmm`.
|
* Format a time duration like `HH:MM:SS.mmm`.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import type {PhaseNode} from "../pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx";
|
import type {PhaseNode} from "../pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
export type PriorityFilterPredicate<T> = {
|
export type PriorityFilterPredicate<T> = {
|
||||||
priority: number;
|
priority: number;
|
||||||
predicate: (element: T) => boolean | null; // The predicate and its priority are ignored if it returns null.
|
predicate: (element: T) => boolean | null; // The predicate and its priority are ignored if it returns null.
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {create} from "zustand";
|
import {create} from "zustand";
|
||||||
|
|
||||||
// the type of a reduced program
|
// the type of a reduced program
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { render, screen} from '@testing-library/react';
|
import { render, screen} from '@testing-library/react';
|
||||||
import Counter from '../src/components/components';
|
import Counter from '../src/components/components';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {render, screen, waitFor, fireEvent} from "@testing-library/react";
|
import {render, screen, waitFor, fireEvent} from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {render, screen, fireEvent, act, waitFor} from "@testing-library/react";
|
import {render, screen, fireEvent, act, waitFor} from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { render, screen, act } from "@testing-library/react";
|
import { render, screen, act } from "@testing-library/react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import {type LogRecord, useLogs} from "../../../src/components/Logging/useLogs.ts";
|
import {type LogRecord, useLogs} from "../../../src/components/Logging/useLogs.ts";
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { render, screen, act, cleanup, waitFor } from '@testing-library/react';
|
import { render, screen, act, cleanup, waitFor } from '@testing-library/react';
|
||||||
import ConnectedRobots from '../../../src/pages/ConnectedRobots/ConnectedRobots';
|
import ConnectedRobots from '../../../src/pages/ConnectedRobots/ConnectedRobots';
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { render, screen, fireEvent, act } from '@testing-library/react';
|
import { render, screen, fireEvent, act } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
import MonitoringPage from '../../../src/pages/MonitoringPage/MonitoringPage';
|
import MonitoringPage from '../../../src/pages/MonitoringPage/MonitoringPage';
|
||||||
@@ -27,7 +30,7 @@ jest.mock('../../../src/pages/MonitoringPage/MonitoringPageAPI', () => ({
|
|||||||
// Mock VisProg functionality
|
// Mock VisProg functionality
|
||||||
jest.mock('../../../src/pages/VisProgPage/VisProgLogic', () => ({
|
jest.mock('../../../src/pages/VisProgPage/VisProgLogic', () => ({
|
||||||
graphReducer: jest.fn(),
|
graphReducer: jest.fn(),
|
||||||
runProgramm: jest.fn(),
|
runProgram: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Mock Child Components to reduce noise (optional, but keeps unit test focused)
|
// Mock Child Components to reduce noise (optional, but keeps unit test focused)
|
||||||
@@ -160,12 +163,12 @@ describe('MonitoringPage', () => {
|
|||||||
|
|
||||||
expect(VisProg.graphReducer).toHaveBeenCalled();
|
expect(VisProg.graphReducer).toHaveBeenCalled();
|
||||||
expect(mockSetProgramState).toHaveBeenCalledWith({ phases: [{ id: 'new-phase' }] });
|
expect(mockSetProgramState).toHaveBeenCalledWith({ phases: [{ id: 'new-phase' }] });
|
||||||
expect(VisProg.runProgramm).toHaveBeenCalled();
|
expect(VisProg.runProgram).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Reset Experiment handles errors gracefully', async () => {
|
test('Reset Experiment handles errors gracefully', async () => {
|
||||||
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||||
(VisProg.runProgramm as jest.Mock).mockRejectedValue(new Error('Fail'));
|
(VisProg.runProgram as jest.Mock).mockRejectedValue(new Error('Fail'));
|
||||||
|
|
||||||
render(<MonitoringPage />);
|
render(<MonitoringPage />);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { renderHook, act, cleanup } from '@testing-library/react';
|
import { renderHook, act, cleanup } from '@testing-library/react';
|
||||||
import {
|
import {
|
||||||
sendAPICall,
|
sendAPICall,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render, screen, fireEvent, act } from '@testing-library/react';
|
import { render, screen, fireEvent, act } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { render, screen, act, cleanup, fireEvent } from '@testing-library/react';
|
import { render, screen, act, cleanup, fireEvent } from '@testing-library/react';
|
||||||
import Robot from '../../../src/pages/Robot/Robot';
|
import Robot from '../../../src/pages/Robot/Robot';
|
||||||
|
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
|
||||||
import SimpleProgram from "../../../src/pages/SimpleProgram/SimpleProgram";
|
|
||||||
import useProgramStore from "../../../src/utils/programStore";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to preload the program store before rendering.
|
|
||||||
*/
|
|
||||||
function loadProgram(phases: Record<string, unknown>[]) {
|
|
||||||
useProgramStore.getState().setProgramState({ phases });
|
|
||||||
}
|
|
||||||
|
|
||||||
describe("SimpleProgram", () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
loadProgram([]);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("shows empty state when no program is loaded", () => {
|
|
||||||
render(<SimpleProgram />);
|
|
||||||
expect(screen.getByText("No program loaded.")).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("renders first phase content", () => {
|
|
||||||
loadProgram([
|
|
||||||
{
|
|
||||||
id: "phase-1",
|
|
||||||
norms: [{ id: "n1", norm: "Be polite" }],
|
|
||||||
goals: [{ id: "g1", description: "Finish task", achieved: true }],
|
|
||||||
triggers: [{ id: "t1", label: "Keyword trigger" }],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
render(<SimpleProgram />);
|
|
||||||
|
|
||||||
expect(screen.getByText("Phase 1 / 1")).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Be polite")).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Finish task")).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Keyword trigger")).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("allows navigating between phases", () => {
|
|
||||||
loadProgram([
|
|
||||||
{
|
|
||||||
id: "phase-1",
|
|
||||||
norms: [],
|
|
||||||
goals: [],
|
|
||||||
triggers: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "phase-2",
|
|
||||||
norms: [{ id: "n2", norm: "Be careful" }],
|
|
||||||
goals: [],
|
|
||||||
triggers: [],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
render(<SimpleProgram />);
|
|
||||||
|
|
||||||
expect(screen.getByText("Phase 1 / 2")).toBeInTheDocument();
|
|
||||||
|
|
||||||
fireEvent.click(screen.getByText("Next ▶"));
|
|
||||||
|
|
||||||
expect(screen.getByText("Phase 2 / 2")).toBeInTheDocument();
|
|
||||||
expect(screen.getByText("Be careful")).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("prev button is disabled on first phase", () => {
|
|
||||||
loadProgram([
|
|
||||||
{ id: "phase-1", norms: [], goals: [], triggers: [] },
|
|
||||||
]);
|
|
||||||
|
|
||||||
render(<SimpleProgram />);
|
|
||||||
expect(screen.getByText("◀ Prev")).toBeDisabled();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("next button is disabled on last phase", () => {
|
|
||||||
loadProgram([
|
|
||||||
{ id: "phase-1", norms: [], goals: [], triggers: [] },
|
|
||||||
]);
|
|
||||||
|
|
||||||
render(<SimpleProgram />);
|
|
||||||
expect(screen.getByText("Next ▶")).toBeDisabled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {act} from '@testing-library/react';
|
import {act} from '@testing-library/react';
|
||||||
import useFlowStore from '../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores.tsx';
|
import useFlowStore from '../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores.tsx';
|
||||||
import { mockReactFlow } from '../../../setupFlowTests.ts';
|
import { mockReactFlow } from '../../../setupFlowTests.ts';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
describe('not yet implemented', () => {
|
describe('not yet implemented', () => {
|
||||||
test('nothing yet', () => {
|
test('nothing yet', () => {
|
||||||
expect(true);
|
expect(true);
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {renderHook} from "@testing-library/react";
|
import {renderHook} from "@testing-library/react";
|
||||||
import type {Connection} from "@xyflow/react";
|
import type {Connection} from "@xyflow/react";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {ruleResult} from "../../../../src/pages/VisProgPage/visualProgrammingUI/HandleRuleLogic.ts";
|
import {ruleResult} from "../../../../src/pages/VisProgPage/visualProgrammingUI/HandleRuleLogic.ts";
|
||||||
import {
|
import {
|
||||||
allowOnlyConnectionsFromType,
|
allowOnlyConnectionsFromType,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {act} from '@testing-library/react';
|
import {act} from '@testing-library/react';
|
||||||
import {
|
import {
|
||||||
type Connection,
|
type Connection,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { getByTestId, render } from '@testing-library/react';
|
import { getByTestId, render } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import useFlowStore from '../../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores';
|
import useFlowStore from '../../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { describe, it, expect} from '@jest/globals';
|
import { describe, it, expect} from '@jest/globals';
|
||||||
import {
|
import {
|
||||||
type EditorWarning, warningSummary
|
type EditorWarning, warningSummary
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { renderWithProviders, screen } from '../../../../test-utils/test-utils.tsx';
|
import { renderWithProviders, screen } from '../../../../test-utils/test-utils.tsx';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { fireEvent, screen } from '@testing-library/react';
|
import { fireEvent, screen } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
import {Tooltip} from "../../../../../src/pages/VisProgPage/visualProgrammingUI/components/NodeComponents.tsx";
|
import {Tooltip} from "../../../../../src/pages/VisProgPage/visualProgrammingUI/components/NodeComponents.tsx";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { describe, it, beforeEach, jest } from '@jest/globals';
|
import { describe, it, beforeEach, jest } from '@jest/globals';
|
||||||
import { screen, within } from '@testing-library/react';
|
import { screen, within } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
// SaveLoadPanel.all.test.tsx
|
// SaveLoadPanel.all.test.tsx
|
||||||
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||||
import useFlowStore from '../../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores.tsx';
|
import useFlowStore from '../../../../../src/pages/VisProgPage/visualProgrammingUI/VisProgStores.tsx';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import { act } from '@testing-library/react';
|
import { act } from '@testing-library/react';
|
||||||
import ScrollIntoView from '../../../../../src/components/ScrollIntoView';
|
import ScrollIntoView from '../../../../../src/components/ScrollIntoView';
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import {fireEvent, render, screen} from '@testing-library/react';
|
import {fireEvent, render, screen} from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
import {useReactFlow, useStoreApi} from "@xyflow/react";
|
import {useReactFlow, useStoreApi} from "@xyflow/react";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
import { describe, it, expect, jest, beforeEach } from '@jest/globals';
|
import { describe, it, expect, jest, beforeEach } from '@jest/globals';
|
||||||
import {type Connection, getOutgoers, type Node} from '@xyflow/react';
|
import {type Connection, getOutgoers, type Node} from '@xyflow/react';
|
||||||
import {ruleResult} from "../../../../../src/pages/VisProgPage/visualProgrammingUI/HandleRuleLogic.ts";
|
import {ruleResult} from "../../../../../src/pages/VisProgPage/visualProgrammingUI/HandleRuleLogic.ts";
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// This program has been developed by students from the bachelor Computer Science at Utrecht
|
||||||
|
// University within the Software Project course.
|
||||||
|
// © Copyright Utrecht University (Department of Information and Computing Sciences)
|
||||||
// BasicBeliefNode.test.tsx
|
// BasicBeliefNode.test.tsx
|
||||||
import { describe, it, beforeEach } from '@jest/globals';
|
import { describe, it, beforeEach } from '@jest/globals';
|
||||||
import { screen, waitFor } from '@testing-library/react';
|
import { screen, waitFor } from '@testing-library/react';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user