@valtimo/account 4.23.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/esm2020/lib/account-routing.module.mjs +52 -0
  2. package/esm2020/lib/account.init.mjs +36 -0
  3. package/esm2020/lib/account.module.mjs +83 -0
  4. package/esm2020/lib/password/password.component.mjs +104 -0
  5. package/esm2020/lib/profile/profile.component.mjs +89 -0
  6. package/esm2020/public_api.mjs +23 -0
  7. package/esm2020/valtimo-account.mjs +5 -0
  8. package/fesm2015/valtimo-account.mjs +367 -0
  9. package/fesm2015/valtimo-account.mjs.map +1 -0
  10. package/fesm2020/valtimo-account.mjs +367 -0
  11. package/fesm2020/valtimo-account.mjs.map +1 -0
  12. package/lib/account-routing.module.d.ts +7 -0
  13. package/lib/account-routing.module.d.ts.map +1 -0
  14. package/lib/account.init.d.ts +1 -0
  15. package/lib/account.init.d.ts.map +1 -0
  16. package/lib/account.module.d.ts +12 -0
  17. package/lib/account.module.d.ts.map +1 -0
  18. package/lib/password/password.component.d.ts +4 -0
  19. package/lib/password/password.component.d.ts.map +1 -0
  20. package/lib/profile/profile.component.d.ts +4 -0
  21. package/lib/profile/profile.component.d.ts.map +1 -0
  22. package/package.json +23 -11
  23. package/public_api.d.ts +1 -0
  24. package/public_api.d.ts.map +1 -0
  25. package/valtimo-account.d.ts +2 -1
  26. package/valtimo-account.d.ts.map +1 -0
  27. package/bundles/valtimo-account.umd.js +0 -366
  28. package/bundles/valtimo-account.umd.js.map +0 -1
  29. package/bundles/valtimo-account.umd.min.js +0 -2
  30. package/bundles/valtimo-account.umd.min.js.map +0 -1
  31. package/esm2015/lib/account-routing.module.js +0 -48
  32. package/esm2015/lib/account.init.js +0 -38
  33. package/esm2015/lib/account.module.js +0 -55
  34. package/esm2015/lib/password/password.component.js +0 -107
  35. package/esm2015/lib/profile/profile.component.js +0 -93
  36. package/esm2015/public_api.js +0 -23
  37. package/esm2015/valtimo-account.js +0 -6
  38. package/fesm2015/valtimo-account.js +0 -346
  39. package/fesm2015/valtimo-account.js.map +0 -1
  40. package/valtimo-account.metadata.json +0 -1
