From 3bd5db9bf03a3225522a45f675d39f92d2168bd9 Mon Sep 17 00:00:00 2001 From: AntonyAntonio Date: Fri, 16 Sep 2016 19:53:41 -0300 Subject: [PATCH] Guillermo - add-edit-password-frontend [skip ci] --- .../dashboard-edit-profile-page.js | 43 +++++++++++++++---- .../dashboard-list-tickets-page.js | 7 ++- client/src/data/fixtures/user-fixtures.js | 10 +++++ 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/client/src/app/main/dashboard/dashboard-edit-profile/dashboard-edit-profile-page.js b/client/src/app/main/dashboard/dashboard-edit-profile/dashboard-edit-profile-page.js index 3d00f610..8fc86afa 100644 --- a/client/src/app/main/dashboard/dashboard-edit-profile/dashboard-edit-profile-page.js +++ b/client/src/app/main/dashboard/dashboard-edit-profile/dashboard-edit-profile-page.js @@ -9,26 +9,35 @@ import SubmitButton from 'core-components/submit-button'; class DashboardEditProfilePage extends React.Component { - state = { - loading: false + state= { + loadingEmail: false, + loadingPass: false }; + render() { return (
-
+
Edit Email
-
- + + CHANGE EMAIL +
Edit password
+
+ + + + CHANGE PASSWORD +
); } - onSubmit(formState) { + onSubmitEditEmail(formState) { this.setState({ - loading: true + loadingEmail: true }); API.call({ @@ -38,7 +47,25 @@ class DashboardEditProfilePage extends React.Component { } }).then(function () { this.setState({ - loading: false + loadingEmail: false + }); + }.bind(this)); + } + + onSubmitEditPassword(formState) { + this.setState({ + loadingPass: true + }); + + API.call({ + path: "/user/edit-password", + data: { + oldPassword: formState.oldPassword, + newPassword: formState.password + } + }).then(function () { + this.setState({ + loadingPass: false }); }.bind(this)); } diff --git a/client/src/app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page.js b/client/src/app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page.js index f033fb93..e4ef056a 100644 --- a/client/src/app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page.js +++ b/client/src/app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page.js @@ -6,6 +6,7 @@ import i18n from 'lib-app/i18n'; import Header from 'core-components/header'; import Table from 'core-components/table'; import Button from 'core-components/button'; +import Tooltip from 'core-components/tooltip'; class DashboardListTicketsPage extends React.Component { static propTypes = { @@ -58,7 +59,11 @@ class DashboardListTicketsPage extends React.Component { let titleText = (ticket.unread) ? ticket.title + ' (1)' : ticket.title; return { - number: '#' + ticket.ticketNumber, + number: ( + + {'#' + ticket.ticketNumber} + + ), title: (