@tuki-io/tuki-widgets 0.0.7 → 0.0.9

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 (229) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +3 -39
  4. package/src/lib/widgets.component.spec.ts +23 -0
  5. package/src/lib/widgets.component.ts +20 -0
  6. package/src/lib/widgets.module.ts +16 -0
  7. package/src/lib/widgets.service.spec.ts +16 -0
  8. package/src/lib/widgets.service.ts +9 -0
  9. package/{public-api.d.ts → src/public-api.ts} +4 -0
  10. package/src/test.ts +27 -0
  11. package/styles/_variables.scss +90 -0
  12. package/styles/form.scss +231 -0
  13. package/styles/icons.scss +32 -0
  14. package/styles/styles.scss +110 -0
  15. package/styles/tables.scss +30 -0
  16. package/tsconfig.lib.json +36 -0
  17. package/tsconfig.lib.prod.json +10 -0
  18. package/tsconfig.spec.json +17 -0
  19. package/user-manage/ng-package.json +7 -0
  20. package/user-manage/src/app.constants.ts +38 -0
  21. package/user-manage/src/classes/device.ts +225 -0
  22. package/user-manage/src/classes/line.ts +117 -0
  23. package/user-manage/src/classes/notification.ts +39 -0
  24. package/user-manage/src/classes/pagination.ts +18 -0
  25. package/user-manage/src/classes/simplified-user.ts +128 -0
  26. package/user-manage/src/classes/table-data.ts +6 -0
  27. package/user-manage/src/classes/user-interface.ts +225 -0
  28. package/user-manage/src/classes/user-list.ts +40 -0
  29. package/user-manage/src/classes/user.ts +8 -0
  30. package/user-manage/src/common-functions.ts +16 -0
  31. package/user-manage/src/environments/environment.prod.ts +9 -0
  32. package/user-manage/src/environments/environment.ts +10 -0
  33. package/user-manage/src/interseptors/auth.interceptor.ts +36 -0
  34. package/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +50 -0
  35. package/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +3 -0
  36. package/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +81 -0
  37. package/user-manage/src/material.module.ts +85 -0
  38. package/user-manage/src/notifications/notification.component.html +33 -0
  39. package/user-manage/src/notifications/notification.component.scss +84 -0
  40. package/user-manage/src/notifications/notification.component.ts +46 -0
  41. package/user-manage/src/removeKynFromIBM.service.ts +25 -0
  42. package/user-manage/src/services/api.service.ts +90 -0
  43. package/user-manage/src/services/notification.service.ts +68 -0
  44. package/user-manage/src/services/removeKynFromIBM.service.ts +25 -0
  45. package/user-manage/src/services/site-settings.service.ts +35 -0
  46. package/user-manage/src/services/user.service.ts +120 -0
  47. package/user-manage/src/services/users-search.service.ts +58 -0
  48. package/user-manage/src/services/utils.service.ts +71 -0
  49. package/user-manage/src/styles/_variables.scss +90 -0
  50. package/user-manage/src/styles/form.scss +231 -0
  51. package/user-manage/src/styles/icons.scss +32 -0
  52. package/user-manage/src/styles/styles.scss +110 -0
  53. package/user-manage/src/styles/tables.scss +30 -0
  54. package/user-manage/src/user-details/notification.service.ts +68 -0
  55. package/user-manage/src/user-info/user-info.component.html +32 -0
  56. package/user-manage/src/user-info/user-info.component.scss +53 -0
  57. package/user-manage/src/user-info/user-info.component.ts +19 -0
  58. package/user-manage/src/user-manage-widget.component.html +291 -0
  59. package/user-manage/src/user-manage-widget.component.scss +461 -0
  60. package/user-manage/src/user-manage-widget.component.ts +165 -0
  61. package/user-manage/src/user-manage.module.ts +53 -0
  62. package/user-manage/src/utils/app-loader/app-loader.component.html +6 -0
  63. package/user-manage/src/utils/app-loader/app-loader.component.scss +11 -0
  64. package/user-manage/src/utils/app-loader/app-loader.ts +13 -0
  65. package/user-manage/src/utils/pagination/pagination.component.html +26 -0
  66. package/user-manage/src/utils/pagination/pagination.component.scss +41 -0
  67. package/user-manage/src/utils/pagination/pagination.component.ts +41 -0
  68. package/users-list/ng-package.json +6 -0
  69. package/users-list/src/app.constants.ts +35 -0
  70. package/users-list/src/classes/device.ts +225 -0
  71. package/users-list/src/classes/line.ts +117 -0
  72. package/users-list/src/classes/notification.ts +38 -0
  73. package/users-list/src/classes/pagination.ts +18 -0
  74. package/users-list/src/classes/simlified-user.ts +74 -0
  75. package/users-list/src/classes/table-data.ts +6 -0
  76. package/users-list/src/classes/user-interface.ts +225 -0
  77. package/users-list/src/classes/user-list.ts +40 -0
  78. package/users-list/src/classes/user.ts +8 -0
  79. package/users-list/src/material.module.ts +84 -0
  80. package/users-list/src/services/api.service.ts +90 -0
  81. package/users-list/src/services/events-communication.service.ts +11 -0
  82. package/users-list/src/services/notification.service.ts +68 -0
  83. package/users-list/src/services/removeKynFromIBM.service.ts +25 -0
  84. package/users-list/src/services/user.service.ts +117 -0
  85. package/users-list/src/services/users-search.service.ts +58 -0
  86. package/users-list/src/users-list.component.css +4 -0
  87. package/users-list/src/users-list.component.css.map +1 -0
  88. package/users-list/src/users-list.component.html +39 -0
  89. package/users-list/src/users-list.component.scss +9 -0
  90. package/users-list/src/users-list.component.ts +87 -0
  91. package/users-list/src/users-list.module.ts +36 -0
  92. package/users-list/src/utils/app-loader/app-loader.component.css +11 -0
  93. package/users-list/src/utils/app-loader/app-loader.component.css.map +1 -0
  94. package/users-list/src/utils/app-loader/app-loader.component.html +6 -0
  95. package/users-list/src/utils/app-loader/app-loader.component.scss +11 -0
  96. package/users-list/src/utils/app-loader/app-loader.ts +13 -0
  97. package/users-list/src/utils/common-functions.ts +16 -0
  98. package/users-list/src/utils/notifications/notification.component.html +33 -0
  99. package/users-list/src/utils/notifications/notification.component.scss +84 -0
  100. package/users-list/src/utils/notifications/notification.component.ts +46 -0
  101. package/users-list/src/utils/pagination/pagination.component.css +45 -0
  102. package/users-list/src/utils/pagination/pagination.component.css.map +1 -0
  103. package/users-list/src/utils/pagination/pagination.component.html +26 -0
  104. package/users-list/src/utils/pagination/pagination.component.scss +41 -0
  105. package/users-list/src/utils/pagination/pagination.component.ts +41 -0
  106. package/users-list/src/utils/utils.service.ts +71 -0
  107. package/esm2020/lib/widgets.component.mjs +0 -22
  108. package/esm2020/lib/widgets.module.mjs +0 -21
  109. package/esm2020/lib/widgets.service.mjs +0 -14
  110. package/esm2020/public-api.mjs +0 -7
  111. package/esm2020/tuki-io-tuki-widgets.mjs +0 -5
  112. package/esm2020/user-manage/public-api.mjs +0 -7
  113. package/esm2020/user-manage/src/app.constants.mjs +0 -38
  114. package/esm2020/user-manage/src/classes/device.mjs +0 -7
  115. package/esm2020/user-manage/src/classes/line.mjs +0 -9
  116. package/esm2020/user-manage/src/classes/notification.mjs +0 -32
  117. package/esm2020/user-manage/src/classes/pagination.mjs +0 -8
  118. package/esm2020/user-manage/src/classes/simplified-user.mjs +0 -82
  119. package/esm2020/user-manage/src/classes/table-data.mjs +0 -2
  120. package/esm2020/user-manage/src/classes/user-list.mjs +0 -10
  121. package/esm2020/user-manage/src/common-functions.mjs +0 -19
  122. package/esm2020/user-manage/src/environments/environment.mjs +0 -11
  123. package/esm2020/user-manage/src/interseptors/auth.interceptor.mjs +0 -37
  124. package/esm2020/user-manage/src/lazy-loading-select/lazy-loading-select.component.mjs +0 -74
  125. package/esm2020/user-manage/src/material.module.mjs +0 -188
  126. package/esm2020/user-manage/src/notifications/notification.component.mjs +0 -35
  127. package/esm2020/user-manage/src/removeKynFromIBM.service.mjs +0 -25
  128. package/esm2020/user-manage/src/services/api.service.mjs +0 -79
  129. package/esm2020/user-manage/src/services/notification.service.mjs +0 -62
  130. package/esm2020/user-manage/src/services/removeKynFromIBM.service.mjs +0 -25
  131. package/esm2020/user-manage/src/services/site-settings.service.mjs +0 -36
  132. package/esm2020/user-manage/src/services/user.service.mjs +0 -108
  133. package/esm2020/user-manage/src/services/users-search.service.mjs +0 -49
  134. package/esm2020/user-manage/src/services/utils.service.mjs +0 -73
  135. package/esm2020/user-manage/src/user-info/user-info.component.mjs +0 -20
  136. package/esm2020/user-manage/src/user-manage-widget.component.mjs +0 -159
  137. package/esm2020/user-manage/src/user-manage.module.mjs +0 -84
  138. package/esm2020/user-manage/src/utils/app-loader/app-loader.mjs +0 -14
  139. package/esm2020/user-manage/src/utils/pagination/pagination.component.mjs +0 -43
  140. package/esm2020/user-manage/tuki-io-tuki-widgets-user-manage.mjs +0 -5
  141. package/esm2020/users-list/public-api.mjs +0 -9
  142. package/esm2020/users-list/src/app.constants.mjs +0 -35
  143. package/esm2020/users-list/src/classes/device.mjs +0 -7
  144. package/esm2020/users-list/src/classes/line.mjs +0 -9
  145. package/esm2020/users-list/src/classes/notification.mjs +0 -31
  146. package/esm2020/users-list/src/classes/pagination.mjs +0 -8
  147. package/esm2020/users-list/src/classes/simlified-user.mjs +0 -50
  148. package/esm2020/users-list/src/classes/table-data.mjs +0 -2
  149. package/esm2020/users-list/src/classes/user-list.mjs +0 -10
  150. package/esm2020/users-list/src/material.module.mjs +0 -188
  151. package/esm2020/users-list/src/services/api.service.mjs +0 -78
  152. package/esm2020/users-list/src/services/events-communication.service.mjs +0 -14
  153. package/esm2020/users-list/src/services/notification.service.mjs +0 -62
  154. package/esm2020/users-list/src/services/removeKynFromIBM.service.mjs +0 -25
  155. package/esm2020/users-list/src/services/user.service.mjs +0 -105
  156. package/esm2020/users-list/src/services/users-search.service.mjs +0 -49
  157. package/esm2020/users-list/src/users-list.component.mjs +0 -75
  158. package/esm2020/users-list/src/users-list.module.mjs +0 -58
  159. package/esm2020/users-list/src/utils/common-functions.mjs +0 -19
  160. package/esm2020/users-list/src/utils/pagination/pagination.component.mjs +0 -43
  161. package/esm2020/users-list/src/utils/utils.service.mjs +0 -73
  162. package/esm2020/users-list/tuki-io-tuki-widgets-users-list.mjs +0 -5
  163. package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs +0 -1232
  164. package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs.map +0 -1
  165. package/fesm2015/tuki-io-tuki-widgets-users-list.mjs +0 -869
  166. package/fesm2015/tuki-io-tuki-widgets-users-list.mjs.map +0 -1
  167. package/fesm2015/tuki-io-tuki-widgets.mjs +0 -63
  168. package/fesm2015/tuki-io-tuki-widgets.mjs.map +0 -1
  169. package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs +0 -1219
  170. package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs.map +0 -1
  171. package/fesm2020/tuki-io-tuki-widgets-users-list.mjs +0 -866
  172. package/fesm2020/tuki-io-tuki-widgets-users-list.mjs.map +0 -1
  173. package/fesm2020/tuki-io-tuki-widgets.mjs +0 -63
  174. package/fesm2020/tuki-io-tuki-widgets.mjs.map +0 -1
  175. package/index.d.ts +0 -5
  176. package/lib/widgets.component.d.ts +0 -8
  177. package/lib/widgets.module.d.ts +0 -7
  178. package/lib/widgets.service.d.ts +0 -6
  179. package/user-manage/index.d.ts +0 -5
  180. package/user-manage/src/app.constants.d.ts +0 -20
  181. package/user-manage/src/classes/device.d.ts +0 -224
  182. package/user-manage/src/classes/line.d.ts +0 -116
  183. package/user-manage/src/classes/notification.d.ts +0 -18
  184. package/user-manage/src/classes/pagination.d.ts +0 -13
  185. package/user-manage/src/classes/simplified-user.d.ts +0 -41
  186. package/user-manage/src/classes/table-data.d.ts +0 -5
  187. package/user-manage/src/classes/user-list.d.ts +0 -32
  188. package/user-manage/src/common-functions.d.ts +0 -1
  189. package/user-manage/src/environments/environment.d.ts +0 -9
  190. package/user-manage/src/interseptors/auth.interceptor.d.ts +0 -9
  191. package/user-manage/src/lazy-loading-select/lazy-loading-select.component.d.ts +0 -35
  192. package/user-manage/src/material.module.d.ts +0 -28
  193. package/user-manage/src/notifications/notification.component.d.ts +0 -19
  194. package/user-manage/src/removeKynFromIBM.service.d.ts +0 -8
  195. package/user-manage/src/services/api.service.d.ts +0 -20
  196. package/user-manage/src/services/notification.service.d.ts +0 -18
  197. package/user-manage/src/services/removeKynFromIBM.service.d.ts +0 -8
  198. package/user-manage/src/services/site-settings.service.d.ts +0 -9
  199. package/user-manage/src/services/user.service.d.ts +0 -26
  200. package/user-manage/src/services/users-search.service.d.ts +0 -25
  201. package/user-manage/src/services/utils.service.d.ts +0 -9
  202. package/user-manage/src/user-info/user-info.component.d.ts +0 -9
  203. package/user-manage/src/user-manage-widget.component.d.ts +0 -31
  204. package/user-manage/src/user-manage.module.d.ts +0 -18
  205. package/user-manage/src/utils/app-loader/app-loader.d.ts +0 -6
  206. package/user-manage/src/utils/pagination/pagination.component.d.ts +0 -18
  207. package/users-list/index.d.ts +0 -5
  208. package/users-list/src/app.constants.d.ts +0 -17
  209. package/users-list/src/classes/device.d.ts +0 -224
  210. package/users-list/src/classes/line.d.ts +0 -116
  211. package/users-list/src/classes/notification.d.ts +0 -18
  212. package/users-list/src/classes/pagination.d.ts +0 -13
  213. package/users-list/src/classes/simlified-user.d.ts +0 -25
  214. package/users-list/src/classes/table-data.d.ts +0 -5
  215. package/users-list/src/classes/user-list.d.ts +0 -32
  216. package/users-list/src/material.module.d.ts +0 -28
  217. package/users-list/src/services/api.service.d.ts +0 -20
  218. package/users-list/src/services/events-communication.service.d.ts +0 -8
  219. package/users-list/src/services/notification.service.d.ts +0 -18
  220. package/users-list/src/services/removeKynFromIBM.service.d.ts +0 -8
  221. package/users-list/src/services/user.service.d.ts +0 -26
  222. package/users-list/src/services/users-search.service.d.ts +0 -25
  223. package/users-list/src/users-list.component.d.ts +0 -34
  224. package/users-list/src/users-list.module.d.ts +0 -12
  225. package/users-list/src/utils/common-functions.d.ts +0 -1
  226. package/users-list/src/utils/pagination/pagination.component.d.ts +0 -18
  227. package/users-list/src/utils/utils.service.d.ts +0 -9
  228. /package/user-manage/{public-api.d.ts → public-api.ts} +0 -0
  229. /package/users-list/{public-api.d.ts → public-api.ts} +0 -0
@@ -1,869 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
3
- import * as i6$1 from '@angular/material/table';
4
- import { MatTableDataSource, MatTableModule } from '@angular/material/table';
5
- import { of, forkJoin, Subject, BehaviorSubject } from 'rxjs';
6
- import * as i2 from '@angular/forms';
7
- import { FormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
- import { map } from 'rxjs/operators';
9
- import * as i1 from '@angular/common/http';
10
- import { HttpHeaders, HttpClientModule } from '@angular/common/http';
11
- import * as i1$1 from '@angular/common';
12
- import * as i3 from '@angular/material/progress-spinner';
13
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
14
- import * as i4 from '@angular/material/core';
15
- import { MatNativeDateModule } from '@angular/material/core';
16
- import * as i5 from '@angular/material/select';
17
- import { MatSelectModule } from '@angular/material/select';
18
- import * as i6 from '@angular/material/paginator';
19
- import { MatPaginatorModule } from '@angular/material/paginator';
20
- import { BrowserModule } from '@angular/platform-browser';
21
- import { MatExpansionModule } from '@angular/material/expansion';
22
- import { MatDatepickerModule } from '@angular/material/datepicker';
23
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
24
- import { MatChipsModule } from '@angular/material/chips';
25
- import { MatListModule } from '@angular/material/list';
26
- import { MatSidenavModule } from '@angular/material/sidenav';
27
- import { MatTreeModule } from '@angular/material/tree';
28
- import { DragDropModule } from '@angular/cdk/drag-drop';
29
- import { MatButtonModule } from '@angular/material/button';
30
- import { MatInputModule } from '@angular/material/input';
31
- import { MatTooltipModule } from '@angular/material/tooltip';
32
- import { MatFormFieldModule } from '@angular/material/form-field';
33
- import { MatStepperModule } from '@angular/material/stepper';
34
- import { MatTabsModule } from '@angular/material/tabs';
35
- import { MatCardModule } from '@angular/material/card';
36
- import { MatCheckboxModule } from '@angular/material/checkbox';
37
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
38
-
39
- const getSavableData = (model, exclude) => {
40
- let result = Object.keys(model);
41
- if (exclude && exclude.length) {
42
- result = result.filter(key => !exclude.some(item => item === key));
43
- }
44
- return result.reduce((result, key) => {
45
- if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
46
- result[key] = model[key].map((item) => item.getSavableData());
47
- }
48
- else if (model[key] instanceof Object && model[key].getSavableData) {
49
- result[key] = model[key].getSavableData();
50
- }
51
- else {
52
- result[key] = model[key];
53
- }
54
- return result;
55
- }, {});
56
- };
57
-
58
- const API = {
59
- USER_TOKEN: '/api/provision/:siteId/users/:userId/token',
60
- UPDATE_USER_FIELDS: '/api/provision/:siteId/userFields/:token',
61
- PERSIST_USER_CACHE: '/api/provision/:siteId/saveUser/:token',
62
- USER_BY_ID: '/api/provision/:siteId/users/:userId',
63
- QUICK_USERS_SEARCH: "/api/search/quickusers"
64
- };
65
- const REGEX_PATTERN = {
66
- EMAIL: '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))' +
67
- '@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,62}[a-zA-Z0-9])' +
68
- '?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?)*$'
69
- };
70
- const PAGINATION_DEFAULTS = {
71
- SIZE: 10,
72
- INDEX: 0
73
- };
74
- const PAGINATION_SIZE_OPTIONS = [
75
- 10,
76
- 50,
77
- 100,
78
- 500
79
- ];
80
- const CUCS_TO_IGNORE = [
81
- 189,
82
- 194,
83
- 191,
84
- 190
85
- ];
86
- const CUCMS_TO_IGNORE = [
87
- 249,
88
- 255,
89
- 251,
90
- 250
91
- ];
92
-
93
- class SimplifiedUser {
94
- constructor(user) {
95
- if (user) {
96
- this.userid = user.userid;
97
- this.email = user.email;
98
- this.firstName = user.firstName;
99
- this.lastName = user.lastName;
100
- this.token = user.token;
101
- }
102
- this.initForm();
103
- }
104
- initForm() {
105
- const formBuilder = new FormBuilder();
106
- const formSettings = {
107
- userid: [{ value: this.userid || '', disabled: true }, [Validators.required, Validators.maxLength(128)]],
108
- email: [{ value: this.email || '', disabled: true }, [
109
- Validators.pattern(REGEX_PATTERN.EMAIL),
110
- Validators.required
111
- ]],
112
- firstName: [{ value: this.firstName || '', disabled: true }],
113
- lastName: [{ value: this.lastName || '', disabled: true }, Validators.required],
114
- };
115
- this.form = formBuilder.group(formSettings);
116
- }
117
- toggleEditMode() {
118
- this.editMode = !this.editMode;
119
- ['userid', 'email', 'firstName', 'lastName'].forEach(token => {
120
- var _a, _b;
121
- if (this.editMode) {
122
- (_a = this.form.get(token)) === null || _a === void 0 ? void 0 : _a.enable();
123
- }
124
- else {
125
- (_b = this.form.get(token)) === null || _b === void 0 ? void 0 : _b.disable();
126
- }
127
- });
128
- }
129
- getSavableData() {
130
- const excludedFields = ['form', 'editMode', 'viewMode', 'token', 'hasModifiedCache'];
131
- return getSavableData(this, excludedFields);
132
- }
133
- equal(userToCompare) {
134
- if (!userToCompare) {
135
- return false;
136
- }
137
- return JSON.stringify(this.getSavableData()) === JSON.stringify(userToCompare.getSavableData());
138
- }
139
- }
140
-
141
- class UtilsService {
142
- static sortSortArrayByProperty(array, sortBy) {
143
- if (!array) {
144
- return null;
145
- }
146
- return array.sort((a, b) => {
147
- if (!a[sortBy] && !b[sortBy]) {
148
- return 0;
149
- }
150
- if (a[sortBy] && !b[sortBy]) {
151
- return 1;
152
- }
153
- if (!a[sortBy] && b[sortBy]) {
154
- return -1;
155
- }
156
- const positionA = a[sortBy];
157
- const positionB = b[sortBy];
158
- return (positionA < positionB) ? -1 : (positionA > positionB) ? 1 : 0;
159
- });
160
- }
161
- static diff(origObject, updatedObj, path, keysToIgnore) {
162
- let result = [];
163
- if (Object.is(origObject, updatedObj)) {
164
- return undefined;
165
- }
166
- if (!updatedObj || typeof updatedObj !== 'object') {
167
- return updatedObj;
168
- }
169
- const concat = Array.from(new Set([...Object.keys(origObject || {}), ...Object.keys(updatedObj || {})]));
170
- const filter = keysToIgnore ? concat.filter(key => !keysToIgnore.includes(key)) : concat;
171
- filter
172
- .forEach(key => {
173
- if (typeof updatedObj[key] === 'object' && typeof origObject[key] === 'object') {
174
- if (UtilsService.differs(updatedObj[key], origObject[key])) {
175
- const newPath = `${path}${path ? '.' : ''}${key}`;
176
- const values = UtilsService.diff(origObject[key], updatedObj[key], newPath, keysToIgnore);
177
- if (values !== undefined) {
178
- result = [...result, ...values];
179
- }
180
- }
181
- }
182
- else if (updatedObj && !origObject || updatedObj[key] !== origObject[key] && !Object.is(origObject[key], updatedObj[key])) {
183
- const value = updatedObj ? UtilsService.formatIfEmpty(updatedObj[key]) : null;
184
- result.push(`${path}${path ? '.' : ''}${key}=${value}`);
185
- }
186
- });
187
- return result;
188
- }
189
- static formatIfEmpty(value) {
190
- if (value) {
191
- return value;
192
- }
193
- switch (typeof value) {
194
- case 'boolean':
195
- return value;
196
- case 'string':
197
- return '';
198
- default:
199
- return null;
200
- }
201
- }
202
- static differs(obj1, obj2) {
203
- return JSON.stringify(obj1) !== JSON.stringify(obj2);
204
- }
205
- }
206
- UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
207
- UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService });
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, decorators: [{
209
- type: Injectable
210
- }] });
211
-
212
- const apiUrl = 'http://192.168.0.191:8080';
213
- class APIService {
214
- constructor(httpClient) {
215
- this.httpClient = httpClient;
216
- }
217
- fetch(url, params = {}, cache) {
218
- const headers = this.getHeaders(cache);
219
- return this.httpClient.get(apiUrl + url, { params: this.prepareEncodedParams(params), headers });
220
- }
221
- post(url, body, params = {}) {
222
- body = body || null;
223
- const headers = this.getHeaders();
224
- return this.httpClient.post(apiUrl + url, body, { params: this.prepareEncodedParams(params), headers });
225
- }
226
- // use when response extended data is necessary:
227
- postExtended(url, body = null, params = {}, headers = {}) {
228
- headers = headers || this.getHeaders();
229
- return this.httpClient.post(apiUrl + url, body, {
230
- headers,
231
- observe: 'response',
232
- params: this.prepareEncodedParams(params)
233
- });
234
- }
235
- put(url, body = null, params = {}) {
236
- const headers = this.getHeaders();
237
- return this.httpClient.put(apiUrl + url, body, { headers, params: this.prepareEncodedParams(params) });
238
- }
239
- delete(url, params = {}) {
240
- const headers = this.getHeaders();
241
- return this.httpClient.delete(apiUrl + url, { headers, params: this.prepareEncodedParams(params) });
242
- }
243
- fetchPagination(url, pageSize, pageNumber, additionalParams = {}, cache) {
244
- const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
245
- const params = Object.assign(copyAdditionalParams, { size: pageSize.toString(), page: pageNumber.toString() });
246
- return this.fetch(url, params, cache);
247
- }
248
- prepareEncodedParams(params) {
249
- const result = {};
250
- if (!params) {
251
- return {};
252
- }
253
- for (const key of Object.keys(params)) {
254
- if (params[key]) {
255
- const stringParam = params[key].toString();
256
- result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
257
- }
258
- }
259
- return result;
260
- }
261
- getHeaders(cache) {
262
- let headers = new HttpHeaders();
263
- if (cache) {
264
- headers = headers.append('_Cache', 'true ');
265
- }
266
- const token = this.token || this.getParameterByName('token');
267
- headers = headers.append('Authorization', 'Bearer ' + token);
268
- return headers;
269
- }
270
- getParameterByName(name, url = window.location.href) {
271
- name = name.replace(/[\[\]]/g, '\\$&');
272
- var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);
273
- if (!results)
274
- return null;
275
- if (!results[2])
276
- return '';
277
- return decodeURIComponent(results[2].replace(/\+/g, ' '));
278
- }
279
- }
280
- APIService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
281
- APIService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService });
282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, decorators: [{
283
- type: Injectable
284
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
285
-
286
- class UserService {
287
- constructor(apiService) {
288
- this.apiService = apiService;
289
- this.siteId = -1;
290
- this.userId = '';
291
- this.userIdExistPending = false;
292
- this.hasExistedUserId = false;
293
- }
294
- ngOnInit() {
295
- console.log(this.siteId);
296
- }
297
- fetchUserToken(siteId, userId) {
298
- if (this.siteId === siteId && this.userId === userId && this.user) {
299
- return of(this.user);
300
- }
301
- this.siteId = siteId;
302
- this.userId = userId;
303
- return this.apiService.fetch(API.USER_TOKEN.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(userId))))
304
- .pipe(map((result) => {
305
- this.setSimplifiedUser(Object.values(result)[0]);
306
- }));
307
- // .pipe(this.handleError(false, true));
308
- }
309
- updateUserFields(body) {
310
- var _a;
311
- if (!this.userId || !this.siteId || !((_a = this.user) === null || _a === void 0 ? void 0 : _a.token)) {
312
- return;
313
- }
314
- return this.apiService.post(API.UPDATE_USER_FIELDS.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), body);
315
- // .pipe(this.handleError(false, true));
316
- }
317
- fetchUserById(id) {
318
- this.userIdExistPending = true;
319
- return this.apiService.fetch(API.USER_BY_ID.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(id))))
320
- .pipe(map(result => {
321
- this.userIdExistPending = false;
322
- return result;
323
- }));
324
- }
325
- persistCacheChanges() {
326
- const params = {
327
- excludeDeviceExtraOptions: true
328
- };
329
- return this.processUserChangesToCache()
330
- .pipe(map((result) => {
331
- return this.apiService.post(API.PERSIST_USER_CACHE.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), {}, params)
332
- .subscribe(() => {
333
- });
334
- // .pipe(map((user) => {
335
- // // this.setUser(user, false, this.user.token);
336
- // this.user.hasModifiedCache = false;
337
- // }))
338
- // .pipe(this.handleError(true, true));
339
- }));
340
- }
341
- processUserChangesToCache() {
342
- const calls = [];
343
- const body = UtilsService.diff(this.originUser.getSavableData(), this.user.getSavableData(), 'user');
344
- if (body) {
345
- calls.push(this.updateUserFields(body));
346
- }
347
- if (!(calls === null || calls === void 0 ? void 0 : calls.length)) {
348
- return of(this.user);
349
- }
350
- return forkJoin(calls)
351
- .pipe(map((responses) => {
352
- // ApiUserResponse
353
- this.handleSaveUserResponse(responses);
354
- }));
355
- // .pipe(this.handleError(false, true));
356
- }
357
- hasUnsavedChanges() {
358
- return !this.user.equal(this.originUser);
359
- }
360
- setSimplifiedUser(user) {
361
- this.user = new SimplifiedUser(user);
362
- const copiedUser = JSON.parse(JSON.stringify(user));
363
- this.originUser = new SimplifiedUser(copiedUser);
364
- }
365
- handleSaveUserResponse(responses) {
366
- if (!(responses === null || responses === void 0 ? void 0 : responses.length)) {
367
- return;
368
- }
369
- for (let len = responses.length, i = len - 1; i >= 0; i--) {
370
- if (responses[i] && responses[i].currentUpdatedUser) {
371
- // this.setUser(responses[i].currentUpdatedUser, false, this.user.token);
372
- this.user.hasModifiedCache = true;
373
- return;
374
- }
375
- }
376
- }
377
- }
378
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: APIService }], target: i0.ɵɵFactoryTarget.Injectable });
379
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
381
- type: Injectable
382
- }], ctorParameters: function () { return [{ type: APIService }]; } });
383
-
384
- const TTL_DEFAULT = 30000;
385
- const TTL_LONG_DEFAULT = 45000;
386
- var NotificationType;
387
- (function (NotificationType) {
388
- NotificationType["info"] = "info";
389
- NotificationType["error"] = "error";
390
- NotificationType["success"] = "success";
391
- NotificationType["warning"] = "warning";
392
- })(NotificationType || (NotificationType = {}));
393
- class Notification {
394
- constructor(data) {
395
- this.ttl = TTL_DEFAULT;
396
- Object.assign(this, data || {});
397
- if (this.ttl === undefined) {
398
- this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
399
- }
400
- }
401
- isInfo() {
402
- return this.type === NotificationType.info;
403
- }
404
- isError() {
405
- return this.type === NotificationType.error;
406
- }
407
- isSuccess() {
408
- return this.type === NotificationType.success;
409
- }
410
- isWarning() {
411
- return this.type === NotificationType.warning;
412
- }
413
- }
414
-
415
- const SUCCESS_TIME = 5000;
416
- const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
417
- const INACTIVE_SESSION = 'SESSION_INACTIVE';
418
- class NotificationService {
419
- constructor() {
420
- this.listChange = new Subject();
421
- this.max = 0;
422
- this.list = [];
423
- }
424
- error(message, ttl) {
425
- this.notify('error', message, ttl);
426
- }
427
- success(message, ttl) {
428
- this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
429
- }
430
- warning(message, ttl) {
431
- this.notify('warning', message, ttl);
432
- }
433
- info(message, ttl) {
434
- this.notify('info', message, ttl);
435
- }
436
- notify(type, message, ttl) {
437
- const found = this.list.find((n) => n.message === message);
438
- if (found) {
439
- this.remove(found);
440
- }
441
- const notification = new Notification({
442
- id: ++this.max,
443
- type, message, ttl
444
- });
445
- if (notification.ttl > 0) {
446
- notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
447
- }
448
- this.list.push(notification);
449
- this.listChange.next(this.list);
450
- }
451
- remove(notification, auto) {
452
- if (!auto && notification.timerId) {
453
- // clear timeout in case of manual remove
454
- clearInterval(notification.timerId);
455
- }
456
- this.list = this.list.filter(n => n.id !== notification.id);
457
- this.listChange.next(this.list);
458
- }
459
- removeInactiveSessionError() {
460
- if (!this.list || !this.list.length) {
461
- return;
462
- }
463
- this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
464
- this.listChange.next(this.list);
465
- }
466
- }
467
- NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
468
- NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService });
469
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, decorators: [{
470
- type: Injectable
471
- }], ctorParameters: function () { return []; } });
472
-
473
- class ListUser {
474
- constructor(user) {
475
- this.devices = [];
476
- this.deviceProfiles = [];
477
- if (user) {
478
- Object.assign(this, user);
479
- }
480
- }
481
- }
482
-
483
- class RemoveKynFromIBMService {
484
- constructor() {
485
- }
486
- removeCUCMS(date, customerId) {
487
- if (customerId === 8) {
488
- return date.filter((val) => !CUCMS_TO_IGNORE.includes(Math.round(val.cucmId)));
489
- }
490
- return date;
491
- }
492
- removeCUCS(date, customerId) {
493
- if (customerId === 8) {
494
- return date.filter((val) => !CUCS_TO_IGNORE.includes(Math.round(val.cucId)));
495
- }
496
- return date;
497
- }
498
- }
499
- RemoveKynFromIBMService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
500
- RemoveKynFromIBMService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService });
501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, decorators: [{
502
- type: Injectable
503
- }], ctorParameters: function () { return []; } });
504
-
505
- class UsersSearchService {
506
- constructor(apiService, removeKynFromIBMService) {
507
- this.apiService = apiService;
508
- this.removeKynFromIBMService = removeKynFromIBMService;
509
- this.siteId = -1;
510
- this.userId = '';
511
- this.userIdExistPending = false;
512
- this.hasExistedUserId = false;
513
- this.pageSize = PAGINATION_DEFAULTS.SIZE;
514
- this.pageIndex = PAGINATION_DEFAULTS.SIZE;
515
- this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
516
- this.foundUsers$ = new BehaviorSubject(null);
517
- }
518
- getPagination() {
519
- return {
520
- total: this.total,
521
- pageSizeOptions: this.pageSizeOptions,
522
- pageSize: this.pageSize,
523
- pageIndex: this.pageIndex
524
- };
525
- }
526
- quickRegularUsersSearch() {
527
- this.searchParams = this.searchParams || { customerid: this.customerId };
528
- return this.apiService.fetchPagination(API.QUICK_USERS_SEARCH, this.pageSize, this.pageIndex, this.searchParams)
529
- .pipe(map((res) => {
530
- this.total = res.total;
531
- // this.totals = this.totals || {};
532
- // this.totals['users'] = res.total;
533
- const users = res.pageData && res.pageData.length ? res.pageData.map(user => new ListUser(user)) : [];
534
- // this.foundUsers$.next(this.removeKynFromIBMService.removeCUCMS(users, this.customerId));
535
- this.foundUsers$.next(users);
536
- }));
537
- // .pipe(this.handleError(true));
538
- }
539
- }
540
- UsersSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService, deps: [{ token: APIService }, { token: RemoveKynFromIBMService }], target: i0.ɵɵFactoryTarget.Injectable });
541
- UsersSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService });
542
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService, decorators: [{
543
- type: Injectable
544
- }], ctorParameters: function () { return [{ type: APIService }, { type: RemoveKynFromIBMService }]; } });
545
-
546
- class PaginationComponent {
547
- constructor() {
548
- this.pageEmitter = new EventEmitter();
549
- this.pageNumberChangeEmitter = new EventEmitter();
550
- this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
551
- }
552
- ngOnInit() {
553
- }
554
- pageEvent(event) {
555
- this.pageEmitter.emit(event);
556
- }
557
- changePerPageNumber(event) {
558
- this.pageNumberChangeEmitter.emit(event.value);
559
- }
560
- }
561
- PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
562
- PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PaginationComponent, selector: "app-pagination", inputs: { pagination: "pagination", showPageSizeOptions: "showPageSizeOptions", showRefreshButton: "showRefreshButton", lengthPending: "lengthPending" }, outputs: { pageEmitter: "pageEmitter", pageNumberChangeEmitter: "pageNumberChangeEmitter" }, ngImport: i0, template: "<div class=\"flex-box pagination\">\n <div class=\"page-indexes-box\">\n <mat-paginator\n [id]=\"'commonPagination'\"\n [hidePageSize]=\"true\"\n [length]=\"pagination.total\"\n [pageIndex]=\"pagination.pageIndex\"\n [pageSize]=\"pagination.pageSize\"\n [pageSizeOptions]=\"pagination.pageSizeOptions\"\n (page)=\"pageEvent($event)\">\n </mat-paginator>\n <mat-spinner class=\"length-spinner\" [diameter]=\"20\" mode=\"indeterminate\" *ngIf=\"lengthPending\">\n </mat-spinner>\n </div>\n\n <div class=\"flex-box per-page-block\" *ngIf=\"showPageSizeOptions\">\n <div class=\"item_per_page\">Items per page:</div>\n <div class=\"select-box select-page-size\">\n <mat-select [(ngModel)]=\"pagination.pageSize\" (selectionChange)=\"changePerPageNumber($event)\" #page\n [id]=\"'commonPaginationSelect'\">\n <mat-option *ngFor=\"let option of pageSizeOptions; let i = index;\" [id]=\"'paginationSelectOpt_' + i\" [value]=\"option\">{{option}}</mat-option>\n </mat-select>\n </div>\n\n </div>\n</div>\n", styles: [".search-header-refresh-icon{align-items:center;line-height:54px;margin-left:10px}button[mat-icon-button] i{font-size:18px}mat-spinner.length-spinner{position:absolute;right:120px}h3,.search-header-refresh-icon{float:left}.page-options,.mat-paginator{float:right}.per-page-block mat-form-field{width:70px!important}.per-page-block span{margin-right:20px}.pagination{display:flex;justify-content:flex-end}.select-page-size{width:60px;margin:0 0 0 15px;padding:0 10px}.item_per_page{line-height:35px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }] });
563
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, decorators: [{
564
- type: Component,
565
- args: [{ selector: 'app-pagination', template: "<div class=\"flex-box pagination\">\n <div class=\"page-indexes-box\">\n <mat-paginator\n [id]=\"'commonPagination'\"\n [hidePageSize]=\"true\"\n [length]=\"pagination.total\"\n [pageIndex]=\"pagination.pageIndex\"\n [pageSize]=\"pagination.pageSize\"\n [pageSizeOptions]=\"pagination.pageSizeOptions\"\n (page)=\"pageEvent($event)\">\n </mat-paginator>\n <mat-spinner class=\"length-spinner\" [diameter]=\"20\" mode=\"indeterminate\" *ngIf=\"lengthPending\">\n </mat-spinner>\n </div>\n\n <div class=\"flex-box per-page-block\" *ngIf=\"showPageSizeOptions\">\n <div class=\"item_per_page\">Items per page:</div>\n <div class=\"select-box select-page-size\">\n <mat-select [(ngModel)]=\"pagination.pageSize\" (selectionChange)=\"changePerPageNumber($event)\" #page\n [id]=\"'commonPaginationSelect'\">\n <mat-option *ngFor=\"let option of pageSizeOptions; let i = index;\" [id]=\"'paginationSelectOpt_' + i\" [value]=\"option\">{{option}}</mat-option>\n </mat-select>\n </div>\n\n </div>\n</div>\n", styles: [".search-header-refresh-icon{align-items:center;line-height:54px;margin-left:10px}button[mat-icon-button] i{font-size:18px}mat-spinner.length-spinner{position:absolute;right:120px}h3,.search-header-refresh-icon{float:left}.page-options,.mat-paginator{float:right}.per-page-block mat-form-field{width:70px!important}.per-page-block span{margin-right:20px}.pagination{display:flex;justify-content:flex-end}.select-page-size{width:60px;margin:0 0 0 15px;padding:0 10px}.item_per_page{line-height:35px}\n"] }]
566
- }], ctorParameters: function () { return []; }, propDecorators: { pagination: [{
567
- type: Input
568
- }], showPageSizeOptions: [{
569
- type: Input
570
- }], showRefreshButton: [{
571
- type: Input
572
- }], lengthPending: [{
573
- type: Input
574
- }], pageEmitter: [{
575
- type: Output
576
- }], pageNumberChangeEmitter: [{
577
- type: Output
578
- }] } });
579
-
580
- const DISPLAYED_COLS = ['user-icon', 'name', 'email', 'status', 'role'];
581
- class UsersListComponent {
582
- get form() {
583
- var _a, _b;
584
- return (_b = (_a = this.userService) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.form;
585
- }
586
- constructor(userService, apiService, notifications, usersSearchService) {
587
- this.userService = userService;
588
- this.apiService = apiService;
589
- this.notifications = notifications;
590
- this.usersSearchService = usersSearchService;
591
- this.openUser = new EventEmitter();
592
- this.displayedColumns = DISPLAYED_COLS;
593
- console.log('users list 1');
594
- }
595
- ngOnInit() {
596
- console.log('users list 2');
597
- this.usersSearchService.customerId = this.customerId;
598
- this.apiService.token = this.token;
599
- this.runSearch();
600
- this.searchSubscription = this.usersSearchService.foundUsers$
601
- .subscribe((users) => {
602
- this.initializeDataSource(users);
603
- this.users = users;
604
- });
605
- }
606
- pageNumberChangeEvent(perPageNumber) {
607
- this.usersSearchService.pageSize = perPageNumber;
608
- this.usersSearchService.pageIndex = 0;
609
- this.runSearch();
610
- }
611
- pageEvent(event) {
612
- this.usersSearchService.pageSize = event.pageSize;
613
- this.usersSearchService.pageIndex = event.pageIndex;
614
- this.runSearch();
615
- }
616
- onUserClick(user) {
617
- this.openUser.emit(user);
618
- }
619
- initializeDataSource(users) {
620
- this.dataSource = new MatTableDataSource(users);
621
- }
622
- runSearch() {
623
- this.dataPending = true;
624
- this.usersSearchService.quickRegularUsersSearch()
625
- .subscribe(() => {
626
- this.dataPending = false;
627
- }, () => {
628
- this.dataPending = false;
629
- this.notifications.error('The data can not be received');
630
- });
631
- }
632
- }
633
- UsersListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListComponent, deps: [{ token: UserService }, { token: APIService }, { token: NotificationService }, { token: UsersSearchService }], target: i0.ɵɵFactoryTarget.Component });
634
- UsersListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UsersListComponent, selector: "app-users-list", inputs: { token: "token", customerId: "customerId" }, outputs: { openUser: "openUser" }, ngImport: i0, template: "<app-pagination\n [pagination]=\"usersSearchService.getPagination()\"\n [showPageSizeOptions]=\"true\"\n (pageNumberChangeEmitter)=\"pageNumberChangeEvent($event)\"\n (pageEmitter)=\"pageEvent($event)\">\n</app-pagination>\n\n<table class=\"webex-table\" mat-table *ngIf=\"users?.length\" #table [dataSource]=\"dataSource\">\n\n <ng-container matColumnDef=\"user-icon\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\"></th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\">\n <span class=\"icon-webex-box\"><span class=\"icon-webex icon-webex-user\"></span></span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">First Name/Last Name</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.firstName }} {{ user.lastName }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Email</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Status</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <ng-container matColumnDef=\"role\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Administrator Role</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{border-collapse:collapse;border-spacing:0}table.mat-table{border-spacing:0;width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: PaginationComponent, selector: "app-pagination", inputs: ["pagination", "showPageSizeOptions", "showRefreshButton", "lengthPending"], outputs: ["pageEmitter", "pageNumberChangeEmitter"] }] });
635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListComponent, decorators: [{
636
- type: Component,
637
- args: [{ selector: 'app-users-list', template: "<app-pagination\n [pagination]=\"usersSearchService.getPagination()\"\n [showPageSizeOptions]=\"true\"\n (pageNumberChangeEmitter)=\"pageNumberChangeEvent($event)\"\n (pageEmitter)=\"pageEvent($event)\">\n</app-pagination>\n\n<table class=\"webex-table\" mat-table *ngIf=\"users?.length\" #table [dataSource]=\"dataSource\">\n\n <ng-container matColumnDef=\"user-icon\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\"></th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\">\n <span class=\"icon-webex-box\"><span class=\"icon-webex icon-webex-user\"></span></span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">First Name/Last Name</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.firstName }} {{ user.lastName }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Email</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Status</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <ng-container matColumnDef=\"role\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Administrator Role</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{border-collapse:collapse;border-spacing:0}table.mat-table{border-spacing:0;width:100%}\n"] }]
638
- }], ctorParameters: function () { return [{ type: UserService }, { type: APIService }, { type: NotificationService }, { type: UsersSearchService }]; }, propDecorators: { token: [{
639
- type: Input
640
- }], customerId: [{
641
- type: Input
642
- }], openUser: [{
643
- type: Output
644
- }] } });
645
-
646
- class EventsCommunicationService {
647
- constructor() {
648
- this.onSuccessfulLoginEvent = new Subject();
649
- }
650
- }
651
- EventsCommunicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
652
- EventsCommunicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService });
653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, decorators: [{
654
- type: Injectable
655
- }], ctorParameters: function () { return []; } });
656
-
657
- class MaterialModule {
658
- }
659
- MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
660
- MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
661
- MatButtonModule,
662
- MatListModule,
663
- MatProgressSpinnerModule,
664
- MatExpansionModule,
665
- MatInputModule,
666
- MatInputModule,
667
- MatListModule,
668
- MatTreeModule,
669
- MatTreeModule,
670
- MatNativeDateModule,
671
- MatDatepickerModule,
672
- MatTooltipModule,
673
- MatAutocompleteModule,
674
- MatChipsModule,
675
- MatSidenavModule,
676
- MatFormFieldModule,
677
- MatStepperModule,
678
- MatTabsModule,
679
- MatCardModule,
680
- MatSelectModule,
681
- MatCheckboxModule,
682
- MatSlideToggleModule,
683
- MatTableModule,
684
- MatPaginatorModule], exports: [DragDropModule,
685
- MatButtonModule,
686
- MatListModule,
687
- MatProgressSpinnerModule,
688
- MatExpansionModule,
689
- MatInputModule,
690
- MatInputModule,
691
- MatListModule,
692
- MatTreeModule,
693
- MatTreeModule,
694
- MatNativeDateModule,
695
- MatDatepickerModule,
696
- MatTooltipModule,
697
- MatAutocompleteModule,
698
- MatChipsModule,
699
- MatSidenavModule,
700
- MatFormFieldModule,
701
- MatStepperModule,
702
- MatTabsModule,
703
- MatCardModule,
704
- MatCheckboxModule,
705
- MatSelectModule,
706
- MatSlideToggleModule,
707
- MatProgressSpinnerModule,
708
- MatTableModule,
709
- MatPaginatorModule] });
710
- MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
711
- MatButtonModule,
712
- MatListModule,
713
- MatProgressSpinnerModule,
714
- MatExpansionModule,
715
- MatInputModule,
716
- MatInputModule,
717
- MatListModule,
718
- MatTreeModule,
719
- MatTreeModule,
720
- MatNativeDateModule,
721
- MatDatepickerModule,
722
- MatTooltipModule,
723
- MatAutocompleteModule,
724
- MatChipsModule,
725
- MatSidenavModule,
726
- MatFormFieldModule,
727
- MatStepperModule,
728
- MatTabsModule,
729
- MatCardModule,
730
- MatSelectModule,
731
- MatCheckboxModule,
732
- MatSlideToggleModule,
733
- MatTableModule,
734
- MatPaginatorModule, DragDropModule,
735
- MatButtonModule,
736
- MatListModule,
737
- MatProgressSpinnerModule,
738
- MatExpansionModule,
739
- MatInputModule,
740
- MatInputModule,
741
- MatListModule,
742
- MatTreeModule,
743
- MatTreeModule,
744
- MatNativeDateModule,
745
- MatDatepickerModule,
746
- MatTooltipModule,
747
- MatAutocompleteModule,
748
- MatChipsModule,
749
- MatSidenavModule,
750
- MatFormFieldModule,
751
- MatStepperModule,
752
- MatTabsModule,
753
- MatCardModule,
754
- MatCheckboxModule,
755
- MatSelectModule,
756
- MatSlideToggleModule,
757
- MatProgressSpinnerModule,
758
- MatTableModule,
759
- MatPaginatorModule] });
760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
761
- type: NgModule,
762
- args: [{
763
- imports: [
764
- DragDropModule,
765
- MatButtonModule,
766
- MatListModule,
767
- MatProgressSpinnerModule,
768
- MatExpansionModule,
769
- MatInputModule,
770
- MatInputModule,
771
- MatListModule,
772
- MatTreeModule,
773
- MatTreeModule,
774
- MatNativeDateModule,
775
- MatDatepickerModule,
776
- MatTooltipModule,
777
- MatAutocompleteModule,
778
- MatChipsModule,
779
- MatSidenavModule,
780
- MatFormFieldModule,
781
- MatStepperModule,
782
- MatTabsModule,
783
- MatCardModule,
784
- MatSelectModule,
785
- MatCheckboxModule,
786
- MatSlideToggleModule,
787
- MatTableModule,
788
- MatPaginatorModule
789
- ],
790
- exports: [
791
- DragDropModule,
792
- MatButtonModule,
793
- MatListModule,
794
- MatProgressSpinnerModule,
795
- MatExpansionModule,
796
- MatInputModule,
797
- MatInputModule,
798
- MatListModule,
799
- MatTreeModule,
800
- MatTreeModule,
801
- MatNativeDateModule,
802
- MatDatepickerModule,
803
- MatTooltipModule,
804
- MatAutocompleteModule,
805
- MatChipsModule,
806
- MatSidenavModule,
807
- MatFormFieldModule,
808
- MatStepperModule,
809
- MatTabsModule,
810
- MatCardModule,
811
- MatCheckboxModule,
812
- MatSelectModule,
813
- MatSlideToggleModule,
814
- MatProgressSpinnerModule,
815
- MatTableModule,
816
- MatPaginatorModule
817
- ],
818
- }]
819
- }] });
820
-
821
- class UsersListModule {
822
- }
823
- UsersListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
824
- UsersListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, declarations: [UsersListComponent, PaginationComponent], imports: [BrowserModule,
825
- FormsModule,
826
- ReactiveFormsModule,
827
- HttpClientModule,
828
- MaterialModule], exports: [UsersListComponent] });
829
- UsersListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, providers: [
830
- UserService,
831
- APIService,
832
- EventsCommunicationService,
833
- UsersSearchService,
834
- NotificationService,
835
- RemoveKynFromIBMService
836
- ], imports: [BrowserModule,
837
- FormsModule,
838
- ReactiveFormsModule,
839
- HttpClientModule,
840
- MaterialModule] });
841
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, decorators: [{
842
- type: NgModule,
843
- args: [{
844
- declarations: [UsersListComponent, PaginationComponent],
845
- imports: [
846
- BrowserModule,
847
- FormsModule,
848
- ReactiveFormsModule,
849
- HttpClientModule,
850
- MaterialModule
851
- ],
852
- providers: [
853
- UserService,
854
- APIService,
855
- EventsCommunicationService,
856
- UsersSearchService,
857
- NotificationService,
858
- RemoveKynFromIBMService
859
- ],
860
- exports: [UsersListComponent]
861
- }]
862
- }] });
863
-
864
- /**
865
- * Generated bundle index. Do not edit.
866
- */
867
-
868
- export { APIService, EventsCommunicationService, NotificationService, RemoveKynFromIBMService, UserService, UsersListComponent, UsersListModule, UsersSearchService };
869
- //# sourceMappingURL=tuki-io-tuki-widgets-users-list.mjs.map