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

UI: Support new parameters in Trial template #1363

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
100 changes: 72 additions & 28 deletions pkg/ui/v1beta1/frontend/src/actions/generalActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,67 @@ export const closeDialogSuggestion = () => ({
type: CLOSE_DIALOG_SUGGESTION,
});

export const FETCH_EXPERIMENTS_REQUEST = 'FETCH_EXPERIMENTS_REQUEST';
export const FETCH_EXPERIMENTS_SUCCESS = 'FETCH_EXPERIMENTS_SUCCESS';
export const FETCH_EXPERIMENTS_FAILURE = 'FETCH_EXPERIMENTS_FAILURE';

export const fetchExperiments = () => ({
type: FETCH_EXPERIMENTS_REQUEST,
});

export const FILTER_EXPERIMENTS = 'FILTER_EXPERIMENTS';

export const filterExperiments = (experimentName, experimentNamespace) => ({
type: FILTER_EXPERIMENTS,
experimentName,
experimentNamespace,
});

export const CHANGE_STATUS = 'CHANGE_STATUS';

export const changeStatus = (filter, checked) => ({
type: CHANGE_STATUS,
filter,
checked,
});

export const CHANGE_TRIAL_TEMPLATE_SOURCE = 'CHANGE_TRIAL_TEMPLATE_SOURCE';

export const changeTrialTemplateSource = source => ({
type: CHANGE_TRIAL_TEMPLATE_SOURCE,
source,
});

export const ADD_PRIMARY_POD_LABEL = 'ADD_PRIMARY_POD_LABEL';

export const addPrimaryPodLabel = () => ({
type: ADD_PRIMARY_POD_LABEL,
});

export const CHANGE_PRIMARY_POD_LABEL = 'CHANGE_PRIMARY_POD_LABEL';

export const changePrimaryPodLabel = (fieldName, index, value) => ({
type: CHANGE_PRIMARY_POD_LABEL,
fieldName,
index,
value,
});

export const DELETE_PRIMARY_POD_LABEL = 'DELETE_PRIMARY_POD_LABEL';

export const deletePrimaryPodLabel = index => ({
type: DELETE_PRIMARY_POD_LABEL,
index,
});

export const CHANGE_TRIAL_TEMPLATE_SPEC = 'CHANGE_TRIAL_TEMPLATE_SPEC';

export const changeTrialTemplateSpec = (name, value) => ({
type: CHANGE_TRIAL_TEMPLATE_SPEC,
name,
value,
});

export const FILTER_TEMPLATES_EXPERIMENT = 'FILTER_TEMPLATES_EXPERIMENT';

export const filterTemplatesExperiment = (
Expand All @@ -104,43 +165,26 @@ export const filterTemplatesExperiment = (
configMapPathIndex,
});

export const VALIDATION_ERROR = 'VALIDATION_ERROR';
export const CHANGE_TRIAL_TEMPLATE_YAML = 'CHANGE_TRIAL_TEMPLATE_YAML';

export const validationError = message => ({
type: VALIDATION_ERROR,
message,
export const changeTrialTemplateYAML = templateYAML => ({
type: CHANGE_TRIAL_TEMPLATE_YAML,
templateYAML,
});

export const EDIT_TRIAL_PARAMETERS = 'EDIT_TRIAL_PARAMETERS';
export const CHANGE_TRIAL_PARAMETERS = 'CHANGE_TRIAL_PARAMETERS';

export const editTrialParameters = (index, name, reference, description) => ({
type: EDIT_TRIAL_PARAMETERS,
export const changeTrialParameters = (index, name, reference, description) => ({
type: CHANGE_TRIAL_PARAMETERS,
index,
name,
reference,
description,
});

export const FETCH_EXPERIMENTS_REQUEST = 'FETCH_EXPERIMENTS_REQUEST';
export const FETCH_EXPERIMENTS_SUCCESS = 'FETCH_EXPERIMENTS_SUCCESS';
export const FETCH_EXPERIMENTS_FAILURE = 'FETCH_EXPERIMENTS_FAILURE';

export const fetchExperiments = () => ({
type: FETCH_EXPERIMENTS_REQUEST,
});

export const FILTER_EXPERIMENTS = 'FILTER_EXPERIMENTS';

export const filterExperiments = (experimentName, experimentNamespace) => ({
type: FILTER_EXPERIMENTS,
experimentName,
experimentNamespace,
});

export const CHANGE_STATUS = 'CHANGE_STATUS';
export const VALIDATION_ERROR = 'VALIDATION_ERROR';

export const changeStatus = (filter, checked) => ({
type: CHANGE_STATUS,
filter,
checked,
export const validationError = message => ({
type: VALIDATION_ERROR,
message,
});
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class MetricsCollectorSpec extends React.Component {
<Tooltip title={'Yaml structure for the custom metrics collector container'}>
<HelpOutlineIcon className={classes.help} color={'primary'} />
</Tooltip>
{'Yaml for the Custom Container'}
{'YAML for the Custom Container'}
</Typography>
</Grid>
<Grid item xs={6}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Typography from '@material-ui/core/Typography';
import TextField from '@material-ui/core/TextField';
import HelpOutlineIcon from '@material-ui/icons/HelpOutline';

import { editTrialParameters } from '../../../../../actions/generalActions';
import { changeTrialParameters } from '../../../../../actions/generalActions';
import { GENERAL_MODULE } from '../../../../../constants/constants';

const useStyles = makeStyles({
Expand Down Expand Up @@ -36,21 +36,21 @@ const TrialParameters = props => {
let param = props.trialParameters[index];
let reference = param.reference;
let description = param.description;
props.editTrialParameters(index, event.target.value, reference, description);
props.changeTrialParameters(index, event.target.value, reference, description);
};

const onReferenceChange = index => event => {
let param = props.trialParameters[index];
let name = param.name;
let description = param.description;
props.editTrialParameters(index, name, event.target.value, description);
props.changeTrialParameters(index, name, event.target.value, description);
};

const onDescriptionChange = index => event => {
let param = props.trialParameters[index];
let name = param.name;
let reference = param.reference;
props.editTrialParameters(index, name, reference, event.target.value);
props.changeTrialParameters(index, name, reference, event.target.value);
};

return (
Expand Down Expand Up @@ -121,4 +121,4 @@ const mapStateToProps = state => {
};
};

export default connect(mapStateToProps, { editTrialParameters })(TrialParameters);
export default connect(mapStateToProps, { changeTrialParameters })(TrialParameters);
Loading