@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.
- package/.editorconfig +16 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +27 -0
- package/angular.json +41 -0
- package/package.json +42 -0
- package/projects/tuki/widgets/README.md +24 -0
- package/projects/tuki/widgets/karma.conf.js +44 -0
- package/projects/tuki/widgets/ng-package.json +7 -0
- package/projects/tuki/widgets/package.json +13 -0
- package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +23 -0
- package/projects/tuki/widgets/src/lib/widgets.component.ts +20 -0
- package/projects/tuki/widgets/src/lib/widgets.module.ts +16 -0
- package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +16 -0
- package/projects/tuki/widgets/src/lib/widgets.service.ts +9 -0
- package/projects/tuki/widgets/src/public-api.ts +7 -0
- package/projects/tuki/widgets/src/test.ts +27 -0
- package/projects/tuki/widgets/styles/_variables.scss +90 -0
- package/projects/tuki/widgets/styles/form.scss +231 -0
- package/projects/tuki/widgets/styles/icons.scss +32 -0
- package/projects/tuki/widgets/styles/styles.scss +110 -0
- package/projects/tuki/widgets/styles/tables.scss +30 -0
- package/projects/tuki/widgets/tsconfig.lib.json +36 -0
- package/projects/tuki/widgets/tsconfig.lib.prod.json +10 -0
- package/projects/tuki/widgets/tsconfig.spec.json +17 -0
- package/projects/tuki/widgets/user-manage/ng-package.json +7 -0
- package/projects/tuki/widgets/user-manage/public-api.ts +6 -0
- package/projects/tuki/widgets/user-manage/src/app.constants.ts +38 -0
- package/projects/tuki/widgets/user-manage/src/classes/device.ts +225 -0
- package/projects/tuki/widgets/user-manage/src/classes/line.ts +117 -0
- package/projects/tuki/widgets/user-manage/src/classes/notification.ts +39 -0
- package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +18 -0
- package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +128 -0
- package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +6 -0
- package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +225 -0
- package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +40 -0
- package/projects/tuki/widgets/user-manage/src/classes/user.ts +8 -0
- package/projects/tuki/widgets/user-manage/src/common-functions.ts +16 -0
- package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +9 -0
- package/projects/tuki/widgets/user-manage/src/environments/environment.ts +10 -0
- package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +36 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +50 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +3 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +81 -0
- package/projects/tuki/widgets/user-manage/src/material.module.ts +85 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +33 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +84 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +46 -0
- package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/user-manage/src/services/api.service.ts +89 -0
- package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +68 -0
- package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +35 -0
- package/projects/tuki/widgets/user-manage/src/services/user.service.ts +120 -0
- package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +58 -0
- package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +71 -0
- package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +90 -0
- package/projects/tuki/widgets/user-manage/src/styles/form.scss +231 -0
- package/projects/tuki/widgets/user-manage/src/styles/icons.scss +32 -0
- package/projects/tuki/widgets/user-manage/src/styles/styles.scss +110 -0
- package/projects/tuki/widgets/user-manage/src/styles/tables.scss +30 -0
- package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +68 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +32 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +53 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +19 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +291 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +461 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +163 -0
- package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +53 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +6 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +11 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +13 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +26 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +41 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +41 -0
- package/projects/tuki/widgets/users-list/ng-package.json +6 -0
- package/projects/tuki/widgets/users-list/public-api.ts +8 -0
- package/projects/tuki/widgets/users-list/src/app.constants.ts +35 -0
- package/projects/tuki/widgets/users-list/src/classes/device.ts +225 -0
- package/projects/tuki/widgets/users-list/src/classes/line.ts +117 -0
- package/projects/tuki/widgets/users-list/src/classes/notification.ts +38 -0
- package/projects/tuki/widgets/users-list/src/classes/pagination.ts +18 -0
- package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +74 -0
- package/projects/tuki/widgets/users-list/src/classes/table-data.ts +6 -0
- package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +225 -0
- package/projects/tuki/widgets/users-list/src/classes/user-list.ts +40 -0
- package/projects/tuki/widgets/users-list/src/classes/user.ts +8 -0
- package/projects/tuki/widgets/users-list/src/material.module.ts +84 -0
- package/projects/tuki/widgets/users-list/src/services/api.service.ts +87 -0
- package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +11 -0
- package/projects/tuki/widgets/users-list/src/services/notification.service.ts +68 -0
- package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/users-list/src/services/user.service.ts +117 -0
- package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +58 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.css +4 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.html +39 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.scss +9 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.ts +85 -0
- package/projects/tuki/widgets/users-list/src/users-list.module.ts +36 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +11 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +6 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +11 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +13 -0
- package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +16 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +33 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +84 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +46 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +45 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +26 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +41 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +41 -0
- package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +71 -0
- package/tsconfig.json +46 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
export interface UserInterface {
|
|
4
|
+
userid: string;
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
middleName: string;
|
|
8
|
+
email: string;
|
|
9
|
+
department: string;
|
|
10
|
+
telephoneNumber: string;
|
|
11
|
+
homeNumber: string;
|
|
12
|
+
mobileNumber: string;
|
|
13
|
+
pagerNumber: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
features: string[];
|
|
16
|
+
ldapIntegrated: boolean;
|
|
17
|
+
sparkLicenses: any[];
|
|
18
|
+
extensionMobility: ExtensionMobilityInterface;
|
|
19
|
+
singleNumberReach?: SingleNumberReachInterface;
|
|
20
|
+
primaryLineReference: LineDirectoryInterface;
|
|
21
|
+
voicemail: VoicemailInterface;
|
|
22
|
+
devices: DeviceInterface[];
|
|
23
|
+
deviceProfiles: DeviceInterface[];
|
|
24
|
+
lines: LineInterface[];
|
|
25
|
+
subscribeCss: string;
|
|
26
|
+
presenceGroup: string;
|
|
27
|
+
allowDeviceControlFromCti: boolean;
|
|
28
|
+
enableCrossClusterEm: boolean;
|
|
29
|
+
ucServiceProfile: string;
|
|
30
|
+
manager: string;
|
|
31
|
+
title: string;
|
|
32
|
+
associatedPc: string;
|
|
33
|
+
userProfile: string;
|
|
34
|
+
enableUserToHostConferenceNow: boolean;
|
|
35
|
+
attendeesAccessCode: string;
|
|
36
|
+
enableMobileVoiceAccess: boolean;
|
|
37
|
+
mlppUserIdNumber: string;
|
|
38
|
+
mlppPrecedencePattern: string;
|
|
39
|
+
userLocale: string;
|
|
40
|
+
siteId: number;
|
|
41
|
+
siteName: string;
|
|
42
|
+
location: string;
|
|
43
|
+
lineAppearances: Array<LineAppearance>;
|
|
44
|
+
meetMes: Array<MeetMeConferencing>;
|
|
45
|
+
homeCluster: boolean;
|
|
46
|
+
vmOnlyUser?: boolean;
|
|
47
|
+
directoryUri:string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface SingleNumberReachInterface {
|
|
51
|
+
remoteDestinationProfileName: string;
|
|
52
|
+
remoteDestinations?: RemoteDestinationInterface[];
|
|
53
|
+
devicePool?: string;
|
|
54
|
+
css?: string;
|
|
55
|
+
rerouteCss?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface VoicemailInterface {
|
|
59
|
+
callHandlerObjectId?: string;
|
|
60
|
+
extension: string;
|
|
61
|
+
vmUserTemplate?: string;
|
|
62
|
+
vmPassword?: VoicemailSettingsInterface;
|
|
63
|
+
vmMailbox?: MailboxInterface;
|
|
64
|
+
vmUnifiedMessagingAccount?: UnifiedMessagingAccount[];
|
|
65
|
+
notificationDevices?: VoicemailNotifications[];
|
|
66
|
+
alternateExtensions?: AlternateExtensions[];
|
|
67
|
+
language?: LanguageMailbox;
|
|
68
|
+
messageActions?: MessageActions;
|
|
69
|
+
webAppPassword?: WebAppPassword;
|
|
70
|
+
vmPasswordSettings?: VmPasswordSettings;
|
|
71
|
+
pkid?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ExtensionMobilityInterface {
|
|
75
|
+
deviceType: string;
|
|
76
|
+
deviceProfileName: string;
|
|
77
|
+
buttonTemplate: string;
|
|
78
|
+
services: string[];
|
|
79
|
+
protocol: string;
|
|
80
|
+
userLocale: string;
|
|
81
|
+
lineAssociations: LineAssociationInterface[];
|
|
82
|
+
speedDials: SpeedDialInterface[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface SpeedDialInterface {
|
|
86
|
+
index: number;
|
|
87
|
+
position: number;
|
|
88
|
+
destination: string;
|
|
89
|
+
label: string;
|
|
90
|
+
editMode?: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface DeviceInterface {
|
|
94
|
+
name: string;
|
|
95
|
+
newName: string;
|
|
96
|
+
pkid: string;
|
|
97
|
+
entityChangeType: EntityChangeType;
|
|
98
|
+
deviceType: string;
|
|
99
|
+
protocol: string;
|
|
100
|
+
description: string;
|
|
101
|
+
buttonTemplate: string;
|
|
102
|
+
softkeyTemplate: string;
|
|
103
|
+
devicePoolName: string;
|
|
104
|
+
location: string;
|
|
105
|
+
userLocale: string;
|
|
106
|
+
enabledExtensionMobility: boolean;
|
|
107
|
+
callingSearchSpaceName: string;
|
|
108
|
+
services: string[];
|
|
109
|
+
networkLocale: string;
|
|
110
|
+
securityProfile: string;
|
|
111
|
+
lineAssociations: LineAssociationInterface[];
|
|
112
|
+
speedDials: SpeedDialInterface[];
|
|
113
|
+
sipProfile: string;
|
|
114
|
+
subscribeCallingSearchSpaceName: string;
|
|
115
|
+
commonPhoneConfigName: string;
|
|
116
|
+
ctiRemoteDevice: boolean;
|
|
117
|
+
firstExpansionModule: string;
|
|
118
|
+
secondExpansionModule: string;
|
|
119
|
+
thirdExpansionModule: string;
|
|
120
|
+
builtInBridge: string;
|
|
121
|
+
extraOptions?: DeviceExtraOptionsInterface;
|
|
122
|
+
formDisabledControls?: string[];
|
|
123
|
+
sharedUsers: string[];
|
|
124
|
+
busyLampFields: BusyLampFieldsInterface[];
|
|
125
|
+
meetMeEnabled: boolean;
|
|
126
|
+
deviceKind;
|
|
127
|
+
isCtiRoutePoint?: boolean;
|
|
128
|
+
cucmId: string;
|
|
129
|
+
plarDevice?: boolean;
|
|
130
|
+
firmwareVersion;
|
|
131
|
+
certificateOperation: string;
|
|
132
|
+
authenticationMode: string;
|
|
133
|
+
authenticationString?: string;
|
|
134
|
+
rsaKeySize?: string;
|
|
135
|
+
operationCompletesBy: string;
|
|
136
|
+
certificateStatus: string;
|
|
137
|
+
day?: string;
|
|
138
|
+
month?: string;
|
|
139
|
+
year?: string;
|
|
140
|
+
hour?: string;
|
|
141
|
+
securityProfileUuid?: string;
|
|
142
|
+
excludeDeviceExtraOptions?: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface DeviceViewConfiguration {
|
|
146
|
+
viewMode: any;
|
|
147
|
+
editMode: boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export enum DeviceViewType {
|
|
151
|
+
details = 0,
|
|
152
|
+
lines = 1,
|
|
153
|
+
speedDials = 2,
|
|
154
|
+
blf = 2,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface LineAssociationInterface {
|
|
158
|
+
index: number;
|
|
159
|
+
position?: number;
|
|
160
|
+
e164Mask: string;
|
|
161
|
+
textLabel: string;
|
|
162
|
+
displayLabel: string;
|
|
163
|
+
displayLabelAscii: string;
|
|
164
|
+
directoryNumber: LineDirectoryInterface;
|
|
165
|
+
didPattern: TranslationPatternInterface;
|
|
166
|
+
mappedDids: Array<string>;
|
|
167
|
+
linePkid: string;
|
|
168
|
+
maxNumberOfCalls: number;
|
|
169
|
+
busyTrigger: number;
|
|
170
|
+
recordingOption: RecordingOptions;
|
|
171
|
+
recordingProfile: string;
|
|
172
|
+
recordingMediaSource: string;
|
|
173
|
+
visualMWI: string;
|
|
174
|
+
audibleMWI: string;
|
|
175
|
+
ringSetting_idle: string;
|
|
176
|
+
ringSetting_active: string;
|
|
177
|
+
pickupAAS_idle: string;
|
|
178
|
+
pickupAAS_active: string;
|
|
179
|
+
monitorCSS: string;
|
|
180
|
+
logMissedCall: string;
|
|
181
|
+
callInfoDisplay: LineCallInfoDisplayInterface;
|
|
182
|
+
lineLocalId: string;
|
|
183
|
+
sharedUsers: string[];
|
|
184
|
+
sharedDevices: string[];
|
|
185
|
+
ownerUserId: Array<string>;
|
|
186
|
+
associated: boolean;
|
|
187
|
+
populateWithDid: boolean;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface LineCallInfoDisplayInterface {
|
|
191
|
+
callerName: string;
|
|
192
|
+
callerNumber: string;
|
|
193
|
+
redirectedNumber: string;
|
|
194
|
+
dialedNumber: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface LineDirectoryInterface {
|
|
198
|
+
directoryNumber: string;
|
|
199
|
+
routePartitionName: string;
|
|
200
|
+
pkid: string;
|
|
201
|
+
dnType: string;
|
|
202
|
+
subType?: string;
|
|
203
|
+
templateDirectoryNumber?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface TranslationPatternInterface {
|
|
207
|
+
pattern: string;
|
|
208
|
+
calledPartyTransformationMask: string;
|
|
209
|
+
description?: string;
|
|
210
|
+
site?: SiteShortDataInterface;
|
|
211
|
+
hasMultipleSites?: boolean;
|
|
212
|
+
multipleSitesId?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface SiteShortDataInterface {
|
|
216
|
+
id: number;
|
|
217
|
+
name: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export enum RecordingOptions {
|
|
221
|
+
disabled = 'Call Recording Disabled',
|
|
222
|
+
auto_enabled = 'Automatic Call Recording Enabled',
|
|
223
|
+
selective_enabled = 'Selective Call Recording Enabled'
|
|
224
|
+
}
|
|
225
|
+
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DeviceInterface } from '../classes/device';
|
|
2
|
+
import { LineInterface } from '../classes/line';
|
|
3
|
+
|
|
4
|
+
export class ListUser implements ListUserInterface {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
userid: string;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
telephoneNumber?: string;
|
|
11
|
+
devices: DeviceInterface[] = [];
|
|
12
|
+
deviceProfiles: DeviceInterface[] = [];
|
|
13
|
+
lines?: LineInterface[];
|
|
14
|
+
siteId?: number;
|
|
15
|
+
siteName?: string;
|
|
16
|
+
webexUUID?: string;
|
|
17
|
+
cucmId?: number;
|
|
18
|
+
|
|
19
|
+
constructor(user?: ListUser) {
|
|
20
|
+
if (user) {
|
|
21
|
+
Object.assign(this, user);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ListUserInterface {
|
|
27
|
+
userid: string;
|
|
28
|
+
firstName?: string;
|
|
29
|
+
lastName?: string;
|
|
30
|
+
email?: string;
|
|
31
|
+
telephoneNumber?: string;
|
|
32
|
+
viewMode?: any;
|
|
33
|
+
devices: DeviceInterface[];
|
|
34
|
+
deviceProfiles: DeviceInterface[];
|
|
35
|
+
lines?: LineInterface[];
|
|
36
|
+
siteId?: number;
|
|
37
|
+
siteName?: string;
|
|
38
|
+
webexUUID?: string;
|
|
39
|
+
cucmId?: number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const getSavableData = (model: any, exclude?: Array<string>) => {
|
|
2
|
+
let result = Object.keys(model);
|
|
3
|
+
if (exclude && exclude.length) {
|
|
4
|
+
result = result.filter(key => !exclude.some(item => item === key));
|
|
5
|
+
}
|
|
6
|
+
return result.reduce((result, key) => {
|
|
7
|
+
if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
|
|
8
|
+
(result as any)[key] = model[key].map((item: any) => item.getSavableData());
|
|
9
|
+
} else if (model[key] instanceof Object && model[key].getSavableData) {
|
|
10
|
+
(result as any)[key] = model[key].getSavableData();
|
|
11
|
+
} else {
|
|
12
|
+
(result as any)[key] = model[key];
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}, {});
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const environment = {
|
|
2
|
+
production: false,
|
|
3
|
+
// apiUrl: 'http://localhost:4200',
|
|
4
|
+
apiUrl: 'http://192.168.0.191:8080',
|
|
5
|
+
notificationsLifetime: 30000,
|
|
6
|
+
longNotificationsLifetime: 45000,
|
|
7
|
+
cashCleanTimer: 900000,
|
|
8
|
+
cashArrayLength: 10000,
|
|
9
|
+
matomoUrl: 'http://192.168.0.136/matomo/',
|
|
10
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import {HttpEvent, HttpRequest, HttpInterceptor, HttpHandler, HttpErrorResponse} from '@angular/common/http';
|
|
3
|
+
import { Observable, throwError } from 'rxjs';
|
|
4
|
+
import {catchError } from 'rxjs/operators';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class AuthInterceptor implements HttpInterceptor {
|
|
8
|
+
constructor() {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
intercept(
|
|
12
|
+
request: HttpRequest<any>,
|
|
13
|
+
next: HttpHandler
|
|
14
|
+
): Observable<HttpEvent<any>> {
|
|
15
|
+
request = request.clone({
|
|
16
|
+
setHeaders: {
|
|
17
|
+
// Authorization: basicAuthHeaderString
|
|
18
|
+
}
|
|
19
|
+
, withCredentials: true
|
|
20
|
+
})
|
|
21
|
+
console.log('request :: ', request);
|
|
22
|
+
|
|
23
|
+
return next.handle(request).pipe(catchError(err => {
|
|
24
|
+
if (err instanceof HttpErrorResponse) {
|
|
25
|
+
if (err.status === 401) {
|
|
26
|
+
if (window.history.length < 3) {
|
|
27
|
+
err.error.message = '';
|
|
28
|
+
} else {
|
|
29
|
+
err.error.message = 'SESSION_INACTIVE';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return throwError(err);
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}
|
package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<ng-container *ngIf="standalone">
|
|
2
|
+
<mat-form-field appearance="outline">
|
|
3
|
+
<mat-select [formControl]="formControl"
|
|
4
|
+
(openedChange)="getOptions()"
|
|
5
|
+
[placeholder]="placeholder"
|
|
6
|
+
(selectionChange)="onFieldChange(controlName)"
|
|
7
|
+
[id]="id">
|
|
8
|
+
<mat-option *ngIf="default" [disabled]="default.disabled" [value]="default.key">{{default.value}}</mat-option>
|
|
9
|
+
<mat-option *ngFor="let type of options" [value]="type">
|
|
10
|
+
{{type}}
|
|
11
|
+
</mat-option>
|
|
12
|
+
<mat-progress-spinner class="field-spinner"
|
|
13
|
+
[diameter]="20"
|
|
14
|
+
mode="indeterminate"
|
|
15
|
+
*ngIf="optionsPending"></mat-progress-spinner>
|
|
16
|
+
</mat-select>
|
|
17
|
+
<mat-error *ngIf="form.get(controlName)?.hasError(errorCode)">
|
|
18
|
+
<i class="fa fa-exclamation-triangle"></i>
|
|
19
|
+
{{errorText}}
|
|
20
|
+
</mat-error>
|
|
21
|
+
</mat-form-field>
|
|
22
|
+
</ng-container>
|
|
23
|
+
|
|
24
|
+
<!--
|
|
25
|
+
This duplication is caused by the following bug: https://github.com/angular/components/issues/9411
|
|
26
|
+
Which doesn't allow projection in mat-form-field
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
<ng-container *ngIf="!standalone">
|
|
30
|
+
<mat-select *ngIf="form.get(controlName)"
|
|
31
|
+
[formControl]="formControl"
|
|
32
|
+
(openedChange)="getOptions()"
|
|
33
|
+
[placeholder]="placeholder"
|
|
34
|
+
(selectionChange)="onFieldChange(controlName)"
|
|
35
|
+
[id]="id"
|
|
36
|
+
>
|
|
37
|
+
<mat-option *ngIf="default" [disabled]="default.disabled" [value]="default.key">{{default.value}}</mat-option>
|
|
38
|
+
<mat-option *ngFor="let type of options" [value]="type">
|
|
39
|
+
{{type}}
|
|
40
|
+
</mat-option>
|
|
41
|
+
<mat-progress-spinner class="field-spinner"
|
|
42
|
+
[diameter]="20"
|
|
43
|
+
mode="indeterminate"
|
|
44
|
+
*ngIf="optionsPending"></mat-progress-spinner>
|
|
45
|
+
</mat-select>
|
|
46
|
+
<mat-error *ngIf="form.get(controlName)?.hasError(errorCode)">
|
|
47
|
+
<i class="fa fa-exclamation-triangle"></i>
|
|
48
|
+
{{errorText}}
|
|
49
|
+
</mat-error>
|
|
50
|
+
</ng-container>
|
package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AfterContentInit, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { NotificationService } from '../services/notification.service';
|
|
4
|
+
import { SiteSettingsService } from '../services/site-settings.service';
|
|
5
|
+
|
|
6
|
+
export interface OptionValue {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'app-lazy-loading-select',
|
|
14
|
+
templateUrl: './lazy-loading-select.component.html',
|
|
15
|
+
styleUrls: ['./lazy-loading-select.component.scss']
|
|
16
|
+
})
|
|
17
|
+
export class LazyLoadingSelectComponent implements AfterContentInit {
|
|
18
|
+
optionsPending!: boolean;
|
|
19
|
+
options!: any;
|
|
20
|
+
|
|
21
|
+
@Input()
|
|
22
|
+
public siteId!: number
|
|
23
|
+
@Input()
|
|
24
|
+
public form!: FormGroup;
|
|
25
|
+
@Input()
|
|
26
|
+
public standalone = true;
|
|
27
|
+
@Input()
|
|
28
|
+
public placeholder!: string;
|
|
29
|
+
@Input()
|
|
30
|
+
public controlName!: string;
|
|
31
|
+
@Input()
|
|
32
|
+
public optionsToken!: string;
|
|
33
|
+
@Input()
|
|
34
|
+
public appearance = 'standard';
|
|
35
|
+
@Input()
|
|
36
|
+
public errorCode!: string;
|
|
37
|
+
@Input()
|
|
38
|
+
public errorText!: string;
|
|
39
|
+
@Input()
|
|
40
|
+
public default!: OptionValue;
|
|
41
|
+
@Input()
|
|
42
|
+
public id!: string;
|
|
43
|
+
@Output()
|
|
44
|
+
public changeField = new EventEmitter<string>();
|
|
45
|
+
|
|
46
|
+
get formControl(): FormControl {
|
|
47
|
+
return this.form?.get(this.controlName) as FormControl;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
private notificationService: NotificationService,
|
|
53
|
+
private siteSettingsService: SiteSettingsService,
|
|
54
|
+
) {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ngAfterContentInit() {
|
|
58
|
+
this.options = [this.form?.get(this.controlName)?.value];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getOptions() {
|
|
62
|
+
if (!this.siteId && this.options.length > 1) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.optionsPending = true;
|
|
66
|
+
this.siteSettingsService.getSelectionOptions(this.siteId, this.optionsToken)
|
|
67
|
+
.subscribe(() => {
|
|
68
|
+
this.optionsPending = false;
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
this.options = this.siteSettingsService[this.optionsToken];
|
|
71
|
+
}, () => {
|
|
72
|
+
this.optionsPending = false;
|
|
73
|
+
// this.notificationService.error(this.translate.instant('COMMON.LOAD_SELECT_OPTIONS_FAILED'));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public onFieldChange(token: string) {
|
|
78
|
+
this.changeField.emit(token);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
-->
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
|