@wawjs/ngx-bos 22.0.5 → 22.0.7

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 (41) hide show
  1. package/README.md +1 -1
  2. package/RELEASES.md +38 -0
  3. package/ai/code-style.md +15 -0
  4. package/fesm2022/file.service-C8Erkqrm.mjs +48 -0
  5. package/fesm2022/file.service-C8Erkqrm.mjs.map +1 -0
  6. package/fesm2022/{wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs → ngx-bos.config-DjtgUjR8.mjs} +3 -5
  7. package/fesm2022/ngx-bos.config-DjtgUjR8.mjs.map +1 -0
  8. package/fesm2022/user-crud.component-B1_SlIDS.mjs +317 -0
  9. package/fesm2022/user-crud.component-B1_SlIDS.mjs.map +1 -0
  10. package/fesm2022/wawjs-ngx-bos.mjs +206 -187
  11. package/fesm2022/wawjs-ngx-bos.mjs.map +1 -1
  12. package/package.json +11 -9
  13. package/src/feature/file/file.component.html +1 -0
  14. package/src/feature/file/file.component.ts +265 -239
  15. package/src/feature/file/file.service.ts +36 -36
  16. package/src/feature/file/file.util.ts +9 -2
  17. package/src/feature/file/pages/files/files.component.html +12 -12
  18. package/src/feature/file/pages/files/files.component.ts +116 -116
  19. package/src/feature/user/guards/admins.guard.ts +21 -21
  20. package/src/feature/user/guards/authenticated.guard.ts +15 -15
  21. package/src/feature/user/guards/guest.guard.ts +15 -15
  22. package/src/feature/user/pages/clients/clients.component.ts +19 -45
  23. package/src/feature/user/pages/user-crud.component.ts +119 -0
  24. package/src/feature/user/pages/users/users.component.ts +33 -86
  25. package/src/feature/user/user.service.ts +120 -21
  26. package/src/feature/user/user.storage.ts +31 -31
  27. package/src/form-components/ace/ace.component.ts +15 -1
  28. package/src/form-components/file/file.component.html +2 -2
  29. package/src/form-components/form-config-cache.ts +70 -0
  30. package/src/form-components/input/input.form.ts +1 -1
  31. package/src/form-components/select/select.component.html +24 -24
  32. package/src/form-components/tinymce/tinymce.component.ts +12 -0
  33. package/src/icons/spider/spider.component.ts +4 -4
  34. package/src/ngx-bos.config.ts +7 -5
  35. package/src/pages/form/form.component.ts +137 -100
  36. package/src/pages/forms/forms.component.ts +14 -2
  37. package/src/public-api.ts +1 -1
  38. package/types/wawjs-ngx-bos.d.ts +52 -15
  39. package/fesm2022/wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs.map +0 -1
  40. package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs +0 -181
  41. package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs.map +0 -1
@@ -1,100 +1,137 @@
1
- import { Component, computed, effect, inject } from '@angular/core';
2
- import { toSignal } from '@angular/core/rxjs-interop';
3
- import { ActivatedRoute } from '@angular/router';
4
- import { TableComponent } from '@wawjs/ngx-ui';
5
- import {
6
- Formcomponent,
7
- FormcomponentService,
8
- formcomponentForm,
9
- FormInterface,
10
- FormService,
11
- } from '@wawjs/ngx-form';
12
- import { CrudComponent } from '@wawjs/ngx-crud';
13
- import { FORM_COMPONENT_FORM } from '../../form-components';
14
- import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
15
-
16
- @Component({
17
- imports: [TableComponent],
18
- templateUrl: './form.component.html',
19
- })
20
- export class FormComponent extends CrudComponent<
21
- FormcomponentService,
22
- Formcomponent,
23
- FormInterface
24
- > {
25
- private _route = inject(ActivatedRoute);
26
- private _bosConfig = inject(NGX_BOS_CONFIG);
27
-
28
- private readonly _params = toSignal(this._route.paramMap, {
29
- initialValue: this._route.snapshot.paramMap,
30
- });
31
-
32
- /** Current `:formId` route param; updates when navigating between forms. */
33
- readonly formId = computed(() => this._params().get('formId') || '');
34
-
35
- protected override configType: 'server' | 'local' = 'local';
36
-
37
- protected override preCreate(doc: Formcomponent) {
38
- doc.formId = this.formId();
39
-
40
- doc.appId = this._bosConfig.appId;
41
- }
42
-
43
- protected override localDocumentsFilter = (doc: Formcomponent) => {
44
- return doc.formId === this.formId();
45
- };
46
-
47
- protected override allowUrl() {
48
- return false;
49
- }
50
-
51
- /** Basic columns for clients table */
52
- columns = ['name', 'key'];
53
-
54
- /** wtable config built by CrudComponent, aware of server mode */
55
- config = this.getConfig();
56
-
57
- constructor() {
58
- const formcomponentService = inject(FormcomponentService);
59
- const formService = inject(FormService);
60
-
61
- super(
62
- formcomponentForm,
63
- formService,
64
- formcomponentService,
65
- 'formcomponent',
66
- );
67
-
68
- effect(() => {
69
- // Re-filter when the route's formId changes (component is reused).
70
- this.formId();
71
-
72
- if (formcomponentService.isLoaded()) {
73
- this.setDocuments();
74
- }
75
- });
76
-
77
- this.config.buttons.unshift({
78
- icon: 'settings',
79
- click: (doc: Formcomponent) => {
80
- formService.modal<Record<string, unknown>>(
81
- FORM_COMPONENT_FORM(doc.name),
82
- {
83
- label: 'Update',
84
- click: async (updated: unknown, close: () => void) => {
85
- close();
86
-
87
- doc.props = {
88
- ...doc.props,
89
- ...(updated as object),
90
- };
91
-
92
- formcomponentService.update(doc);
93
- },
94
- },
95
- doc.props || {},
96
- );
97
- },
98
- });
99
- }
100
- }
1
+ import { Component, computed, effect, inject, untracked } from '@angular/core';
2
+ import { toSignal } from '@angular/core/rxjs-interop';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { TableComponent } from '@wawjs/ngx-ui';
5
+ import {
6
+ createFormcomponentForm,
7
+ Formcomponent,
8
+ FormcomponentService,
9
+ FormInterface,
10
+ FormService,
11
+ } from '@wawjs/ngx-form';
12
+ import { AlertService } from '@wawjs/ngx-ui';
13
+ import { CrudComponent } from '@wawjs/ngx-crud';
14
+ import { FORM_COMPONENT_FORM, FORM_COMPONENTS } from '../../form-components';
15
+ import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
16
+
17
+ @Component({
18
+ imports: [TableComponent],
19
+ templateUrl: './form.component.html',
20
+ })
21
+ export class FormComponent extends CrudComponent<
22
+ FormcomponentService,
23
+ Formcomponent,
24
+ FormInterface
25
+ > {
26
+ private _route = inject(ActivatedRoute);
27
+ private _bosConfig = inject(NGX_BOS_CONFIG);
28
+
29
+ private readonly _params = toSignal(this._route.paramMap, {
30
+ initialValue: this._route.snapshot.paramMap,
31
+ });
32
+
33
+ /** Current `:formId` route param; updates when navigating between forms. */
34
+ readonly formId = computed(() => this._params().get('formId') || '');
35
+
36
+ protected override configType: 'server' | 'local' = 'local';
37
+
38
+ protected override preCreate(doc: Formcomponent) {
39
+ doc.formId = this.formId();
40
+
41
+ doc.appId = this._bosConfig.appId;
42
+ }
43
+
44
+ protected override localDocumentsFilter = (doc: Formcomponent) => {
45
+ return doc.formId === this.formId();
46
+ };
47
+
48
+ protected override allowUrl() {
49
+ return false;
50
+ }
51
+
52
+ /** The modal reuses one model per formId; start from an empty component, not the last one. */
53
+ protected override create() {
54
+ this._resetModel(this.createObject());
55
+
56
+ super.create();
57
+ }
58
+
59
+ protected override update(doc: Formcomponent) {
60
+ this._resetModel(doc as unknown as Record<string, unknown>);
61
+
62
+ super.update(doc);
63
+ }
64
+
65
+ private _resetModel(model: Record<string, unknown>) {
66
+ if (this.form.formId) {
67
+ this._formService.reset(this.form.formId, model);
68
+ }
69
+ }
70
+
71
+ private readonly _formService = inject(FormService);
72
+
73
+ /** Basic columns for clients table */
74
+ columns = ['name', 'key'];
75
+
76
+ /** wtable config built by CrudComponent, aware of server mode */
77
+ config = this.getConfig();
78
+
79
+ constructor() {
80
+ const formcomponentService = inject(FormcomponentService);
81
+ const formService = inject(FormService);
82
+ const alertService = inject(AlertService);
83
+
84
+ super(
85
+ createFormcomponentForm(FORM_COMPONENTS),
86
+ formService,
87
+ formcomponentService,
88
+ 'formcomponent',
89
+ );
90
+
91
+ effect(() => {
92
+ // Re-filter when the route's formId or the loaded components change (component is reused).
93
+ // setDocuments() reads and writes document signals, so it runs untracked.
94
+ this.formId();
95
+ formcomponentService.documents();
96
+
97
+ if (formcomponentService.isLoaded()) {
98
+ untracked(() => void this.setDocuments());
99
+ }
100
+ });
101
+
102
+ this.config.buttons.unshift({
103
+ icon: 'settings',
104
+ click: (doc: Formcomponent) => {
105
+ const settingsForm = doc.name ? FORM_COMPONENT_FORM(doc.name) : undefined;
106
+
107
+ if (!settingsForm) {
108
+ alertService.error({ text: 'Choose a component name first' });
109
+
110
+ return;
111
+ }
112
+
113
+ if (settingsForm.formId) {
114
+ formService.reset(settingsForm.formId, doc.props || {});
115
+ }
116
+
117
+ formService.modal<Record<string, unknown>>(
118
+ settingsForm,
119
+ {
120
+ label: 'Update',
121
+ click: async (updated: unknown, close: () => void) => {
122
+ close();
123
+
124
+ doc.props = {
125
+ ...doc.props,
126
+ ...(updated as object),
127
+ };
128
+
129
+ formcomponentService.update(doc);
130
+ },
131
+ },
132
+ doc.props || {},
133
+ );
134
+ },
135
+ });
136
+ }
137
+ }
@@ -18,6 +18,11 @@ export class FormsComponent {
18
18
  {
19
19
  icon: 'edit',
20
20
  click: (form: Form) => {
21
+ // The modal reuses one model per formId; start from this form, not the last one.
22
+ if (formForm.formId) {
23
+ this._formService.reset(formForm.formId, form as unknown as Record<string, unknown>);
24
+ }
25
+
21
26
  this._formService.modal<Record<string, unknown>>(
22
27
  formForm,
23
28
  {
@@ -51,13 +56,20 @@ export class FormsComponent {
51
56
  ],
52
57
  };
53
58
 
59
+ /** Groups plain documents by formId; getSignal() writes signals, which a computed may not do. */
54
60
  readonly documents = computed<Form[]>(() => {
55
- const byFormId = this._formService.getFieldSignals('formId')();
61
+ const firstByFormId: Record<string, Form> = {};
62
+
63
+ for (const doc of this._formService.documents()) {
64
+ const formId = String(doc.formId);
65
+
66
+ firstByFormId[formId] ??= doc;
67
+ }
56
68
 
57
69
  return this._formService.formIds().map((formId) => {
58
70
  return {
71
+ ...firstByFormId[formId],
59
72
  formId,
60
- ...(byFormId[formId]?.length ? byFormId[formId][0]() : {}),
61
73
  } as Form;
62
74
  });
63
75
  });
package/src/public-api.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * the source app into the package.
6
6
  */
7
7
 
8
- export const NGX_BOS_VERSION = '22.0.4' as const;
8
+ export const NGX_BOS_VERSION = '22.0.7' as const;
9
9
 
10
10
  export type NgxBosVersion = typeof NGX_BOS_VERSION;
11
11
 
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { EnvironmentProviders, InjectionToken, PipeTransform, Provider, TemplateRef, Type } from "@angular/core";
3
3
  import { Form, FormComponentInterface, FormInterface, Formcomponent, FormcomponentService } from "@wawjs/ngx-form";
4
- import { CrudComponent, CrudDocument, CrudService } from "@wawjs/ngx-crud";
4
+ import { CrudComponent, CrudDocument, CrudService, TableConfig } from "@wawjs/ngx-crud";
5
5
  import { SelectValue } from "@wawjs/ngx-ui";
6
6
  import { CanActivateFn, Routes } from "@angular/router";
7
7
  import { CountryCode } from "libphonenumber-js";
@@ -49,6 +49,7 @@ export declare class FileComponent {
49
49
  readonly wFiles: import("@angular/core").ModelSignal<string[]>;
50
50
  private readonly _modal;
51
51
  private readonly _fs;
52
+ private readonly _alert;
52
53
  readonly isMultiple: import("@angular/core").Signal<boolean>;
53
54
  readonly isImageMode: import("@angular/core").Signal<boolean>;
54
55
  /** Normalized list of URLs for rendering */
@@ -58,6 +59,11 @@ export declare class FileComponent {
58
59
  onPicked(input: HTMLInputElement): Promise<void>;
59
60
  removeAt(index: number): void;
60
61
  clear(): void;
62
+ /**
63
+ * The backend takes the stored file's extension from `name`; without one, images are saved
64
+ * with no extension and are later shown as plain links.
65
+ */
66
+ private _uploadName;
61
67
  private _cropStageWidth;
62
68
  private _cropStageHeight;
63
69
  private _applyNewUrls;
@@ -208,7 +214,7 @@ export declare class FileSelectorComponent {
208
214
  private _translate;
209
215
  readonly wModel: import("@angular/core").InputSignal<string | null>;
210
216
  readonly wChange: import("@angular/core").OutputEmitterRef<string | null>;
211
- readonly items: import("@angular/core").Signal<import("@wawjs/ngx-bos").File[]>;
217
+ readonly items: import("@angular/core").Signal<File$1[]>;
212
218
  readonly placeholder: import("@angular/core").WritableSignal<string>;
213
219
  onSelect(value: SelectValue): void;
214
220
  static ɵfac: i0.ɵɵFactoryDeclaration<FileSelectorComponent, never>;
@@ -284,6 +290,8 @@ export declare class UserService extends CrudService<User> {
284
290
  private readonly _router;
285
291
  private readonly _emitterService;
286
292
  private readonly _bosConfig;
293
+ /** Other CRUD collections whose cached documents and queued mutations belong to one user. */
294
+ private readonly _userScopedServices;
287
295
  readonly url: string;
288
296
  roles: string[];
289
297
  employees: string[];
@@ -291,6 +299,14 @@ export declare class UserService extends CrudService<User> {
291
299
  user: import("@angular/core").WritableSignal<User>;
292
300
  thumb: import("@angular/core").Signal<string>;
293
301
  role(role: string): boolean;
302
+ /** True when the user has at least one role (admin or any configured staff role). */
303
+ hasAnyRole(user?: User): boolean;
304
+ private _usersRequested;
305
+ /**
306
+ * Loads the user list once. The backend only gives it to users with a role (it holds emails
307
+ * and phones, and anyone can register), so plain accounts do not request it at all.
308
+ */
309
+ loadUsers(): void;
294
310
  readonly usersByRole: import("@angular/core").Signal<Record<string, User[]>>;
295
311
  constructor();
296
312
  setUser(user: User): void;
@@ -323,36 +339,51 @@ export declare class UserSelectorComponent {
323
339
  }
324
340
  export declare class UserPreviewComponent {
325
341
  userService: UserService;
326
- protected readonly bosConfig: Required<import("@wawjs/ngx-bos").NgxBosConfig>;
342
+ protected readonly bosConfig: Required<NgxBosConfig>;
327
343
  static ɵfac: i0.ɵɵFactoryDeclaration<UserPreviewComponent, never>;
328
344
  static ɵcmp: i0.ɵɵComponentDeclaration<UserPreviewComponent, "user-preview", never, {}, {}, never, never, true, never>;
329
345
  }
330
- export declare class UsersComponent extends CrudComponent<UserService, User, FormInterface> {
346
+ /**
347
+ * Shared admin behavior for the Users and Clients tables.
348
+ *
349
+ * The backend's unnamed `/api/user/update` always targets the signed-in user, and user delete only
350
+ * exists as the `admin` variant, so every mutation here goes through `updateAdmin` / `deleteAdmin`.
351
+ * Email is not an updatable key on the backend, so the edit form leaves it out.
352
+ */
353
+ declare abstract class UserCrudComponent extends CrudComponent<UserService, User, FormInterface> {
354
+ protected readonly userService: UserService;
355
+ private readonly _userFormService;
356
+ private readonly _userAlertService;
357
+ private readonly _createForm;
358
+ private readonly _editForm;
331
359
  protected configType: 'server' | 'local';
332
- private readonly _formService;
360
+ constructor();
333
361
  protected allowUrl(): boolean;
334
- protected delete(doc: User): Promise<void>;
362
+ /** Bulk edit would post every row through the self-update route, so only bulk create stays. */
363
+ protected withoutBulkEdit(config: TableConfig<User>): TableConfig<User>;
364
+ protected create(): void;
335
365
  protected update(doc: User): void;
336
- userService: UserService;
366
+ protected delete(doc: User): Promise<void>;
367
+ }
368
+ export declare class UsersComponent extends UserCrudComponent {
337
369
  /** Every role gets a checkbox column; matches the columns added in the constructor. */
338
370
  readonly roles: string[];
339
371
  columns: string[];
340
372
  config: import("@wawjs/ngx-crud").TableConfig<User>;
341
- constructor();
373
+ /** Sends a copy: the row shares its `is` object with the cached user document. */
342
374
  updateRole(user: User, role: string, value: boolean): void;
343
375
  static ɵfac: i0.ɵɵFactoryDeclaration<UsersComponent, never>;
344
376
  static ɵcmp: i0.ɵɵComponentDeclaration<UsersComponent, "ng-component", never, {}, {}, never, never, true, never>;
345
377
  }
346
378
  export declare const usersRoutes: Routes;
347
- export declare class ClientsComponent extends CrudComponent<UserService, User, FormInterface> {
348
- /** Use server-side pagination for clients */
349
- protected configType: 'server' | 'local';
379
+ export declare class ClientsComponent extends UserCrudComponent {
350
380
  /** Basic columns for clients table */
351
381
  columns: string[];
352
- /** wtable config built by CrudComponent, aware of server mode */
382
+ /**
383
+ * Local mode reads the shared user list. Server mode would replace that list with one page and
384
+ * shrink the Users table and the user selectors until reload.
385
+ */
353
386
  config: import("@wawjs/ngx-crud").TableConfig<User>;
354
- protected allowUrl(): boolean;
355
- constructor();
356
387
  static ɵfac: i0.ɵɵFactoryDeclaration<ClientsComponent, never>;
357
388
  static ɵcmp: i0.ɵɵComponentDeclaration<ClientsComponent, "ng-component", never, {}, {}, never, never, true, never>;
358
389
  }
@@ -367,6 +398,11 @@ export declare class FormComponent extends CrudComponent<FormcomponentService, F
367
398
  protected preCreate(doc: Formcomponent): void;
368
399
  protected localDocumentsFilter: (doc: Formcomponent) => boolean;
369
400
  protected allowUrl(): boolean;
401
+ /** The modal reuses one model per formId; start from an empty component, not the last one. */
402
+ protected create(): void;
403
+ protected update(doc: Formcomponent): void;
404
+ private _resetModel;
405
+ private readonly _formService;
370
406
  /** Basic columns for clients table */
371
407
  columns: string[];
372
408
  /** wtable config built by CrudComponent, aware of server mode */
@@ -391,6 +427,7 @@ export declare class FormsComponent {
391
427
  click?: undefined;
392
428
  })[];
393
429
  };
430
+ /** Groups plain documents by formId; getSignal() writes signals, which a computed may not do. */
394
431
  readonly documents: import("@angular/core").Signal<Form[]>;
395
432
  static ɵfac: i0.ɵɵFactoryDeclaration<FormsComponent, never>;
396
433
  static ɵcmp: i0.ɵɵComponentDeclaration<FormsComponent, "ng-component", never, {}, {}, never, never, true, never>;
@@ -430,6 +467,6 @@ export declare class PhonePipe implements PipeTransform {
430
467
  static ɵfac: i0.ɵɵFactoryDeclaration<PhonePipe, never>;
431
468
  static ɵpipe: i0.ɵɵPipeDeclaration<PhonePipe, "phone", true>;
432
469
  }
433
- export declare const NGX_BOS_VERSION: "22.0.4";
470
+ export declare const NGX_BOS_VERSION: "22.0.7";
434
471
  export type NgxBosVersion = typeof NGX_BOS_VERSION;
435
472
  export { File$1 as File };
@@ -1 +0,0 @@
1
- {"version":3,"file":"wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs","names":[],"sources":["../../../projects/ngx-bos/src/ngx-bos.config.ts"],"sourcesContent":["import {\r\n\tEnvironmentProviders,\r\n\tInjectionToken,\r\n\tProvider,\r\n\tmakeEnvironmentProviders,\r\n} from '@angular/core';\r\nimport { FormComponentInterface } from '@wawjs/ngx-form';\r\n\r\nexport interface NgxBosConfig {\r\n\tappId?: string;\r\n\turl?: string;\r\n\tcdnUrl?: string;\r\n\troles?: string[];\r\n\tuserFields?: string[];\r\n\tuserForm?: FormComponentInterface[];\r\n\tsignPath?: string;\r\n\tprofilePath?: string;\r\n\tdefaultUserThumb?: string;\r\n}\r\n\r\nexport const DEFAULT_NGX_BOS_CONFIG: Required<NgxBosConfig> = {\r\n\tappId: '',\r\n\turl: '',\r\n\tcdnUrl: 'https://cdn.webart.work',\r\n\troles: [],\r\n\tuserFields: [],\r\n\tuserForm: [],\r\n\tsignPath: '/sign',\r\n\tprofilePath: '/profile',\r\n\tdefaultUserThumb: 'default.png',\n};\r\n\r\nexport const NGX_BOS_CONFIG = new InjectionToken<Required<NgxBosConfig>>(\r\n\t'NGX_BOS_CONFIG',\r\n\t{\r\n\t\tfactory: () => DEFAULT_NGX_BOS_CONFIG,\r\n\t},\r\n);\r\n\r\nexport function ngxBosProvide(config: NgxBosConfig = {}): EnvironmentProviders {\r\n\treturn makeEnvironmentProviders([\r\n\t\t{\r\n\t\t\tprovide: NGX_BOS_CONFIG,\r\n\t\t\tuseValue: {\r\n\t\t\t\t...DEFAULT_NGX_BOS_CONFIG,\r\n\t\t\t\t...config,\r\n\t\t\t\troles: config.roles ?? DEFAULT_NGX_BOS_CONFIG.roles,\r\n\t\t\t\tuserFields: config.userFields ?? DEFAULT_NGX_BOS_CONFIG.userFields,\r\n\t\t\t\tuserForm: config.userForm ?? DEFAULT_NGX_BOS_CONFIG.userForm,\r\n\t\t\t},\r\n\t\t} satisfies Provider,\r\n\t]);\r\n}\r\n\r\nexport const provideNgxBos = ngxBosProvide;\r\n"],"mappings":";AAoBA,MAAa,yBAAiD;CAC7D,OAAO;CACP,KAAK;CACL,QAAQ;CACR,OAAO,CAAA;CACP,YAAY,CAAA;CACZ,UAAU,CAAA;CACV,UAAU;CACV,aAAa;CACb,kBAAkB;AAClB;AAED,MAAa,iBAAiB,IAAI,eACjC,kBACA,EACC,eAAe,uBACf,CAAA;AAGF,SAAgB,cAAc,SAAuB,CAAA,GAAE;CACtD,OAAO,yBAAyB,CAC/B;EACC,SAAS;EACT,UAAU;GACT,GAAG;GACH,GAAG;GACH,OAAO,OAAO,SAAS,uBAAuB;GAC9C,YAAY,OAAO,cAAc,uBAAuB;GACxD,UAAU,OAAO,YAAY,uBAAuB;EACpD;CACkB,CACpB,CAAA;AACF;AAEA,MAAa,gBAAgB"}
@@ -1,181 +0,0 @@
1
- import { n as NGX_BOS_CONFIG } from "./wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs";
2
- import * as i0 from "@angular/core";
3
- import { Service, computed, inject, signal } from "@angular/core";
4
- import { AlertService } from "@wawjs/ngx-ui";
5
- import { CrudService } from "@wawjs/ngx-crud";
6
- import { HttpService } from "@wawjs/ngx-http";
7
- import { EmitterService } from "@wawjs/ngx-core";
8
- import { Router } from "@angular/router";
9
- const createUserFormComponents = (userForm = []) => ({
10
- formId: "user",
11
- title: "Profile Settings",
12
- components: [
13
- {
14
- name: "Input",
15
- key: "name",
16
- focused: true,
17
- props: {
18
- placeholder: "Enter name...",
19
- label: "Name"
20
- }
21
- },
22
- {
23
- name: "Input",
24
- key: "email",
25
- props: {
26
- placeholder: "Enter email...",
27
- label: "Email",
28
- type: "email"
29
- }
30
- },
31
- {
32
- name: "Input",
33
- key: "phone",
34
- props: {
35
- placeholder: "Enter phone...",
36
- label: "Phone"
37
- }
38
- },
39
- {
40
- name: "Input",
41
- key: "bio",
42
- props: {
43
- placeholder: "Enter bio...",
44
- label: "Biography",
45
- type: "textarea"
46
- }
47
- },
48
- ...userForm
49
- ]
50
- });
51
- const userFormComponentsFactory = () => {
52
- const config = inject(NGX_BOS_CONFIG);
53
- return createUserFormComponents(config.userForm);
54
- };
55
- const USER_STORAGE_KEY = "waw_user";
56
- function readStoredUser() {
57
- const stored = localStorage.getItem(USER_STORAGE_KEY);
58
- if (!stored) return null;
59
- try {
60
- const user = JSON.parse(stored);
61
- if (user && typeof user === "object") return user;
62
- } catch {}
63
- localStorage.removeItem(USER_STORAGE_KEY);
64
- return null;
65
- }
66
- var UserService = class UserService extends CrudService {
67
- role(role) {
68
- return !!(this.user().is || {})[role];
69
- }
70
- constructor() {
71
- super({
72
- name: "user",
73
- replace: (user) => {
74
- user.roles = [];
75
- user.data = user.data || {};
76
- user.is = user.is || {};
77
- for (const field of this._bosConfig.userFields) user.data[field] = user.data[field] || {};
78
- for (const role of this.roles) if (user.is[role]) user.roles.push(role);
79
- return user;
80
- }
81
- });
82
- this._userHttpService = inject(HttpService);
83
- this._alertService = inject(AlertService);
84
- this._router = inject(Router);
85
- this._emitterService = inject(EmitterService);
86
- this._bosConfig = inject(NGX_BOS_CONFIG);
87
- this.url = this._bosConfig.url;
88
- this.roles = this._bosConfig.roles.concat(["admin"]);
89
- this.employees = this._bosConfig.roles;
90
- this.users = this.documents;
91
- this.user = signal(readStoredUser() ?? this.prepareDocument()(), ...ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []);
92
- this.thumb = computed(() => {
93
- const thumb = this.user().thumb;
94
- return !thumb || thumb.includes(this._bosConfig.defaultUserThumb) ? this._bosConfig.defaultUserThumb : /^https?:\/\//i.test(thumb) ? thumb : this.url + thumb;
95
- }, ...ngDevMode ? [{ debugName: "thumb" }] : /* istanbul ignore next */ []);
96
- this.usersByRole = computed(() => {
97
- const splitted = {};
98
- for (const user of this.documents()) for (const role of user.roles || []) {
99
- if (role === void 0 || role === null) continue;
100
- (splitted[String(role)] ??= []).push(user);
101
- }
102
- return splitted;
103
- }, ...ngDevMode ? [{ debugName: "usersByRole" }] : /* istanbul ignore next */ []);
104
- if (localStorage.getItem("waw_user")) {
105
- this.fetch({}, { name: "me" }).subscribe((user) => {
106
- if (user) this.setUser(user);
107
- else if (localStorage.getItem("waw_user")) this.logout();
108
- });
109
- this.get({ query: this._bosConfig.appId ? "appId=" + this._bosConfig.appId : "" });
110
- }
111
- }
112
- setUser(user) {
113
- this.user.set(user);
114
- localStorage.setItem(USER_STORAGE_KEY, JSON.stringify(user));
115
- this._emitterService.complete("us.user");
116
- }
117
- updateMe() {
118
- this.setUser(this.user());
119
- return this.update(this.user()).subscribe(() => {
120
- this._alertService.info({ text: "Profile information has been updated" });
121
- });
122
- }
123
- updateMeAfterWhile() {
124
- this.setUser(this.user());
125
- this.updateAfterWhile(this.user());
126
- }
127
- changePassword(oldPass, newPass) {
128
- return this._userHttpService.post("/api/user/changePassword", {
129
- newPass,
130
- oldPass
131
- }, (resp) => {
132
- if (resp) this._alertService.info({ text: "Successfully changed password" });
133
- else this._alertService.error({ text: "Incorrect current password" });
134
- });
135
- }
136
- logout() {
137
- this.user.set(this.prepareDocument()());
138
- localStorage.removeItem(USER_STORAGE_KEY);
139
- this._userHttpService.remove("token");
140
- this._userHttpService.get("/api/user/logout");
141
- this._router.navigateByUrl(this._bosConfig.signPath);
142
- setTimeout(() => {
143
- location.reload();
144
- }, 100);
145
- }
146
- updateAdmin(user) {
147
- return this.update(user, { name: "admin" });
148
- }
149
- deleteAdmin(user) {
150
- return this.delete(user, { name: "admin" });
151
- }
152
- static {
153
- this.ɵfac = i0.ɵɵngDeclareFactory({
154
- minVersion: "12.0.0",
155
- version: "22.2.5",
156
- ngImport: i0,
157
- type: UserService,
158
- deps: [],
159
- target: i0.ɵɵFactoryTarget.Service
160
- });
161
- }
162
- static {
163
- this.ɵprov = i0.ɵɵngDeclareService({
164
- minVersion: "22.0.0",
165
- version: "22.2.5",
166
- ngImport: i0,
167
- type: UserService
168
- });
169
- }
170
- };
171
- i0.ɵɵngDeclareClassMetadata({
172
- minVersion: "12.0.0",
173
- version: "22.2.5",
174
- ngImport: i0,
175
- type: UserService,
176
- decorators: [{ type: Service }],
177
- ctorParameters: () => []
178
- });
179
- export { userFormComponentsFactory as i, readStoredUser as n, createUserFormComponents as r, UserService as t };
180
-
181
- //# sourceMappingURL=wawjs-ngx-bos-user.service-BL0vq7J4.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wawjs-ngx-bos-user.service-BL0vq7J4.mjs","names":[],"sources":["../../../projects/ngx-bos/src/feature/user/user.form.ts","../../../projects/ngx-bos/src/feature/user/user.storage.ts","../../../projects/ngx-bos/src/feature/user/user.service.ts"],"sourcesContent":["import { inject } from '@angular/core';\r\nimport { FormComponentInterface } from '@wawjs/ngx-form';\r\nimport { NGX_BOS_CONFIG } from '../../ngx-bos.config';\r\n\r\nexport const createUserFormComponents = (\r\n\tuserForm: FormComponentInterface[] = [],\r\n) => ({\r\n\tformId: 'user',\r\n\ttitle: 'Profile Settings',\r\n\tcomponents: [\r\n\t\t{\r\n\t\t\tname: 'Input',\r\n\t\t\tkey: 'name',\r\n\t\t\tfocused: true,\r\n\t\t\tprops: {\r\n\t\t\t\tplaceholder: 'Enter name...',\r\n\t\t\t\tlabel: 'Name',\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: 'Input',\r\n\t\t\tkey: 'email',\r\n\t\t\tprops: {\r\n\t\t\t\tplaceholder: 'Enter email...',\r\n\t\t\t\tlabel: 'Email',\r\n\t\t\t\ttype: 'email',\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: 'Input',\r\n\t\t\tkey: 'phone',\r\n\t\t\tprops: {\r\n\t\t\t\tplaceholder: 'Enter phone...',\r\n\t\t\t\tlabel: 'Phone',\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: 'Input',\r\n\t\t\tkey: 'bio',\r\n\t\t\tprops: {\r\n\t\t\t\tplaceholder: 'Enter bio...',\r\n\t\t\t\tlabel: 'Biography',\r\n\t\t\t\ttype: 'textarea',\r\n\t\t\t},\r\n\t\t},\r\n\t\t...userForm,\r\n\t],\r\n});\r\n\r\nexport const userFormComponentsFactory = () => {\r\n\tconst config = inject(NGX_BOS_CONFIG);\r\n\r\n\treturn createUserFormComponents(config.userForm);\r\n};\r\n","import { User } from './user.interface';\n\n/** localStorage key holding the signed-in user snapshot. */\nexport const USER_STORAGE_KEY = 'waw_user';\n\n/**\n * Reads the stored user snapshot. Returns `null` when nothing is stored or when the\n * stored value is corrupted; a corrupted value is removed so it cannot break guards\n * or service initialization again.\n */\nexport function readStoredUser(): User | null {\n\tconst stored = localStorage.getItem(USER_STORAGE_KEY);\n\n\tif (!stored) {\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst user = JSON.parse(stored) as User | null;\n\n\t\tif (user && typeof user === 'object') {\n\t\t\treturn user;\n\t\t}\n\t} catch {\n\t\t// fall through to cleanup\n\t}\n\n\tlocalStorage.removeItem(USER_STORAGE_KEY);\n\n\treturn null;\n}\n","import { Service, computed, inject, signal } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport { AlertService } from '@wawjs/ngx-ui';\r\nimport { CrudService } from '@wawjs/ngx-crud';\r\nimport { EmitterService } from '@wawjs/ngx-core';\r\nimport { HttpService } from '@wawjs/ngx-http';\r\nimport { NGX_BOS_CONFIG } from '../../ngx-bos.config';\r\nimport { User } from './user.interface';\r\nimport { readStoredUser, USER_STORAGE_KEY } from './user.storage';\r\n@Service()\r\nexport class UserService extends CrudService<User> {\r\n\tprivate readonly _userHttpService = inject(HttpService);\r\n\r\n\tprivate readonly _alertService = inject(AlertService);\r\n\r\n\tprivate readonly _router = inject(Router);\r\n\r\n\tprivate readonly _emitterService = inject(EmitterService);\r\n\r\n\tprivate readonly _bosConfig = inject(NGX_BOS_CONFIG);\r\n\r\n\treadonly url = this._bosConfig.url;\r\n\r\n\troles = this._bosConfig.roles.concat(['admin']);\r\n\r\n\temployees = this._bosConfig.roles;\r\n\r\n\treadonly users = this.documents;\r\n\r\n\tuser = signal<User>(readStoredUser() ?? this.prepareDocument()());\r\n\r\n\tthumb = computed(() => {\r\n\t\tconst thumb = this.user().thumb;\r\n\r\n\t\treturn !thumb || thumb.includes(this._bosConfig.defaultUserThumb)\r\n\t\t\t? this._bosConfig.defaultUserThumb\r\n\t\t\t: /^https?:\\/\\//i.test(thumb)\r\n\t\t\t\t? thumb\r\n\t\t\t\t: this.url + thumb;\r\n\t});\r\n\r\n\trole(role: string): boolean {\r\n\t\treturn !!(this.user().is || {})[role];\r\n\t}\r\n\r\n\treadonly usersByRole = computed<Record<string, User[]>>(() => {\r\n\t\tconst splitted: Record<string, User[]> = {};\r\n\r\n\t\tfor (const user of this.documents()) {\r\n\t\t\tfor (const role of user.roles || []) {\r\n\t\t\t\tif (role === undefined || role === null) continue;\r\n\t\t\t\t(splitted[String(role)] ??= []).push(user);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn splitted;\r\n\t});\r\n\r\n\tconstructor() {\r\n\t\tsuper({\r\n\t\t\tname: 'user',\r\n\t\t\treplace: (user) => {\r\n\t\t\t\tuser.roles = [];\r\n\t\t\t\tuser.data = user.data || {};\r\n\t\t\t\tuser.is = user.is || {};\r\n\r\n\t\t\t\tfor (const field of this._bosConfig.userFields) {\r\n\t\t\t\t\tuser.data[field] = user.data[field] || {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (const role of this.roles) {\r\n\t\t\t\t\tif (user.is[role]) {\r\n\t\t\t\t\t\tuser.roles.push(role);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn user;\r\n\t\t\t},\r\n\t\t});\r\n\r\n\t\tif (localStorage.getItem(USER_STORAGE_KEY)) {\r\n\t\t\tthis.fetch({}, { name: 'me' }).subscribe((user: User) => {\r\n\t\t\t\tif (user) {\r\n\t\t\t\t\tthis.setUser(user);\r\n\t\t\t\t} else if (localStorage.getItem(USER_STORAGE_KEY)) {\r\n\t\t\t\t\tthis.logout();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.get({\r\n\t\t\t\tquery: this._bosConfig.appId ? 'appId=' + this._bosConfig.appId : '',\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tsetUser(user: User) {\r\n\t\tthis.user.set(user);\r\n\r\n\t\tlocalStorage.setItem(USER_STORAGE_KEY, JSON.stringify(user));\r\n\r\n\t\tthis._emitterService.complete('us.user');\r\n\t}\r\n\r\n\tupdateMe() {\r\n\t\tthis.setUser(this.user());\r\n\r\n\t\treturn this.update(this.user()).subscribe(() => {\r\n\t\t\tthis._alertService.info({\r\n\t\t\t\ttext: 'Profile information has been updated',\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tupdateMeAfterWhile() {\r\n\t\tthis.setUser(this.user());\r\n\r\n\t\tthis.updateAfterWhile(this.user());\r\n\t}\r\n\r\n\tchangePassword(oldPass: string, newPass: string) {\r\n\t\treturn this._userHttpService.post(\r\n\t\t\t'/api/user/changePassword',\r\n\t\t\t{\r\n\t\t\t\tnewPass: newPass,\r\n\t\t\t\toldPass: oldPass,\r\n\t\t\t},\r\n\t\t\t(resp: boolean) => {\r\n\t\t\t\tif (resp) {\r\n\t\t\t\t\tthis._alertService.info({\r\n\t\t\t\t\t\ttext: 'Successfully changed password',\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._alertService.error({\r\n\t\t\t\t\t\ttext: 'Incorrect current password',\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\t}\r\n\r\n\tlogout() {\r\n\t\tthis.user.set(this.prepareDocument()());\r\n\r\n\t\tlocalStorage.removeItem(USER_STORAGE_KEY);\r\n\r\n\t\tthis._userHttpService.remove('token');\r\n\r\n\t\tthis._userHttpService.get('/api/user/logout');\r\n\r\n\t\tthis._router.navigateByUrl(this._bosConfig.signPath);\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tlocation.reload();\r\n\t\t}, 100);\r\n\t}\r\n\r\n\tupdateAdmin(user: User) {\r\n\t\treturn this.update(user, {\r\n\t\t\tname: 'admin',\r\n\t\t});\r\n\t}\r\n\r\n\tdeleteAdmin(user: User) {\r\n\t\treturn this.delete(user, {\r\n\t\t\tname: 'admin',\r\n\t\t});\r\n\t}\r\n}\r\n"],"mappings":";;;;;;;;AAIA,MAAa,4BACZ,WAAqC,CAAA,OAChC;CACL,QAAQ;CACR,OAAO;CACP,YAAY;EACX;GACC,MAAM;GACN,KAAK;GACL,SAAS;GACT,OAAO;IACN,aAAa;IACb,OAAO;GACP;EACD;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