Skip to content

Commit

Permalink
Select objectiveType from the list (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvelich authored and k8s-ci-robot committed Jun 18, 2019
1 parent c81692c commit 855f75c
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 69 deletions.
6 changes: 3 additions & 3 deletions pkg/ui/v1alpha2/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"main.js": "./static/js/main.bf4e0f37.chunk.js",
"main.js": "./static/js/main.8ac4c65c.chunk.js",
"runtime~main.js": "./static/js/runtime~main.d653cc00.js",
"static/css/2.3e32d45a.chunk.css": "./static/css/2.3e32d45a.chunk.css",
"static/js/2.f25c288f.chunk.js": "./static/js/2.f25c288f.chunk.js",
"static/js/2.ae40dfca.chunk.js": "./static/js/2.ae40dfca.chunk.js",
"index.html": "./index.html",
"precache-manifest.688d4f0a6a704321c7606d0910c524a0.js": "./precache-manifest.688d4f0a6a704321c7606d0910c524a0.js",
"precache-manifest.bbb166e00cf4999bf8bab23e184dda32.js": "./precache-manifest.bbb166e00cf4999bf8bab23e184dda32.js",
"service-worker.js": "./service-worker.js"
}
2 changes: 1 addition & 1 deletion pkg/ui/v1alpha2/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script type="text/javascript" src="https://d3js.org/d3.v5.min.js"></script><script type="text/javascript" src="https://underscorejs.org/underscore-min.js"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/mode-xml.js"></script><script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script><meta charset="utf-8"/><link rel="shortcut icon" href="./logo.png"/><meta http-equiv="Access-Control-Allow-Origin" content="*"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><style>body{background-color:#f7f7f7,}</style><title>Katib UI</title><link href="./static/css/2.3e32d45a.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="./";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="./static/js/2.f25c288f.chunk.js"></script><script src="./static/js/main.bf4e0f37.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script type="text/javascript" src="https://d3js.org/d3.v5.min.js"></script><script type="text/javascript" src="https://underscorejs.org/underscore-min.js"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/mode-xml.js"></script><script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script><meta charset="utf-8"/><link rel="shortcut icon" href="./logo.png"/><meta http-equiv="Access-Control-Allow-Origin" content="*"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><style>body{background-color:#f7f7f7,}</style><title>Katib UI</title><link href="./static/css/2.3e32d45a.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="./";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="./static/js/2.ae40dfca.chunk.js"></script><script src="./static/js/main.8ac4c65c.chunk.js"></script></body></html>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
self.__precacheManifest = [
{
"revision": "8c97409f0ee389fe75da",
"url": "./static/js/runtime~main.d653cc00.js"
},
{
"revision": "91061d47dcbdbf88f1e6",
"url": "./static/js/main.8ac4c65c.chunk.js"
},
{
"revision": "1356e6af903ab0f4271c",
"url": "./static/js/2.ae40dfca.chunk.js"
},
{
"revision": "1356e6af903ab0f4271c",
"url": "./static/css/2.3e32d45a.chunk.css"
},
{
"revision": "58c8a0b24f15ef69047d2b581c310099",
"url": "./index.html"
}
];
2 changes: 1 addition & 1 deletion pkg/ui/v1alpha2/frontend/build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(
"./precache-manifest.688d4f0a6a704321c7606d0910c524a0.js"
"./precache-manifest.bbb166e00cf4999bf8bab23e184dda32.js"
);

workbox.clientsClaim();
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import IconButton from '@material-ui/core/IconButton';
import DeleteIcon from '@material-ui/icons/Delete';
import Fab from '@material-ui/core/Fab';
import AddIcon from '@material-ui/icons/Add';

import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
import InputLabel from '@material-ui/core/InputLabel';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import MenuItem from '@material-ui/core/MenuItem';

import { changeObjective, addMetrics, editMetrics, deleteMetrics } from '../../../../actions/hpCreateActions';

Expand All @@ -32,15 +36,19 @@ const useStyles = makeStyles({
padding: 2,
marginBottom: 10,
},
selectBox: {
width: 150
}
})

const Objective = (props) => {

const classes = useStyles();

const onObjectiveChange = (name) => (event) => {
props.changeObjective(name, event.target.value);
}
props.changeObjective(name, event.target.value);
}

const onMetricsEdit = (index) => (event) => {
props.editMetrics(index, event.target.value);
}
Expand All @@ -53,25 +61,60 @@ const Objective = (props) => {
<div>
{props.objective.map((param, i) => {
return (
<div key={i} className={classes.parameter}>
<Grid container alignItems={"center"}>
<Grid item xs={12} sm={3}>
<Typography variant={"subheading"}>
<Tooltip title={param.description}>
<HelpOutlineIcon className={classes.help} color={"primary"}/>
</Tooltip>
{param.name}
</Typography>
param.name === "Type" ?
<div key={i} className={classes.parameter}>
<Grid container alignItems={"center"}>
<Grid item xs={12} sm={3}>
<Typography>
<Tooltip title={param.description}>
<HelpOutlineIcon className={classes.help} color={"primary"}/>
</Tooltip>
{param.name}
</Typography>
</Grid>
<Grid item xs={12} sm={8}>
<FormControl variant="outlined" className={classes.formControl}>
<InputLabel>
Objective Type
</InputLabel>
<Select
value={param.value}
onChange={onObjectiveChange(param.name)}
input={
<OutlinedInput labelWidth={160}/>
}
className={classes.selectBox}
>
{props.allObjectiveTypes.map((type, i) => {
return (
<MenuItem value={type} key={i}>{type}</MenuItem>
)
})}
</Select>
</FormControl>
</Grid>
</Grid>
<Grid item xs={12} sm={8}>
<TextField
className={classes.textField}
value={param.value}
onChange={onObjectiveChange(param.name)}
/>
</div>
:
<div key={i} className={classes.parameter}>
<Grid container alignItems={"center"}>
<Grid item xs={12} sm={3}>
<Typography variant={"subheading"}>
<Tooltip title={param.description}>
<HelpOutlineIcon className={classes.help} color={"primary"}/>
</Tooltip>
{param.name}
</Typography>
</Grid>
<Grid item xs={12} sm={8}>
<TextField
className={classes.textField}
value={param.value}
onChange={onObjectiveChange(param.name)}
/>
</Grid>
</Grid>
</Grid>
</div>
</div>
)
})}
<div className={classes.parameter}>
Expand Down Expand Up @@ -126,6 +169,7 @@ const Objective = (props) => {

const mapStateToProps = state => {
return {
allObjectiveTypes: state[module].allObjectiveTypes,
objective: state[module].objective,
additionalMetricNames: state[module].additionalMetricNames
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const useStyles = makeStyles({
fab: {
margin: 2,
},
section: {
marginTop: 20
}
})

const SectionInTypography = (name, classes, variant) => {
Expand Down
Loading

0 comments on commit 855f75c

Please sign in to comment.