Commit 4206c98f authored by Matthieu Lamalle's avatar Matthieu Lamalle
Browse files

Merge branch 'fix_syntax' into 'develop'

remove debug logs and fix syntax

See merge request !4
parents 5a3baa29 81bbb700
......@@ -11,7 +11,6 @@ export const SETTINGS_GET_SUCCESS = 'SETTINGS_GET_SUCCESS';
export const SETTINGS_GET_FAILURE = 'SETTINGS_GET_FAILURE';
function getSetting(username) {
console.log(username)
return (dispatch) => {
dispatch(request(username));
......
......@@ -62,9 +62,7 @@ export function withForm(validators = {}) {
handleChange(evt) {
const { name, value, type } = evt.target;
if (type === "checkbox"){
console.log(value)
let valcheck = value === 'true' ? false : true
console.log(valcheck)
let valcheck = value === 'true' ? false : true;
this.setFieldValue(name, valcheck);
}else {
const errorMessage = this.validate(name, value, false);
......
......@@ -58,21 +58,18 @@ class JobsPage extends React.Component {
render() {
const { history } = this.props;
const { jobId } = this.state;
console.log(history.goBack)
return (
<Page title={`Détails du job #${jobId}`} navRight={
<div>
<Button color="inherit">
<JobsNavRight onRefresh={this.onRefresh} />
</Button>
<Button onClick={history.goBack} color="inherit">
<CloseIcon />
Fermer
</Button>
</div>
<Button color="inherit">
<JobsNavRight onRefresh={this.onRefresh} />
</Button>
<Button onClick={history.goBack} color="inherit">
<CloseIcon />
Fermer
</Button>
</div>
}>
{ this.renderContent() }
</Page>
......
......@@ -30,8 +30,8 @@ class PreferencesDetail extends React.Component {
componentDidMount() {
const { user } = this.props;
this.setState(() => {
this.props.dispatch(settingsActions.getSetting(user.username))
})
this.props.dispatch(settingsActions.getSetting(user.username));
});
}
componentDidUpdate() {
......@@ -42,7 +42,7 @@ class PreferencesDetail extends React.Component {
saveSettings() {
this.setState({ isSaving: true }, () => {
const { form, user } = this.props;
const data_settings = form.data
const data_settings = form.data;
let savePromise;
if (form.data) { // Modification d'un serveur existant
......@@ -50,9 +50,9 @@ class PreferencesDetail extends React.Component {
this.setState({isSaving: false});
}
savePromise.catch(err => {
form.reset();
throw err;
});
form.reset();
throw err;
});
});
}
......@@ -65,9 +65,8 @@ class PreferencesDetail extends React.Component {
lastname: '',
firstname: '',
email: '',
alertes: 'false',
}
console.log(settings)
alertes: 'false'
};
return((!isLoading ) && settings &&
<div className={classes.content}>
<form name="form" onSubmit={this.handleSubmit}>
......@@ -104,13 +103,13 @@ class PreferencesDetail extends React.Component {
onChange={ form.onChange }
/>
<TextField
id="email"
label="email"
className={classes.textField}
disabled={isLoading || isSaving}
name="email"
value={ form.field('email', email) || email }
onChange={ form.onChange }
id="email"
label="email"
className={classes.textField}
disabled={isLoading || isSaving}
name="email"
value={ form.field('email', email) || email }
onChange={ form.onChange }
/>
<FormControlLabel
labelPlacement='end'
......@@ -125,7 +124,7 @@ class PreferencesDetail extends React.Component {
onChange={ form.onChange }
/>
}
/>
/>
</div>
</Grid>
......@@ -200,11 +199,11 @@ const mapStateToProps = ({ settings, auth }) => {
const managedFormPreferencesPage = withForm({
sshkey: (value, formData, submitting) => {},
firstname: (value, formData, submitting) => {},
lastname: (value, formData, submitting) => {},
email: (value, formData, submitting) => {},
alertes: (value, formData, submitting) => {},
sshkey: () => {},
firstname: () => {},
lastname: () => {},
email: () => {},
alertes: () => {},
})(PreferencesDetail);
const connectedPreferencesPage = connect(mapStateToProps)(managedFormPreferencesPage);
......
......@@ -12,13 +12,10 @@ export function selectServerModelsWithFilter(servermodelsIndex, filter) {
'servermodeldescription',
'subreleasename'
];
console.log(servermodelsIndex)
return Object.keys(servermodelsIndex)
.reduce((result, servermodelId) => {
const servermodel = servermodelsIndex[servermodelId];
console.log("servermodel",servermodel)
if ( props.some(p => re.test(servermodel.model[p])) ) result.push(servermodel);
console.log(result)
return result;
}, []);
......
......@@ -3,12 +3,10 @@ export function selectServerById(serversIndex, serverId) {
}
export function selectAllServers(serversIndex) {
console.log('selectAllServers')
return Object.keys(serversIndex).map(serverId => serversIndex[serverId]);
}
export function selectServersWithFilter(serversIndex, filter) {
console.log('selectServersWithFilter')
const re = new RegExp(filter, 'i');
const props = [
'servername',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment