From 143670872aca9ab326ff2e1a53b87d675bb3c276 Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 31 Aug 2017 12:03:50 -0300 Subject: [PATCH 1/4] Changing versions to v0.3.0 for email app, and v0.2.0 for web hosting app --- email_app/package.json | 2 +- web_hosting_manager/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/email_app/package.json b/email_app/package.json index 94f17e6..396133d 100644 --- a/email_app/package.json +++ b/email_app/package.json @@ -1,7 +1,7 @@ { "name": "safe-mail-tutorial", "productName": "SAFE Mail Tutorial", - "version": "0.2.2", + "version": "0.3.0", "description": "Mailing application tutorial using SAFE Network", "identifier": "net.maidsafe.examples.mailtutorial", "vendor": "MaidSafe.net Ltd", diff --git a/web_hosting_manager/package.json b/web_hosting_manager/package.json index baf7d80..1b57f0c 100644 --- a/web_hosting_manager/package.json +++ b/web_hosting_manager/package.json @@ -1,7 +1,7 @@ { "name": "web-hosting-manager", "productName": "Web Hosting Manager", - "version": "0.1.2", + "version": "0.2.0", "description": "Application to host web files in the SAFE Network", "main": "main.js", "scripts": { From a3ca1fef0d3fa056533347bfd2e36a90d4de4b14 Mon Sep 17 00:00:00 2001 From: bochaco Date: Wed, 6 Sep 2017 21:21:58 -0300 Subject: [PATCH 2/4] chore/Upgrading safe_app_nodejs to v0.2.1 and web hosting mgr. app to v0.1.3 --- email_app/package.json | 2 +- web_hosting_manager/app/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/email_app/package.json b/email_app/package.json index 396133d..6c7011b 100644 --- a/email_app/package.json +++ b/email_app/package.json @@ -123,7 +123,7 @@ "redux-axios-middleware": "^2.0.0", "redux-promise-middleware": "^4.2.0", "redux-thunk": "^2.1.0", - "safe-app": "https://s3.eu-west-2.amazonaws.com/safe-app-nodejs/safe-app-0.2.0.tgz", + "safe-app": "https://s3.eu-west-2.amazonaws.com/safe-app-nodejs/safe-app-0.2.1.tgz", "source-map-support": "^0.4.2", "urlsafe-base64": "^1.0.0" }, diff --git a/web_hosting_manager/app/package.json b/web_hosting_manager/app/package.json index 8cae2f3..6cfe0a1 100644 --- a/web_hosting_manager/app/package.json +++ b/web_hosting_manager/app/package.json @@ -1,7 +1,7 @@ { "name": "web-hosting-manager", "productName": "Web Hosting Manager", - "version": "0.1.2", + "version": "0.1.3", "description": "Application to manage web hosting in SAFE Network", "identifier": "net.maidsafe.webhostingmanager", "main": "./main.js", @@ -13,6 +13,6 @@ "license": "MIT", "dependencies": { "classnames": "^2.2.5", - "safe-app": "https://s3.eu-west-2.amazonaws.com/safe-app-nodejs/safe-app-0.2.0.tgz" + "safe-app": "https://s3.eu-west-2.amazonaws.com/safe-app-nodejs/safe-app-0.2.1.tgz" } } From 103c1e05ea85e791835ace014df58ac5b9350cba Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 14 Sep 2017 04:13:08 -0300 Subject: [PATCH 3/4] feat/Allow to go back to switch or create new email id --- email_app/app/actions/actionTypes.js | 1 + email_app/app/actions/create_account_actions.js | 5 +++++ email_app/app/components/home.js | 13 ++++++++++++- email_app/app/containers/home_container.js | 5 ++++- email_app/app/less/home.less | 3 ++- email_app/app/reducers/create_account.js | 3 +++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/email_app/app/actions/actionTypes.js b/email_app/app/actions/actionTypes.js index 8e6b365..bd7fe2d 100644 --- a/email_app/app/actions/actionTypes.js +++ b/email_app/app/actions/actionTypes.js @@ -11,6 +11,7 @@ const ACTION_TYPES = { // Create Account AUTHORISE_SHARE_MD: 'AUTHORISE_SHARE_MD', + CREATE_ACCOUNT_RESET: 'CREATE_ACCOUNT_RESET', CREATE_ACCOUNT: 'CREATE_ACCOUNT', CREATE_ACCOUNT_ERROR: 'SET_CREATE_ACCOUNT_ERROR', diff --git a/email_app/app/actions/create_account_actions.js b/email_app/app/actions/create_account_actions.js index 37f0c35..60fe5ae 100644 --- a/email_app/app/actions/create_account_actions.js +++ b/email_app/app/actions/create_account_actions.js @@ -11,6 +11,11 @@ export const createAccount = (emailId) => { }; }; +export const resetCurrentAccount = () => ({ + type: ACTION_TYPES.CREATE_ACCOUNT_RESET, + payload: Promise.resolve() +}); + export const createAccountError = (error) => ({ type: ACTION_TYPES.CREATE_ACCOUNT, payload: Promise.reject(error) diff --git a/email_app/app/components/home.js b/email_app/app/components/home.js index 9a8b845..5f84f90 100755 --- a/email_app/app/components/home.js +++ b/email_app/app/components/home.js @@ -12,6 +12,7 @@ export default class Home extends Component { super(); this.reconnect = this.reconnect.bind(this); + this.handleBack = this.handleBack.bind(this); } reconnect() { @@ -21,6 +22,14 @@ export default class Home extends Component { (err) => 'failed reconnecting'); } + handleBack(e) { + e.preventDefault(); + const { resetCurrentAccount, getEmailIds } = this.props; + return resetCurrentAccount() + .then(() => getEmailIds()) + .then(() => this.context.router.push(`/create_account`)); + } + render() { const { router } = this.context; const { coreData, inboxSize, savedSize, networkStatus, processing } = this.props; @@ -67,9 +76,11 @@ export default class Home extends Component {
+ +
+

Email ID: {coreData.id}

-
diff --git a/email_app/app/containers/home_container.js b/email_app/app/containers/home_container.js index 98fc2d1..ad6f860 100644 --- a/email_app/app/containers/home_container.js +++ b/email_app/app/containers/home_container.js @@ -1,6 +1,7 @@ import { connect } from 'react-redux'; import Home from '../components/home'; -import { reconnectApplication, refreshEmail } from '../actions/initializer_actions'; +import { reconnectApplication, refreshEmail, getEmailIds } from '../actions/initializer_actions'; +import { resetCurrentAccount } from '../actions/create_account_actions'; const mapStateToProps = state => { return { @@ -17,6 +18,8 @@ const mapDispatchToProps = dispatch => { return { reconnectApplication: () => (dispatch(reconnectApplication())), refreshEmail: (account) => (dispatch(refreshEmail(account))), + getEmailIds: () => (dispatch(getEmailIds())), + resetCurrentAccount: () => (dispatch(resetCurrentAccount())) }; }; diff --git a/email_app/app/less/home.less b/email_app/app/less/home.less index 23f7dd2..dabda8f 100755 --- a/email_app/app/less/home.less +++ b/email_app/app/less/home.less @@ -12,7 +12,6 @@ color: #FFFFFF; height: 64px; .lt-sec, .rt-sec { - width: 50%; padding: 0 16px; .title { line-height: 64px; @@ -20,9 +19,11 @@ } } .lt-sec { + width: 5%; float: left; } .rt-sec { + width: 95%; float: right; } .clearfix(); diff --git a/email_app/app/reducers/create_account.js b/email_app/app/reducers/create_account.js index 06a362f..dcdeb92 100644 --- a/email_app/app/reducers/create_account.js +++ b/email_app/app/reducers/create_account.js @@ -10,6 +10,9 @@ const initialState = { const createAccount = (state = initialState, action) => { switch (action.type) { + case `${ACTION_TYPES.CREATE_ACCOUNT_RESET}_LOADING`: + return initialState; + break; case `${ACTION_TYPES.CREATE_ACCOUNT}_ERROR`: return { ...state, error: action.payload }; break; From 9f8c966b5c8ddfa9b8aaa6b82489f850c831bf87 Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 14 Sep 2017 12:07:10 -0300 Subject: [PATCH 4/4] fix/Fix styling for the go back button --- email_app/app/components/home.js | 4 +++- email_app/app/less/home.less | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/email_app/app/components/home.js b/email_app/app/components/home.js index 5f84f90..7ad6a45 100755 --- a/email_app/app/components/home.js +++ b/email_app/app/components/home.js @@ -76,7 +76,9 @@ export default class Home extends Component {
- +

Email ID: {coreData.id}

diff --git a/email_app/app/less/home.less b/email_app/app/less/home.less index dabda8f..b21590c 100755 --- a/email_app/app/less/home.less +++ b/email_app/app/less/home.less @@ -21,6 +21,7 @@ .lt-sec { width: 5%; float: left; + line-height: 64px; } .rt-sec { width: 95%;