diff --git a/src/Router.jsx b/src/Router.jsx index cdc883d..9d14752 100644 --- a/src/Router.jsx +++ b/src/Router.jsx @@ -1,23 +1,23 @@ import React from "react"; import { Routes, BrowserRouter, Route } from "react-router-dom"; -import Home from "./components/Home.jsx"; -import Executions from "./components/Executions.jsx"; -import Scripts from "./components/Scripts.jsx"; -import Dagre from "./components/dagre/Dagre.jsx"; -import NoMatch from "./components/NoMatch.jsx"; -import Layout from "./components/Layout.jsx"; +import HomePage from "./pages/HomePage.jsx"; +import ExecutionsPage from "./pages/ExecutionsPage.jsx"; +import ScriptsPage from "./pages/ScriptsPage.jsx"; +import Layout from "./layouts/Layout.jsx"; +import NotFoundPage from "./pages/NotFoundPage.jsx"; +import ScriptPage from "./pages/ScriptPage.jsx"; const Router = () => { return ( }> - } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> - } /> + } /> ); diff --git a/src/components/ModuleTypesSelection.jsx b/src/components/ModuleTypesSelection.jsx index 1505ca7..d861f65 100644 --- a/src/components/ModuleTypesSelection.jsx +++ b/src/components/ModuleTypesSelection.jsx @@ -1,7 +1,7 @@ import React from "react"; import { Dropdown } from "semantic-ui-react"; import Rest from "../rest/Rest"; -import { ICONS_MAP } from "./dagre/DagreIcons"; +import { ICONS_MAP } from "../constants/dagreIcons.js"; class ModuleTypesSelection extends React.Component { constructor(props) { diff --git a/src/components/NoMatch.jsx b/src/components/NoMatch.jsx deleted file mode 100644 index 6e232ba..0000000 --- a/src/components/NoMatch.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from "react"; -import { Icon } from "semantic-ui-react"; - -import Layout from "./Layout"; - -const NoMatch = () => { - return ( - <> - - Page not found! - - ); -}; - -export default NoMatch; diff --git a/src/components/ScriptFunctionSelection.jsx b/src/components/ScriptFunctionSelection.jsx index 55d05da..a5d84d3 100644 --- a/src/components/ScriptFunctionSelection.jsx +++ b/src/components/ScriptFunctionSelection.jsx @@ -1,6 +1,6 @@ import React from "react"; import { Dropdown } from "semantic-ui-react"; -import { FUNCTION_URI, FUNCTION_NAME } from "../constants/Vocabulary.js"; +import { FUNCTION_URI, FUNCTION_NAME } from "../constants/vocabulary.js"; import Rest from "../rest/Rest.jsx"; class ScriptFunctionSelection extends React.Component { diff --git a/src/components/modal/MoveModuleModal.jsx b/src/components/modal/MoveModuleModal.jsx index 72bd09a..183fe79 100644 --- a/src/components/modal/MoveModuleModal.jsx +++ b/src/components/modal/MoveModuleModal.jsx @@ -1,7 +1,7 @@ import React from "react"; import { Alert, Button, Col, Container, Modal, Row } from "react-bootstrap"; -import { ONTOLOGY_URI, SCRIPT_PATH } from "../../constants/Vocabulary.js"; +import { ONTOLOGY_URI, SCRIPT_PATH } from "../../constants/vocabulary.js"; import Rest from "../../rest/Rest.jsx"; class MoveModuleModal extends React.Component { diff --git a/src/components/modal/ScriptExecutionModal.jsx b/src/components/modal/ScriptExecutionModal.jsx index f0bdac6..bf3cbb2 100644 --- a/src/components/modal/ScriptExecutionModal.jsx +++ b/src/components/modal/ScriptExecutionModal.jsx @@ -9,7 +9,7 @@ import { MODULE_VARIABLES, MODULE_VARIABLE_NAME, MODULE_VARIABLE_VALUE, -} from "../../constants/Vocabulary.js"; +} from "../../constants/vocabulary.js"; import { faDownload } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; diff --git a/src/components/modal/ValidationReportModal.jsx b/src/components/modal/ValidationReportModal.jsx index 4439c82..3bfa894 100644 --- a/src/components/modal/ValidationReportModal.jsx +++ b/src/components/modal/ValidationReportModal.jsx @@ -1,7 +1,7 @@ import React from "react"; import { Alert, Button, Col, Container, Modal, Row } from "react-bootstrap"; -import { ERROR_MESSAGE, MODULE_URI, RULE_COMMENT } from "../../constants/Vocabulary.js"; +import { ERROR_MESSAGE, MODULE_URI, RULE_COMMENT } from "../../constants/vocabulary.js"; class FunctionExecutionModal extends React.Component { constructor(props) { diff --git a/src/components/dagre/DagreIcons.jsx b/src/constants/dagreIcons.js similarity index 100% rename from src/components/dagre/DagreIcons.jsx rename to src/constants/dagreIcons.js diff --git a/src/constants/Vocabulary.js b/src/constants/vocabulary.js similarity index 100% rename from src/constants/Vocabulary.js rename to src/constants/vocabulary.js diff --git a/src/components/Layout.jsx b/src/layouts/Layout.jsx similarity index 91% rename from src/components/Layout.jsx rename to src/layouts/Layout.jsx index 43a107a..399e49d 100644 --- a/src/components/Layout.jsx +++ b/src/layouts/Layout.jsx @@ -1,7 +1,7 @@ import React from "react"; import { Container, Icon } from "semantic-ui-react"; import { Navbar } from "react-bootstrap"; -import NavbarMenu from "./NavbarMenu"; +import NavbarMenu from "../components/NavbarMenu.jsx"; import { Outlet } from "react-router-dom"; const Layout = ({ children }) => { diff --git a/src/components/Executions.jsx b/src/pages/ExecutionsPage.jsx similarity index 95% rename from src/components/Executions.jsx rename to src/pages/ExecutionsPage.jsx index 7471003..26942a5 100644 --- a/src/components/Executions.jsx +++ b/src/pages/ExecutionsPage.jsx @@ -1,13 +1,12 @@ import React from "react"; -import Layout from "./Layout"; -import { ABSOLUTE_PATH, DISPLAY_NAME, EXECUTION_DURATION, TRANSFORMATION } from "../constants/Vocabulary.js"; +import { ABSOLUTE_PATH, DISPLAY_NAME, EXECUTION_DURATION, TRANSFORMATION } from "../constants/vocabulary.js"; import Rest from "../rest/Rest.jsx"; import { Col, Container, Row, Table } from "react-bootstrap"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMugHot, faEdit, faQuestion } from "@fortawesome/free-solid-svg-icons"; import { Link } from "react-router-dom"; -class Executions extends React.Component { +class ExecutionsPage extends React.Component { constructor(props) { super(props); this.state = { @@ -87,4 +86,4 @@ class Executions extends React.Component { } } -export default Executions; +export default ExecutionsPage; diff --git a/src/components/Home.jsx b/src/pages/HomePage.jsx similarity index 71% rename from src/components/Home.jsx rename to src/pages/HomePage.jsx index 62fce3b..6172235 100644 --- a/src/components/Home.jsx +++ b/src/pages/HomePage.jsx @@ -1,9 +1,8 @@ import React from "react"; import { Grid } from "semantic-ui-react"; -import Layout from "./Layout"; -import ScriptsTree from "./treebeard/ScriptsTree"; +import ScriptsTree from "../components/treebeard/ScriptsTree.jsx"; -class Home extends React.Component { +class HomePage extends React.Component { render() { return ( @@ -19,4 +18,4 @@ class Home extends React.Component { } } -export default Home; +export default HomePage; diff --git a/src/pages/NotFoundPage.jsx b/src/pages/NotFoundPage.jsx new file mode 100644 index 0000000..3522262 --- /dev/null +++ b/src/pages/NotFoundPage.jsx @@ -0,0 +1,25 @@ +import React from "react"; +import { useNavigate } from "react-router-dom"; + +const NotFoundPage = () => { + const navigate = useNavigate(); + + const handleGoHome = () => { + navigate("/"); + }; + + return ( +
+

Oops! Page Not Found

+

The page you are looking for does not exist.

+ +
+ ); +}; + +export default NotFoundPage; diff --git a/src/components/dagre/Dagre.jsx b/src/pages/ScriptPage.jsx similarity index 95% rename from src/components/dagre/Dagre.jsx rename to src/pages/ScriptPage.jsx index 562bec9..2fe1046 100644 --- a/src/components/dagre/Dagre.jsx +++ b/src/pages/ScriptPage.jsx @@ -6,24 +6,24 @@ import cxtmenu from "cytoscape-cxtmenu"; import popper from "cytoscape-popper"; import navigator from "cytoscape-navigator"; import expandCollapse from "cytoscape-expand-collapse"; -import Rest from "../../rest/Rest.jsx"; -import NavbarMenu from "../NavbarMenu"; -import SFormsModal from "../sform/SFormsModal"; -import ModuleTypesSelection from "../ModuleTypesSelection"; -import ScriptInputOutputModal from "../sform/ScriptInputOutputModal"; +import Rest from "../rest/Rest.jsx"; +import NavbarMenu from "../components/NavbarMenu.jsx"; +import SFormsModal from "../components/sform/SFormsModal.jsx"; +import ModuleTypesSelection from "../components/ModuleTypesSelection.jsx"; +import ScriptInputOutputModal from "../components/sform/ScriptInputOutputModal.jsx"; import { Dropdown } from "semantic-ui-react"; -import { ICONS_MAP } from "./DagreIcons"; -import ScriptFunctionSelection from "../ScriptFunctionSelection"; +import { ICONS_MAP } from "../constants/dagreIcons.js"; +import ScriptFunctionSelection from "../components/ScriptFunctionSelection.jsx"; import { Button } from "react-bootstrap"; -import ValidationReportModal from "../modal/ValidationReportModal"; -import MoveModuleModal from "../modal/MoveModuleModal"; -import ScriptOntologyModal from "../modal/ScriptOntologyModal"; -import ScriptExecutionModal from "../modal/ScriptExecutionModal"; +import ValidationReportModal from "../components/modal/ValidationReportModal.jsx"; +import MoveModuleModal from "../components/modal/MoveModuleModal.jsx"; +import ScriptOntologyModal from "../components/modal/ScriptOntologyModal.jsx"; +import ScriptExecutionModal from "../components/modal/ScriptExecutionModal.jsx"; import "@triply/yasgui/build/yasgui.min.css"; -import SFormsFunctionModal from "../sform/SFormsFunctionModal"; +import SFormsFunctionModal from "../components/sform/SFormsFunctionModal.jsx"; import "@kbss-cvut/s-forms/css"; -import Loading from "../Loading"; -import ErrorModal from "../modal/ErrorModal"; +import Loading from "../components/Loading.jsx"; +import ErrorModal from "../components/modal/ErrorModal.jsx"; import { useLocation } from "react-router-dom"; import { TYPE, @@ -43,7 +43,7 @@ import { MODULE_VARIABLE_VALUE, MODULE_VARIABLES, SCRIPT_PATH, -} from "../../constants/Vocabulary.js"; +} from "../constants/vocabulary.js"; const rankDirOptions = [ // preset @@ -78,7 +78,7 @@ const modalInputs = { errorMessage: null, }; -class DagrePage extends React.Component { +class Script extends React.Component { constructor(props) { super(props); @@ -726,9 +726,9 @@ class DagrePage extends React.Component { } } -const Dagre = () => { +const ScriptPage = () => { const location = useLocation(); - return ; + return