diff --git a/src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js b/src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js
index f2c109e2..07e08fd9 100644
--- a/src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js
+++ b/src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js
@@ -1,113 +1,153 @@
// src/views/builder/BuilderView/ColorCoded/ExtensionDomain.js
-import React, { useState } from 'react';
-import {
- Card,
- CardActionArea,
- CardContent,
- TextField,
- Typography,
-} from '@material-ui/core';
+import React from 'react';
+import { withStyles, Typography } from '@material-ui/core';
+import Table from '@material-ui/core/Table';
+import TableBody from '@material-ui/core/TableBody';
+import TableCell from '@material-ui/core/TableCell';
+import TableHead from '@material-ui/core/TableHead';
+import TableRow from '@material-ui/core/TableRow';
import HelpIcon from '@material-ui/icons/Help';
import Button from '@material-ui/core/Button';
-import PropTypes from 'prop-types';
-import Extension from 'src/components/Extension';
+import TextField from '@material-ui/core/TextField';
+import Card from '@material-ui/core/Card';
+import Linker from './components/Linker';
+
+// Cell styling
+const StyledCell = withStyles({
+ root: {
+ color: 'black'
+ },
+ bordered: {
+ border: '1px solid black'
+ }
+})(TableCell);
// Pass an object and whether its keys are properties.
export default function ExtensionDomain({ items }) {
- const [newSchema, setNewSchema] = useState();
+ const classes = withStyles();
+
+ const setInput = (value, i) => {
+ const holder = items.exd;
+ holder[i] = JSON.parse(value);
+ items.setExd(holder);
+ console.log('working?', items.exd[i]);
+ };
const addRows = () => {
- fetch(newSchema)
- .then((response) => response.json())
- .then((jsonData) => {
- console.log(jsonData);
- if (!items.exd) {
- const holder = [];
- holder.push({
- extension_schema: newSchema
- });
- items.setExd(holder);
- } else {
- const holder = items.exd;
- holder.push({
- extension_schema: newSchema
- });
- items.setExd(holder);
- }
- })
- .catch((error) => {
- console.log(`ERROR: ${error}`);
- alert(`Fetch schema from '${newSchema}' FAILED: ${error}`);
+ console.log('add Rows', items);
+ if (!items.exd) {
+ const holder = [];
+ holder.push({
+ extension_schema: ''
});
- setNewSchema('');
+ items.setExd(holder);
+ } else {
+ const holder = items.exd;
+ holder.push({
+ extension_schema: ''
+ })
+ items.setExd(holder);
+ }
+ items.setRerender(items.rerender + 1);
};
- const removeRows = (index) => {
- items.setExd(items.exd.filter(((o, i) => index !== i)));
+ const removeRows = (which) => {
+ const holder = items.exd;
+ holder.splice(which, 1);
+ items.setExd(holder);
+ items.setRerender(items.rerender + 1);
};
-
- const link = 'https://docs.biocomputeobject.org/extension-domain/';
+ // useEffect(() => {
+ // if (!items.exd) {
+ // console.log('No Extension');
+ // } else {
+ // for (let extensionIndex = 0; extensionIndex < items.exd.length; extensionIndex++) {
+ // const schemaURL = items.exd[extensionIndex].extension_schema;
+ // console.log('Extension schema', schema);
+ // fetch(schemaURL)
+ // .then((response) => response.json())
+ // .then((jsonData) => {
+ // schemaList.push(jsonData);
+ // console.log(jsonData);
+ // })
+ // .catch((error) => {
+ // // handle your errors here
+ // console.error(error);
+ // });
+ // }
+ // setSchema(schemaList);
+ // }
+ // }, [items.exd]);
return (
-