Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature

This commit is contained in:
vpopescu
2022-09-22 15:11:42 +02:00

View File

@@ -2,9 +2,7 @@ import React, { useState, useEffect } from "react";
import "./table-select.css";
import PropTypes from "prop-types";
const DynamicTable = (props) => {
var [message, setMessage] = useState(""),
[message2, setMessage2] = useState("");
var { current_propobject } = props;
@@ -18,12 +16,11 @@ const DynamicTable = (props) => {
var updateMessageKey = (event) => {
setMessage(event.target.value);
}
};
var updateMessageValue = (event) => {
setMessage2(event.target.value);
}
};
const handleRefresh = () => {
var propobject = {};
propkeys.forEach((key, i) => (propobject[key] = propvalues[i]));
props.setProp(propobject);
@@ -31,8 +28,7 @@ const DynamicTable = (props) => {
props.setPropValues(propvalues);
setMessage("");
setMessage2("");
}
};
const handleClick = () => {
if (message != "") {
@@ -57,8 +53,7 @@ const DynamicTable = (props) => {
console.log(propkeys);
console.log(propvalues);
console.log(propobject);
}
};
const renderKeyRows = () => {
return propkeys.map(function (o, i) {
@@ -79,7 +74,7 @@ const DynamicTable = (props) => {
}
setOwnKeys(propkeys);
props.setPropKeys(propkeys);
props.setProp(propobject)
props.setProp(propobject);
handleRefresh();
}}
/>
@@ -87,9 +82,8 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
const renderValueRows = () => {
return propvalues.map(function (o, i) {
//console.log("ValRows" +i)
//console.log("ValRows" +o)
@@ -111,9 +105,8 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
const renderDelete = () => {
return propvalues.map(function (o, i) {
return (
<tr key={"item-" + i}>
@@ -139,9 +132,7 @@ const DynamicTable = (props) => {
</tr>
);
});
}
};
return (
<div>
@@ -194,7 +185,7 @@ const DynamicTable = (props) => {
<hr />
</div>
);
}
};
DynamicTable.propTypes = {
current_keys: PropTypes.array,
current_values: PropTypes.array,