diff --git a/ui/src/account_settings/index.js b/ui/src/account_settings/index.js
deleted file mode 100644
index da30804b7..000000000
--- a/ui/src/account_settings/index.js
+++ /dev/null
@@ -1,135 +0,0 @@
-import React, {PropTypes} from 'react';
-import {meShow, meUpdate} from 'shared/apis';
-import FlashMessages from 'shared/components/FlashMessages';
-
-const {func} = PropTypes;
-const AccountSettingsPage = React.createClass({
- propTypes: {
- addFlashMessage: func.isRequired,
- },
-
- getInitialState() {
- return {};
- },
-
- componentDidMount() {
- meShow().then(({data: user}) => {
- this.setState({user});
- });
- },
-
- handleSubmit(e) {
- e.preventDefault();
- const email = this.email.value;
- const lastName = this.lastName.value;
- const firstName = this.firstName.value;
- const newUser = Object.assign({}, this.state.user, {lastName, firstName, email});
- meUpdate(newUser).then(() => {
- this.props.addFlashMessage({
- text: 'User updated successfully',
- type: 'success',
- });
- }).catch((err) => {
- this.props.addFlashMessage({
- text: err.toString(),
- type: 'error',
- });
- });
- },
-
- handleChangePassword(e) {
- e.preventDefault();
- const password = this.newPassword.value;
- const confirmation = this.newPasswordConfirmation.value;
- const newUser = Object.assign({}, this.state.user, {password, confirmation});
- meUpdate(newUser).then(() => {
- this.props.addFlashMessage({
- text: 'Password updated successfully',
- type: 'success',
- });
-
- // reset the form fields
- this.newPassword.value = '';
- this.newPasswordConfirmation.value = '';
- }).catch(() => {
- this.props.addFlashMessage({
- text: 'Passwords did not match',
- type: 'error',
- });
- });
- },
-
- render() {
- const {user} = this.state;
- if (!user) {
- return null; // or something else, idk
- }
-
- return (
-
- );
- },
-});
-
-export default FlashMessages(AccountSettingsPage);
diff --git a/ui/src/index.js b/ui/src/index.js
index 97d1c8b24..3c25526c4 100644
--- a/ui/src/index.js
+++ b/ui/src/index.js
@@ -14,10 +14,8 @@ import DataExplorer from 'src/chronograf';
import DatabaseManager from 'src/database_manager';
import SignUp from 'src/sign_up';
import SelectSourcePage from 'src/select_source';
-import {UsersPage, UserEditPage} from 'src/web_users';
import {ClusterAccountsPage, ClusterAccountPage} from 'src/cluster_accounts';
import {RolesPageContainer, RolePageContainer} from 'src/access_control';
-import AccountSettingsPage from 'src/account_settings';
import NotFound from 'src/shared/components/NotFound';
import NoClusterError from 'src/shared/components/NoClusterError';
import configureStore from 'src/store/configureStore';
@@ -121,6 +119,7 @@ const Root = React.createClass({
+
@@ -136,10 +135,7 @@ const Root = React.createClass({
-
-
-
diff --git a/ui/src/side_nav/components/SideNav.js b/ui/src/side_nav/components/SideNav.js
index 8bff3b491..93593871b 100644
--- a/ui/src/side_nav/components/SideNav.js
+++ b/ui/src/side_nav/components/SideNav.js
@@ -17,13 +17,18 @@ const SideNav = React.createClass({
-
-
- Users
+
+
+ Host List
+
+
+
+ Data Explorer
-
+
Overview
+ Manage Sources
Queries
Tasks
Roles
@@ -31,19 +36,6 @@ const SideNav = React.createClass({
Database Manager
Retention Policies
-
-
- Data Explorer
-
-
-
- Settings
- Logout
-
-
-
- Host List
-
);
},
diff --git a/ui/src/web_users/components/PageHeader.js b/ui/src/web_users/components/PageHeader.js
deleted file mode 100644
index db89b06fc..000000000
--- a/ui/src/web_users/components/PageHeader.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import React, {PropTypes} from 'react';
-
-const {string} = PropTypes;
-const Header = React.createClass({
- propTypes: {
- activeCluster: string.isRequired,
- },
-
- render() {
- return (
-
-
-
-
-
- Web Users
-
-
-
-
-
-
-
-
- );
- },
-});
-
-export default Header;
diff --git a/ui/src/web_users/components/modals/AddClusterLinksModal.js b/ui/src/web_users/components/modals/AddClusterLinksModal.js
deleted file mode 100644
index 5a1f0ad49..000000000
--- a/ui/src/web_users/components/modals/AddClusterLinksModal.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import React, {PropTypes} from 'react';
-import AddClusterAccounts from 'src/shared/components/AddClusterAccounts';
-import {getClusters} from 'shared/apis';
-
-const {func, shape, string} = PropTypes;
-const AddClusterLinksModal = React.createClass({
- propTypes: {
- user: shape({name: string.isRequired}).isRequired,
- onAddClusterAccount: func.isRequired,
- onCreateClusterLinks: func.isRequired,
- },
-
- getInitialState() {
- return {
- clusters: [],
- clusterLinks: {},
- };
- },
-
- componentDidMount() {
- getClusters().then(({data: clusters}) => {
- this.setState({clusters});
- });
- },
-
- handleSelectClusterAccount({clusterID, accountName}) {
- const clusterLinks = Object.assign({}, this.state.clusterLinks, {
- [clusterID]: accountName,
- });
- this.setState({clusterLinks});
- this.props.onAddClusterAccount(clusterLinks);
- },
-
- handleSubmit(e) {
- e.preventDefault();
- $('#addClusterAccountModal').modal('hide'); // eslint-disable-line no-undef
- this.props.onCreateClusterLinks();
- },
-
- render() {
- return (
-
-
-
-
-
-
Add Cluster Accounts to {this.props.user.name}
-
-
-
-
-
- );
- },
-});
-
-export default AddClusterLinksModal;
diff --git a/ui/src/web_users/components/modals/DeleteUsers.js b/ui/src/web_users/components/modals/DeleteUsers.js
deleted file mode 100644
index 6d273977e..000000000
--- a/ui/src/web_users/components/modals/DeleteUsers.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, {PropTypes} from 'react';
-
-const {func, string, number, shape} = PropTypes;
-const DeleteUsersModal = React.createClass({
- propTypes: {
- handleConfirmDeleteUser: func.isRequired,
- userToDelete: shape({
- id: number.isRequired,
- name: string.isRequired,
- }).isRequired,
- },
-
- onConfirmDeleteUser() {
- this.props.handleConfirmDeleteUser(this.props.userToDelete.id);
- },
-
- render() {
- return (
-
-
-
-
-
-
{`Are you sure you want to delete ${this.props.userToDelete.name}?`}
-
-
-
-
-
-
-
-
- );
- },
-});
-
-export default DeleteUsersModal;
diff --git a/ui/src/web_users/components/modals/DissociateUserClusterLink.js b/ui/src/web_users/components/modals/DissociateUserClusterLink.js
deleted file mode 100644
index 90e8bfbea..000000000
--- a/ui/src/web_users/components/modals/DissociateUserClusterLink.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, {PropTypes} from 'react';
-
-const {func, string, number, shape} = PropTypes;
-const DissociateUserClusterLink = React.createClass({
- propTypes: {
- handleDissociate: func.isRequired,
- clusterLink: shape({
- id: number,
- name: string,
- cluster_user: string,
- }).isRequired,
- user: shape({
- name: string,
- }).isRequired,
- },
-
- onConfirmDissociate() {
- this.props.handleDissociate(this.props.clusterLink);
- },
-
- render() {
- const {clusterLink, user} = this.props;
- return (
-
-
-
-
-
- Are you sure you want to unlink {clusterLink.cluster_user} from {user.name}?
-
-
-
-
-
-
-
-
-
- );
- },
-});
-
-export default DissociateUserClusterLink;
diff --git a/ui/src/web_users/components/modals/InviteUser.js b/ui/src/web_users/components/modals/InviteUser.js
deleted file mode 100644
index 5cb95b844..000000000
--- a/ui/src/web_users/components/modals/InviteUser.js
+++ /dev/null
@@ -1,111 +0,0 @@
-import React, {PropTypes} from 'react';
-import {getClusters} from 'shared/apis';
-import FlashMessages from 'shared/components/FlashMessages';
-import ClusterAccounts from 'shared/components/AddClusterAccounts';
-import $ from 'jquery';
-
-const {string, func} = PropTypes;
-const InviteUserModal = React.createClass({
- propTypes: {
- clusterID: string.isRequired,
- addFlashMessage: func.isRequired,
- onCreateWebUser: func.isRequired,
- onSelectClusterAccount: func.isRequired,
- },
-
- getInitialState() {
- return {
- errors: null,
- clusters: [],
- clusterLinks: {},
- };
- },
-
- componentDidMount() {
- getClusters().then(({data}) => {
- this.setState({clusters: data});
- });
- },
-
- handleSubmit(e) {
- e.preventDefault();
- const firstName = this.firstName.value;
- const lastName = this.lastName.value;
- const email = this.email.value;
- const password = this.password.value;
-
- this.props.onCreateWebUser({clusterID: this.props.clusterID, firstName, lastName, email, password});
- this.cleanup();
- },
-
- render() {
- return (
-
-
-
-
-
-
Invite User
-
-
-
-
-
- );
- },
-
- cleanup() {
- $('.modal').hide();
- $('.modal-backdrop').hide();
-
- // reset form values
- this.firstName.value = '';
- this.lastName.value = '';
- this.email.value = '';
- this.password.value = '';
- },
-});
-
-export default FlashMessages(InviteUserModal);
diff --git a/ui/src/web_users/containers/UserEditPage.js b/ui/src/web_users/containers/UserEditPage.js
deleted file mode 100644
index 1cad5997a..000000000
--- a/ui/src/web_users/containers/UserEditPage.js
+++ /dev/null
@@ -1,250 +0,0 @@
-import React, {PropTypes} from 'react';
-import FlashMessages from 'shared/components/FlashMessages';
-import DissociateModal from '../components/modals/DissociateUserClusterLink';
-import AddClusterLinksModal from '../components/modals/AddClusterLinksModal';
-import {
- showUser,
- updateUser,
- deleteUserClusterLink,
- batchCreateUserClusterLink,
-} from 'shared/apis';
-
-const {func, string, shape} = PropTypes;
-const WebUserEdit = React.createClass({
- propTypes: {
- addFlashMessage: func.isRequired,
- params: shape({
- userID: string,
- clusterID: string,
- }),
- },
-
- getInitialState() {
- return {
- linkToDissociate: {},
- };
- },
-
- componentDidMount() {
- this.getPageData();
- },
-
- getPageData() {
- const {userID} = this.props.params;
- showUser(userID).then(({data}) => {
- this.setState({user: data});
- });
- },
-
- handleSubmit(e) {
- e.preventDefault();
- const email = this.email.value;
- const lastName = this.lastName.value;
- const firstName = this.firstName.value;
- const admin = this.admin.checked;
- const password = this.newPassword.value;
- const confirmation = this.newPasswordConfirmation.value;
- const newUser = Object.assign({}, this.state.user, {lastName, firstName, email, admin, password, confirmation});
-
- updateUser(this.props.params.userID, newUser).then(() => {
- this.props.addFlashMessage({
- text: 'User updated successfully',
- type: 'success',
- });
-
- this.newPassword.value = '';
- this.newPasswordConfirmation.value = '';
- }).catch((err) => {
- this.props.addFlashMessage({
- text: err.toString(),
- type: 'error',
- });
- });
- },
-
- handleAddClusterLinks(clusterLinks) {
- this.setState({clusterLinks});
- },
-
- handleCreateClusterLinks() {
- const {user} = this.state;
- const clusterLinks = this.getClusterLinks();
- batchCreateUserClusterLink(
- user.id,
- clusterLinks,
- ).then(() => {
- this.props.addFlashMessage({
- type: 'success',
- text: `Cluster account added to ${user.name}`,
- });
- this.getPageData();
- }).catch((err) => {
- this.props.addFlashMessage({
- type: 'error',
- text: 'Something went wrong while trying to add cluster account',
- });
- console.error(err); // eslint-disable-line no-console
- });
- },
-
- handleDissociation() {
- const {linkToDissociate, user} = this.state;
- const {params: {clusterID}} = this.props;
- deleteUserClusterLink(clusterID, linkToDissociate.id).then(() => {
- this.props.addFlashMessage({
- text: `${user.name} dissociated from ${linkToDissociate.cluster_user}`,
- type: 'success',
- });
- this.getPageData();
- }).catch(() => {
- this.props.addFlashMessage({
- text: `Something went wrong`,
- type: 'error',
- });
- });
- },
-
- handleLinkToDissociate(linkToDissociate) {
- this.setState({linkToDissociate});
- },
-
- getClusterLinks() {
- return Object.keys(this.state.clusterLinks).map((clusterID) => {
- return {
- cluster_id: clusterID,
- cluster_user: this.state.clusterLinks[clusterID],
- };
- });
- },
-
- render() {
- const {user, linkToDissociate} = this.state;
- if (!user) {
- return null; // or something else, idk
- }
-
- return (
-
-
-
-
-
- {user.name}
- Web User
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Account Details
-
-
-
-
-
-
-
-
-
-
Linked Cluster Accounts
-
-
- {this.renderClusterLinks()}
-
-
-
-
-
-
-
-
- );
- },
-
- renderClusterLinks() {
- const {user: {cluster_links}} = this.state;
- if (!cluster_links.length) {
- return (
-
-
-
No Cluster Accounts linked to this user
-
- );
- }
-
- return (
-
-
-
- |
- Account |
- Cluster |
- |
-
- {
- cluster_links.map((link) => {
- return (
-
- |
- {link.cluster_user} |
- {link.cluster_id} |
-
-
- |
-
- );
- })
- }
-
-
- );
- },
-});
-
-export default FlashMessages(WebUserEdit);
diff --git a/ui/src/web_users/containers/UsersPage.js b/ui/src/web_users/containers/UsersPage.js
deleted file mode 100644
index 3344f796a..000000000
--- a/ui/src/web_users/containers/UsersPage.js
+++ /dev/null
@@ -1,186 +0,0 @@
-import React, {PropTypes} from 'react';
-import _ from 'lodash';
-import PageHeader from '../components/PageHeader';
-import UsersTable from 'shared/components/UsersTable';
-import InviteUserModal from '../components/modals/InviteUser';
-import FlashMessages from 'shared/components/FlashMessages';
-import DeleteUserModal from '../components/modals/DeleteUsers';
-import {
- getWebUsers,
- deleteWebUsers,
- meShow,
- createWebUser,
- batchCreateUserClusterLink,
-} from 'shared/apis/index';
-
-const {string, func} = PropTypes;
-const UsersPage = React.createClass({
- propTypes: {
- params: PropTypes.shape({
- clusterID: PropTypes.string.isRequired,
- }).isRequired,
- addFlashMessage: PropTypes.func.isRequired,
- },
-
- getInitialState() {
- return {
- filterText: '',
- users: [],
- userToDelete: {
- id: 0,
- name: '',
- },
- me: {
- id: 0,
- },
- clusterLinks: {},
- };
- },
-
- componentDidMount() {
- this.refreshUsers();
- meShow().then(({data}) => {
- this.setState({me: data});
- });
- },
-
- handleCreateWebUser(user) {
- const {addFlashMessage} = this.props;
-
- createWebUser(user).then(({data}) => {
- batchCreateUserClusterLink(data.id, this.getClusterLinks()).then(() => {
- this.refreshUsers();
- addFlashMessage({
- type: 'success',
- text: 'User added successfully',
- });
- }).catch((err) => {
- this.handleFormError(err, 'Problem adding user');
- });
- }).catch((err) => {
- this.handleFormError(err, 'Problem adding cluster account');
- });
- },
-
- handleSelectClusterAccount({clusterID, accountName}) {
- const clusterLinks = Object.assign({}, this.state.clusterLinks, {
- [clusterID]: accountName,
- });
- this.setState({clusterLinks});
- },
-
- handleUserInput(filterText) {
- this.setState({filterText});
- },
-
- handleUserToDelete(userToDelete) {
- this.setState({userToDelete});
- },
-
- handleConfirmDeleteUser(userID) {
- deleteWebUsers(userID).then(() => {
- this.refreshUsers();
- this.props.addFlashMessage({
- type: 'success',
- text: 'User successfully deleted!',
- });
- }).catch(() => {
- this.props.addFlashMessage({
- type: 'error',
- text: 'There was a problem deleting the user...',
- });
- });
- },
-
- getClusterLinks() {
- return Object.keys(this.state.clusterLinks).map((clusterID) => {
- return {
- cluster_id: clusterID,
- cluster_user: this.state.clusterLinks[clusterID],
- };
- });
- },
-
- refreshUsers() {
- getWebUsers(this.props.params.clusterID).then(({data}) => {
- this.setState({users: data});
- });
- },
-
- handleFormError(err, text) {
- const formErrors = _.get(err, 'response.data.errors', null);
- const messages = formErrors ? Object.keys(formErrors).map(k => formErrors[k]) : text;
- console.error(messages); // eslint-disable-line no-console
- this.props.addFlashMessage({
- type: 'error',
- text: messages,
- });
- },
-
- render() {
- const {users, filterText, me} = this.state;
- const {params: {clusterID}} = this.props;
- const filteredUsers = users.filter((user) => user.name.toLowerCase().indexOf(filterText.toLowerCase()) > -1);
-
- return (
-
- );
- },
-});
-
-const SearchBar = React.createClass({
- propTypes: {
- onUserInput: func.isRequired,
- filterText: string.isRequired,
- },
-
- handleChange() {
- this.props.onUserInput(this._filterText.value);
- },
-
- render() {
- return (
-
-
-
-
-
this._filterText = ref}
- onChange={this.handleChange}
- />
-
- );
- },
-});
-
-export default FlashMessages(UsersPage);
diff --git a/ui/src/web_users/index.js b/ui/src/web_users/index.js
deleted file mode 100644
index 867ce84e3..000000000
--- a/ui/src/web_users/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import UsersPage from './containers/UsersPage';
-import UserEditPage from './containers/UserEditPage';
-export {UsersPage, UserEditPage};