Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFDE exportation empty domain #329

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions client/src/components/builder/errorDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import { updateBcoStatus, updateErrorDomain, updateModified } from "../../slices
import { FormObserver } from "./components";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
import Tooltip from "@mui/material/Tooltip";
import { colors } from "@mui/joy";

export const ErrorDomain = ({onSave}) => {
const dispatch = useDispatch()
const error_domain = useSelector(state => state.bco.data.error_domain)
const bco = useSelector(state => state.bco.data);
let has_error = "error_domain" in bco;
const errorDomain = has_error ? bco.error_domain : {};
const [writing, setWriting] = useState(false);
let has_empirical = "empirical_error" in error_domain;
let has_algorithmic = "algorithmic_error" in error_domain;
let has_empirical = "empirical_error" in errorDomain;
let has_algorithmic = "algorithmic_error" in errorDomain;
const [jsonErrors, setJsonErrors] = useState("");
const [algorithmic_error, setAlgo] = useState(has_algorithmic ? error_domain.algorithmic_error : {})
const [empirical_error, setEmp ] = useState(has_empirical ? error_domain.empirical_error : {})
const [algorithmic_error, setAlgo] = useState(has_algorithmic ? errorDomain.algorithmic_error : {})
const [empirical_error, setEmp ] = useState(has_empirical ? errorDomain.empirical_error : {})

const setInput = (target) => {
setWriting(true)
Expand All @@ -38,18 +39,12 @@ export const ErrorDomain = ({onSave}) => {
};

const defaultAlgorithmicError = `{
"algorithmic_error": {
"false_positive_mutation_calls": "<0.00005",
"false_discovery": "0.005"
}
"algorithmic_error": {}
}`;

const defaultEmpiricalError = `{
"empirical_error": {
"false_negative_alignment_hits": "<0.0010",
"false_discovery": "<0.05"
}
}`
"empirical_error": {}
}`;

return (
<Card className="object-domain">
Expand Down
23 changes: 6 additions & 17 deletions client/src/components/builder/extensionDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,18 @@ import { Card, CardContent, TextField, Typography, Grid, Button, Paper, CardHead
import { addExtensionDomain, getExtension, deleteExtensionDomain, updateModified } from "../../slices/bcoSlice"
import { Extension } from "./extension";
import { Next } from "./components";
import AddCircleIcon from '@mui/icons-material/AddCircle';
import RemoveCircleIcon from '@mui/icons-material/RemoveCircle';
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
import AddCircleIcon from "@mui/icons-material/AddCircle";
import RemoveCircleIcon from "@mui/icons-material/RemoveCircle";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
import Tooltip from "@mui/material/Tooltip";

export const ExtensionDomain = ({onSave}) => {
const dispatch = useDispatch();
const extensionDomain = useSelector(state => state.bco.data.extension_domain)
const bco = useSelector(state => state.bco.data)
let has_extension = "extension_domain" in bco
const extensionDomain = has_extension ? bco.extension_domain : [];
const [newSchema, setNewSchema] = React.useState("")

const errorSchema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
}

const addExtension = async () => {
dispatch(getExtension({newSchema}))
.unwrap()
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export default function BuilderColorCode () {
dispatch(getTempDraftBco(queryString))
}
}, [])

useEffect(() => {
if (validURL(bco["object_id"]) === true) {
if (validURL(bco["object_id"]) === true && bco["object_id"].indexOf("?") === -1) {
navigate(`/builder?${bco["object_id"]}`);
}
}, [bco])
Expand Down Expand Up @@ -134,7 +134,7 @@ export default function BuilderColorCode () {
? (<>
<CardHeader title="BCO Errors"/>
<CardContent>
<ReactJson src={bcoError[0]}/>
<ReactJson src={bcoError}/>
</CardContent>
</>)
: (<></>)
Expand Down
15 changes: 2 additions & 13 deletions client/src/components/builder/specialFeilds.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import React, { useState } from "react";
import React from "react";
import { useField, useFormikContext} from "formik";
import { Box, MenuItem, TextField } from "@material-ui/core";
import { Chip, FormControl, InputLabel, OutlinedInput, Select } from "@mui/material";
import { DateTimePicker } from "@mui/x-date-pickers/DateTimePicker";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import Checkbox from '@mui/material/Checkbox';

const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
};
import { FormHelperText } from "@mui/material";

export const MyTextField = ({placeholder,label, isFullWidth, isRequired, type, isDisabled,...props}) => {
const [field, meta] = useField(props);
Expand Down
Loading