Skip to content

Commit

Permalink
Merge pull request #80 from kbss-cvut/77-constants-refactor
Browse files Browse the repository at this point in the history
Constrants refactor
  • Loading branch information
blcham authored Nov 11, 2024
2 parents 28e2918 + 1fbee1e commit 62469d0
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 156 deletions.
4 changes: 2 additions & 2 deletions src/components/Executions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
DISPLAY_NAME,
EXECUTION_DURATION,
FINISH_DATE_UNIX,
Rest,
START_DATE_UNIX,
TRANSFORMATION,
} from "./rest/Rest";
} 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, faTrash, faRunning, faPlayCircle, faEdit, faQuestion } from "@fortawesome/free-solid-svg-icons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModuleTypesSelection.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Dropdown } from "semantic-ui-react";
import { Rest } from "./rest/Rest";
import Rest from "./rest/Rest";
import { ICONS_MAP } from "./dagre/DagreIcons";

class ModuleTypesSelection extends React.Component {
Expand Down
7 changes: 4 additions & 3 deletions src/components/ScriptFunctionSelection.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { Dropdown } from "semantic-ui-react";
import { FUNCTION, FUNCTION_NAME, Rest } from "./rest/Rest";
import { FUNCTION_URI, FUNCTION_NAME } from "../constants/Vocabulary.js";
import Rest from "./rest/Rest.jsx";
import { ICONS_MAP } from "./dagre/DagreIcons";

class ScriptFunctionSelection extends React.Component {
Expand All @@ -15,9 +16,9 @@ class ScriptFunctionSelection extends React.Component {
Rest.getModulesFunctions(this.props.scriptPath).then((res) => {
const options = res.map((r) => {
return {
key: r[FUNCTION],
key: r[FUNCTION_URI],
text: r[FUNCTION_NAME],
value: r[FUNCTION],
value: r[FUNCTION_URI],
image: { avatar: true, src: "/icons/fire-extinguisher.png" },
};
});
Expand Down
52 changes: 26 additions & 26 deletions src/components/dagre/Dagre.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import cxtmenu from "cytoscape-cxtmenu";
import popper from "cytoscape-popper";
import navigator from "cytoscape-navigator";
import expandCollapse from "cytoscape-expand-collapse";
import {
MODULE_URI,
MODULE_VARIABLE_NAME,
MODULE_VARIABLE_VALUE,
MODULE_VARIABLES,
Rest,
SCRIPT_PATH,
} from "../rest/Rest";
import Rest from "../rest/Rest.jsx";
import NavbarMenu from "../NavbarMenu";
import SFormsModal from "../sform/SFormsModal";
import ModuleTypesSelection from "../ModuleTypesSelection";
Expand All @@ -31,24 +24,31 @@ import SFormsFunctionModal from "../sform/SFormsFunctionModal";
import "@kbss-cvut/s-forms/css";
import Loading from "../Loading";
import ErrorModal from "../modal/ErrorModal";
const TYPE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-module-type";
const LABEL = "http://www.w3.org/2000/01/rdf-schema#label";
const X = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-x-coordinate";
const Y = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-y-coordinate";
const EDGE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/consists-of-edge";
const SOURCE_NODE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-source-node";
const DESTINATION_NODE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-destination-node";
const NODE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/consists-of-node";
const ICON = "http://topbraid.org/sparqlmotion#icon";
const COMMENT = "http://www.w3.org/2000/01/rdf-schema#comment";
const ANSWERS = "http://onto.fel.cvut.cz/ontologies/documentation/has_answer";
const OBJECT_VALUE = "http://onto.fel.cvut.cz/ontologies/documentation/has_object_value";
const COMPONENT = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/component";
const FUNCTION_LOCAL_NAME = "http://onto.fel.cvut.cz/ontologies/s-pipes/has-function-local-name";
const FUNCTION_URI = "http://onto.fel.cvut.cz/ontologies/s-pipes/has-function-uri";
const INPUT_PARAMETER = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-input-parameter";
const OUTPUT_PARAMETER = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-output-parameter";
const GROUP = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/group";
import {
TYPE,
LABEL,
X,
Y,
EDGE,
SOURCE_NODE,
DESTINATION_NODE,
NODE,
ICON,
COMMENT,
ANSWERS,
OBJECT_VALUE,
COMPONENT,
FUNCTION_LOCAL_NAME,
FUNCTION_URI,
INPUT_PARAMETER,
OUTPUT_PARAMETER,
GROUP,
MODULE_URI,
MODULE_VARIABLE_NAME,
MODULE_VARIABLE_VALUE,
MODULE_VARIABLES,
SCRIPT_PATH,
} from "../../constants/Vocabulary.js";

const rankDirOptions = [
// preset
Expand Down
1 change: 0 additions & 1 deletion src/components/modal/ErrorModal.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";

import { Button, Form, Modal } from "react-bootstrap";
import { Rest } from "../rest/Rest";

class ErrorModal extends React.Component {
constructor(props) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/MoveModuleModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
FINISH_DATE_UNIX,
MODULE_URI,
ONTOLOGY_URI,
Rest,
RULE_COMMENT,
SCRIPT_PATH,
START_DATE_UNIX,
TRANSFORMATION,
} from "../rest/Rest";
} from "../../constants/Vocabulary.js";
import Rest from "../rest/Rest.jsx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons";
import { Link } from "react-router-dom";
Expand Down
3 changes: 1 addition & 2 deletions src/components/modal/ScriptActionsModuleModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import {
FINISH_DATE_UNIX,
MODULE_URI,
ONTOLOGY_URI,
Rest,
RULE_COMMENT,
SCRIPT_PATH,
START_DATE_UNIX,
TRANSFORMATION,
} from "../rest/Rest";
} from "../../constants/Vocabulary.js";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons";
import { Link } from "react-router-dom";
Expand Down
3 changes: 1 addition & 2 deletions src/components/modal/ScriptExecutionModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {
MODULE_EXECUTION_START_DATE,
MODULE_EXECUTION_DURATION,
MODULE_URI,
Rest,
MODULE_INPUT_PATH,
MODULE_OUTPUT_PATH,
EXECUTION_VARIABLE,
MODULE_VARIABLES,
MODULE_VARIABLE_NAME,
MODULE_VARIABLE_VALUE,
} from "../rest/Rest";
} from "../../constants/Vocabulary.js";
import { faDownload, faMugHot } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

Expand Down
3 changes: 1 addition & 2 deletions src/components/modal/ScriptOntologyModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import {
FINISH_DATE_UNIX,
MODULE_URI,
ONTOLOGY_URI,
Rest,
RULE_COMMENT,
SCRIPT_PATH,
START_DATE_UNIX,
TRANSFORMATION,
} from "../rest/Rest";
} from "../../constants/Vocabulary.js";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEdit, faMugHot, faPlayCircle, faPlusCircle, faTrash } from "@fortawesome/free-solid-svg-icons";
import { Link } from "react-router-dom";
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/ValidationReportModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
EXECUTION_DURATION,
FINISH_DATE_UNIX,
MODULE_URI,
Rest,
RULE_COMMENT,
START_DATE_UNIX,
TRANSFORMATION,
} from "../rest/Rest";
} from "../../constants/Vocabulary.js";
import Rest from "../rest/Rest.jsx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons";
import { Link } from "react-router-dom";
Expand Down
Loading

0 comments on commit 62469d0

Please sign in to comment.