@tuki-io/tuki-widgets 0.0.6 → 0.0.8
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.
- package/README.md +9 -10
- package/esm2020/lib/widgets.component.mjs +22 -0
- package/esm2020/lib/widgets.module.mjs +21 -0
- package/esm2020/lib/widgets.service.mjs +14 -0
- package/esm2020/public-api.mjs +7 -0
- package/esm2020/tuki-io-tuki-widgets.mjs +5 -0
- package/esm2020/user-manage/public-api.mjs +7 -0
- package/esm2020/user-manage/src/app.constants.mjs +38 -0
- package/esm2020/user-manage/src/classes/device.mjs +7 -0
- package/esm2020/user-manage/src/classes/line.mjs +9 -0
- package/esm2020/user-manage/src/classes/notification.mjs +32 -0
- package/esm2020/user-manage/src/classes/pagination.mjs +8 -0
- package/esm2020/user-manage/src/classes/simplified-user.mjs +82 -0
- package/esm2020/user-manage/src/classes/table-data.mjs +2 -0
- package/esm2020/user-manage/src/classes/user-list.mjs +10 -0
- package/esm2020/user-manage/src/common-functions.mjs +19 -0
- package/esm2020/user-manage/src/environments/environment.mjs +11 -0
- package/esm2020/user-manage/src/interseptors/auth.interceptor.mjs +37 -0
- package/esm2020/user-manage/src/lazy-loading-select/lazy-loading-select.component.mjs +74 -0
- package/esm2020/user-manage/src/material.module.mjs +188 -0
- package/esm2020/user-manage/src/notifications/notification.component.mjs +35 -0
- package/esm2020/user-manage/src/removeKynFromIBM.service.mjs +25 -0
- package/esm2020/user-manage/src/services/api.service.mjs +79 -0
- package/esm2020/user-manage/src/services/notification.service.mjs +62 -0
- package/esm2020/user-manage/src/services/removeKynFromIBM.service.mjs +25 -0
- package/esm2020/user-manage/src/services/site-settings.service.mjs +36 -0
- package/esm2020/user-manage/src/services/user.service.mjs +108 -0
- package/esm2020/user-manage/src/services/users-search.service.mjs +49 -0
- package/esm2020/user-manage/src/services/utils.service.mjs +73 -0
- package/esm2020/user-manage/src/user-info/user-info.component.mjs +20 -0
- package/esm2020/user-manage/src/user-manage-widget.component.mjs +162 -0
- package/esm2020/user-manage/src/user-manage.module.mjs +84 -0
- package/esm2020/user-manage/src/utils/app-loader/app-loader.mjs +14 -0
- package/esm2020/user-manage/src/utils/pagination/pagination.component.mjs +43 -0
- package/esm2020/user-manage/tuki-io-tuki-widgets-user-manage.mjs +5 -0
- package/esm2020/users-list/public-api.mjs +9 -0
- package/esm2020/users-list/src/app.constants.mjs +35 -0
- package/esm2020/users-list/src/classes/device.mjs +7 -0
- package/esm2020/users-list/src/classes/line.mjs +9 -0
- package/esm2020/users-list/src/classes/notification.mjs +31 -0
- package/esm2020/users-list/src/classes/pagination.mjs +8 -0
- package/esm2020/users-list/src/classes/simlified-user.mjs +50 -0
- package/esm2020/users-list/src/classes/table-data.mjs +2 -0
- package/esm2020/users-list/src/classes/user-list.mjs +10 -0
- package/esm2020/users-list/src/material.module.mjs +188 -0
- package/esm2020/users-list/src/services/api.service.mjs +78 -0
- package/esm2020/users-list/src/services/events-communication.service.mjs +14 -0
- package/esm2020/users-list/src/services/notification.service.mjs +62 -0
- package/esm2020/users-list/src/services/removeKynFromIBM.service.mjs +25 -0
- package/esm2020/users-list/src/services/user.service.mjs +105 -0
- package/esm2020/users-list/src/services/users-search.service.mjs +49 -0
- package/esm2020/users-list/src/users-list.component.mjs +78 -0
- package/esm2020/users-list/src/users-list.module.mjs +58 -0
- package/esm2020/users-list/src/utils/common-functions.mjs +19 -0
- package/esm2020/users-list/src/utils/pagination/pagination.component.mjs +43 -0
- package/esm2020/users-list/src/utils/utils.service.mjs +73 -0
- package/esm2020/users-list/tuki-io-tuki-widgets-users-list.mjs +5 -0
- package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs +1235 -0
- package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
- package/fesm2015/tuki-io-tuki-widgets-users-list.mjs +872 -0
- package/fesm2015/tuki-io-tuki-widgets-users-list.mjs.map +1 -0
- package/fesm2015/tuki-io-tuki-widgets.mjs +63 -0
- package/fesm2015/tuki-io-tuki-widgets.mjs.map +1 -0
- package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs +1222 -0
- package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
- package/fesm2020/tuki-io-tuki-widgets-users-list.mjs +869 -0
- package/fesm2020/tuki-io-tuki-widgets-users-list.mjs.map +1 -0
- package/fesm2020/tuki-io-tuki-widgets.mjs +63 -0
- package/fesm2020/tuki-io-tuki-widgets.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/widgets.component.d.ts +8 -0
- package/lib/widgets.module.d.ts +7 -0
- package/lib/widgets.service.d.ts +6 -0
- package/package.json +44 -36
- package/{projects/tuki/widgets/src/public-api.ts → public-api.d.ts} +0 -4
- package/user-manage/index.d.ts +5 -0
- package/user-manage/src/app.constants.d.ts +20 -0
- package/user-manage/src/classes/device.d.ts +224 -0
- package/user-manage/src/classes/line.d.ts +116 -0
- package/user-manage/src/classes/notification.d.ts +18 -0
- package/user-manage/src/classes/pagination.d.ts +13 -0
- package/user-manage/src/classes/simplified-user.d.ts +41 -0
- package/user-manage/src/classes/table-data.d.ts +5 -0
- package/user-manage/src/classes/user-list.d.ts +32 -0
- package/user-manage/src/common-functions.d.ts +1 -0
- package/user-manage/src/environments/environment.d.ts +9 -0
- package/user-manage/src/interseptors/auth.interceptor.d.ts +9 -0
- package/user-manage/src/lazy-loading-select/lazy-loading-select.component.d.ts +35 -0
- package/user-manage/src/material.module.d.ts +28 -0
- package/user-manage/src/notifications/notification.component.d.ts +19 -0
- package/user-manage/src/removeKynFromIBM.service.d.ts +8 -0
- package/user-manage/src/services/api.service.d.ts +21 -0
- package/user-manage/src/services/notification.service.d.ts +18 -0
- package/user-manage/src/services/removeKynFromIBM.service.d.ts +8 -0
- package/user-manage/src/services/site-settings.service.d.ts +9 -0
- package/user-manage/src/services/user.service.d.ts +26 -0
- package/user-manage/src/services/users-search.service.d.ts +25 -0
- package/user-manage/src/services/utils.service.d.ts +9 -0
- package/user-manage/src/user-info/user-info.component.d.ts +9 -0
- package/user-manage/src/user-manage-widget.component.d.ts +32 -0
- package/user-manage/src/user-manage.module.d.ts +18 -0
- package/user-manage/src/utils/app-loader/app-loader.d.ts +6 -0
- package/user-manage/src/utils/pagination/pagination.component.d.ts +18 -0
- package/users-list/index.d.ts +5 -0
- package/users-list/src/app.constants.d.ts +17 -0
- package/users-list/src/classes/device.d.ts +224 -0
- package/users-list/src/classes/line.d.ts +116 -0
- package/users-list/src/classes/notification.d.ts +18 -0
- package/users-list/src/classes/pagination.d.ts +13 -0
- package/users-list/src/classes/simlified-user.d.ts +25 -0
- package/users-list/src/classes/table-data.d.ts +5 -0
- package/users-list/src/classes/user-list.d.ts +32 -0
- package/users-list/src/material.module.d.ts +28 -0
- package/users-list/src/services/api.service.d.ts +21 -0
- package/users-list/src/services/events-communication.service.d.ts +8 -0
- package/users-list/src/services/notification.service.d.ts +18 -0
- package/users-list/src/services/removeKynFromIBM.service.d.ts +8 -0
- package/users-list/src/services/user.service.d.ts +26 -0
- package/users-list/src/services/users-search.service.d.ts +25 -0
- package/users-list/src/users-list.component.d.ts +35 -0
- package/users-list/src/users-list.module.d.ts +12 -0
- package/users-list/src/utils/common-functions.d.ts +1 -0
- package/users-list/src/utils/pagination/pagination.component.d.ts +18 -0
- package/users-list/src/utils/utils.service.d.ts +9 -0
- package/.editorconfig +0 -16
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/tasks.json +0 -42
- package/angular.json +0 -41
- package/projects/tuki/widgets/README.md +0 -24
- package/projects/tuki/widgets/karma.conf.js +0 -44
- package/projects/tuki/widgets/ng-package.json +0 -7
- package/projects/tuki/widgets/package.json +0 -13
- package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +0 -23
- package/projects/tuki/widgets/src/lib/widgets.component.ts +0 -20
- package/projects/tuki/widgets/src/lib/widgets.module.ts +0 -16
- package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +0 -16
- package/projects/tuki/widgets/src/lib/widgets.service.ts +0 -9
- package/projects/tuki/widgets/src/test.ts +0 -27
- package/projects/tuki/widgets/styles/_variables.scss +0 -90
- package/projects/tuki/widgets/styles/form.scss +0 -231
- package/projects/tuki/widgets/styles/icons.scss +0 -32
- package/projects/tuki/widgets/styles/styles.scss +0 -110
- package/projects/tuki/widgets/styles/tables.scss +0 -30
- package/projects/tuki/widgets/tsconfig.lib.json +0 -36
- package/projects/tuki/widgets/tsconfig.lib.prod.json +0 -10
- package/projects/tuki/widgets/tsconfig.spec.json +0 -17
- package/projects/tuki/widgets/user-manage/ng-package.json +0 -7
- package/projects/tuki/widgets/user-manage/src/app.constants.ts +0 -38
- package/projects/tuki/widgets/user-manage/src/classes/device.ts +0 -225
- package/projects/tuki/widgets/user-manage/src/classes/line.ts +0 -117
- package/projects/tuki/widgets/user-manage/src/classes/notification.ts +0 -39
- package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +0 -18
- package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +0 -128
- package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +0 -6
- package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +0 -225
- package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +0 -40
- package/projects/tuki/widgets/user-manage/src/classes/user.ts +0 -8
- package/projects/tuki/widgets/user-manage/src/common-functions.ts +0 -16
- package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +0 -9
- package/projects/tuki/widgets/user-manage/src/environments/environment.ts +0 -10
- package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +0 -36
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +0 -50
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +0 -3
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +0 -81
- package/projects/tuki/widgets/user-manage/src/material.module.ts +0 -85
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +0 -33
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +0 -84
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +0 -46
- package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +0 -25
- package/projects/tuki/widgets/user-manage/src/services/api.service.ts +0 -89
- package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +0 -68
- package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +0 -25
- package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +0 -35
- package/projects/tuki/widgets/user-manage/src/services/user.service.ts +0 -120
- package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +0 -58
- package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +0 -71
- package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +0 -90
- package/projects/tuki/widgets/user-manage/src/styles/form.scss +0 -231
- package/projects/tuki/widgets/user-manage/src/styles/icons.scss +0 -32
- package/projects/tuki/widgets/user-manage/src/styles/styles.scss +0 -110
- package/projects/tuki/widgets/user-manage/src/styles/tables.scss +0 -30
- package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +0 -68
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +0 -32
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +0 -53
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +0 -19
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +0 -291
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +0 -461
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +0 -163
- package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +0 -53
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +0 -6
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +0 -11
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +0 -13
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +0 -26
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +0 -41
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +0 -41
- package/projects/tuki/widgets/users-list/ng-package.json +0 -6
- package/projects/tuki/widgets/users-list/src/app.constants.ts +0 -35
- package/projects/tuki/widgets/users-list/src/classes/device.ts +0 -225
- package/projects/tuki/widgets/users-list/src/classes/line.ts +0 -117
- package/projects/tuki/widgets/users-list/src/classes/notification.ts +0 -38
- package/projects/tuki/widgets/users-list/src/classes/pagination.ts +0 -18
- package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +0 -74
- package/projects/tuki/widgets/users-list/src/classes/table-data.ts +0 -6
- package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +0 -225
- package/projects/tuki/widgets/users-list/src/classes/user-list.ts +0 -40
- package/projects/tuki/widgets/users-list/src/classes/user.ts +0 -8
- package/projects/tuki/widgets/users-list/src/material.module.ts +0 -84
- package/projects/tuki/widgets/users-list/src/services/api.service.ts +0 -87
- package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +0 -11
- package/projects/tuki/widgets/users-list/src/services/notification.service.ts +0 -68
- package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +0 -25
- package/projects/tuki/widgets/users-list/src/services/user.service.ts +0 -117
- package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +0 -58
- package/projects/tuki/widgets/users-list/src/users-list.component.css +0 -4
- package/projects/tuki/widgets/users-list/src/users-list.component.css.map +0 -1
- package/projects/tuki/widgets/users-list/src/users-list.component.html +0 -39
- package/projects/tuki/widgets/users-list/src/users-list.component.scss +0 -9
- package/projects/tuki/widgets/users-list/src/users-list.component.ts +0 -85
- package/projects/tuki/widgets/users-list/src/users-list.module.ts +0 -36
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +0 -11
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +0 -1
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +0 -6
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +0 -11
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +0 -13
- package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +0 -16
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +0 -33
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +0 -84
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +0 -46
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +0 -45
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +0 -1
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +0 -26
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +0 -41
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +0 -41
- package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +0 -71
- package/tsconfig.json +0 -46
- /package/{projects/tuki/widgets/user-manage/public-api.ts → user-manage/public-api.d.ts} +0 -0
- /package/{projects/tuki/widgets/users-list/public-api.ts → users-list/public-api.d.ts} +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { MatExpansionModule } from '@angular/material/expansion';
|
|
4
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
6
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
7
|
-
import { MatListModule } from '@angular/material/list';
|
|
8
|
-
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
9
|
-
import { MatTreeModule } from '@angular/material/tree';
|
|
10
|
-
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
12
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
13
|
-
import { MatInputModule } from '@angular/material/input';
|
|
14
|
-
import { MatNativeDateModule } from '@angular/material/core';
|
|
15
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
17
|
-
import { MatStepperModule } from '@angular/material/stepper';
|
|
18
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
19
|
-
import { MatCardModule } from '@angular/material/card';
|
|
20
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
21
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
22
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
23
|
-
import { MatTableModule } from '@angular/material/table';
|
|
24
|
-
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@NgModule({
|
|
28
|
-
imports: [
|
|
29
|
-
DragDropModule,
|
|
30
|
-
MatButtonModule,
|
|
31
|
-
MatListModule,
|
|
32
|
-
MatProgressSpinnerModule,
|
|
33
|
-
MatExpansionModule,
|
|
34
|
-
MatInputModule,
|
|
35
|
-
MatInputModule,
|
|
36
|
-
MatListModule,
|
|
37
|
-
MatTreeModule,
|
|
38
|
-
MatTreeModule,
|
|
39
|
-
MatNativeDateModule,
|
|
40
|
-
MatDatepickerModule,
|
|
41
|
-
MatTooltipModule,
|
|
42
|
-
MatAutocompleteModule,
|
|
43
|
-
MatChipsModule,
|
|
44
|
-
MatSidenavModule,
|
|
45
|
-
MatFormFieldModule,
|
|
46
|
-
MatStepperModule,
|
|
47
|
-
MatTabsModule,
|
|
48
|
-
MatCardModule,
|
|
49
|
-
MatSelectModule,
|
|
50
|
-
MatCheckboxModule,
|
|
51
|
-
MatSlideToggleModule,
|
|
52
|
-
MatTableModule,
|
|
53
|
-
MatPaginatorModule
|
|
54
|
-
],
|
|
55
|
-
exports: [
|
|
56
|
-
DragDropModule,
|
|
57
|
-
MatButtonModule,
|
|
58
|
-
MatListModule,
|
|
59
|
-
MatProgressSpinnerModule,
|
|
60
|
-
MatExpansionModule,
|
|
61
|
-
MatInputModule,
|
|
62
|
-
MatInputModule,
|
|
63
|
-
MatListModule,
|
|
64
|
-
MatTreeModule,
|
|
65
|
-
MatTreeModule,
|
|
66
|
-
MatNativeDateModule,
|
|
67
|
-
MatDatepickerModule,
|
|
68
|
-
MatTooltipModule,
|
|
69
|
-
MatAutocompleteModule,
|
|
70
|
-
MatChipsModule,
|
|
71
|
-
MatSidenavModule,
|
|
72
|
-
MatFormFieldModule,
|
|
73
|
-
MatStepperModule,
|
|
74
|
-
MatTabsModule,
|
|
75
|
-
MatCardModule,
|
|
76
|
-
MatCheckboxModule,
|
|
77
|
-
MatSelectModule,
|
|
78
|
-
MatSlideToggleModule,
|
|
79
|
-
MatProgressSpinnerModule,
|
|
80
|
-
MatTableModule,
|
|
81
|
-
MatPaginatorModule
|
|
82
|
-
],
|
|
83
|
-
})
|
|
84
|
-
export class MaterialModule {
|
|
85
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
<div class="notification-block" role="alert" aria-live="assertive">
|
|
4
|
-
<div class="notification"
|
|
5
|
-
*ngFor="let notification of list"
|
|
6
|
-
[ngClass]="{'error': notification.isError(), 'success': notification.isSuccess()}">
|
|
7
|
-
|
|
8
|
-
<div class="flex-box">
|
|
9
|
-
<div class="notification-icons-block">
|
|
10
|
-
<i *ngIf="notification.isError()" class="fa fa-exclamation-triangle"></i>
|
|
11
|
-
<i *ngIf="notification.isWarning()" class="fa fa-hand-paper-o"></i>
|
|
12
|
-
<i *ngIf="notification.isSuccess()" class="fa fa-check"></i>
|
|
13
|
-
<i *ngIf="notification.isInfo()" class="fa fa-info-circle"></i>
|
|
14
|
-
</div>
|
|
15
|
-
<div *ngIf="!isReadMore" class="message-block">
|
|
16
|
-
{{notification.message | truncate:[93]}}
|
|
17
|
-
</div>
|
|
18
|
-
<div *ngIf="isReadMore" class="message-block">
|
|
19
|
-
{{notification.message}}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="read-more-error link clickable" *ngIf="notification.message && notification.message.length > 93"
|
|
23
|
-
(click)="readMore()">{{(isReadMore ? 'BUTTON.COLLAPSE' : 'BUTTON.READ_MORE') | translate}}</div>
|
|
24
|
-
<button
|
|
25
|
-
class="close"
|
|
26
|
-
mat-icon-button
|
|
27
|
-
matTooltip="{{'BUTTON.CLOSE' | translate}} {{'NOTIFICATION_MSG.' + notification.type | translate}} {{'NOTIFICATION_MSG.NOTI' | translate}}"
|
|
28
|
-
(click)="removeNotification(notification)">
|
|
29
|
-
<img class="notification-icon-close" src="assets/icons/close_icon_modal.svg" alt="">
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
-->
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
@import '../styles/variables';
|
|
2
|
-
|
|
3
|
-
.notification-block {
|
|
4
|
-
right: 0;
|
|
5
|
-
top: 110px;
|
|
6
|
-
position: absolute;
|
|
7
|
-
width: 20%;
|
|
8
|
-
z-index: 100;
|
|
9
|
-
|
|
10
|
-
.read-more-error {
|
|
11
|
-
margin: 10px 13px 3px 0;
|
|
12
|
-
text-align: right;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.notification {
|
|
16
|
-
padding: 15px 0 10px 0;
|
|
17
|
-
margin-bottom: 18px;
|
|
18
|
-
color: $main-txt-color;
|
|
19
|
-
position: relative;
|
|
20
|
-
border-radius: 3px;
|
|
21
|
-
border-top: 1.5px solid $warning-border-color;
|
|
22
|
-
background: $warning-bg-color;
|
|
23
|
-
box-shadow: 0px 8px 12px 0px rgba(9, 30, 66, 0.15), 0px 0px 1px 0px rgba(9, 30, 66, 0.31);
|
|
24
|
-
width: 368px;
|
|
25
|
-
position: relative;
|
|
26
|
-
|
|
27
|
-
.notification-icons-block {
|
|
28
|
-
text-align: center;
|
|
29
|
-
width: 56px;
|
|
30
|
-
}
|
|
31
|
-
.message-block {
|
|
32
|
-
font-size: 14px;
|
|
33
|
-
font-family: $poppins-font !important;
|
|
34
|
-
word-break: break-word;
|
|
35
|
-
width: 270px;
|
|
36
|
-
}
|
|
37
|
-
.notification-icon-close {
|
|
38
|
-
height: 24px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.error {
|
|
42
|
-
background: #FFE9E9;
|
|
43
|
-
border-top: 1.5px solid #E16D6D;
|
|
44
|
-
}
|
|
45
|
-
&.success {
|
|
46
|
-
background: $success-bg-color;
|
|
47
|
-
border-top: 1.5px solid $success-border-color;
|
|
48
|
-
}
|
|
49
|
-
.fa-exclamation-triangle {
|
|
50
|
-
color: #E16D6D !important;
|
|
51
|
-
}
|
|
52
|
-
.fa-check {
|
|
53
|
-
color: #a0c37f !important;
|
|
54
|
-
}
|
|
55
|
-
.fa-info-circle, .fa-hand-paper-o {
|
|
56
|
-
color: #bdb89e !important;
|
|
57
|
-
}
|
|
58
|
-
.fa {
|
|
59
|
-
font-size: 20px;
|
|
60
|
-
}
|
|
61
|
-
.close {
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 2px;
|
|
64
|
-
right: -5px;
|
|
65
|
-
.fa {
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
.fa {
|
|
70
|
-
margin: 0;
|
|
71
|
-
color: inherit;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@media screen and (max-width: 600px) {
|
|
77
|
-
.notification-block {
|
|
78
|
-
width: 50%;
|
|
79
|
-
min-width: 150px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { Subscription } from 'rxjs';
|
|
3
|
-
import { NotificationService } from '../services/notification.service';
|
|
4
|
-
import { Notification } from '../classes/notification';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-notification',
|
|
8
|
-
templateUrl: './notification.component.html',
|
|
9
|
-
styleUrls: ['./notification.component.scss'],
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
11
|
-
})
|
|
12
|
-
export class NotificationsComponent implements OnInit, OnDestroy {
|
|
13
|
-
public list!: Notification[];
|
|
14
|
-
public isReadMore!: boolean;
|
|
15
|
-
private listSubscription!: Subscription;
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
-
public notificationService: NotificationService,
|
|
19
|
-
private ref: ChangeDetectorRef
|
|
20
|
-
) {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
ngOnInit() {
|
|
24
|
-
this.listChangeSubscribe();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
ngOnDestroy() {
|
|
28
|
-
this.listSubscription.unsubscribe();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public readMore(): void {
|
|
32
|
-
this.isReadMore = !this.isReadMore;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public removeNotification(notification: Notification): void {
|
|
36
|
-
this.notificationService.remove(notification);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private listChangeSubscribe(): void {
|
|
40
|
-
this.listSubscription = this.notificationService.listChange
|
|
41
|
-
.subscribe((list: any) => {
|
|
42
|
-
this.list = list;
|
|
43
|
-
this.ref.detectChanges();
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { CUCMS_TO_IGNORE, CUCS_TO_IGNORE } from './app.constants';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class RemoveKynFromIBMService {
|
|
6
|
-
constructor() {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
removeCUCMS(date: any, customerId: number) {
|
|
11
|
-
if (customerId === 8) {
|
|
12
|
-
return date.filter((val: any) => !CUCMS_TO_IGNORE.includes(Math.round(val.cucmId)));
|
|
13
|
-
}
|
|
14
|
-
return date;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
removeCUCS(date: any, customerId: number) {
|
|
18
|
-
if (customerId === 8) {
|
|
19
|
-
return date.filter((val: any) => !CUCS_TO_IGNORE.includes(Math.round(val.cucId)));
|
|
20
|
-
}
|
|
21
|
-
return date;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
3
|
-
import { TableDataInterface } from '../classes/table-data';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
const apiUrl = 'http://192.168.0.191:8080';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@Injectable()
|
|
10
|
-
export class APIService {
|
|
11
|
-
public token: any;
|
|
12
|
-
constructor(
|
|
13
|
-
private httpClient: HttpClient
|
|
14
|
-
) {
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
fetch(url: string, params?: any, cache?: boolean) {
|
|
18
|
-
const headers = this.getHeaders(cache);
|
|
19
|
-
params = params || {};
|
|
20
|
-
return this.httpClient.get(apiUrl + url, {params: this.prepareEncodedParams(params), headers});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
post(url: string, body: any, params = {}): any {
|
|
24
|
-
body = body || null;
|
|
25
|
-
const headers = this.getHeaders();
|
|
26
|
-
return this.httpClient.post(apiUrl + url, body, {params: this.prepareEncodedParams(params), headers});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// use when response extended data is necessary:
|
|
30
|
-
postExtended(url: string, body = null, params = {}, headers = {}) {
|
|
31
|
-
headers = headers || this.getHeaders();
|
|
32
|
-
return this.httpClient.post(apiUrl + url, body, {
|
|
33
|
-
headers,
|
|
34
|
-
observe: 'response',
|
|
35
|
-
params: this.prepareEncodedParams(params)
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
put(url: string, body = null, params = {}) {
|
|
40
|
-
const headers = this.getHeaders();
|
|
41
|
-
return this.httpClient.put(apiUrl + url, body, {headers, params: this.prepareEncodedParams(params)});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
delete(url: string, params = {}) {
|
|
45
|
-
const headers = this.getHeaders();
|
|
46
|
-
return this.httpClient.delete(apiUrl + url, {headers, params: this.prepareEncodedParams(params)});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
fetchPagination(url: string, pageSize: number, pageNumber: number, additionalParams = {}, cache?: boolean): Observable<TableDataInterface> {
|
|
50
|
-
const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
|
|
51
|
-
const params = Object.assign(copyAdditionalParams, {size: pageSize.toString(), page: pageNumber.toString()});
|
|
52
|
-
return this.fetch(url, params, cache) as Observable<TableDataInterface>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
private prepareEncodedParams(params: any) {
|
|
56
|
-
const result: any = {};
|
|
57
|
-
|
|
58
|
-
if (!params) {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
for (const key of Object.keys(params)) {
|
|
62
|
-
if (params[key]) {
|
|
63
|
-
const stringParam = params[key].toString();
|
|
64
|
-
result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
private getHeaders(cache?: boolean): HttpHeaders {
|
|
71
|
-
let headers = new HttpHeaders();
|
|
72
|
-
if (cache) {
|
|
73
|
-
headers = headers.append('_Cache', 'true ');
|
|
74
|
-
}
|
|
75
|
-
const token = this.token || this.getParameterByName('token');
|
|
76
|
-
headers = headers.append('Authorization', 'Bearer '+ token);
|
|
77
|
-
return headers;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
private getParameterByName(name: any, url = window.location.href) {
|
|
81
|
-
name = name.replace(/[\[\]]/g, '\\$&');
|
|
82
|
-
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
|
83
|
-
results = regex.exec(url);
|
|
84
|
-
if (!results) return null;
|
|
85
|
-
if (!results[2]) return '';
|
|
86
|
-
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Notification } from '../classes/notification';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
const SUCCESS_TIME = 5000;
|
|
5
|
-
const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
|
|
6
|
-
const INACTIVE_SESSION = 'SESSION_INACTIVE';
|
|
7
|
-
|
|
8
|
-
@Injectable()
|
|
9
|
-
export class NotificationService {
|
|
10
|
-
|
|
11
|
-
public listChange = new Subject();
|
|
12
|
-
|
|
13
|
-
private max = 0;
|
|
14
|
-
private list: Notification[] = [];
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
17
|
-
) {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
error(message: string, ttl?: number): void {
|
|
21
|
-
this.notify('error', message, ttl);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
success(message: string, ttl?: number): void {
|
|
25
|
-
this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
warning(message: string, ttl?: number): void {
|
|
29
|
-
this.notify('warning', message, ttl);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
info(message: string, ttl?: number): void {
|
|
33
|
-
this.notify('info', message, ttl);
|
|
34
|
-
}
|
|
35
|
-
private notify(type: string, message: string, ttl?: number): void {
|
|
36
|
-
const found = this.list.find((n: Notification) => n.message === message);
|
|
37
|
-
if (found) {
|
|
38
|
-
this.remove(found);
|
|
39
|
-
}
|
|
40
|
-
const notification = new Notification({
|
|
41
|
-
id: ++this.max,
|
|
42
|
-
type, message, ttl
|
|
43
|
-
});
|
|
44
|
-
if (notification.ttl > 0) {
|
|
45
|
-
notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
|
|
46
|
-
}
|
|
47
|
-
this.list.push(notification);
|
|
48
|
-
this.listChange.next(this.list);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
remove(notification: Notification, auto?: boolean): void {
|
|
52
|
-
if (!auto && notification.timerId) {
|
|
53
|
-
// clear timeout in case of manual remove
|
|
54
|
-
clearInterval(notification.timerId);
|
|
55
|
-
}
|
|
56
|
-
this.list = this.list.filter(n => n.id !== notification.id);
|
|
57
|
-
this.listChange.next(this.list);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
private removeInactiveSessionError(): void {
|
|
61
|
-
if (!this.list || !this.list.length) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
|
|
65
|
-
this.listChange.next(this.list);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { CUCMS_TO_IGNORE, CUCS_TO_IGNORE } from '../app.constants';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class RemoveKynFromIBMService {
|
|
6
|
-
constructor() {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
removeCUCMS(date: any, customerId: number) {
|
|
11
|
-
if (customerId === 8) {
|
|
12
|
-
return date.filter((val: any) => !CUCMS_TO_IGNORE.includes(Math.round(val.cucmId)));
|
|
13
|
-
}
|
|
14
|
-
return date;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
removeCUCS(date: any, customerId: number) {
|
|
18
|
-
if (customerId === 8) {
|
|
19
|
-
return date.filter((val: any) => !CUCS_TO_IGNORE.includes(Math.round(val.cucId)));
|
|
20
|
-
}
|
|
21
|
-
return date;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Injectable, OnInit } from '@angular/core';
|
|
2
|
-
import { APIService } from './api.service';
|
|
3
|
-
import { API } from '../app.constants';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { map } from 'rxjs/operators';
|
|
6
|
-
const urlMap = {
|
|
7
|
-
locations: API.LOCATION,
|
|
8
|
-
userLocales: API.USER_LOCALES,
|
|
9
|
-
userProfiles: API.USER_PROFILES
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@Injectable()
|
|
13
|
-
export class SiteSettingsService {
|
|
14
|
-
|
|
15
|
-
constructor(
|
|
16
|
-
private apiService: APIService
|
|
17
|
-
) {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
public getSelectionOptions(siteId: number, token: string): any {
|
|
21
|
-
if(!siteId) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
const URL = urlMap[token];
|
|
26
|
-
return this.apiService.fetch(URL.replace(':siteId', String(siteId)), null, true)
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
.pipe(map((options: string[]) => {
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
this[token] = options ? options.sort() : [];
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
return this[token];
|
|
33
|
-
}))
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import {Injectable, OnInit} from '@angular/core';
|
|
2
|
-
import { Observable, of, forkJoin } from 'rxjs';
|
|
3
|
-
import { SimplifiedUser } from '../classes/simplified-user';
|
|
4
|
-
import { API } from '../app.constants';
|
|
5
|
-
import { APIService } from './api.service';
|
|
6
|
-
import { map } from 'rxjs/operators';
|
|
7
|
-
import { UtilsService } from './utils.service';
|
|
8
|
-
|
|
9
|
-
@Injectable()
|
|
10
|
-
export class UserService implements OnInit{
|
|
11
|
-
siteId: number = -1;
|
|
12
|
-
userId: string = '';
|
|
13
|
-
userIdExistPending = false;
|
|
14
|
-
hasExistedUserId = false;
|
|
15
|
-
user!: SimplifiedUser;
|
|
16
|
-
originUser!: SimplifiedUser;
|
|
17
|
-
|
|
18
|
-
constructor(
|
|
19
|
-
private apiService: APIService
|
|
20
|
-
) {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ngOnInit(): void {
|
|
25
|
-
console.log(this.siteId)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public fetchUserToken(siteId: number, userId: string): any {
|
|
29
|
-
if (this.siteId === siteId && this.userId === userId && this.user) {
|
|
30
|
-
return of(this.user);
|
|
31
|
-
}
|
|
32
|
-
this.siteId = siteId;
|
|
33
|
-
this.userId = userId;
|
|
34
|
-
return this.apiService.fetch(API.USER_TOKEN.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(userId))))
|
|
35
|
-
.pipe(map((result: any) => {
|
|
36
|
-
this.setSimplifiedUser(Object.values(result)[0]);
|
|
37
|
-
}))
|
|
38
|
-
// .pipe(this.handleError(false, true));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public updateUserFields(body: any): any {
|
|
42
|
-
if (!this.userId || !this.siteId || !this.user?.token) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
return this.apiService.post(API.UPDATE_USER_FIELDS.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), body)
|
|
46
|
-
// .pipe(this.handleError(false, true));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public fetchUserById(id: string) {
|
|
50
|
-
this.userIdExistPending = true;
|
|
51
|
-
return this.apiService.fetch(API.USER_BY_ID.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(id))))
|
|
52
|
-
.pipe(map(result => {
|
|
53
|
-
this.userIdExistPending = false;
|
|
54
|
-
return result;
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public persistCacheChanges() {
|
|
59
|
-
const params = {
|
|
60
|
-
excludeDeviceExtraOptions: true
|
|
61
|
-
};
|
|
62
|
-
return this.processUserChangesToCache()
|
|
63
|
-
.pipe(map((result: any) => {
|
|
64
|
-
return this.apiService.post(API.PERSIST_USER_CACHE.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), {}, params)
|
|
65
|
-
.subscribe(() => {
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
// .pipe(map((user) => {
|
|
69
|
-
// // this.setUser(user, false, this.user.token);
|
|
70
|
-
// this.user.hasModifiedCache = false;
|
|
71
|
-
// }))
|
|
72
|
-
// .pipe(this.handleError(true, true));
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public processUserChangesToCache(): any {
|
|
77
|
-
const calls = [];
|
|
78
|
-
const body = UtilsService.diff(this.originUser.getSavableData(), this.user.getSavableData(), 'user');
|
|
79
|
-
if (body) {
|
|
80
|
-
calls.push(this.updateUserFields(body));
|
|
81
|
-
}
|
|
82
|
-
if (!calls?.length) {
|
|
83
|
-
return of(this.user);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return forkJoin(calls)
|
|
87
|
-
.pipe(map((responses: any) => {
|
|
88
|
-
// ApiUserResponse
|
|
89
|
-
this.handleSaveUserResponse(responses);
|
|
90
|
-
}))
|
|
91
|
-
// .pipe(this.handleError(false, true));
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
public hasUnsavedChanges() {
|
|
96
|
-
if (this.user && this.originUser) {
|
|
97
|
-
return !this.user.equal(this.originUser);
|
|
98
|
-
}
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public setSimplifiedUser(user: any): void {
|
|
103
|
-
this.user = new SimplifiedUser(user);
|
|
104
|
-
const copiedUser = JSON.parse(JSON.stringify(user));
|
|
105
|
-
this.originUser = new SimplifiedUser(copiedUser);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
private handleSaveUserResponse(responses: any) {
|
|
109
|
-
if (!responses?.length) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
for (let len = responses.length, i = len - 1; i >= 0; i--) {
|
|
113
|
-
if (responses[i] && responses[i].currentUpdatedUser) {
|
|
114
|
-
// this.setUser(responses[i].currentUpdatedUser, false, this.user.token);
|
|
115
|
-
this.user.hasModifiedCache = true;
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Injectable, OnInit } from '@angular/core';
|
|
2
|
-
import { SimplifiedUser } from '../classes/simplified-user';
|
|
3
|
-
import { APIService } from './api.service';
|
|
4
|
-
import { ListUser, ListUserInterface } from '../classes/user-list';
|
|
5
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
|
6
|
-
import { API, PAGINATION_DEFAULTS, PAGINATION_SIZE_OPTIONS } from '../app.constants';
|
|
7
|
-
import { TableDataInterface } from '../classes/table-data';
|
|
8
|
-
import { map } from 'rxjs/operators';
|
|
9
|
-
import { RemoveKynFromIBMService } from '../removeKynFromIBM.service';
|
|
10
|
-
import { PaginationDataDto } from '../classes/pagination';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@Injectable()
|
|
15
|
-
export class UsersSearchService {
|
|
16
|
-
siteId: number = -1;
|
|
17
|
-
userId: string = '';
|
|
18
|
-
customerId!: number;
|
|
19
|
-
userIdExistPending = false;
|
|
20
|
-
hasExistedUserId = false;
|
|
21
|
-
pageSize = PAGINATION_DEFAULTS.SIZE;
|
|
22
|
-
pageIndex = PAGINATION_DEFAULTS.SIZE;
|
|
23
|
-
pageSizeOptions = PAGINATION_SIZE_OPTIONS;
|
|
24
|
-
total!: number;
|
|
25
|
-
searchParams!: any;
|
|
26
|
-
foundUsers$!: any;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
private apiService: APIService,
|
|
30
|
-
private removeKynFromIBMService: RemoveKynFromIBMService
|
|
31
|
-
) {
|
|
32
|
-
this.foundUsers$ = new BehaviorSubject(null);
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public getPagination(): PaginationDataDto {
|
|
37
|
-
return {
|
|
38
|
-
total: this.total,
|
|
39
|
-
pageSizeOptions: this.pageSizeOptions,
|
|
40
|
-
pageSize: this.pageSize,
|
|
41
|
-
pageIndex: this.pageIndex
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public quickRegularUsersSearch() {
|
|
46
|
-
this.searchParams = this.searchParams || {customerid: this.customerId};
|
|
47
|
-
return this.apiService.fetchPagination(API.QUICK_USERS_SEARCH, this.pageSize, this.pageIndex, this.searchParams)
|
|
48
|
-
.pipe(map((res: TableDataInterface) => {
|
|
49
|
-
this.total = res.total;
|
|
50
|
-
// this.totals = this.totals || {};
|
|
51
|
-
// this.totals['users'] = res.total;
|
|
52
|
-
const users = res.pageData && res.pageData.length ? res.pageData.map(user => new ListUser(user)) : [];
|
|
53
|
-
// this.foundUsers$.next(this.removeKynFromIBMService.removeCUCMS(users, this.customerId));
|
|
54
|
-
this.foundUsers$.next(users);
|
|
55
|
-
}));
|
|
56
|
-
// .pipe(this.handleError(true));
|
|
57
|
-
}
|
|
58
|
-
}
|