@tuki-io/tuki-widgets 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/.editorconfig +16 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/README.md +27 -0
  6. package/angular.json +41 -0
  7. package/package.json +42 -0
  8. package/projects/tuki/widgets/README.md +24 -0
  9. package/projects/tuki/widgets/karma.conf.js +44 -0
  10. package/projects/tuki/widgets/ng-package.json +7 -0
  11. package/projects/tuki/widgets/package.json +13 -0
  12. package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +23 -0
  13. package/projects/tuki/widgets/src/lib/widgets.component.ts +20 -0
  14. package/projects/tuki/widgets/src/lib/widgets.module.ts +16 -0
  15. package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +16 -0
  16. package/projects/tuki/widgets/src/lib/widgets.service.ts +9 -0
  17. package/projects/tuki/widgets/src/public-api.ts +7 -0
  18. package/projects/tuki/widgets/src/test.ts +27 -0
  19. package/projects/tuki/widgets/styles/_variables.scss +90 -0
  20. package/projects/tuki/widgets/styles/form.scss +231 -0
  21. package/projects/tuki/widgets/styles/icons.scss +32 -0
  22. package/projects/tuki/widgets/styles/styles.scss +110 -0
  23. package/projects/tuki/widgets/styles/tables.scss +30 -0
  24. package/projects/tuki/widgets/tsconfig.lib.json +36 -0
  25. package/projects/tuki/widgets/tsconfig.lib.prod.json +10 -0
  26. package/projects/tuki/widgets/tsconfig.spec.json +17 -0
  27. package/projects/tuki/widgets/user-manage/ng-package.json +7 -0
  28. package/projects/tuki/widgets/user-manage/public-api.ts +6 -0
  29. package/projects/tuki/widgets/user-manage/src/app.constants.ts +38 -0
  30. package/projects/tuki/widgets/user-manage/src/classes/device.ts +225 -0
  31. package/projects/tuki/widgets/user-manage/src/classes/line.ts +117 -0
  32. package/projects/tuki/widgets/user-manage/src/classes/notification.ts +39 -0
  33. package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +18 -0
  34. package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +128 -0
  35. package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +6 -0
  36. package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +225 -0
  37. package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +40 -0
  38. package/projects/tuki/widgets/user-manage/src/classes/user.ts +8 -0
  39. package/projects/tuki/widgets/user-manage/src/common-functions.ts +16 -0
  40. package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +9 -0
  41. package/projects/tuki/widgets/user-manage/src/environments/environment.ts +10 -0
  42. package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +36 -0
  43. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +50 -0
  44. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +3 -0
  45. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +81 -0
  46. package/projects/tuki/widgets/user-manage/src/material.module.ts +85 -0
  47. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +33 -0
  48. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +84 -0
  49. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +46 -0
  50. package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +25 -0
  51. package/projects/tuki/widgets/user-manage/src/services/api.service.ts +89 -0
  52. package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +68 -0
  53. package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +25 -0
  54. package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +35 -0
  55. package/projects/tuki/widgets/user-manage/src/services/user.service.ts +120 -0
  56. package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +58 -0
  57. package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +71 -0
  58. package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +90 -0
  59. package/projects/tuki/widgets/user-manage/src/styles/form.scss +231 -0
  60. package/projects/tuki/widgets/user-manage/src/styles/icons.scss +32 -0
  61. package/projects/tuki/widgets/user-manage/src/styles/styles.scss +110 -0
  62. package/projects/tuki/widgets/user-manage/src/styles/tables.scss +30 -0
  63. package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +68 -0
  64. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +32 -0
  65. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +53 -0
  66. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +19 -0
  67. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +291 -0
  68. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +461 -0
  69. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +163 -0
  70. package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +53 -0
  71. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +6 -0
  72. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +11 -0
  73. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +13 -0
  74. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +26 -0
  75. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +41 -0
  76. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +41 -0
  77. package/projects/tuki/widgets/users-list/ng-package.json +6 -0
  78. package/projects/tuki/widgets/users-list/public-api.ts +8 -0
  79. package/projects/tuki/widgets/users-list/src/app.constants.ts +35 -0
  80. package/projects/tuki/widgets/users-list/src/classes/device.ts +225 -0
  81. package/projects/tuki/widgets/users-list/src/classes/line.ts +117 -0
  82. package/projects/tuki/widgets/users-list/src/classes/notification.ts +38 -0
  83. package/projects/tuki/widgets/users-list/src/classes/pagination.ts +18 -0
  84. package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +74 -0
  85. package/projects/tuki/widgets/users-list/src/classes/table-data.ts +6 -0
  86. package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +225 -0
  87. package/projects/tuki/widgets/users-list/src/classes/user-list.ts +40 -0
  88. package/projects/tuki/widgets/users-list/src/classes/user.ts +8 -0
  89. package/projects/tuki/widgets/users-list/src/material.module.ts +84 -0
  90. package/projects/tuki/widgets/users-list/src/services/api.service.ts +87 -0
  91. package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +11 -0
  92. package/projects/tuki/widgets/users-list/src/services/notification.service.ts +68 -0
  93. package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +25 -0
  94. package/projects/tuki/widgets/users-list/src/services/user.service.ts +117 -0
  95. package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +58 -0
  96. package/projects/tuki/widgets/users-list/src/users-list.component.css +4 -0
  97. package/projects/tuki/widgets/users-list/src/users-list.component.css.map +1 -0
  98. package/projects/tuki/widgets/users-list/src/users-list.component.html +39 -0
  99. package/projects/tuki/widgets/users-list/src/users-list.component.scss +9 -0
  100. package/projects/tuki/widgets/users-list/src/users-list.component.ts +85 -0
  101. package/projects/tuki/widgets/users-list/src/users-list.module.ts +36 -0
  102. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +11 -0
  103. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +1 -0
  104. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +6 -0
  105. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +11 -0
  106. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +13 -0
  107. package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +16 -0
  108. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +33 -0
  109. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +84 -0
  110. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +46 -0
  111. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +45 -0
  112. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +1 -0
  113. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +26 -0
  114. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +41 -0
  115. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +41 -0
  116. package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +71 -0
  117. package/tsconfig.json +46 -0
