ember-flexberry-account 0.1.0-alpha.7 → 0.1.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +58 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +46 -0
  3. package/.jscsrc +15 -15
  4. package/CHANGELOG.md +25 -17
  5. package/README.md +38 -38
  6. package/addon/components/flexberry-login.js +163 -158
  7. package/addon/components/flexberry-pwd-reset.js +123 -123
  8. package/addon/components/flexberry-recaptcha.js +115 -115
  9. package/addon/components/flexberry-register.js +226 -226
  10. package/addon/components/flexberry-user-profile.js +8 -8
  11. package/addon/controllers/email-confirmation.js +91 -91
  12. package/addon/controllers/login.js +4 -4
  13. package/addon/controllers/pwd-reset.js +4 -4
  14. package/addon/controllers/register.js +4 -4
  15. package/addon/controllers/user-profile.js +4 -4
  16. package/addon/locales/en/translations.js +63 -63
  17. package/addon/locales/ru/translations.js +65 -65
  18. package/addon/models/user-profile.js +5 -5
  19. package/addon/routes/email-confirmation.js +4 -4
  20. package/addon/routes/login.js +4 -4
  21. package/addon/routes/pwd-reset.js +4 -4
  22. package/addon/routes/reg-end.js +4 -4
  23. package/addon/routes/register.js +4 -4
  24. package/addon/routes/user-profile.js +4 -4
  25. package/addon/services/user-account.js +184 -184
  26. package/app/components/flexberry-login.js +1 -1
  27. package/app/components/flexberry-pwd-reset.js +1 -1
  28. package/app/components/flexberry-recaptcha.js +1 -1
  29. package/app/components/flexberry-register.js +1 -1
  30. package/app/components/flexberry-user-profile.js +1 -1
  31. package/app/controllers/email-confirmation.js +1 -1
  32. package/app/controllers/login.js +1 -1
  33. package/app/controllers/pwd-reset.js +1 -1
  34. package/app/controllers/register.js +1 -1
  35. package/app/controllers/user-profile.js +1 -1
  36. package/app/models/user-profile.js +1 -1
  37. package/app/routes/login.js +1 -1
  38. package/app/routes/pwd-reset.js +1 -1
  39. package/app/routes/register.js +1 -1
  40. package/app/routes/user-profile.js +1 -1
  41. package/app/services/user-account.js +82 -82
  42. package/app/templates/components/flexberry-login.hbs +53 -53
  43. package/app/templates/components/flexberry-pwd-reset.hbs +38 -38
  44. package/app/templates/components/flexberry-register.hbs +75 -75
  45. package/app/templates/components/flexberry-user-profile.hbs +1 -1
  46. package/app/templates/login.hbs +5 -5
  47. package/app/templates/pwd-reset.hbs +4 -4
  48. package/app/templates/register.hbs +4 -4
  49. package/app/templates/user-profile.hbs +3 -3
  50. package/blueprints/ember-flexberry-account/index.js +43 -43
  51. package/config/environment.js +6 -6
  52. package/index.js +6 -6
  53. package/package.json +1 -1
  54. package/scripts/deploy-to-gh-pages.sh +78 -78
  55. package/yarn.lock +7185 -0
  56. package/.npmignore +0 -16
  57. package/jsconfig.json +0 -1
  58. package/package-lock.json +0 -8894
  59. package/typings/ember/ember.d.ts +0 -3188
