From 380cc3c0751c0a7f79ed1fc59220b2633c7879b9 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Tue, 12 Nov 2024 15:39:25 +0100 Subject: [PATCH] [#84] Move page component to folder pages --- src/Router.jsx | 22 ++++++------ src/components/ModuleTypesSelection.jsx | 2 +- .../ExecutionsPage.jsx} | 5 ++- .../Home.jsx => pages/HomePage.jsx} | 7 ++-- .../Scripts.jsx => pages/ScriptsPage.jsx} | 7 ++-- .../dagre/DagreIcons.jsx | 0 .../Dagre.jsx => pages/dagre/DagrePage.jsx} | 34 +++++++++---------- 7 files changed, 37 insertions(+), 40 deletions(-) rename src/{components/Executions.jsx => pages/ExecutionsPage.jsx} (96%) rename src/{components/Home.jsx => pages/HomePage.jsx} (71%) rename src/{components/Scripts.jsx => pages/ScriptsPage.jsx} (65%) rename src/{components => pages}/dagre/DagreIcons.jsx (100%) rename src/{components/dagre/Dagre.jsx => pages/dagre/DagrePage.jsx} (95%) diff --git a/src/Router.jsx b/src/Router.jsx index cdc883d..6b74eaf 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 DagrePage from "./pages/dagre/DagrePage.jsx"; +import Layout from "./layouts/Layout.jsx"; +import NotFoundPage from "./pages/NotFoundPage.jsx"; const Router = () => { return ( }> - } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> - } /> + } /> ); diff --git a/src/components/ModuleTypesSelection.jsx b/src/components/ModuleTypesSelection.jsx index 1505ca7..a135478 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 "../pages/dagre/DagreIcons"; class ModuleTypesSelection extends React.Component { constructor(props) { diff --git a/src/components/Executions.jsx b/src/pages/ExecutionsPage.jsx similarity index 96% rename from src/components/Executions.jsx rename to src/pages/ExecutionsPage.jsx index 7471003..7f13f15 100644 --- a/src/components/Executions.jsx +++ b/src/pages/ExecutionsPage.jsx @@ -1,5 +1,4 @@ import React from "react"; -import Layout from "./Layout"; 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"; @@ -7,7 +6,7 @@ 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/components/Scripts.jsx b/src/pages/ScriptsPage.jsx similarity index 65% rename from src/components/Scripts.jsx rename to src/pages/ScriptsPage.jsx index 352b6ae..cabbbd8 100644 --- a/src/components/Scripts.jsx +++ b/src/pages/ScriptsPage.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 Scripts extends React.Component { +class ScriptsPage extends React.Component { render() { return ( @@ -17,4 +16,4 @@ class Scripts extends React.Component { } } -export default Scripts; +export default ScriptsPage; diff --git a/src/components/dagre/DagreIcons.jsx b/src/pages/dagre/DagreIcons.jsx similarity index 100% rename from src/components/dagre/DagreIcons.jsx rename to src/pages/dagre/DagreIcons.jsx diff --git a/src/components/dagre/Dagre.jsx b/src/pages/dagre/DagrePage.jsx similarity index 95% rename from src/components/dagre/Dagre.jsx rename to src/pages/dagre/DagrePage.jsx index 562bec9..b4a8eb3 100644 --- a/src/components/dagre/Dagre.jsx +++ b/src/pages/dagre/DagrePage.jsx @@ -7,23 +7,23 @@ 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 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 "./DagreIcons.jsx"; +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, @@ -78,7 +78,7 @@ const modalInputs = { errorMessage: null, }; -class DagrePage extends React.Component { +class Dagre extends React.Component { constructor(props) { super(props); @@ -726,9 +726,9 @@ class DagrePage extends React.Component { } } -const Dagre = () => { +const DagrePage = () => { const location = useLocation(); - return ; + return ; }; -export default Dagre; +export default DagrePage;