From 80be7e1901d732a6f2f24fd8ff9cc985436adb79 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:29:45 +0200 Subject: [PATCH 01/10] Bump. --- README.md | 2 +- package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86aae92..4485fd8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Accounts UI -Current version 1.1.2 +Current version 1.1.3 ## Features diff --git a/package.js b/package.js index 97ffd2c..09bdf18 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'std:accounts-ui', - version: '1.1.2', + version: '1.1.3', summary: 'Accounts UI for React in Meteor 1.3', git: 'https://github.com/studiointeract/accounts-ui', documentation: 'README.md' From 4a3e803c2b280f7e479172cd1040f06c77c2887c Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:30:55 +0200 Subject: [PATCH 02/10] Bump. --- .versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.versions b/.versions index c418731..7d52fc9 100644 --- a/.versions +++ b/.versions @@ -50,7 +50,7 @@ session@1.1.3 softwarerero:accounts-t9n@0.0.20 spacebars@1.0.9 spacebars-compiler@1.0.9 -std:accounts-ui@1.1.2 +std:accounts-ui@1.1.3 tracker@1.0.11 ui@1.0.9 underscore@1.0.6 From 7f72e3b7f9424366ab143403354eff18c7024745 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:32:27 +0200 Subject: [PATCH 03/10] Updated readme. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4485fd8..1f70c71 100644 --- a/README.md +++ b/README.md @@ -61,19 +61,19 @@ Configure the behavior of `` Set the path to where you would like the user to be redirected after a successful login or sign out. * **loginPath**    String - Change the default path a user should be redirected to after a clicking a link in a mail provided to them from the accounts system, it could be a mail set to them when they have reset their password, verifying their email if the setting for `sendVerificationEmail` is turned on ([read more on accounts configuration ](http://docs.meteor.com/#/full/accounts_config)). Can also be set as a property to the LoginForm, for i19n routes or other customization. + Change the default path a user should be redirected to after a clicking a link in a mail provided to them from the accounts system, it could be a mail set to them when they have reset their password, verifying their email if the setting for `sendVerificationEmail` is turned on ([read more on accounts configuration ](http://docs.meteor.com/#/full/accounts_config)). Can also be set as a property to the LoginForm, for i18n routes or other customization. * **signUpPath**    String - Set the path to where you would like the sign up links to link to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i19n routes or other customization. + Set the path to where you would like the sign up links to link to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i18n routes or other customization. * **resetPasswordPath**    String - Set the path to where you would like the link to reset password to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i19n routes or other customization. + Set the path to where you would like the link to reset password to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i18n routes or other customization. * **profilePath**    String - Set the path to where you would like the link to the profile to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i19n routes or other customization. + Set the path to where you would like the link to the profile to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i18n routes or other customization. * **changePasswordPath**    String - Set the path to where you would like the link to change password to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i19n routes or other customization. + Set the path to where you would like the link to change password to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i18n routes or other customization. * **onSubmitHook**    function(error, state)    **client** Called when the LoginForm is being submitted: allows for custom actions to be taken on form submission. error contains possible errors occurred during the submission process, state specifies the LoginForm internal state from which the submission was triggered. A nice use case might be closing the modal or side-menu or dropdown showing LoginForm. You can get all the possible states by import `STATES` from this package. From 0ac02ff8f5d2a8a0b1aa68e245b3948230acbc0a Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:34:09 +0200 Subject: [PATCH 04/10] Updated readme. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 1f70c71..b677972 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,26 @@ We support the standard [configuration in the account-ui package](http://docs.me Configure the behavior of `` +Example configuration: + +```javascript +Accounts.config({ + sendVerificationEmail: true, + forbidClientAccountCreation: false +}); + +Accounts.ui.config({ + passwordSignupFields: 'EMAIL_ONLY', + loginPath: '/login', + signUpPath: '/signup', + resetPasswordPath: '/reset-password', + profilePath: '/profile', + onSignedInHook: () => FlowRouter.go('/general'), + onSignedOutHook: () => FlowRouter.go('/login'), + minimumPasswordLength: 6 +}); +``` + **_Options:_** * **requestPermissions**    Object From 4d835cc1fea80faa1365e259e708399d857d9f8a Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:35:57 +0200 Subject: [PATCH 05/10] Updated readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b677972..82595f0 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Accounts.ui.config({ Called just before submitting the LoginForm for sign-up: allows for custom actions on the data being submitted. A nice use could be extending the user profile object accessing options.profile. to be taken on form submission. The plain text password is also provided for any reasonable use. If you return a promise, the submission will wait until you resolve it. * **onPostSignUpHook**    func(options, user)    **client** - Called client side, just after a successful user account creation, post submitting the form for sign-up: allows for custom actions on the data being submitted after we are sure a new user was successfully created. Default is **loginPath**. + Called client side, just after a successful user account creation, post submitting the form for sign-up: allows for custom actions on the data being submitted after we are sure a new user was successfully created. * **onPostSignUpHook**    func(options, user)    **server** Called server side, just after a successful user account creation, post submitting the pwdForm for sign-up: allows for custom actions on the data being submitted after we are sure a new user was successfully created. A common use might be applying roles to the user, as this is only possible after fully completing user creation in `alanning:roles`. Any extra fields added to the form is available as the first parameter, and the user is available as the second argument. *If you return the user object, this will also update the user document.* From c41466a79c4cd5be0bd26c9c83afddaf01ff6afe Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:42:27 +0200 Subject: [PATCH 06/10] Updated readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82595f0..c2972c5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Current version 1.1.3 ## Features 1. **[Easy to use](#using-react-accounts-ui)**, mixing the ideas of useraccounts configuration and accounts-ui that everyone already knows and loves. -3. **[Components](#components-available)** are everywhere, and extensible by replacing them on Accounts.ui. +3. **[Components](#available-components)** are everywhere, and extensible by replacing them on Accounts.ui. 4. **[Basic routing](#configuration)** included, redirections when the user clicks a link in an email or when signing in or out. 5. **[Unstyled](#styling)** is the default, no CSS included. 6. **[No password](#no-password-required)** sign up and sign in are included. From 1df5bb3965c750c734ee37444812588c2241af91 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:45:49 +0200 Subject: [PATCH 07/10] Updated readme. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c2972c5..912ae8c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Current version 1.1.3 7. **[Extra fields](#extra-fields)** is now supported. 8. **[Server Side Rendering](#example-setup-using-flowrouter-meteor-13)** are supported, trough FlowRouter (SSR). 9. **[Extending](#create-your-own-styled-version)** to make your own custom form, for your app, or as a package, all components can be extended and customized. +10. **[States API](#example-setup-using-the-states-api)** makes it possible to use the form on different routes, say you want the login on one route and signup on another, just set the inital state and the links (either globally or per component by using the props). ## Styling From 6acc97f94a72dc5db6427c1aa680da287c2ef146 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 19:46:20 +0200 Subject: [PATCH 08/10] Updated readme. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 912ae8c..4e2eb3e 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ Current version 1.1.3 ## Features 1. **[Easy to use](#using-react-accounts-ui)**, mixing the ideas of useraccounts configuration and accounts-ui that everyone already knows and loves. -3. **[Components](#available-components)** are everywhere, and extensible by replacing them on Accounts.ui. -4. **[Basic routing](#configuration)** included, redirections when the user clicks a link in an email or when signing in or out. -5. **[Unstyled](#styling)** is the default, no CSS included. -6. **[No password](#no-password-required)** sign up and sign in are included. -7. **[Extra fields](#extra-fields)** is now supported. -8. **[Server Side Rendering](#example-setup-using-flowrouter-meteor-13)** are supported, trough FlowRouter (SSR). -9. **[Extending](#create-your-own-styled-version)** to make your own custom form, for your app, or as a package, all components can be extended and customized. -10. **[States API](#example-setup-using-the-states-api)** makes it possible to use the form on different routes, say you want the login on one route and signup on another, just set the inital state and the links (either globally or per component by using the props). +2. **[Components](#available-components)** are everywhere, and extensible by replacing them on Accounts.ui. +3. **[Basic routing](#configuration)** included, redirections when the user clicks a link in an email or when signing in or out. +4. **[Unstyled](#styling)** is the default, no CSS included. +5. **[No password](#no-password-required)** sign up and sign in are included. +6. **[Extra fields](#extra-fields)** is now supported. +7. **[Server Side Rendering](#example-setup-using-flowrouter-meteor-13)** are supported, trough FlowRouter (SSR). +8. **[Extending](#create-your-own-styled-version)** to make your own custom form, for your app, or as a package, all components can be extended and customized. +9. **[States API](#example-setup-using-the-states-api)** makes it possible to use the form on different routes, say you want the login on one route and signup on another, just set the inital state and the links (either globally or per component by using the props). ## Styling From ddcca19867226428ebd8979c9ea2139e617c60e7 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 21:02:28 +0200 Subject: [PATCH 09/10] Bugfixes for Nova. --- README.md | 4 ++-- imports/api/server/onPostSignUpHook.js | 2 +- imports/ui/components/Button.jsx | 2 +- imports/ui/components/Form.jsx | 10 +++++++--- imports/ui/components/LoginForm.jsx | 14 +++++++------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4e2eb3e..0fc27d7 100644 --- a/README.md +++ b/README.md @@ -374,14 +374,14 @@ class NewLogin extends Accounts.ui.LoginForm { return super.fields(); } - signUp(event, options = {}) { + signUp(options = {}) { const { firstname = null } = this.state; if (firstname !== null) { options.profile = Object.assign(options.profile || {}, { firstname: firstname }); } - super.signUp(event, options); + super.signUp(options); } } ``` diff --git a/imports/api/server/onPostSignUpHook.js b/imports/api/server/onPostSignUpHook.js index 8002642..b286a4d 100644 --- a/imports/api/server/onPostSignUpHook.js +++ b/imports/api/server/onPostSignUpHook.js @@ -7,5 +7,5 @@ try { return user; }); } catch(e) { - console.log('You\'ve implemented Accounts.onCreateUser elsewhere in your application, you can therefor not us Accounts.ui.config({ onPostSignUpHook }) on the server.'); + console.log('You\'ve implemented Accounts.onCreateUser elsewhere in your application, you can therefor not use Accounts.ui.config({ onPostSignUpHook }) on the server.'); } diff --git a/imports/ui/components/Button.jsx b/imports/ui/components/Button.jsx index 4e80e10..7c02fd1 100644 --- a/imports/ui/components/Button.jsx +++ b/imports/ui/components/Button.jsx @@ -8,7 +8,7 @@ export class Button extends React.Component { return { label }; } return ; } diff --git a/imports/ui/components/Form.jsx b/imports/ui/components/Form.jsx index a93db34..8248666 100644 --- a/imports/ui/components/Form.jsx +++ b/imports/ui/components/Form.jsx @@ -9,10 +9,14 @@ import './SocialButtons.jsx'; export class Form extends React.Component { componentDidMount() { + let node = ReactDOM.findDOMNode(this); - node.addEventListener('submit', (e) => { - e.preventDefault(); - }); + console.log(node); + if (node) { + node.addEventListener('submit', (e) => { + e.preventDefault(); + }); + } } render() { diff --git a/imports/ui/components/LoginForm.jsx b/imports/ui/components/LoginForm.jsx index e14761a..6ed4869 100644 --- a/imports/ui/components/LoginForm.jsx +++ b/imports/ui/components/LoginForm.jsx @@ -301,7 +301,7 @@ export class LoginForm extends Tracker.Component { type: hasPasswordService() ? 'submit' : 'link', className: 'active', disabled: waiting, - onClick: hasPasswordService() ? this.signUp.bind(this) : null + onClick: hasPasswordService() ? this.signUp.bind(this, {}) : null }); } @@ -510,7 +510,7 @@ export class LoginForm extends Tracker.Component { } - signUp(event, options = {}) { + signUp(options = {}) { const { username = null, email = null, @@ -563,8 +563,8 @@ export class LoginForm extends Tracker.Component { this.setState({waiting: true}); - const SignUp = () => { - Accounts.createUser(options, (error) => { + const SignUp = function(_options) { + Accounts.createUser(_options, (error) => { if (error) { this.showMessage(T9n.get(`error.accounts.${error.reason}`) || T9n.get("Unknown error"), 'error'); if (T9n.get(`error.accounts.${error.reason}`)) { @@ -581,7 +581,7 @@ export class LoginForm extends Tracker.Component { password: null }); let user = Accounts.user(); - loginResultCallback(Accounts.ui._options.onPostSignUpHook.bind(this, options, user)); + loginResultCallback(Accounts.ui._options.onPostSignUpHook.bind(this, _options, user)); } this.setState({ waiting: false }); @@ -591,10 +591,10 @@ export class LoginForm extends Tracker.Component { // Allow for Promises to return. let promise = Accounts.ui._options.onPreSignUpHook(options); if (promise instanceof Promise) { - promise.then(SignUp); + promise.then(SignUp.bind(this, options)); } else { - SignUp(); + SignUp(options); } } From 0b86066fdfb63b1d952d7a4173013ddff0b69376 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Sat, 2 Apr 2016 21:07:51 +0200 Subject: [PATCH 10/10] Bump --- .versions | 2 +- CHANGELOG.md | 6 +++++- README.md | 2 +- package.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.versions b/.versions index 7d52fc9..84057d7 100644 --- a/.versions +++ b/.versions @@ -50,7 +50,7 @@ session@1.1.3 softwarerero:accounts-t9n@0.0.20 spacebars@1.0.9 spacebars-compiler@1.0.9 -std:accounts-ui@1.1.3 +std:accounts-ui@1.1.4 tracker@1.0.11 ui@1.0.9 underscore@1.0.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e1cd7..94b4c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # ChangeLog -### v1.1.1-2 +### v1.1.4 + +* Bugfixes for Telescope Nova + +### v1.1.1-3 * Bugfixes diff --git a/README.md b/README.md index 0fc27d7..d25124f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Accounts UI -Current version 1.1.3 +Current version 1.1.4 ## Features diff --git a/package.js b/package.js index 09bdf18..e10355c 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'std:accounts-ui', - version: '1.1.3', + version: '1.1.4', summary: 'Accounts UI for React in Meteor 1.3', git: 'https://github.com/studiointeract/accounts-ui', documentation: 'README.md'