From 5b4798b196c58c702247596dcacb71210ce74d55 Mon Sep 17 00:00:00 2001 From: John Lyon-Smith Date: Mon, 14 May 2018 13:31:46 -0700 Subject: [PATCH] Fix broken links --- website/src/App.js | 2 +- website/src/Home/Home.js | 6 +- website/src/Profile/Profile.js | 156 ++++++++++++++++++--------------- website/src/System/System.js | 8 -- 4 files changed, 90 insertions(+), 82 deletions(-) diff --git a/website/src/App.js b/website/src/App.js index d36c784..caafb26 100644 --- a/website/src/App.js +++ b/website/src/App.js @@ -56,7 +56,7 @@ export class App extends Component { - + diff --git a/website/src/Home/Home.js b/website/src/Home/Home.js index 5bc35f8..a135f16 100644 --- a/website/src/Home/Home.js +++ b/website/src/Home/Home.js @@ -19,7 +19,7 @@ export class Home extends Component { this.props.history.push("/users")} + onClick={() => this.props.history.push("/app/users")} /> @@ -27,7 +27,7 @@ export class Home extends Component { this.props.history.push("/teams")} + onClick={() => this.props.history.push("/app/teams")} /> @@ -35,7 +35,7 @@ export class Home extends Component { this.props.history.push("/system")} + onClick={() => this.props.history.push("/app/system")} /> diff --git a/website/src/Profile/Profile.js b/website/src/Profile/Profile.js index f791b08..20f8a83 100644 --- a/website/src/Profile/Profile.js +++ b/website/src/Profile/Profile.js @@ -1,11 +1,16 @@ -import React, { Fragment, Component } from 'react' -import { ProfileForm } from './ProfileForm' -import { api } from 'src/API' -import { WaitModal, MessageModal, ChangePasswordModal, ChangeEmailModal } from '../Modal' -import { Column, Row } from 'ui' -import { sizeInfo } from 'ui/style' -import PropTypes from 'prop-types' -import autobind from 'autobind-decorator' +import React, { Fragment, Component } from "react" +import { ProfileForm } from "./ProfileForm" +import { api } from "src/API" +import { + WaitModal, + MessageModal, + ChangePasswordModal, + ChangeEmailModal, +} from "../Modal" +import { Column, Row } from "ui" +import { sizeInfo } from "ui/style" +import PropTypes from "prop-types" +import autobind from "autobind-decorator" export class Profile extends Component { static propTypes = { @@ -23,36 +28,31 @@ export class Profile extends Component { changeEmailModal: null, progressModal: null, uploadPercent: 0, - user + user, } } - componentDidMount() { - this.props.changeTitle('Profile') - } - - componentWillUnmount() { - this.props.changeTitle('') - } - @autobind handleSaved(user) { - this.setState({ waitModal: { message: 'Updating Profile' } }) - api.updateUser(user).then((updatedUser) => { - this.setState({ - waitModal: null, - user: updatedUser + this.setState({ waitModal: { message: "Updating Profile" } }) + api + .updateUser(user) + .then((updatedUser) => { + this.setState({ + waitModal: null, + user: updatedUser, + }) }) - }).catch((error) => { - this.setState({ - waitModal: null, - messageModal: { - icon: 'hand', - message: 'Unable to save the profile changes.', - detail: error.message, - }, + .catch((error) => { + this.setState({ + waitModal: null, + messageModal: { + icon: "hand", + message: "Unable to save the profile changes.", + detail: error.message, + }, + }) }) - }) } @autobind @@ -71,20 +71,23 @@ export class Profile extends Component { if (passwords) { this.setState({ - waitModal: { message: 'Changing Password' } + waitModal: { message: "Changing Password" }, }) - api.changePassword(passwords).then(() => { - this.setState({ waitModal: false }) - }).catch((error) => { - this.setState({ - waitModal: false, - messageModal: { - icon: 'hand', - message: 'Unable to change password', - detail: error.message, - } + api + .changePassword(passwords) + .then(() => { + this.setState({ waitModal: false }) + }) + .catch((error) => { + this.setState({ + waitModal: false, + messageModal: { + icon: "hand", + message: "Unable to change password", + detail: error.message, + }, + }) }) - }) } } @@ -100,30 +103,38 @@ export class Profile extends Component { return } this.setState({ - waitModal: { message: 'Requesting Email Change...' } + waitModal: { message: "Requesting Email Change..." }, }) - api.sendConfirmEmail({ newEmail }).then(() => { - this.setState({ - waitModal: null, - messageModal: { - icon: 'thumb', - message: `An email has been sent to '${newEmail}' with a link that you need to click on to finish changing your email.` - } + api + .sendConfirmEmail({ newEmail }) + .then(() => { + this.setState({ + waitModal: null, + messageModal: { + icon: "thumb", + message: `An email has been sent to '${newEmail}' with a link that you need to click on to finish changing your email.`, + }, + }) }) - }).catch((error) => { - this.setState({ - waitModal: null, - messageModal: { - icon: 'hand', - message: 'Unable to request email change.', - detail: error.message - } + .catch((error) => { + this.setState({ + waitModal: null, + messageModal: { + icon: "hand", + message: "Unable to request email change.", + detail: error.message, + }, + }) }) - }) } render() { - const { messageModal, waitModal, changeEmailModal, changePasswordModal } = this.state + const { + messageModal, + waitModal, + changeEmailModal, + changePasswordModal, + } = this.state return ( @@ -138,7 +149,8 @@ export class Profile extends Component { onSelectImage={this.handleSelectImage} onChangePassword={this.handleChangePassword} onChangeEmail={this.handleChangeEmail} - userImageUrl={this.state.userImageUrl} /> + userImageUrl={this.state.userImageUrl} + /> @@ -146,23 +158,27 @@ export class Profile extends Component { + icon={messageModal ? messageModal.icon : ""} + title={messageModal ? messageModal.title : ""} + message={messageModal ? messageModal.message : ""} + onDismiss={this.handleMessageModalDismiss} + /> + oldEmail={changeEmailModal ? changeEmailModal.oldEmail : ""} + onDismiss={this.handleChangeEmailDismiss} + /> + message={waitModal ? waitModal.message : ""} + /> + onDismiss={this.handleChangePasswordDismiss} + /> diff --git a/website/src/System/System.js b/website/src/System/System.js index ebe4e0a..94e0854 100644 --- a/website/src/System/System.js +++ b/website/src/System/System.js @@ -21,14 +21,6 @@ export class System extends Component { } } - componentDidMount(props) { - this.props.changeTitle("System") - } - - componentWillUnmount() { - this.props.changeTitle("") - } - @autobind handleDeleteActivities() { this.setState({