You can now generate keys from the advanced settings interface

This commit is contained in:
Vertmo 2018-10-16 00:22:56 +02:00 committed by Cassie Tarakajian
parent cd21e9ae72
commit 64caab0702
3 changed files with 9 additions and 9 deletions

View file

@ -1,5 +1,6 @@
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import axios from 'axios'; import axios from 'axios';
import crypto from 'crypto';
import * as ActionTypes from '../../constants'; import * as ActionTypes from '../../constants';
import { showErrorModal, justOpenedProject } from '../IDE/actions/ide'; import { showErrorModal, justOpenedProject } from '../IDE/actions/ide';
import { showToast, setToastText } from '../IDE/actions/toast'; import { showToast, setToastText } from '../IDE/actions/toast';

View file

@ -1,11 +1,10 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { reduxForm } from 'redux-form'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import InlineSVG from 'react-inlinesvg'; import InlineSVG from 'react-inlinesvg';
import axios from 'axios';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions';
import AccountForm from '../components/AccountForm'; import AccountForm from '../components/AccountForm';
@ -114,10 +113,4 @@ AccountView.propTypes = {
theme: PropTypes.string.isRequired theme: PropTypes.string.isRequired
}; };
export default reduxForm({ export default connect(mapStateToProps, mapDispatchToProps)(AdvancedSettingsView);
form: 'updateAllSettings',
fields: ['username', 'email', 'currentPassword', 'newPassword'],
validate: validateSettings,
asyncValidate,
asyncBlurFields: ['username', 'email', 'currentPassword']
}, mapStateToProps, mapDispatchToProps)(AccountView);

View file

@ -31,9 +31,15 @@ const user = (state = { authenticated: false }, action) => {
return Object.assign({}, state, { emailVerificationTokenState: 'invalid' }); return Object.assign({}, state, { emailVerificationTokenState: 'invalid' });
case ActionTypes.SETTINGS_UPDATED: case ActionTypes.SETTINGS_UPDATED:
return { ...state, ...action.user }; return { ...state, ...action.user };
<<<<<<< HEAD
case ActionTypes.API_KEY_REMOVED: case ActionTypes.API_KEY_REMOVED:
return { ...state, ...action.user }; return { ...state, ...action.user };
case ActionTypes.API_KEY_CREATED: case ActionTypes.API_KEY_CREATED:
=======
case ActionTypes.REMOVED_API_KEY:
return { ...state, ...action.user };
case ActionTypes.ADDED_API_KEY:
>>>>>>> You can now generate keys from the advanced settings interface
return { ...state, ...action.user }; return { ...state, ...action.user };
default: default:
return state; return state;