@@ -1,346 +0,0 @@
1
- import { Component, NgModule } from '@angular/core';
2
- import { FormControl, Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
3
- import { AlertService, WidgetModule, ListModule, FieldAutoFocusModule, UploaderModule, AlertModule } from '@valtimo/components';
4
- import * as momentImported from 'moment';
5
- import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
6
- import { RouterModule } from '@angular/router';
7
- import { CommonModule } from '@angular/common';
8
- import { AuthGuardService } from '@valtimo/security';
9
- import { ROLE_USER, HttpLoaderFactory } from '@valtimo/config';
10
- import { HttpClient } from '@angular/common/http';
11
-
12
- /*
13
- * Copyright 2015-2020 Ritense BV, the Netherlands.
14
- *
15
- * Licensed under EUPL, Version 1.2 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" basis,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
26
- */
27
- const moment = momentImported;
28
- moment.locale(localStorage.getItem('langKey'));
29
- class ProfileComponent {
30
- constructor(formBuilder, alertService, translate) {
31
- this.formBuilder = formBuilder;
32
- this.alertService = alertService;
33
- this.translate = translate;
34
- this.resourceIds = [];
35
- }
36
- ngOnInit() {
37
- this.reset();
38
- }
39
- ngOnDestroy() {
40
- location.reload();
41
- }
42
- get formControls() {
43
- return this.form.controls;
44
- }
45
- initData() {
46
- /* this.userProviderService.getUserIdentity().subscribe(value => {
47
- this.profile = value;
48
- this.setValues();
49
- });*/
50
- }
51
- setValues() {
52
- if (this.profile) {
53
- // set humanize dates
54
- this.profile.humanize_dates = {
55
- created_at: moment(this.profile.created_at).fromNow(),
56
- updated_at: moment(this.profile.updated_at).fromNow(),
57
- last_password_reset: moment(this.profile.last_password_reset).fromNow(),
58
- };
59
- // set form values
60
- this.form.controls.firstName.setValue(this.profile.user_metadata.firstname);
61
- this.form.controls.lastName.setValue(this.profile.user_metadata.lastname);
62
- this.form.controls.langKey.setValue(this.profile.user_metadata.langKey);
63
- }
64
- }
65
- createFormGroup() {
66
- return this.formBuilder.group({
67
- firstName: new FormControl('', Validators.required),
68
- lastName: new FormControl('', Validators.required),
69
- langKey: new FormControl('', Validators.required),
70
- });
71
- }
72
- onFileUpload(resources) {
73
- this.resourceIds = resources.map(resource => resource.id);
74
- }
75
- onSubmit() {
76
- this.form.value.email = this.profile.email;
77
- // TODO Updating profile ?? allowed when using keycloak
78
- /* this.userService.updateProfile(this.form.value).subscribe(() => {
79
- this.alertService.success('Profile has been updated');
80
- });*/
81
- }
82
- reset() {
83
- this.form = this.createFormGroup();
84
- this.initData();
85
- }
86
- }
87
- ProfileComponent.decorators = [
88
- { type: Component, args: [{
89
- selector: 'valtimo-profile',
90
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"profile\">\n <div>\n <div class=\"card-body\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Nickname</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ profile.nickname }}</div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Email</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ profile.email }}</div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Authorities</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <span\n class=\"badge badge-pill badge-success mb-1 mr-1\"\n *ngFor=\"let role of profile.roles\"\n >{{ role }}</span\n >\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Account status</strong></div>\n <div\n class=\"col-12 col-sm-8 col-lg-6\"\n [ngClass]=\"{'text-danger': profile.blocked}\"\n >\n {{ profile.blocked ? 'Blocked' : 'Activated' }}\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Account created</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.created_at }}\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Last updated</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.updated_at }}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"card-body-contrast p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"firstName\"\n >First name</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"firstName\"\n formControlName=\"firstName\"\n class=\"form-control\"\n placeholder=\"Your first name\"\n [ngClass]=\"{\n 'is-valid': formControls.firstName.touched && formControls.firstName.valid,\n 'is-invalid': formControls.firstName.touched && formControls.firstName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.firstName.touched && formControls.firstName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.firstName.errors.required\">\n Your first name is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"lastName\"\n >Last name</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"lastName\"\n formControlName=\"lastName\"\n class=\"form-control\"\n placeholder=\"Your last name\"\n [ngClass]=\"{\n 'is-valid': formControls.lastName.touched && formControls.lastName.valid,\n 'is-invalid': formControls.lastName.touched && formControls.lastName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.lastName.touched && formControls.lastName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.lastName.errors.required\">\n Your last name is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"langKey\"\n >Language</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n id=\"langKey\"\n formControlName=\"langKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid': formControls.langKey.touched && formControls.langKey.valid,\n 'is-invalid': formControls.langKey.touched && formControls.langKey.errors\n }\"\n required\n >\n <option\n *ngFor=\"let lang of translate.getLangs()\"\n [value]=\"lang\"\n [selected]=\"lang === translate.currentLang\"\n >\n {{ 'settings.language.options.' + lang | translate }}\n </option>\n </select>\n <div\n *ngIf=\"formControls.langKey.touched && formControls.langKey.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.langKey.errors.required\">\n Your language is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12\">\n <div class=\"text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
91
- styles: [""]
92
- },] }
93
- ];
94
- ProfileComponent.ctorParameters = () => [
95
- { type: FormBuilder },
96
- { type: AlertService },
97
- { type: TranslateService }
98
- ];
99
-
100
- /*
101
- * Copyright 2015-2020 Ritense BV, the Netherlands.
102
- *
103
- * Licensed under EUPL, Version 1.2 (the "License");
104
- * you may not use this file except in compliance with the License.
105
- * You may obtain a copy of the License at
106
- *
107
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
108
- *
109
- * Unless required by applicable law or agreed to in writing, software
110
- * distributed under the License is distributed on an "AS IS" basis,
111
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
- * See the License for the specific language governing permissions and
113
- * limitations under the License.
114
- */
115
- const moment$1 = momentImported;
116
- moment$1.locale(localStorage.getItem('langKey'));
117
- class PasswordComponent {
118
- constructor(formBuilder, alertService) {
119
- this.formBuilder = formBuilder;
120
- this.alertService = alertService;
121
- }
122
- ngOnInit() {
123
- this.reset();
124
- }
125
- ngOnDestroy() {
126
- location.reload();
127
- }
128
- get formControls() {
129
- return this.form.controls;
130
- }
131
- initData() {
132
- /* this.userService.getUserIdentity().subscribe(value => {
133
- this.profile = value;
134
- this.setValues();
135
- });*/
136
- }
137
- setValues() {
138
- if (this.profile) {
139
- // humanize dates
140
- this.profile.humanize_dates = {
141
- created_at: moment$1(this.profile.created_at).fromNow(),
142
- updated_at: moment$1(this.profile.updated_at).fromNow(),
143
- last_password_reset: moment$1(this.profile.last_password_reset).fromNow(),
144
- };
145
- }
146
- }
147
- createFormGroup() {
148
- return this.formBuilder.group({
149
- password: new FormControl('', [
150
- Validators.required,
151
- Validators.pattern('(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&]).{4,}'),
152
- Validators.maxLength(50),
153
- ]),
154
- confirmPassword: new FormControl('', [
155
- Validators.required,
156
- Validators.minLength(4),
157
- Validators.maxLength(50),
158
- ]),
159
- }, {
160
- validator: this.mustMatch('password', 'confirmPassword'),
161
- });
162
- }
163
- mustMatch(controlName, matchingControlName) {
164
- return (formGroup) => {
165
- const control = formGroup.controls[controlName];
166
- const matchingControl = formGroup.controls[matchingControlName];
167
- if (matchingControl.errors && !matchingControl.errors.mustMatch) {
168
- return;
169
- }
170
- if (control.value !== matchingControl.value) {
171
- matchingControl.setErrors({ mustMatch: true });
172
- }
173
- else {
174
- matchingControl.setErrors(null);
175
- }
176
- };
177
- }
178
- onSubmit() {
179
- /* this.userService.changePassword(this.form.value.password).subscribe(() => {
180
- this.alertService.success('Password has been changed');
181
- }, result => {
182
- this.errorMsg = result.error.detail.split(': ', 2)[1];
183
- this.reset();
184
- });*/
185
- }
186
- reset() {
187
- this.form = this.createFormGroup();
188
- this.initData();
189
- }
190
- }
191
- PasswordComponent.decorators = [
192
- { type: Component, args: [{
193
- selector: 'valtimo-password',
194
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"profile\">\n <div>\n <div class=\"card-body\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\">\n <strong>Last password changed</strong>\n </div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.last_password_reset }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"errorMsg\" class=\"bg-danger text-white mb-0 p-3 text-center\">\n {{ errorMsg }}\n </div>\n <div class=\"card-body-contrast p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"password\"\n >New password</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"password\"\n id=\"password\"\n minlength=\"4\"\n maxlength=\"50\"\n formControlName=\"password\"\n class=\"form-control\"\n placeholder=\"Your new password\"\n [ngClass]=\"{\n 'is-valid': formControls.password.touched && formControls.password.valid,\n 'is-invalid': formControls.password.touched && formControls.password.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.password.touched && formControls.password.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.password.errors.required\">\n Your password is required\n </div>\n <div *ngIf=\"formControls.password.errors.pattern\">\n It expects at least 1 lowercase letter, 1 uppercase letter, 1 digit and 1\n special characters. The length should be greater than 4 characters. The\n sequence of the characters is not important.\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"confirmPassword\"\n >New password confirmation</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"password\"\n id=\"confirmPassword\"\n minlength=\"4\"\n maxlength=\"50\"\n formControlName=\"confirmPassword\"\n class=\"form-control\"\n placeholder=\"Your new password confirmation\"\n [ngClass]=\"{\n 'is-valid':\n formControls.confirmPassword.touched && formControls.confirmPassword.valid,\n 'is-invalid':\n formControls.confirmPassword.touched && formControls.confirmPassword.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.confirmPassword.touched && formControls.confirmPassword.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.confirmPassword.errors.required\">\n Your new password confirmation is required\n </div>\n <div *ngIf=\"formControls.confirmPassword.errors.minlength\">\n Your new password confirmation is required to be at least 4 characters\n </div>\n <div *ngIf=\"formControls.confirmPassword.errors.mustMatch\">\n Your password and confirmation password must match\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12\">\n <div class=\"text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
195
- styles: [""]
196
- },] }
197
- ];
198
- PasswordComponent.ctorParameters = () => [
199
- { type: FormBuilder },
200
- { type: AlertService }
201
- ];
202
-
203
- /*
204
- * Copyright 2015-2020 Ritense BV, the Netherlands.
205
- *
206
- * Licensed under EUPL, Version 1.2 (the "License");
207
- * you may not use this file except in compliance with the License.
208
- * You may obtain a copy of the License at
209
- *
210
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
211
- *
212
- * Unless required by applicable law or agreed to in writing, software
213
- * distributed under the License is distributed on an "AS IS" basis,
214
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
215
- * See the License for the specific language governing permissions and
216
- * limitations under the License.
217
- */
218
- const ɵ0 = { title: 'Profile', roles: [ROLE_USER] }, ɵ1 = { title: 'Password', roles: [ROLE_USER] };
219
- const routes = [
220
- {
221
- path: 'profile',
222
- component: ProfileComponent,
223
- canActivate: [AuthGuardService],
224
- data: ɵ0,
225
- },
226
- {
227
- path: 'password',
228
- component: PasswordComponent,
229
- canActivate: [AuthGuardService],
230
- data: ɵ1,
231
- },
232
- ];
233
- class AccountRoutingModule {
234
- }
235
- AccountRoutingModule.decorators = [
236
- { type: NgModule, args: [{
237
- declarations: [],
238
- imports: [CommonModule, RouterModule.forChild(routes)],
239
- exports: [RouterModule],
240
- },] }
241
- ];
242
-
243
- /*
244
- * Copyright 2015-2020 Ritense BV, the Netherlands.
245
- *
246
- * Licensed under EUPL, Version 1.2 (the "License");
247
- * you may not use this file except in compliance with the License.
248
- * You may obtain a copy of the License at
249
- *
250
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
251
- *
252
- * Unless required by applicable law or agreed to in writing, software
253
- * distributed under the License is distributed on an "AS IS" basis,
254
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255
- * See the License for the specific language governing permissions and
256
- * limitations under the License.
257
- */
258
- const ɵ0$1 = HttpLoaderFactory;
259
- class AccountModule {
260
- }
261
- AccountModule.decorators = [
262
- { type: NgModule, args: [{
263
- declarations: [ProfileComponent, PasswordComponent],
264
- imports: [
265
- CommonModule,
266
- AccountRoutingModule,
267
- WidgetModule,
268
- ListModule,
269
- FieldAutoFocusModule,
270
- FormsModule,
271
- TranslateModule.forRoot({
272
- loader: {
273
- provide: TranslateLoader,
274
- useFactory: ɵ0$1,
275
- deps: [HttpClient],
276
- },
277
- }),
278
- ReactiveFormsModule,
279
- UploaderModule,
280
- AlertModule,
281
- ],
282
- exports: [ProfileComponent, PasswordComponent],
283
- providers: [],
284
- },] }
285
- ];
286
-
287
- /*
288
- * Copyright 2015-2020 Ritense BV, the Netherlands.
289
- *
290
- * Licensed under EUPL, Version 1.2 (the "License");
291
- * you may not use this file except in compliance with the License.
292
- * You may obtain a copy of the License at
293
- *
294
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
295
- *
296
- * Unless required by applicable law or agreed to in writing, software
297
- * distributed under the License is distributed on an "AS IS" basis,
298
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
- * See the License for the specific language governing permissions and
300
- * limitations under the License.
301
- */
302
- function accountInitializer(translate, logger) {
303
- return () => {
304
- return new Promise((resolve, reject) => {
305
- try {
306
- logger.debug('Account initializer');
307
- translate.addLangs(['en', 'nl', 'de']);
308
- let langKey = localStorage.getItem('langKey');
309
- if (langKey === null) {
310
- langKey = 'nl';
311
- localStorage.setItem('langKey', 'nl');
312
- }
313
- logger.debug('Using langKey', langKey);
314
- translate.use(langKey);
315
- resolve();
316
- }
317
- catch (error) {
318
- logger.debug('Account initializer error', error);
319
- reject(error);
320
- }
321
- });
322
- };
323
- }
324
-
325
- /*
326
- * Copyright 2015-2020 Ritense BV, the Netherlands.
327
- *
328
- * Licensed under EUPL, Version 1.2 (the "License");
329
- * you may not use this file except in compliance with the License.
330
- * You may obtain a copy of the License at
331
- *
332
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
333
- *
334
- * Unless required by applicable law or agreed to in writing, software
335
- * distributed under the License is distributed on an "AS IS" basis,
336
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
337
- * See the License for the specific language governing permissions and
338
- * limitations under the License.
339
- */
340
-
341
- /**
342
- * Generated bundle index. Do not edit.
343
- */
344
-
345
- export { AccountModule, PasswordComponent, ProfileComponent, accountInitializer, ɵ0$1 as ɵ0, AccountRoutingModule as ɵa };
346
- //# sourceMappingURL=valtimo-account.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valtimo-account.js","sources":["../../../../projects/valtimo/account/src/lib/profile/profile.component.ts","../../../../projects/valtimo/account/src/lib/password/password.component.ts","../../../../projects/valtimo/account/src/lib/account-routing.module.ts","../../../../projects/valtimo/account/src/lib/account.module.ts","../../../../projects/valtimo/account/src/lib/account.init.ts","../../../../projects/valtimo/account/src/public_api.ts","../../../../projects/valtimo/account/src/valtimo-account.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnDestroy, OnInit} from '@angular/core';\nimport {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';\nimport {AlertService} from '@valtimo/components';\nimport * as momentImported from 'moment';\nimport {TranslateService} from '@ngx-translate/core';\n\nconst moment = momentImported;\nmoment.locale(localStorage.getItem('langKey'));\n\n@Component({\n selector: 'valtimo-profile',\n templateUrl: './profile.component.html',\n styleUrls: ['./profile.component.css'],\n})\nexport class ProfileComponent implements OnInit, OnDestroy {\n public profile: any;\n public form: FormGroup;\n public resourceIds: Array<any> = [];\n\n constructor(\n private formBuilder: FormBuilder,\n private alertService: AlertService,\n public translate: TranslateService\n ) {}\n\n ngOnInit() {\n this.reset();\n }\n\n ngOnDestroy() {\n location.reload();\n }\n\n get formControls() {\n return this.form.controls;\n }\n\n private initData() {\n /* this.userProviderService.getUserIdentity().subscribe(value => {\n this.profile = value;\n this.setValues();\n });*/\n }\n\n private setValues() {\n if (this.profile) {\n // set humanize dates\n this.profile.humanize_dates = {\n created_at: moment(this.profile.created_at).fromNow(),\n updated_at: moment(this.profile.updated_at).fromNow(),\n last_password_reset: moment(this.profile.last_password_reset).fromNow(),\n };\n // set form values\n this.form.controls.firstName.setValue(this.profile.user_metadata.firstname);\n this.form.controls.lastName.setValue(this.profile.user_metadata.lastname);\n this.form.controls.langKey.setValue(this.profile.user_metadata.langKey);\n }\n }\n\n private createFormGroup() {\n return this.formBuilder.group({\n firstName: new FormControl('', Validators.required),\n lastName: new FormControl('', Validators.required),\n langKey: new FormControl('', Validators.required),\n });\n }\n\n public onFileUpload(resources) {\n this.resourceIds = resources.map(resource => resource.id);\n }\n\n public onSubmit() {\n this.form.value.email = this.profile.email;\n // TODO Updating profile ?? allowed when using keycloak\n /* this.userService.updateProfile(this.form.value).subscribe(() => {\n this.alertService.success('Profile has been updated');\n });*/\n }\n\n public reset() {\n this.form = this.createFormGroup();\n this.initData();\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnDestroy, OnInit} from '@angular/core';\nimport {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';\nimport {AlertService} from '@valtimo/components';\nimport * as momentImported from 'moment';\n\nconst moment = momentImported;\nmoment.locale(localStorage.getItem('langKey'));\n\n@Component({\n selector: 'valtimo-password',\n templateUrl: './password.component.html',\n styleUrls: ['./password.component.css'],\n})\nexport class PasswordComponent implements OnInit, OnDestroy {\n public profile: any;\n public errorMsg: string;\n public form: FormGroup;\n\n constructor(private formBuilder: FormBuilder, private alertService: AlertService) {}\n\n ngOnInit() {\n this.reset();\n }\n\n ngOnDestroy() {\n location.reload();\n }\n\n get formControls() {\n return this.form.controls;\n }\n\n private initData() {\n /* this.userService.getUserIdentity().subscribe(value => {\n this.profile = value;\n this.setValues();\n });*/\n }\n\n private setValues() {\n if (this.profile) {\n // humanize dates\n this.profile.humanize_dates = {\n created_at: moment(this.profile.created_at).fromNow(),\n updated_at: moment(this.profile.updated_at).fromNow(),\n last_password_reset: moment(this.profile.last_password_reset).fromNow(),\n };\n }\n }\n\n private createFormGroup() {\n return this.formBuilder.group(\n {\n password: new FormControl('', [\n Validators.required,\n Validators.pattern('(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&]).{4,}'),\n Validators.maxLength(50),\n ]),\n confirmPassword: new FormControl('', [\n Validators.required,\n Validators.minLength(4),\n Validators.maxLength(50),\n ]),\n },\n {\n validator: this.mustMatch('password', 'confirmPassword'),\n }\n );\n }\n\n public mustMatch(controlName: string, matchingControlName: string) {\n return (formGroup: FormGroup) => {\n const control = formGroup.controls[controlName];\n const matchingControl = formGroup.controls[matchingControlName];\n if (matchingControl.errors && !matchingControl.errors.mustMatch) {\n return;\n }\n if (control.value !== matchingControl.value) {\n matchingControl.setErrors({mustMatch: true});\n } else {\n matchingControl.setErrors(null);\n }\n };\n }\n\n public onSubmit() {\n /* this.userService.changePassword(this.form.value.password).subscribe(() => {\n this.alertService.success('Password has been changed');\n }, result => {\n this.errorMsg = result.error.detail.split(': ', 2)[1];\n this.reset();\n });*/\n }\n\n public reset() {\n this.form = this.createFormGroup();\n this.initData();\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {ProfileComponent} from './profile/profile.component';\nimport {PasswordComponent} from './password/password.component';\nimport {ROLE_USER} from '@valtimo/config';\n\nconst routes: Routes = [\n {\n path: 'profile',\n component: ProfileComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Profile', roles: [ROLE_USER]},\n },\n {\n path: 'password',\n component: PasswordComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Password', roles: [ROLE_USER]},\n },\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class AccountRoutingModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {AccountRoutingModule} from './account-routing.module';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n AlertModule,\n FieldAutoFocusModule,\n ListModule,\n UploaderModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {ProfileComponent} from './profile/profile.component';\nimport {PasswordComponent} from './password/password.component';\nimport {TranslateLoader, TranslateModule} from '@ngx-translate/core';\nimport {HttpLoaderFactory} from '@valtimo/config';\nimport {HttpClient} from '@angular/common/http';\n\n@NgModule({\n declarations: [ProfileComponent, PasswordComponent],\n imports: [\n CommonModule,\n AccountRoutingModule,\n WidgetModule,\n ListModule,\n FieldAutoFocusModule,\n FormsModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient],\n },\n }),\n ReactiveFormsModule,\n UploaderModule,\n AlertModule,\n ],\n exports: [ProfileComponent, PasswordComponent],\n providers: [],\n})\nexport class AccountModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NGXLogger} from 'ngx-logger';\nimport {TranslateService} from '@ngx-translate/core';\n\nexport function accountInitializer(\n translate: TranslateService,\n logger: NGXLogger\n): () => Promise<any> {\n return (): Promise<any> => {\n return new Promise((resolve, reject) => {\n try {\n logger.debug('Account initializer');\n translate.addLangs(['en', 'nl', 'de']);\n let langKey = localStorage.getItem('langKey');\n if (langKey === null) {\n langKey = 'nl';\n localStorage.setItem('langKey', 'nl');\n }\n logger.debug('Using langKey', langKey);\n translate.use(langKey);\n resolve();\n } catch (error) {\n logger.debug('Account initializer error', error);\n reject(error);\n }\n });\n };\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of account\n */\n\nexport * from './lib/profile/profile.component';\nexport * from './lib/password/password.component';\nexport * from './lib/account.module';\nexport * from './lib/account.init';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {AccountRoutingModule as ɵa} from './lib/account-routing.module';"],"names":["moment"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAsBA,MAAM,MAAM,GAAG,cAAc,CAAC;AAC9B,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;MAOlC,gBAAgB;IAK3B,YACU,WAAwB,EACxB,YAA0B,EAC3B,SAA2B;QAF1B,gBAAW,GAAX,WAAW,CAAa;QACxB,iBAAY,GAAZ,YAAY,CAAc;QAC3B,cAAS,GAAT,SAAS,CAAkB;QAL7B,gBAAW,GAAe,EAAE,CAAC;KAMhC;IAEJ,QAAQ;QACN,IAAI,C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E,iBAAiB,CAAC;gBAC9C,SAAS,EAAE,EAAE;aACd;;;ACvDD;;;;;;;;;;;;;;;SAmBgB,kBAAkB,CAChC,SAA2B,EAC3B,MAAiB;IAEjB,OAAO;QACL,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;YACjC,IAAI;gBACF,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;gBACpC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;gBACvC,IAAI,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAC9C,IAAI,OAAO,KAAK,IAAI,EAAE;oBACpB,OAAO,GAAG,IAAI,CAAC;oBACf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;iBACvC;gBACD,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBACvC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvB,OAAO,EAAE,CAAC;aACX;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBACjD,MAAM,CAAC,KAAK,CAAC,CAAC;aACf;SACF,CAAC,CAAC;KACJ,CAAC;AACJ;;AC1CA;;;;;;;;;;;;;;;;ACAA;;;;;;"}
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"metadata":{"ProfileComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":25,"character":1},"arguments":[{"selector":"valtimo-profile","template":"<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"profile\">\n <div>\n <div class=\"card-body\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Nickname</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ profile.nickname }}</div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Email</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ profile.email }}</div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Authorities</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <span\n class=\"badge badge-pill badge-success mb-1 mr-1\"\n *ngFor=\"let role of profile.roles\"\n >{{ role }}</span\n >\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Account status</strong></div>\n <div\n class=\"col-12 col-sm-8 col-lg-6\"\n [ngClass]=\"{'text-danger': profile.blocked}\"\n >\n {{ profile.blocked ? 'Blocked' : 'Activated' }}\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Account created</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.created_at }}\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Last updated</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.updated_at }}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"card-body-contrast p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"firstName\"\n >First name</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"firstName\"\n formControlName=\"firstName\"\n class=\"form-control\"\n placeholder=\"Your first name\"\n [ngClass]=\"{\n 'is-valid': formControls.firstName.touched && formControls.firstName.valid,\n 'is-invalid': formControls.firstName.touched && formControls.firstName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.firstName.touched && formControls.firstName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.firstName.errors.required\">\n Your first name is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"lastName\"\n >Last name</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"lastName\"\n formControlName=\"lastName\"\n class=\"form-control\"\n placeholder=\"Your last name\"\n [ngClass]=\"{\n 'is-valid': formControls.lastName.touched && formControls.lastName.valid,\n 'is-invalid': formControls.lastName.touched && formControls.lastName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.lastName.touched && formControls.lastName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.lastName.errors.required\">\n Your last name is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"langKey\"\n >Language</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select\n id=\"langKey\"\n formControlName=\"langKey\"\n class=\"form-control\"\n [ngClass]=\"{\n 'is-valid': formControls.langKey.touched && formControls.langKey.valid,\n 'is-invalid': formControls.langKey.touched && formControls.langKey.errors\n }\"\n required\n >\n <option\n *ngFor=\"let lang of translate.getLangs()\"\n [value]=\"lang\"\n [selected]=\"lang === translate.currentLang\"\n >\n {{ 'settings.language.options.' + lang | translate }}\n </option>\n </select>\n <div\n *ngIf=\"formControls.langKey.touched && formControls.langKey.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.langKey.errors.required\">\n Your language is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12\">\n <div class=\"text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n","styles":[""]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":36,"character":25},{"__symbolic":"reference","module":"@valtimo/components","name":"AlertService","line":37,"character":26},{"__symbolic":"reference","module":"@ngx-translate/core","name":"TranslateService","line":38,"character":22}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"initData":[{"__symbolic":"method"}],"setValues":[{"__symbolic":"method"}],"createFormGroup":[{"__symbolic":"method"}],"onFileUpload":[{"__symbolic":"method"}],"onSubmit":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}]}},"PasswordComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":24,"character":1},"arguments":[{"selector":"valtimo-password","template":"<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget *ngIf=\"profile\">\n <div>\n <div class=\"card-body\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\">\n <strong>Last password changed</strong>\n </div>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n {{ profile.humanize_dates.last_password_reset }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"errorMsg\" class=\"bg-danger text-white mb-0 p-3 text-center\">\n {{ errorMsg }}\n </div>\n <div class=\"card-body-contrast p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"password\"\n >New password</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"password\"\n id=\"password\"\n minlength=\"4\"\n maxlength=\"50\"\n formControlName=\"password\"\n class=\"form-control\"\n placeholder=\"Your new password\"\n [ngClass]=\"{\n 'is-valid': formControls.password.touched && formControls.password.valid,\n 'is-invalid': formControls.password.touched && formControls.password.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.password.touched && formControls.password.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.password.errors.required\">\n Your password is required\n </div>\n <div *ngIf=\"formControls.password.errors.pattern\">\n It expects at least 1 lowercase letter, 1 uppercase letter, 1 digit and 1\n special characters. The length should be greater than 4 characters. The\n sequence of the characters is not important.\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"confirmPassword\"\n >New password confirmation</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"password\"\n id=\"confirmPassword\"\n minlength=\"4\"\n maxlength=\"50\"\n formControlName=\"confirmPassword\"\n class=\"form-control\"\n placeholder=\"Your new password confirmation\"\n [ngClass]=\"{\n 'is-valid':\n formControls.confirmPassword.touched && formControls.confirmPassword.valid,\n 'is-invalid':\n formControls.confirmPassword.touched && formControls.confirmPassword.errors\n }\"\n required\n />\n <div\n *ngIf=\"\n formControls.confirmPassword.touched && formControls.confirmPassword.errors\n \"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.confirmPassword.errors.required\">\n Your new password confirmation is required\n </div>\n <div *ngIf=\"formControls.confirmPassword.errors.minlength\">\n Your new password confirmation is required to be at least 4 characters\n </div>\n <div *ngIf=\"formControls.confirmPassword.errors.mustMatch\">\n Your password and confirmation password must match\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12\">\n <div class=\"text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n","styles":[""]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/forms","name":"FormBuilder","line":34,"character":35},{"__symbolic":"reference","module":"@valtimo/components","name":"AlertService","line":34,"character":70}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"initData":[{"__symbolic":"method"}],"setValues":[{"__symbolic":"method"}],"createFormGroup":[{"__symbolic":"method"}],"mustMatch":[{"__symbolic":"method"}],"onSubmit":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}]}},"AccountModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":33,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ProfileComponent"},{"__symbolic":"reference","name":"PasswordComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":36,"character":4},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","module":"@valtimo/components","name":"WidgetModule","line":38,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"ListModule","line":39,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"FieldAutoFocusModule","line":40,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":41,"character":4},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@ngx-translate/core","name":"TranslateModule","line":42,"character":4},"member":"forRoot"},"arguments":[{"loader":{"provide":{"__symbolic":"reference","module":"@ngx-translate/core","name":"TranslateLoader","line":44,"character":17},"useFactory":{"__symbolic":"reference","module":"@valtimo/config","name":"HttpLoaderFactory","line":45,"character":20},"deps":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":46,"character":15}]}}]},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":49,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"UploaderModule","line":50,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"AlertModule","line":51,"character":4}],"exports":[{"__symbolic":"reference","name":"ProfileComponent"},{"__symbolic":"reference","name":"PasswordComponent"}],"providers":[]}]}],"members":{}},"accountInitializer":{"__symbolic":"function","parameters":["translate","logger"],"value":{"__symbolic":"error","message":"Lambda not supported","line":23,"character":9,"module":"./lib/account.init"}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":39,"character":1},"arguments":[{"declarations":[],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":41,"character":12},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":41,"character":26},"member":"forChild"},"arguments":[[{"path":"profile","component":{"__symbolic":"reference","name":"ProfileComponent"},"canActivate":[{"__symbolic":"reference","module":"@valtimo/security","name":"AuthGuardService","line":28,"character":18}],"data":{"title":"Profile","roles":[{"__symbolic":"reference","module":"@valtimo/config","name":"ROLE_USER","line":29,"character":37}]}},{"path":"password","component":{"__symbolic":"reference","name":"PasswordComponent"},"canActivate":[{"__symbolic":"reference","module":"@valtimo/security","name":"AuthGuardService","line":34,"character":18}],"data":{"title":"Password","roles":[{"__symbolic":"reference","module":"@valtimo/config","name":"ROLE_USER","line":35,"character":38}]}}]]}],"exports":[{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":42,"character":12}]}]}],"members":{}}},"origins":{"ProfileComponent":"./lib/profile/profile.component","PasswordComponent":"./lib/password/password.component","AccountModule":"./lib/account.module","accountInitializer":"./lib/account.init","ɵa":"./lib/account-routing.module"},"importAs":"@valtimo/account"}