@@ -0,0 +1,225 @@
1
+ import { EntityChangeType } from './line';
2
+
3
+ export interface DeviceInterface {
4
+ name: string;
5
+ newName: string;
6
+ pkid: string;
7
+ entityChangeType: EntityChangeType;
8
+ deviceType: string;
9
+ protocol: string;
10
+ description: string;
11
+ buttonTemplate: string;
12
+ softkeyTemplate: string;
13
+ devicePoolName: string;
14
+ location: string;
15
+ userLocale: string;
16
+ enabledExtensionMobility: boolean;
17
+ callingSearchSpaceName: string;
18
+ services: string[];
19
+ networkLocale: string;
20
+ securityProfile: string;
21
+ lineAssociations: LineAssociationInterface[];
22
+ speedDials: SpeedDialInterface[];
23
+ sipProfile: string;
24
+ subscribeCallingSearchSpaceName: string;
25
+ commonPhoneConfigName: string;
26
+ ctiRemoteDevice: boolean;
27
+ firstExpansionModule: string;
28
+ secondExpansionModule: string;
29
+ thirdExpansionModule: string;
30
+ builtInBridge: string;
31
+ extraOptions?: DeviceExtraOptionsInterface;
32
+ formDisabledControls?: string[];
33
+ sharedUsers: string[];
34
+ busyLampFields: BusyLampFieldsInterface[];
35
+ meetMeEnabled: boolean;
36
+ deviceKind?: any;
37
+ isCtiRoutePoint?: boolean;
38
+ cucmId: string;
39
+ plarDevice?: boolean;
40
+ firmwareVersion?: any;
41
+ certificateOperation: string;
42
+ authenticationMode: string;
43
+ authenticationString?: string;
44
+ rsaKeySize?: string;
45
+ operationCompletesBy: string;
46
+ certificateStatus: string;
47
+ day?: string;
48
+ month?: string;
49
+ year?: string;
50
+ hour?: string;
51
+ securityProfileUuid?: string;
52
+ excludeDeviceExtraOptions?: boolean;
53
+ webexUUID?: string;
54
+ }
55
+ export interface LineAssociationInterface {
56
+ index: number;
57
+ position?: number;
58
+ e164Mask: string;
59
+ textLabel: string;
60
+ displayLabel: string;
61
+ displayLabelAscii: string;
62
+ directoryNumber: LineDirectoryInterface;
63
+ didPattern: TranslationPatternInterface;
64
+ mappedDids: Array<string>;
65
+ linePkid: string;
66
+ maxNumberOfCalls: number;
67
+ busyTrigger: number;
68
+ recordingOption: RecordingOptions;
69
+ recordingProfile: string;
70
+ recordingMediaSource: string;
71
+ visualMWI: string;
72
+ audibleMWI: string;
73
+ ringSetting_idle: string;
74
+ ringSetting_active: string;
75
+ pickupAAS_idle: string;
76
+ pickupAAS_active: string;
77
+ monitorCSS: string;
78
+ logMissedCall: string;
79
+ callInfoDisplay: LineCallInfoDisplayInterface;
80
+ lineLocalId: string;
81
+ sharedUsers: string[];
82
+ sharedDevices: string[];
83
+ ownerUserId: Array<string>;
84
+ associated: boolean;
85
+ populateWithDid: boolean;
86
+ }
87
+ export interface SpeedDialInterface {
88
+ index: number;
89
+ position: number;
90
+ destination: string;
91
+ label: string;
92
+ editMode?: boolean;
93
+ }
94
+ export interface LineDirectoryInterface {
95
+ directoryNumber: string;
96
+ routePartitionName: string;
97
+ pkid: string;
98
+ dnType: string;
99
+ subType?: string;
100
+ templateDirectoryNumber?: string;
101
+ }
102
+ export interface TranslationPatternInterface {
103
+ pattern: string;
104
+ calledPartyTransformationMask: string;
105
+ description?: string;
106
+ site?: SiteShortDataInterface;
107
+ hasMultipleSites?: boolean;
108
+ multipleSitesId?: string;
109
+ }
110
+ export enum RecordingOptions {
111
+ disabled = 'Call Recording Disabled',
112
+ auto_enabled = 'Automatic Call Recording Enabled',
113
+ selective_enabled = 'Selective Call Recording Enabled'
114
+ }
115
+ export interface LineCallInfoDisplayInterface {
116
+ callerName: string;
117
+ callerNumber: string;
118
+ redirectedNumber: string;
119
+ dialedNumber: string;
120
+ }
121
+ export interface SiteShortDataInterface {
122
+ id: number;
123
+ name: string;
124
+ }
125
+ export interface DeviceExtraOptionsInterface {
126
+ mediaResourceGroupList: string;
127
+ userHoldMOHAudioSourceId: number;
128
+ userHoldMOHAudioSourceName: string;
129
+ networkMOHAudioSourceId: number;
130
+ networkMOHAudioSourceName: string;
131
+ aarCss: string;
132
+ aarGroup: string;
133
+ privacy: string;
134
+ deviceMobilityMode: string;
135
+ mobilityUserId: string;
136
+ phonePersonalization: string;
137
+ servicesProvisioning: string;
138
+ phoneLoadName: string;
139
+ phoneIdleBLFAlertSetting: string;
140
+ phoneBusyBLFAlertSetting: string;
141
+ useTrustedRelayPoint: string;
142
+ alwaysUsePrimeLine: string;
143
+ alwaysUsePrimeLineForVoiceMessage: string;
144
+ geolocation: string;
145
+ emergencyLocation: string;
146
+ ignorePresentationIndicators: boolean;
147
+ loggedIntoHuntGroup: boolean;
148
+ enabledExtensionMobility: boolean;
149
+ remoteDevice: boolean;
150
+ protectedDevice: boolean;
151
+ hotlineDevice: boolean;
152
+ useDevicePoolCgpnIngressDN: boolean;
153
+ cgpnIngressDN: string;
154
+ useDevicePoolCgpnTransformCss: boolean;
155
+ cgpnTransformationCss: string;
156
+ packetCaptureMode: string;
157
+ packetCaptureDuration: number;
158
+ blfPresenceGroup: string;
159
+ sipDialRules: string;
160
+ mtpPreferredOriginatingCodec: string;
161
+ rerouteCss: string;
162
+ subscribeCss: string;
163
+ mtpRequired: boolean;
164
+ unattendedPort: boolean;
165
+ requireDtmfReception: boolean;
166
+ informationUrl: string;
167
+ directoryUrl: string;
168
+ messagesUrl: string;
169
+ servicesUrl: string;
170
+ authenticationUrl: string;
171
+ proxyServerUrl: string;
172
+ idleUrl: string;
173
+ idleTimeout: string;
174
+ secureAuthenticationUrl: string;
175
+ secureDirectoryUrl: string;
176
+ secureIdleUrl: string;
177
+ secureInformationUrl: string;
178
+ secureMessageUrl: string;
179
+ secureServicesUrl: string;
180
+ mlppDomain: string;
181
+ mlppIndication: string;
182
+ mlppPreemption: string;
183
+ confidentialAccessMode: string;
184
+ confidentialAccessLevel: string;
185
+ confidentialAccessLevelName: string;
186
+ doNotDisturb: boolean;
187
+ dndOption: string;
188
+ dndIncomingCallAlert: string;
189
+ disableSpeakerphone: boolean;
190
+ disableSpeakerphoneAndHeadset: boolean;
191
+ forwardingDelay: boolean;
192
+ pcPort: boolean;
193
+ settingsAccess: string;
194
+ gratuitousARP: boolean;
195
+ pcVoiceVlanAccess: boolean;
196
+ videoCapabilities: boolean;
197
+ webAccess: boolean;
198
+ daysDisplayNotActive: string[];
199
+ displayOnTime: string;
200
+ displayOnDuration: string;
201
+ displayIdleTimeout: string;
202
+ wirelessHeadsetHookswitchControl: boolean;
203
+ minRingVolume: string;
204
+ showAllCallsOnPL: boolean;
205
+ lineMode: string;
206
+ latentCapabilityRegistration: string;
207
+ analogGatewayPortInformation: AnalogGatewayPortInformationInterFace;
208
+ }
209
+ export interface AnalogGatewayPortInformationInterFace {
210
+ portDirection: string;
211
+ prefixDn: string;
212
+ numDigits: number;
213
+ expectedDigits: number;
214
+ smdiPortNumber: number;
215
+ trunk: string;
216
+ unattendedPort: string;
217
+ }
218
+ export interface BusyLampFieldsInterface {
219
+ index: number;
220
+ position: number;
221
+ destination: string;
222
+ dnWithRoutePartition: string;
223
+ label: string;
224
+ callPickup: boolean;
225
+ }
@@ -0,0 +1,117 @@
1
+ export interface LineInterface {
2
+ description: string;
3
+ pkid: string;
4
+ entityChangeType: EntityChangeType;
5
+ alertingName: string;
6
+ asciiAlertingName: string;
7
+ callingSearchSpace: string;
8
+ voiceMailProfile: string;
9
+ noAnswerRingDuration: number;
10
+ autoAnswer: string;
11
+ directoryNumber: LineDirectoryInterface;
12
+ didPatterns: Array<TranslationPatternInterface>;
13
+ mappedDids: Array<string>;
14
+ aarSettings: LineAarInterface;
15
+ callForwardAll: CallInterface;
16
+ callForwardAllSecondaryCSS: CallInterface;
17
+ callForwardBusyInternal: CallInterface;
18
+ callForwardBusyExternal: CallInterface;
19
+ callForwardNoAnswerInternal: CallInterface;
20
+ callForwardNoAnswerExternal: CallInterface;
21
+ callForwardNoCoverageInternal: CallInterface;
22
+ callForwardNoCoverageExternal: CallInterface;
23
+ callForwardOnCTIFailure: CallInterface;
24
+ callForwardUnregisteredInternal: CallInterface;
25
+ callForwardUnregisteredExternal: CallInterface;
26
+ parkMonitoringExternal: LineParkMonitoringInterface;
27
+ parkMonitoringInternal: LineParkMonitoringInterface;
28
+ callPickupGroup: string;
29
+ localId: string;
30
+ urgentPriority: boolean;
31
+ blfPresenceGroup: string;
32
+ userHoldMOHAudioSourceId: string;
33
+ userHoldMOHAudioSourceName: string;
34
+ networkMOHAudioSourceId: string;
35
+ networkMOHAudioSourceName: string;
36
+ rejectAnonymousCall: boolean;
37
+ enterpriseAltNum: AlternateNumberInterface;
38
+ e164AltNum: AlternateNumberInterface;
39
+ directoryUris: Array<DirectoryUriInterface>;
40
+ callForwardAlternateParty: ParkMonitoringInterface;
41
+ mlppNoAnswerRingDuration: number;
42
+ confidentialAccessMode: string;
43
+ confidentialAccessLevel: string;
44
+ confidentialAccessLevelName: string;
45
+ callControlAgentProfile: string;
46
+ holdReversionRingDuration: number;
47
+ holdReversionNotificationInterval: number;
48
+ partyEntranceTone: string;
49
+ pstnFailover: string;
50
+ isExistingLine?: boolean;
51
+ plarDestinationNumber: string;
52
+ prefixDigits: string;
53
+ plarDescription: string;
54
+ plarEnabled: boolean;
55
+ }
56
+
57
+ export enum EntityChangeType {
58
+ added = 'added',
59
+ updated = 'updated',
60
+ existing = 'existing',
61
+ removed = 'removed',
62
+ unassociated = 'unassociated'
63
+ }
64
+ export interface LineDirectoryInterface {
65
+ directoryNumber: string;
66
+ routePartitionName: string;
67
+ pkid: string;
68
+ dnType: string;
69
+ subType?: string;
70
+ templateDirectoryNumber?: string;
71
+ }
72
+ export interface TranslationPatternInterface {
73
+ pattern: string;
74
+ calledPartyTransformationMask: string;
75
+ description?: string;
76
+ site?: SiteShortDataInterface;
77
+ hasMultipleSites?: boolean;
78
+ multipleSitesId?: string;
79
+ }
80
+ export interface SiteShortDataInterface {
81
+ id: number;
82
+ name: string;
83
+ }
84
+ export interface LineAarInterface {
85
+ aarDestinationMask: string;
86
+ aarGroup: string;
87
+ aarVoiceMailEnabled: boolean;
88
+ aarKeepCallHistory: boolean;
89
+ }
90
+ export interface CallInterface {
91
+ forwardToVoiceMail: boolean;
92
+ destination: string;
93
+ callingSearchSpace: string;
94
+ }
95
+ export interface LineParkMonitoringInterface {
96
+ voiceMail: boolean;
97
+ destination: string;
98
+ callingSearchSpace: string;
99
+ }
100
+ export interface AlternateNumberInterface {
101
+ numberMask: string;
102
+ addLocalRoutePartition: boolean;
103
+ routePartition: string;
104
+ isUrgent: boolean;
105
+ advertiseGloballyIls: boolean;
106
+ }
107
+ export interface DirectoryUriInterface {
108
+ primary: boolean;
109
+ uri: string;
110
+ routePartition: string;
111
+ advertiseGloballyIls: boolean;
112
+ }
113
+ export interface ParkMonitoringInterface {
114
+ destination: string;
115
+ callingSearchSpace: string;
116
+ voiceMail: boolean;
117
+ }
@@ -0,0 +1,39 @@
1
+ import { environment } from '../environments/environment';
2
+ const TTL_DEFAULT = environment.notificationsLifetime;
3
+ const TTL_LONG_DEFAULT = environment.longNotificationsLifetime;
4
+
5
+ export enum NotificationType {
6
+ info = 'info',
7
+ error = 'error',
8
+ success = 'success',
9
+ warning = 'warning'
10
+ }
11
+
12
+ export class Notification {
13
+ id?: number;
14
+ type?: NotificationType;
15
+ message?: string;
16
+ ttl: number = TTL_DEFAULT;
17
+ timerId?: any;
18
+
19
+ constructor(data: any) {
20
+ Object.assign(this, data || {});
21
+
22
+ if(this.ttl === undefined) {
23
+ this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
24
+ }
25
+ }
26
+
27
+ isInfo(): boolean {
28
+ return this.type === NotificationType.info;
29
+ }
30
+ isError(): boolean {
31
+ return this.type === NotificationType.error;
32
+ }
33
+ isSuccess(): boolean {
34
+ return this.type === NotificationType.success;
35
+ }
36
+ isWarning(): boolean {
37
+ return this.type === NotificationType.warning;
38
+ }
39
+ }
@@ -0,0 +1,18 @@
1
+ export interface PaginationDataDtoInterface {
2
+ total: number;
3
+ pageSizeOptions?: number[];
4
+ pageSize: number;
5
+ pageIndex: number;
6
+ }
7
+ export class PaginationDataDto {
8
+ total?: number;
9
+ pageSizeOptions?: number[];
10
+ pageSize?: number;
11
+ pageIndex?: number;
12
+
13
+ constructor(pagination: PaginationDataDtoInterface) {
14
+ if (pagination) {
15
+ Object.assign(this, pagination);
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,128 @@
1
+ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { getSavableData } from '../common-functions';
4
+ import { REGEX_PATTERN } from '../app.constants';
5
+
6
+ export class SimplifiedUser {
7
+ userid!: string;
8
+ email!: string;
9
+ firstName!: string;
10
+ lastName!: string;
11
+ // general user info
12
+ department!: string;
13
+ manager!: string;
14
+ associatedPc!: string;
15
+ digestCredentials!: string;
16
+ userProfile!: string;
17
+ enableMobileVoiceAccess!: boolean;
18
+ userLocale!: string;
19
+ confirmDigestCredentials?: any;
20
+
21
+ // contact information
22
+ middleName!: string;
23
+ telephoneNumber!: string;
24
+ mobileNumber!: string;
25
+ directoryUri!: string;
26
+ title!: string;
27
+ homeNumber!: string;
28
+ pagerNumber!: string;
29
+ displayName!: string;
30
+
31
+ token!: string;
32
+ viewMode!: string;
33
+ hasModifiedCache!: boolean;
34
+ newUserId?: string;
35
+ editMode!: boolean;
36
+ form!: FormGroup;
37
+
38
+ constructor(user?: any) {
39
+ if (user) {
40
+ this.userid = user.userid;
41
+ this.email = user.email;
42
+ this.firstName = user.firstName;
43
+ this.lastName = user.lastName;
44
+ this.token = user.token;
45
+
46
+ this.department = user.department;
47
+ this.manager = user.manager;
48
+ this.associatedPc = user.associatedPc;
49
+ this.digestCredentials = user.digestCredentials;
50
+ this.userProfile = user.userProfile;
51
+ this.enableMobileVoiceAccess = user.enableMobileVoiceAccess;
52
+ this.userLocale = user.userLocale;
53
+ this.confirmDigestCredentials = user.confirmDigestCredentials;
54
+
55
+ this.middleName = user.middleName;
56
+ this.telephoneNumber = user.telephoneNumber;
57
+ this.mobileNumber = user.mobileNumber;
58
+ this.directoryUri = user.directoryUri;
59
+ this.title = user.title;
60
+ this.homeNumber = user.homeNumber;
61
+ this.pagerNumber = user.pagerNumber;
62
+ this.displayName = user.displayName;
63
+ }
64
+ this.initForm()
65
+ }
66
+
67
+ initForm() {
68
+ const formBuilder = new FormBuilder();
69
+ const formSettings = {
70
+ userid: [{value: this.userid || '', disabled: false}, [Validators.required, Validators.maxLength(128)]],
71
+ email: [{value: this.email || '', disabled: false}, [
72
+ Validators.pattern(REGEX_PATTERN.EMAIL),
73
+ Validators.required
74
+ ]],
75
+ firstName: [{value: this.firstName || '', disabled: false}],
76
+ lastName: [{value: this.lastName || '', disabled: false}, Validators.required],
77
+ department: [{value: this.department || '', disabled: false}],
78
+ middleName: [{value: this.middleName || '', disabled: false}],
79
+ title: [{value: this.title || '', disabled: false}],
80
+ telephoneNumber: [{value: this.telephoneNumber || '', disabled: false}],
81
+ homeNumber: [{value: this.homeNumber || '', disabled: false}],
82
+ mobileNumber: [{value: this.mobileNumber || '', disabled: false}],
83
+ pagerNumber: [{value: this.pagerNumber || '', disabled: false}],
84
+ displayName: [{value: this.displayName || '', disabled: false}],
85
+ manager: [{value: this.manager || '', disabled: false}],
86
+ associatedPc: [this.associatedPc || ''],
87
+ directoryUri: [this.directoryUri || ''],
88
+ userProfile: [this.userProfile],
89
+ enableMobileVoiceAccess: [this.enableMobileVoiceAccess],
90
+ userLocale: [this.userLocale || ''],
91
+ digestCredentials: [''],
92
+ confirmDigestCredentials: ['']
93
+ };
94
+ this.form = formBuilder.group(formSettings);
95
+ }
96
+
97
+ toggleEditMode() {
98
+ this.editMode = !this.editMode;
99
+ ['userid', 'email', 'firstName', 'lastName'].forEach(token => {
100
+ if (this.editMode) {
101
+ this.form.get(token)?.enable();
102
+ } else {
103
+ this.form.get(token)?.disable();
104
+ }
105
+ })
106
+ }
107
+
108
+ getSavableData() {
109
+ const excludedFields: string[] = ['form', 'editMode', 'viewMode', 'token', 'hasModifiedCache', 'confirmDigestCredentials'];
110
+ return getSavableData(this, excludedFields);
111
+ }
112
+
113
+ equal(userToCompare?: SimplifiedUser): boolean {
114
+ if (!userToCompare) {
115
+ return false;
116
+ }
117
+ return JSON.stringify(this.getSavableData()) === JSON.stringify(userToCompare.getSavableData());
118
+ }
119
+
120
+ }
121
+
122
+ export interface SimplifiedUserInterface {
123
+ userid: string;
124
+ email: string;
125
+ firstName: string;
126
+ lastName: string;
127
+ form?: FormGroup;
128
+ }
@@ -0,0 +1,6 @@
1
+
2
+ export interface TableDataInterface {
3
+ total: number;
4
+ pageData: Array<any>;
5
+ systemSettings?: any;
6
+ }