@@ -1,184 +1,184 @@
1
- /**
2
- @module ember-flexberry-account
3
- */
4
-
5
- import Ember from 'ember';
6
-
7
- export default Ember.Service.extend({
8
- /**
9
- Flag indicates whether user-account service is enabled or not.
10
-
11
- @property enabled
12
- @type Boolean
13
- @default true
14
-
15
- @example
16
- ```
17
- // UserAccount 'enabled' setting could be also defined through application config/environment.js
18
- module.exports = function(environment) {
19
- let ENV = {
20
- ...
21
- APP: {
22
- ...
23
- user-account: {
24
- enabled: true
25
- }
26
- ...
27
- }
28
- ...
29
- };
30
- ```
31
- */
32
- enabled: true,
33
-
34
- vk: false,
35
- facebook: false,
36
- twitter: false,
37
- google: false,
38
- microsoft: false,
39
- github: false,
40
- ok: false,
41
- mailru: false,
42
- yandex: false,
43
- gosuslugi: false,
44
-
45
- /**
46
- Is user authenticated?
47
-
48
- @method login
49
- @return {Boolean} Returns user authenticated status.
50
- */
51
- isUserAuthenticated() {
52
- let enabled = this.get('enabled');
53
-
54
- if (!enabled) {
55
- return;
56
- }
57
-
58
- Ember.assert('Developer must override isUserAuthenticated method of user-account service.');
59
- },
60
-
61
- /**
62
- Log in.
63
-
64
- @method login
65
- @param username {String} User name for log in.
66
- @param password {String} Password phrase for log in.
67
- @return {Boolean} Returns log in result.
68
- */
69
- login(username, password) {
70
- let enabled = this.get('enabled');
71
-
72
- if (!enabled) {
73
- return;
74
- }
75
-
76
- Ember.assert('Developer must override login method of user-account service.' +
77
- ' You try login with ' + username + ' and password ' + password + '.');
78
- },
79
-
80
- /**
81
- Log out.
82
-
83
- @method logout
84
- @return {Boolean} Returns log out result.
85
- */
86
- logout() {
87
- let enabled = this.get('enabled');
88
-
89
- if (!enabled) {
90
- return;
91
- }
92
-
93
- Ember.assert('Developer must override logout method of user-account service.');
94
- },
95
-
96
- /**
97
- Validate username.
98
-
99
- @method validateUsername
100
- @param username {String} User name for validation.
101
- @return {Promise} Returns validation result.
102
- */
103
- validateUsername(username) {
104
- let enabled = this.get('enabled');
105
-
106
- if (!enabled) {
107
- return;
108
- }
109
-
110
- Ember.assert('Developer must override validateUsername method of user-account service.' +
111
- 'Validate username: ' + username + '.');
112
- },
113
-
114
- /**
115
- Register user.
116
-
117
- @method register
118
- @param username {String} User name for log in.
119
- @param name {String} User name.
120
- @param redirectRoute {String} Route to redirect after registration.
121
- @return {Boolean} Returns register result.
122
- */
123
- register(username, name, redirectRoute) {
124
- let enabled = this.get('enabled');
125
-
126
- if (!enabled) {
127
- return;
128
- }
129
-
130
- Ember.assert('Developer must override register method of user-account service.' +
131
- ' You try register with username: ' + username + ', name: ' + name + ', redirectRoute: ' + redirectRoute + '.');
132
- },
133
- /**
134
- Reset password request for username.
135
-
136
- @method pwdReset
137
- @param username {String} User name for reset password request.
138
- @return {Boolean} Returns reset request result.
139
- */
140
- pwdReset(username) {
141
- let enabled = this.get('enabled');
142
-
143
- if (!enabled) {
144
- return;
145
- }
146
-
147
- Ember.assert('Developer must override pwdReset method of user-account service.' +
148
- 'Request for username: ' + username + '.');
149
- },
150
-
151
- /**
152
- Reset password request for username.
153
-
154
- @method validateCaptcha
155
- @return {Boolean} Returns if captcha valid.
156
- */
157
- validateCaptcha() {
158
- let enabled = this.get('enabled');
159
-
160
- if (!enabled) {
161
- return;
162
- }
163
-
164
- Ember.assert('Developer must override validateCaptcha() method of user-account service.');
165
- },
166
-
167
- /**
168
- Activate account.
169
-
170
- @method activateAccount
171
- @param token {String} Activation token from email.
172
- @return {Promise} Returns activation result.
173
- */
174
- activateAccount(token) {
175
- let enabled = this.get('enabled');
176
-
177
- if (!enabled) {
178
- return;
179
- }
180
-
181
- Ember.assert('Developer must override activateAccount method of user-account service.' +
182
- 'Activation token: ' + token + '.');
183
- },
184
- });
1
+ /**
2
+ @module ember-flexberry-account
3
+ */
4
+
5
+ import Ember from 'ember';
6
+
7
+ export default Ember.Service.extend({
8
+ /**
9
+ Flag indicates whether user-account service is enabled or not.
10
+
11
+ @property enabled
12
+ @type Boolean
13
+ @default true
14
+
15
+ @example
16
+ ```
17
+ // UserAccount 'enabled' setting could be also defined through application config/environment.js
18
+ module.exports = function(environment) {
19
+ let ENV = {
20
+ ...
21
+ APP: {
22
+ ...
23
+ user-account: {
24
+ enabled: true
25
+ }
26
+ ...
27
+ }
28
+ ...
29
+ };
30
+ ```
31
+ */
32
+ enabled: true,
33
+
34
+ vk: false,
35
+ facebook: false,
36
+ twitter: false,
37
+ google: false,
38
+ microsoft: false,
39
+ github: false,
40
+ ok: false,
41
+ mailru: false,
42
+ yandex: false,
43
+ gosuslugi: false,
44
+
45
+ /**
46
+ Is user authenticated?
47
+
48
+ @method login
49
+ @return {Boolean} Returns user authenticated status.
50
+ */
51
+ isUserAuthenticated() {
52
+ let enabled = this.get('enabled');
53
+
54
+ if (!enabled) {
55
+ return;
56
+ }
57
+
58
+ Ember.assert('Developer must override isUserAuthenticated method of user-account service.');
59
+ },
60
+
61
+ /**
62
+ Log in.
63
+
64
+ @method login
65
+ @param username {String} User name for log in.
66
+ @param password {String} Password phrase for log in.
67
+ @return {Boolean} Returns log in result.
68
+ */
69
+ login(username, password) {
70
+ let enabled = this.get('enabled');
71
+
72
+ if (!enabled) {
73
+ return;
74
+ }
75
+
76
+ Ember.assert('Developer must override login method of user-account service.' +
77
+ ' You try login with ' + username + ' and password ' + password + '.');
78
+ },
79
+
80
+ /**
81
+ Log out.
82
+
83
+ @method logout
84
+ @return {Boolean} Returns log out result.
85
+ */
86
+ logout() {
87
+ let enabled = this.get('enabled');
88
+
89
+ if (!enabled) {
90
+ return;
91
+ }
92
+
93
+ Ember.assert('Developer must override logout method of user-account service.');
94
+ },
95
+
96
+ /**
97
+ Validate username.
98
+
99
+ @method validateUsername
100
+ @param username {String} User name for validation.
101
+ @return {Promise} Returns validation result.
102
+ */
103
+ validateUsername(username) {
104
+ let enabled = this.get('enabled');
105
+
106
+ if (!enabled) {
107
+ return;
108
+ }
109
+
110
+ Ember.assert('Developer must override validateUsername method of user-account service.' +
111
+ 'Validate username: ' + username + '.');
112
+ },
113
+
114
+ /**
115
+ Register user.
116
+
117
+ @method register
118
+ @param username {String} User name for log in.
119
+ @param name {String} User name.
120
+ @param redirectRoute {String} Route to redirect after registration.
121
+ @return {Boolean} Returns register result.
122
+ */
123
+ register(username, name, redirectRoute) {
124
+ let enabled = this.get('enabled');
125
+
126
+ if (!enabled) {
127
+ return;
128
+ }
129
+
130
+ Ember.assert('Developer must override register method of user-account service.' +
131
+ ' You try register with username: ' + username + ', name: ' + name + ', redirectRoute: ' + redirectRoute + '.');
132
+ },
133
+ /**
134
+ Reset password request for username.
135
+
136
+ @method pwdReset
137
+ @param username {String} User name for reset password request.
138
+ @return {Boolean} Returns reset request result.
139
+ */
140
+ pwdReset(username) {
141
+ let enabled = this.get('enabled');
142
+
143
+ if (!enabled) {
144
+ return;
145
+ }
146
+
147
+ Ember.assert('Developer must override pwdReset method of user-account service.' +
148
+ 'Request for username: ' + username + '.');
149
+ },
150
+
151
+ /**
152
+ Reset password request for username.
153
+
154
+ @method validateCaptcha
155
+ @return {Boolean} Returns if captcha valid.
156
+ */
157
+ validateCaptcha() {
158
+ let enabled = this.get('enabled');
159
+
160
+ if (!enabled) {
161
+ return;
162
+ }
163
+
164
+ Ember.assert('Developer must override validateCaptcha() method of user-account service.');
165
+ },
166
+
167
+ /**
168
+ Activate account.
169
+
170
+ @method activateAccount
171
+ @param token {String} Activation token from email.
172
+ @return {Promise} Returns activation result.
173
+ */
174
+ activateAccount(token) {
175
+ let enabled = this.get('enabled');
176
+
177
+ if (!enabled) {
178
+ return;
179
+ }
180
+
181
+ Ember.assert('Developer must override activateAccount method of user-account service.' +
182
+ 'Activation token: ' + token + '.');
183
+ },
184
+ });
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/components/flexberry-login';
1
+ export { default } from 'ember-flexberry-account/components/flexberry-login';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/components/flexberry-pwd-reset';
1
+ export { default } from 'ember-flexberry-account/components/flexberry-pwd-reset';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/components/flexberry-recaptcha';
1
+ export { default } from 'ember-flexberry-account/components/flexberry-recaptcha';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/components/flexberry-register';
1
+ export { default } from 'ember-flexberry-account/components/flexberry-register';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/components/flexberry-user-profile';
1
+ export { default } from 'ember-flexberry-account/components/flexberry-user-profile';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/controllers/email-confirmation';
1
+ export { default } from 'ember-flexberry-account/controllers/email-confirmation';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/controllers/login';
1
+ export { default } from 'ember-flexberry-account/controllers/login';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/controllers/pwd-reset';
1
+ export { default } from 'ember-flexberry-account/controllers/pwd-reset';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/controllers/register';
1
+ export { default } from 'ember-flexberry-account/controllers/register';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/controllers/user-profile';
1
+ export { default } from 'ember-flexberry-account/controllers/user-profile';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/models/user-profile';
1
+ export { default } from 'ember-flexberry-account/models/user-profile';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/routes/login';
1
+ export { default } from 'ember-flexberry-account/routes/login';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/routes/pwd-reset';
1
+ export { default } from 'ember-flexberry-account/routes/pwd-reset';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/routes/register';
1
+ export { default } from 'ember-flexberry-account/routes/register';
@@ -1 +1 @@
1
- export { default } from 'ember-flexberry-account/routes/user-profile';
1
+ export { default } from 'ember-flexberry-account/routes/user-profile';
@@ -1,82 +1,82 @@
1
- import Ember from 'ember';
2
- import UserAccountService from 'ember-flexberry-account/services/user-account';
3
- import config from '../config/environment';
4
-
5
- let enabled = Ember.get(config, 'APP.userAccount.enabled');
6
- if (Ember.typeOf(enabled) === 'boolean') {
7
- UserAccountService.reopen({
8
- enabled: enabled
9
- });
10
- }
11
-
12
- let vk = Ember.get(config, 'APP.userAccount.vk');
13
- if (Ember.typeOf(vk) === 'boolean') {
14
- UserAccountService.reopen({
15
- vk: vk
16
- });
17
- }
18
-
19
- let facebook = Ember.get(config, 'APP.userAccount.facebook');
20
- if (Ember.typeOf(facebook) === 'boolean') {
21
- UserAccountService.reopen({
22
- facebook: facebook
23
- });
24
- }
25
-
26
- let twitter = Ember.get(config, 'APP.userAccount.twitter');
27
- if (Ember.typeOf(twitter) === 'boolean') {
28
- UserAccountService.reopen({
29
- twitter: twitter
30
- });
31
- }
32
-
33
- let google = Ember.get(config, 'APP.userAccount.google');
34
- if (Ember.typeOf(google) === 'boolean') {
35
- UserAccountService.reopen({
36
- google: google
37
- });
38
- }
39
-
40
- let microsoft = Ember.get(config, 'APP.userAccount.microsoft');
41
- if (Ember.typeOf(microsoft) === 'boolean') {
42
- UserAccountService.reopen({
43
- microsoft: microsoft
44
- });
45
- }
46
-
47
- let github = Ember.get(config, 'APP.userAccount.github');
48
- if (Ember.typeOf(github) === 'boolean') {
49
- UserAccountService.reopen({
50
- github: github
51
- });
52
- }
53
-
54
- let ok = Ember.get(config, 'APP.userAccount.ok');
55
- if (Ember.typeOf(ok) === 'boolean') {
56
- UserAccountService.reopen({
57
- ok: ok
58
- });
59
- }
60
-
61
- let mailru = Ember.get(config, 'APP.userAccount.mailru');
62
- if (Ember.typeOf(mailru) === 'boolean') {
63
- UserAccountService.reopen({
64
- mailru: mailru
65
- });
66
- }
67
-
68
- let yandex = Ember.get(config, 'APP.userAccount.yandex');
69
- if (Ember.typeOf(yandex) === 'boolean') {
70
- UserAccountService.reopen({
71
- yandex: yandex
72
- });
73
- }
74
-
75
- let gosuslugi = Ember.get(config, 'APP.userAccount.gosuslugi');
76
- if (Ember.typeOf(gosuslugi) === 'boolean') {
77
- UserAccountService.reopen({
78
- gosuslugi: gosuslugi
79
- });
80
- }
81
-
82
- export default UserAccountService;
1
+ import Ember from 'ember';
2
+ import UserAccountService from 'ember-flexberry-account/services/user-account';
3
+ import config from '../config/environment';
4
+
5
+ let enabled = Ember.get(config, 'APP.userAccount.enabled');
6
+ if (Ember.typeOf(enabled) === 'boolean') {
7
+ UserAccountService.reopen({
8
+ enabled: enabled
9
+ });
10
+ }
11
+
12
+ let vk = Ember.get(config, 'APP.userAccount.vk');
13
+ if (Ember.typeOf(vk) === 'boolean') {
14
+ UserAccountService.reopen({
15
+ vk: vk
16
+ });
17
+ }
18
+
19
+ let facebook = Ember.get(config, 'APP.userAccount.facebook');
20
+ if (Ember.typeOf(facebook) === 'boolean') {
21
+ UserAccountService.reopen({
22
+ facebook: facebook
23
+ });
24
+ }
25
+
26
+ let twitter = Ember.get(config, 'APP.userAccount.twitter');
27
+ if (Ember.typeOf(twitter) === 'boolean') {
28
+ UserAccountService.reopen({
29
+ twitter: twitter
30
+ });
31
+ }
32
+
33
+ let google = Ember.get(config, 'APP.userAccount.google');
34
+ if (Ember.typeOf(google) === 'boolean') {
35
+ UserAccountService.reopen({
36
+ google: google
37
+ });
38
+ }
39
+
40
+ let microsoft = Ember.get(config, 'APP.userAccount.microsoft');
41
+ if (Ember.typeOf(microsoft) === 'boolean') {
42
+ UserAccountService.reopen({
43
+ microsoft: microsoft
44
+ });
45
+ }
46
+
47
+ let github = Ember.get(config, 'APP.userAccount.github');
48
+ if (Ember.typeOf(github) === 'boolean') {
49
+ UserAccountService.reopen({
50
+ github: github
51
+ });
52
+ }
53
+
54
+ let ok = Ember.get(config, 'APP.userAccount.ok');
55
+ if (Ember.typeOf(ok) === 'boolean') {
56
+ UserAccountService.reopen({
57
+ ok: ok
58
+ });
59
+ }
60
+
61
+ let mailru = Ember.get(config, 'APP.userAccount.mailru');
62
+ if (Ember.typeOf(mailru) === 'boolean') {
63
+ UserAccountService.reopen({
64
+ mailru: mailru
65
+ });
66
+ }
67
+
68
+ let yandex = Ember.get(config, 'APP.userAccount.yandex');
69
+ if (Ember.typeOf(yandex) === 'boolean') {
70
+ UserAccountService.reopen({
71
+ yandex: yandex
72
+ });
73
+ }
74
+
75
+ let gosuslugi = Ember.get(config, 'APP.userAccount.gosuslugi');
76
+ if (Ember.typeOf(gosuslugi) === 'boolean') {
77
+ UserAccountService.reopen({
78
+ gosuslugi: gosuslugi
79
+ });
80
+ }
81
+
82
+ export default UserAccountService;