@c8y/ngx-components 1018.0.176 → 1018.0.183
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/core/bootstrap/cookie-banner/cookie-banner.service.d.ts +1 -1
- package/core/common/ApplicationOptions.d.ts +2 -0
- package/core/date-time-picker/close-date-picker.directive.d.ts +14 -0
- package/core/date-time-picker/date-time-picker.component.d.ts +7 -2
- package/core/date-time-picker/date-time-picker.module.d.ts +8 -7
- package/core/product-experience/gainsight.service.d.ts +86 -28
- package/core/product-experience/index.d.ts +1 -0
- package/core/product-experience/product-experience.module.d.ts +18 -5
- package/core/product-experience/user-engagements.service.d.ts +109 -0
- package/core/user/user-edit-modal.component.d.ts +33 -6
- package/core/user/user-edit.component.d.ts +6 -11
- package/esm2020/context-dashboard/widget-config.component.mjs +3 -3
- package/esm2020/core/bootstrap/cookie-banner/cookie-banner.service.mjs +2 -2
- package/esm2020/core/common/ApplicationOptions.mjs +1 -1
- package/esm2020/core/date-time-picker/close-date-picker.directive.mjs +36 -0
- package/esm2020/core/date-time-picker/date-time-picker.component.mjs +28 -8
- package/esm2020/core/date-time-picker/date-time-picker.module.mjs +4 -3
- package/esm2020/core/product-experience/gainsight.service.mjs +170 -81
- package/esm2020/core/product-experience/index.mjs +2 -1
- package/esm2020/core/product-experience/product-experience.module.mjs +42 -24
- package/esm2020/core/product-experience/user-engagements.service.mjs +174 -0
- package/esm2020/core/user/user-edit-modal.component.mjs +68 -33
- package/esm2020/core/user/user-edit.component.mjs +30 -39
- package/esm2020/datapoint-selector/datapoint-attributes-form/datapoint-attributes-form.component.mjs +3 -3
- package/fesm2015/c8y-ngx-components-context-dashboard.mjs +2 -2
- package/fesm2015/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-datapoint-selector.mjs +2 -2
- package/fesm2015/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components.mjs +516 -167
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-context-dashboard.mjs +2 -2
- package/fesm2020/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-datapoint-selector.mjs +2 -2
- package/fesm2020/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +511 -161
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +2 -2
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ export declare class CookieBannerService {
|
|
|
45
45
|
*/
|
|
46
46
|
getUserCookiePreferences(): CookiePreferences;
|
|
47
47
|
/**
|
|
48
|
-
* Verifies that cookie preferences configuration is defined.
|
|
48
|
+
* Verifies that cookie preferences configuration is defined in the application options.
|
|
49
49
|
* @returns {boolean} Returns if the cookie preferences configuration is defined.
|
|
50
50
|
*/
|
|
51
51
|
isConfigCookiePreferencesDefined(): boolean;
|
|
@@ -136,6 +136,8 @@ export declare class ApplicationOptions {
|
|
|
136
136
|
cookiePreferences?: CookiePreferencesConfiguration;
|
|
137
137
|
/** A key for the product experience software Gainsight. */
|
|
138
138
|
gainsightKey?: string;
|
|
139
|
+
/** Disable user tracking */
|
|
140
|
+
disableTracking?: boolean;
|
|
139
141
|
/** NgModule export for plugins. */
|
|
140
142
|
exports?: PluginsExports[];
|
|
141
143
|
/** List of imported remote plugins. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import { BsDatepickerDirective } from 'ngx-bootstrap/datepicker';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CloseDatePickerDirective {
|
|
6
|
+
private el;
|
|
7
|
+
protected destroy$: Subject<unknown>;
|
|
8
|
+
closeDatepicker: BsDatepickerDirective;
|
|
9
|
+
constructor(el: ElementRef);
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CloseDatePickerDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CloseDatePickerDirective, "[closeDatepicker]", never, { "closeDatepicker": "closeDatepicker"; }, {}, never, never, false>;
|
|
14
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { OnDestroy } from '@angular/core';
|
|
1
|
+
import { OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormGroup, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
3
|
+
import { BsDatepickerDirective } from 'ngx-bootstrap/datepicker';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class DateTimePickerComponent implements ControlValueAccessor, Validator, OnDestroy {
|
|
6
|
+
private cd;
|
|
5
7
|
minDate: Date;
|
|
6
8
|
set _minDate(value: string);
|
|
7
9
|
maxDate: Date;
|
|
@@ -12,10 +14,12 @@ export declare class DateTimePickerComponent implements ControlValueAccessor, Va
|
|
|
12
14
|
defaultPlaceholder: "Select a date…";
|
|
13
15
|
onChange: (value: string) => void;
|
|
14
16
|
onTouched: () => void;
|
|
17
|
+
datepicker: BsDatepickerDirective;
|
|
15
18
|
private previousValue;
|
|
16
19
|
private destroy$;
|
|
17
|
-
constructor();
|
|
20
|
+
constructor(cd: ChangeDetectorRef);
|
|
18
21
|
ngOnDestroy(): void;
|
|
22
|
+
ngAfterViewInit(): void;
|
|
19
23
|
/**
|
|
20
24
|
* Control Value Accessor - If form value changes by external factor, update date property and internal form with new value.
|
|
21
25
|
*/
|
|
@@ -26,6 +30,7 @@ export declare class DateTimePickerComponent implements ControlValueAccessor, Va
|
|
|
26
30
|
validate(_control: AbstractControl): ValidationErrors | null;
|
|
27
31
|
previousDay(): void;
|
|
28
32
|
nextDay(): void;
|
|
33
|
+
hide(): void;
|
|
29
34
|
/**
|
|
30
35
|
* If internal form changes its value, then combine date and time into one Date and pass its ISO string value to onChange method
|
|
31
36
|
* @param dateTime
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./date-time-picker.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "../
|
|
3
|
+
import * as i2 from "./close-date-picker.directive";
|
|
4
|
+
import * as i3 from "../forms/forms.module";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "ngx-bootstrap/datepicker";
|
|
8
|
+
import * as i7 from "../common/common.module";
|
|
9
|
+
import * as i8 from "../time-picker/time-picker.module";
|
|
9
10
|
/**
|
|
10
11
|
* The angular module definition for a date-time picker - it provides FormControl that handles date and time.
|
|
11
12
|
* @exports DateTimePickerComponent
|
|
12
13
|
*/
|
|
13
14
|
export declare class DateTimePickerModule {
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerModule, never>;
|
|
15
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DateTimePickerModule, [typeof i1.DateTimePickerComponent], [typeof
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DateTimePickerModule, [typeof i1.DateTimePickerComponent, typeof i2.CloseDatePickerDirective], [typeof i3.FormsModule, typeof i4.CommonModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.BsDatepickerModule, typeof i7.CommonModule, typeof i8.TimePickerModule], [typeof i1.DateTimePickerComponent]>;
|
|
16
17
|
static ɵinj: i0.ɵɵInjectorDeclaration<DateTimePickerModule>;
|
|
17
18
|
}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { ICustomProperties } from '@c8y/client';
|
|
1
|
+
import { ICurrentTenant, ICustomProperties, IIdentified, IUser } from '@c8y/client';
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
4
|
import { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';
|
|
5
5
|
import { OptionsService } from '../common/options.service';
|
|
6
6
|
import { AppStateService } from '../common/ui-state.service';
|
|
7
7
|
import { UserPreferencesService } from '../common/user-preferences/user-preferences.service';
|
|
8
8
|
import { PxEventData } from './product-experience.model';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @property user The user which is given to Gainsight.
|
|
12
|
+
* @property tenant The tenant which is given to Gainsight.
|
|
13
|
+
* @property instanceId Extracted domain part of an URL.
|
|
14
|
+
* @property versionUI The UI version used.
|
|
15
|
+
* @property versionBE The BE version used.
|
|
16
|
+
*/
|
|
17
|
+
interface IdentifyData {
|
|
18
|
+
user: IUser;
|
|
19
|
+
currentTenant: ICurrentTenant;
|
|
20
|
+
instanceId: string;
|
|
21
|
+
versionUI?: string;
|
|
22
|
+
versionBE?: string;
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* A service to manage the Gainsight integration. It allows to load the
|
|
19
26
|
* tag and
|
|
20
27
|
*/
|
|
21
28
|
export declare class GainsightService {
|
|
22
|
-
private document;
|
|
23
29
|
private appState;
|
|
24
30
|
private options;
|
|
25
31
|
private cookieBannerService;
|
|
@@ -29,6 +35,11 @@ export declare class GainsightService {
|
|
|
29
35
|
* A subject that emits the tag function as soon as a new tag is set.
|
|
30
36
|
*/
|
|
31
37
|
tagFunction$: BehaviorSubject<any>;
|
|
38
|
+
trackingLoaded$: Subject<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Gainsight is activated only when the cookie banner is present. If functional cookies are enabled, both personally identifiable information (PII) and required data are sent.
|
|
41
|
+
* Otherwise, only the required data is transmitted during the identity step execution.
|
|
42
|
+
*/
|
|
32
43
|
readonly USER_PREFERENCES_GAINSIGHT_KEY = "gainsightEnabled";
|
|
33
44
|
/**
|
|
34
45
|
* The name of the key remained unchanged, but applies to all engagements.
|
|
@@ -40,13 +51,21 @@ export declare class GainsightService {
|
|
|
40
51
|
private readonly SCRIPT_EXECUTION_WAIT_TIME;
|
|
41
52
|
private readonly OPTIONS_KEY_CATEGORY;
|
|
42
53
|
private readonly OPTIONS_KEY_NAME;
|
|
43
|
-
private readonly ENGAGEMENTS;
|
|
44
54
|
private isScriptLoaded;
|
|
45
55
|
private gainsightKey;
|
|
46
56
|
private cachedRevertedTranslations;
|
|
47
57
|
private cachedLanguage;
|
|
48
|
-
constructor(
|
|
58
|
+
constructor(appState: AppStateService, options: OptionsService, cookieBannerService: CookieBannerService, userPreferencesService: UserPreferencesService, translateService: TranslateService);
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the specified Gainsight preference is disabled in user preferences.
|
|
61
|
+
* @param preferenceName - Name of the Gainsight preference.
|
|
62
|
+
* @returns A promise that resolves to `true` if the preference is disabled, otherwise `false`.
|
|
63
|
+
*/
|
|
49
64
|
isGainsightPreferenceDisabledInUserPreferences(preferenceName: string): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the state of the functional cookie.
|
|
67
|
+
* @param value - A boolean value to indicate whether the functional cookie should be enabled (`true`) or disabled (`false`).
|
|
68
|
+
*/
|
|
50
69
|
setFunctionalCookie(value: boolean): void;
|
|
51
70
|
getGainsightKey(): Promise<string>;
|
|
52
71
|
/**
|
|
@@ -57,35 +76,74 @@ export declare class GainsightService {
|
|
|
57
76
|
/**
|
|
58
77
|
* Load the script tag and calls the identify function to start the tracking.
|
|
59
78
|
* @param currentTenant The current tenant.
|
|
60
|
-
* @param
|
|
79
|
+
* @param sendPiiData Flag for sending personally identifiable information (PII) during identification in Gainsight.
|
|
61
80
|
*/
|
|
62
|
-
loadTag(currentTenant:
|
|
81
|
+
loadTag(currentTenant: ICurrentTenant, sendPiiData: boolean): Promise<void>;
|
|
63
82
|
/**
|
|
64
83
|
* Identifies the user/account at Gainsight.
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
* @param sendPiiData Flag for sending personally identifiable information.
|
|
85
|
+
* @param identifyData Object containing identification data.
|
|
86
|
+
*/
|
|
87
|
+
identify(sendPiiData: boolean, identifyData: IdentifyData): void;
|
|
88
|
+
/**
|
|
89
|
+
* Triggers an event to be recorded by Gainsight PX.
|
|
90
|
+
* This method calls the Gainsight PX's tracking mechanism to log a specific event
|
|
91
|
+
* along with its associated properties.
|
|
92
|
+
* @param eventName - Name of the event to be triggered.
|
|
93
|
+
* @param props - Optional properties associated with the event.
|
|
69
94
|
*/
|
|
70
|
-
identify(user: any, tenant: any, instanceId: any, versionUI?: any, versionBE?: any): void;
|
|
71
95
|
triggerEvent(eventName: string, props?: PxEventData): void;
|
|
72
96
|
translateToEnglish(textToTranslate: string): string;
|
|
73
97
|
/**
|
|
74
|
-
*
|
|
75
|
-
* The decision to
|
|
76
|
-
*
|
|
98
|
+
* Determines whether personally identifiable information (PII) should be sent while loading a tag.
|
|
99
|
+
* The decision to activate Gainsight and send PII relies on whether the cookiePreferences option is defined in the application settings,
|
|
100
|
+
* if the functional cookie is enabled, and if the user grants permission.
|
|
101
|
+
*/
|
|
102
|
+
shouldSendPiiData(): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Updates a specific user attribute in the Gainsight global scope.
|
|
105
|
+
* This method interfaces with the Gainsight global object to set a user's specific attribute with a provided value.
|
|
106
|
+
* @param name - Name of the user attribute to be updated.
|
|
107
|
+
* @param value - Value to set for the specified user attribute.
|
|
77
108
|
*/
|
|
78
|
-
shouldLoadGainsightTag(customProperties: ICustomProperties): boolean;
|
|
79
109
|
updateUserAttribute(name: string, value: string | Date | number | boolean): void;
|
|
110
|
+
/**
|
|
111
|
+
* Determines if the current user has the capability to modify Gainsight PX settings.
|
|
112
|
+
*
|
|
113
|
+
* This method checks multiple conditions:
|
|
114
|
+
* 1. Whether tracking has been disabled globally via application options.
|
|
115
|
+
* 2. Whether Gainsight is disabled at the tenant level through custom properties.
|
|
116
|
+
* 3. Whether a Gainsight key is available, either currently loaded or fetched asynchronously.
|
|
117
|
+
* 4. Whether cookie preferences are defined and available for the user.
|
|
118
|
+
*
|
|
119
|
+
* @returns Promise that resolves to a boolean. True indicates the user can edit product experience settings, and false otherwise.
|
|
120
|
+
*/
|
|
80
121
|
canEditProductExperienceSettings(): Promise<boolean>;
|
|
81
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Sets the global context for Gainsight with the current application name.
|
|
124
|
+
* The global context can be utilized by Gainsight for various purposes, such as segmenting users.
|
|
125
|
+
*/
|
|
82
126
|
setGlobalContext(): void;
|
|
83
|
-
transformUserRolesToStr(userRoles?:
|
|
84
|
-
|
|
85
|
-
|
|
127
|
+
transformUserRolesToStr(userRoles?: IIdentified[]): string;
|
|
128
|
+
/**
|
|
129
|
+
* Checks if Gainsight is disabled based on tenant custom properties.
|
|
130
|
+
*
|
|
131
|
+
* @param customProperties - The custom properties of the tenant.
|
|
132
|
+
* @returns {boolean} - True if Gainsight is disabled, false otherwise.
|
|
133
|
+
*/
|
|
134
|
+
isGainsightDisabledAtTenantCustomProperties(customProperties: ICustomProperties): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Determines if custom branding is enabled based on the presence of a brand logo.
|
|
137
|
+
*
|
|
138
|
+
* @returns {boolean} - True if custom branding is applied, false otherwise.
|
|
139
|
+
*/
|
|
140
|
+
isCustomBranding(): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Determines if tracking is disabled based on the application options.
|
|
143
|
+
* @returns `true` if tracking is disabled, otherwise `false`.
|
|
144
|
+
*/
|
|
145
|
+
isTrackingDisabled(): boolean;
|
|
86
146
|
private prepareEventName;
|
|
87
|
-
private isGainsightDisabled;
|
|
88
|
-
private isCustomBranding;
|
|
89
147
|
private loadScriptTag;
|
|
90
148
|
private getInstanceIdFromUrl;
|
|
91
149
|
/**
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import { CookieBannerService } from '../bootstrap/cookie-banner/cookie-banner.service';
|
|
2
2
|
import { AppStateService } from '../common/ui-state.service';
|
|
3
|
-
import { UserPreferencesService } from '../common/user-preferences/user-preferences.service';
|
|
4
3
|
import { GainsightService } from './gainsight.service';
|
|
4
|
+
import { UserEngagementsService } from './user-engagements.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
import * as i1 from "./product-experience.directive";
|
|
7
7
|
/**
|
|
8
8
|
* This module enables an tenant to activate the product experience
|
|
9
9
|
* software [Gainsight](https://www.gainsight.com/product-experience/) to help
|
|
10
|
-
* and track user actions.
|
|
11
|
-
* property `gainsightEnabled` is set to true.
|
|
10
|
+
* and track user actions.
|
|
12
11
|
*/
|
|
13
12
|
export declare class ProductExperienceModule {
|
|
14
13
|
private appState;
|
|
15
14
|
private gainsightService;
|
|
16
15
|
private cookieBannerService;
|
|
17
|
-
private
|
|
18
|
-
constructor(appState: AppStateService, gainsightService: GainsightService, cookieBannerService: CookieBannerService,
|
|
16
|
+
private userEngagementsService;
|
|
17
|
+
constructor(appState: AppStateService, gainsightService: GainsightService, cookieBannerService: CookieBannerService, userEngagementsService: UserEngagementsService);
|
|
18
|
+
/**
|
|
19
|
+
* Observes several factors to determine the state of user tracking and manages the visibility of Gainsight engagements.
|
|
20
|
+
* It watches for changes in the current tenant, the state of the cookie banner, and user's preferences for Gainsight engagements.
|
|
21
|
+
*
|
|
22
|
+
* 1. If the cookie banner is being displayed, it returns without making any changes.
|
|
23
|
+
* 2. If Gainsight is disabled at the tenant level via custom properties, it returns without making any changes.
|
|
24
|
+
* 3. If the conditions are met for loading the Gainsight tag, it loads the tag.
|
|
25
|
+
*/
|
|
26
|
+
toggleUserTrackingObservable(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Determines if a tracking tag should be loaded based on cookie preferences.
|
|
29
|
+
* @returns `true` if user cookie preferences exist, otherwise `false`.
|
|
30
|
+
*/
|
|
31
|
+
shouldLoadTag(): boolean;
|
|
19
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProductExperienceModule, never>;
|
|
20
33
|
static ɵmod: i0.ɵɵNgModuleDeclaration<ProductExperienceModule, [typeof i1.ProductExperienceDirective], never, [typeof i1.ProductExperienceDirective]>;
|
|
21
34
|
static ɵinj: i0.ɵɵInjectorDeclaration<ProductExperienceModule>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { UserPreferencesService } from '../common/user-preferences/user-preferences.service';
|
|
3
|
+
import { GainsightService } from './gainsight.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class UserEngagementsService {
|
|
6
|
+
private document;
|
|
7
|
+
private userPreferencesService;
|
|
8
|
+
private gainsightService;
|
|
9
|
+
readonly USER_PREFERENCES_GAINSIGHT_ENGAGEMENTS_KEY = "gainsightBotEnabled";
|
|
10
|
+
readonly userEngagementsEnabled$: BehaviorSubject<boolean>;
|
|
11
|
+
readonly HIDE_GAINSIGHT_BOT_STYLE_ID = "hide-gs-bot";
|
|
12
|
+
private readonly ENGAGEMENTS;
|
|
13
|
+
constructor(document: Document, userPreferencesService: UserPreferencesService, gainsightService: GainsightService);
|
|
14
|
+
/**
|
|
15
|
+
* Handles user engagement settings based on various conditions.
|
|
16
|
+
*
|
|
17
|
+
* - Waits for the Gainsight tracking to be loaded.
|
|
18
|
+
* - Retrieves the engagement settings.
|
|
19
|
+
* - Updates the engagement settings based on the combined observations.
|
|
20
|
+
* - Finally, toggles the Gainsight engagements based on the latest `userEngagementsEnabled$` value.
|
|
21
|
+
*/
|
|
22
|
+
handleUserEngagements(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Updates the user's preference for Gainsight Engagements.
|
|
25
|
+
* @param {boolean} isEnabled - The new value for the user's engagement preference.
|
|
26
|
+
*/
|
|
27
|
+
updateUserEngagementPreference(isEnabled: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* Toggles the visibility of Gainsight Engagements based on the provided flag.
|
|
30
|
+
*
|
|
31
|
+
* @param isEnabled - A flag indicating whether Gainsight Engagements should be visible.
|
|
32
|
+
*/
|
|
33
|
+
toggleGainsightEngagements(isEnabled: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Constructs an observable that emits an array of boolean values representing
|
|
36
|
+
* the current engagement settings. The observable combines the latest values from:
|
|
37
|
+
*
|
|
38
|
+
* 1. User's preferences for Gainsight engagements.
|
|
39
|
+
* 2. A flag indicating if PII data should be sent.
|
|
40
|
+
* 3. A flag indicating if the platform uses custom branding.
|
|
41
|
+
*
|
|
42
|
+
* @returns An observable emitting an array of boolean values.
|
|
43
|
+
*/
|
|
44
|
+
private getEngagementSettingsObservable;
|
|
45
|
+
/**
|
|
46
|
+
* Updates user engagement settings based on provided preferences and settings.
|
|
47
|
+
*
|
|
48
|
+
* Based on the received values, the method decides to:
|
|
49
|
+
* 1. Disable user engagements if PII data should not be shared or certain branding/settings conditions are met.
|
|
50
|
+
* 2. Update the user engagement preference if the user engagement bot setting is undefined.
|
|
51
|
+
*
|
|
52
|
+
* @param userEngagementBotSetting - The user's setting for the engagement bot.
|
|
53
|
+
* @param shouldSendPiiData - Indicates whether PII data should be shared.
|
|
54
|
+
* @param hasCustomBranding - Indicates if custom branding is applied.
|
|
55
|
+
*/
|
|
56
|
+
private updateUserEngagementSettings;
|
|
57
|
+
/**
|
|
58
|
+
* Determines whether user engagements should be disabled due to PII data settings.
|
|
59
|
+
*
|
|
60
|
+
* If the `shouldSendPiiData` parameter is false, this indicates that the user engagements
|
|
61
|
+
* should be disabled to prevent sharing personally identifiable information.
|
|
62
|
+
*
|
|
63
|
+
* @param {boolean} shouldSendPiiData - Indicates whether PII data is allowed to be sent.
|
|
64
|
+
* @returns {boolean} Returns true if user engagements should be disabled, otherwise false.
|
|
65
|
+
*/
|
|
66
|
+
private shouldDisableUserEngagementsDueToPIIData;
|
|
67
|
+
/**
|
|
68
|
+
* Determines if the user engagement bot setting is undefined.
|
|
69
|
+
*
|
|
70
|
+
* @param {boolean | undefined} userEngagementBotSetting - The setting value to check.
|
|
71
|
+
* @returns {boolean} Returns `true` if the setting is undefined; otherwise, `false`.
|
|
72
|
+
*
|
|
73
|
+
* This scenario occurs when a user is new and hasn't modified the bot settings in the user details UI yet.
|
|
74
|
+
*/
|
|
75
|
+
private isUserEngagementBotSettingUndefined;
|
|
76
|
+
/**
|
|
77
|
+
* Enables the visibility of Gainsight engagements.
|
|
78
|
+
*
|
|
79
|
+
* This method removes the CSS styles that hide the Gainsight engagements
|
|
80
|
+
* and updates the relevant user attribute to mark the engagements as visible.
|
|
81
|
+
*/
|
|
82
|
+
private showGainsightEngagements;
|
|
83
|
+
/**
|
|
84
|
+
* Hides the Gainsight engagements.
|
|
85
|
+
*
|
|
86
|
+
* This method applies CSS styles to hide the Gainsight engagements
|
|
87
|
+
* and updates the relevant user attribute to mark the engagements as hidden.
|
|
88
|
+
*/
|
|
89
|
+
private hideGainsightEngagements;
|
|
90
|
+
/**
|
|
91
|
+
* Removes the specified CSS style from the document.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} styleId - The ID of the CSS style element to remove.
|
|
94
|
+
*/
|
|
95
|
+
private removeHidingStyle;
|
|
96
|
+
/**
|
|
97
|
+
* Adds a new CSS style to the document.
|
|
98
|
+
*
|
|
99
|
+
* If the style with the specified ID already exists, the method will do nothing.
|
|
100
|
+
* Otherwise, it creates a new `<style>` element with the given ID and content,
|
|
101
|
+
* then appends it to the document head.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} styleId - The ID to assign to the new style element.
|
|
104
|
+
* @param {string} textContent - The CSS rules to be included in the style.
|
|
105
|
+
*/
|
|
106
|
+
private addHidingStyle;
|
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserEngagementsService, never>;
|
|
108
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserEngagementsService>;
|
|
109
|
+
}
|
|
@@ -9,6 +9,7 @@ import { UserPreferencesService } from '../common/user-preferences/user-preferen
|
|
|
9
9
|
import { LoginService } from '../login/login.service';
|
|
10
10
|
import { ModalService } from '../modal/modal.service';
|
|
11
11
|
import { GainsightService } from '../product-experience/gainsight.service';
|
|
12
|
+
import { UserEngagementsService } from '../product-experience/user-engagements.service';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
export declare class UserEditModalComponent implements OnInit {
|
|
14
15
|
modal: BsModalRef;
|
|
@@ -23,21 +24,47 @@ export declare class UserEditModalComponent implements OnInit {
|
|
|
23
24
|
private cookieBannerService;
|
|
24
25
|
private loginService;
|
|
25
26
|
private passwordService;
|
|
27
|
+
private userEngagementsService;
|
|
26
28
|
currentUser: IUser;
|
|
27
29
|
changedLang: string;
|
|
28
30
|
loading: boolean;
|
|
29
|
-
|
|
31
|
+
showProductExperienceOptions: boolean;
|
|
30
32
|
currentUsageTrackingState: boolean;
|
|
31
|
-
|
|
33
|
+
currentUserEngagementPreferenceInitialState: boolean;
|
|
32
34
|
usageTrackingState: boolean;
|
|
33
|
-
|
|
34
|
-
constructor(modal: BsModalRef, user: UserService, ui: AppStateService, auth: BasicAuth, client: FetchClient, alert: AlertService, userPreferences: UserPreferencesService, c8yModalService: ModalService, gainsightService: GainsightService, cookieBannerService: CookieBannerService, loginService: LoginService, passwordService: PasswordService);
|
|
35
|
+
userEngagementPreferenceNewState: boolean;
|
|
36
|
+
constructor(modal: BsModalRef, user: UserService, ui: AppStateService, auth: BasicAuth, client: FetchClient, alert: AlertService, userPreferences: UserPreferencesService, c8yModalService: ModalService, gainsightService: GainsightService, cookieBannerService: CookieBannerService, loginService: LoginService, passwordService: PasswordService, userEngagementsService: UserEngagementsService);
|
|
35
37
|
ngOnInit(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Initializes product experience options for the user.
|
|
40
|
+
*
|
|
41
|
+
* This function performs the following operations:
|
|
42
|
+
* - Determines if the user has the permission to edit product experience options.
|
|
43
|
+
* - If the user has the permission and functional cookies are enabled:
|
|
44
|
+
* - Checks whether personalized product experience tracking is active.
|
|
45
|
+
* - Checks whether in-product information and communication is active.
|
|
46
|
+
*/
|
|
47
|
+
setInitialProductExperienceOptions(): Promise<void>;
|
|
36
48
|
onDismiss(): Promise<void>;
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
onUsageTrackingChange(isEnabled: boolean): void;
|
|
50
|
+
onUserEngagementPreferenceChange(isEnabled: boolean): void;
|
|
39
51
|
updateAndClose(user: any): Promise<void>;
|
|
40
52
|
gainsightTrackingAppReload(): Promise<void>;
|
|
53
|
+
private updateProductExperienceOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Updates the user engagement preference if it has changed from the initial state.
|
|
56
|
+
* Calls the user engagements service to update the preference.
|
|
57
|
+
*
|
|
58
|
+
* The update only occurs if the current preference differs from the new state.
|
|
59
|
+
*/
|
|
60
|
+
private updateUserEngagementsPreference;
|
|
61
|
+
/**
|
|
62
|
+
* Asynchronously updates the tracking option for user preferences.
|
|
63
|
+
* If the current usage tracking state differs from the new state,
|
|
64
|
+
* it updates the Gainsight preferences and sets a functional cookie
|
|
65
|
+
* before triggering a reload of the application.
|
|
66
|
+
*/
|
|
67
|
+
private updateTrackingOption;
|
|
41
68
|
private updateUserInAppState;
|
|
42
69
|
private updateCredentials;
|
|
43
70
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserEditModalComponent, never>;
|
|
@@ -4,9 +4,7 @@ import { BsModalService } from 'ngx-bootstrap/modal';
|
|
|
4
4
|
import { AlertService } from '../alert/alert.service';
|
|
5
5
|
import { NewPassword } from '../authentication/password.model';
|
|
6
6
|
import { AppStateService } from '../common/ui-state.service';
|
|
7
|
-
import { UserPreferencesService } from '../common/user-preferences/user-preferences.service';
|
|
8
7
|
import { TranslateService } from '../i18n/translate.service';
|
|
9
|
-
import { GainsightService } from '../product-experience/gainsight.service';
|
|
10
8
|
import * as i0 from "@angular/core";
|
|
11
9
|
export interface User extends IUser {
|
|
12
10
|
phone: string;
|
|
@@ -21,17 +19,15 @@ export declare class UserEditComponent implements OnInit {
|
|
|
21
19
|
private userService;
|
|
22
20
|
private tenantLoginOptionsService;
|
|
23
21
|
private tenantService;
|
|
24
|
-
private userPreferencesService;
|
|
25
|
-
private gainsightService;
|
|
26
22
|
loading: boolean;
|
|
27
23
|
set user(u: User);
|
|
28
24
|
get user(): User;
|
|
29
|
-
|
|
25
|
+
showProductExperienceOptions: boolean;
|
|
30
26
|
isUsageTrackingEnabled: boolean;
|
|
31
|
-
|
|
27
|
+
isUserEngagementPreferenceEnabled: boolean;
|
|
32
28
|
onUser: EventEmitter<User>;
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
onUsageTrackingChange: EventEmitter<boolean>;
|
|
30
|
+
onUserEngagementPreferenceChange: EventEmitter<boolean>;
|
|
35
31
|
onCancel: EventEmitter<void>;
|
|
36
32
|
userHasActiveTotp: boolean;
|
|
37
33
|
userCanSetupTotp: boolean;
|
|
@@ -39,9 +35,8 @@ export declare class UserEditComponent implements OnInit {
|
|
|
39
35
|
userIsExternal: boolean;
|
|
40
36
|
isTfaEnabled: boolean;
|
|
41
37
|
private _user;
|
|
42
|
-
constructor(state: AppStateService, translate: TranslateService, bsModalService: BsModalService, alert: AlertService, userService: UserService, tenantLoginOptionsService: TenantLoginOptionsService, tenantService: TenantService
|
|
38
|
+
constructor(state: AppStateService, translate: TranslateService, bsModalService: BsModalService, alert: AlertService, userService: UserService, tenantLoginOptionsService: TenantLoginOptionsService, tenantService: TenantService);
|
|
43
39
|
ngOnInit(): Promise<void>;
|
|
44
|
-
onEnablingProductUsageTracking(isUsageTrackingEnabled: boolean): Promise<void>;
|
|
45
40
|
setupTotp(): void;
|
|
46
41
|
cancel(): void;
|
|
47
42
|
save(): Promise<void>;
|
|
@@ -49,5 +44,5 @@ export declare class UserEditComponent implements OnInit {
|
|
|
49
44
|
private initializeTotpSettings;
|
|
50
45
|
private canUserSetupTotp;
|
|
51
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserEditComponent, never>;
|
|
52
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UserEditComponent, "c8y-user-edit", never, { "loading": "loading"; "user": "user"; "
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserEditComponent, "c8y-user-edit", never, { "loading": "loading"; "user": "user"; "showProductExperienceOptions": "showProductExperienceOptions"; "isUsageTrackingEnabled": "isUsageTrackingEnabled"; "isUserEngagementPreferenceEnabled": "isUserEngagementPreferenceEnabled"; }, { "onUser": "onUser"; "onUsageTrackingChange": "onUsageTrackingChange"; "onUserEngagementPreferenceChange": "onUserEngagementPreferenceChange"; "onCancel": "onCancel"; }, never, never, false>;
|
|
53
48
|
}
|