@c8y/ngx-components 1016.0.476 → 1016.0.483
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/header/right-drawer/right-drawer.component.d.ts +22 -0
- package/core/product-experience/gainsight.service.d.ts +96 -22
- 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/shared/core.model.d.ts +22 -0
- package/core/user/user-edit-modal.component.d.ts +36 -10
- package/core/user/user-edit.component.d.ts +7 -12
- package/device-grid/device-grid.service.d.ts +3 -4
- package/esm2020/core/action-bar/action-bar.component.mjs +10 -7
- package/esm2020/core/bootstrap/cookie-banner/cookie-banner.service.mjs +2 -2
- package/esm2020/core/common/ApplicationOptions.mjs +1 -1
- package/esm2020/core/dynamic-forms/validation/validation-config.factory.mjs +2 -2
- package/esm2020/core/header/right-drawer/right-drawer.component.mjs +5 -3
- package/esm2020/core/product-experience/gainsight.service.mjs +174 -71
- 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/shared/core.model.mjs +15 -0
- package/esm2020/core/user/user-edit-modal.component.mjs +73 -45
- package/esm2020/core/user/user-edit.component.mjs +38 -43
- package/esm2020/device-grid/device-grid.service.mjs +6 -15
- package/esm2020/sensor-phone/sensor-phone-modal.component.mjs +26 -15
- package/esm2020/sensor-phone/sensor-phone.model.mjs +13 -0
- package/esm2020/sensor-phone/sensor-phone.service.mjs +5 -7
- package/esm2020/sub-assets/delete-assets-modal/delete-assets-modal.component.mjs +13 -3
- package/esm2020/sub-assets/shared/sub-assets.model.mjs +11 -0
- package/fesm2015/c8y-ngx-components-device-grid.mjs +4 -15
- package/fesm2015/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sensor-phone.mjs +40 -19
- package/fesm2015/c8y-ngx-components-sensor-phone.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sub-assets.mjs +22 -2
- package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components.mjs +513 -173
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-device-grid.mjs +4 -13
- package/fesm2020/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sensor-phone.mjs +40 -19
- package/fesm2020/c8y-ngx-components-sensor-phone.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sub-assets.mjs +22 -2
- package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +497 -166
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +4 -4
- package/package.json +2 -2
- package/sensor-phone/sensor-phone.model.d.ts +18 -0
- package/sensor-phone/sensor-phone.service.d.ts +2 -3
- package/sub-assets/delete-assets-modal/delete-assets-modal.component.d.ts +1 -0
- package/sub-assets/shared/sub-assets.model.d.ts +15 -0
|
@@ -15,11 +15,10 @@ import * as i8 from 'angularx-qrcode';
|
|
|
15
15
|
import { QRCodeModule } from 'angularx-qrcode';
|
|
16
16
|
|
|
17
17
|
class SensorPhoneService {
|
|
18
|
-
constructor(ui, inventoryService, deviceRegistrationService
|
|
18
|
+
constructor(ui, inventoryService, deviceRegistrationService) {
|
|
19
19
|
this.ui = ui;
|
|
20
20
|
this.inventoryService = inventoryService;
|
|
21
21
|
this.deviceRegistrationService = deviceRegistrationService;
|
|
22
|
-
this.gainsightService = gainsightService;
|
|
23
22
|
this.HTTP_STATUS_CODE = {
|
|
24
23
|
OK: 200,
|
|
25
24
|
CREATED: 201
|
|
@@ -89,14 +88,26 @@ class SensorPhoneService {
|
|
|
89
88
|
if (res.status !== this.HTTP_STATUS_CODE.OK) {
|
|
90
89
|
throw res;
|
|
91
90
|
}
|
|
92
|
-
this.gainsightService.triggerEvent('connectSmartphone:Success');
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
|
-
SensorPhoneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService, deps: [{ token: i5.AppStateService }, { token: i2.InventoryService }, { token: i2.DeviceRegistrationService }
|
|
93
|
+
SensorPhoneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService, deps: [{ token: i5.AppStateService }, { token: i2.InventoryService }, { token: i2.DeviceRegistrationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
96
94
|
SensorPhoneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService });
|
|
97
95
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService, decorators: [{
|
|
98
96
|
type: Injectable
|
|
99
|
-
}], ctorParameters: function () { return [{ type: i5.AppStateService }, { type: i2.InventoryService }, { type: i2.DeviceRegistrationService }
|
|
97
|
+
}], ctorParameters: function () { return [{ type: i5.AppStateService }, { type: i2.InventoryService }, { type: i2.DeviceRegistrationService }]; } });
|
|
98
|
+
|
|
99
|
+
const PRODUCT_EXPERIENCE = {
|
|
100
|
+
EVENTS: {
|
|
101
|
+
CONNECT_SMARTPHONE: 'connectSmartphone'
|
|
102
|
+
},
|
|
103
|
+
COMPONENTS: { SENSOR_PHONE_MODAL: 'sensor-phone-modal' },
|
|
104
|
+
ACTIONS: {
|
|
105
|
+
ESCAPE: 'escape',
|
|
106
|
+
OPEN_DASHBOARD: 'openDashboard',
|
|
107
|
+
RETRY: 'retry'
|
|
108
|
+
},
|
|
109
|
+
RESULTS: { FAILED: 'failed', REGISTER_PHONE_STARTED: 'registerPhoneStarted', SUCCESS: 'success' }
|
|
110
|
+
};
|
|
100
111
|
|
|
101
112
|
class SensorPhoneModalComponent {
|
|
102
113
|
constructor(bsModalRef, sensorPhoneService, renderer, deviceRegistrationService, router, inventoryService, gainsightService) {
|
|
@@ -113,7 +124,9 @@ class SensorPhoneModalComponent {
|
|
|
113
124
|
this.dashboardLink = '';
|
|
114
125
|
}
|
|
115
126
|
onKeydownHandler() {
|
|
116
|
-
this.gainsightService.triggerEvent(
|
|
127
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
128
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
129
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.ESCAPE,
|
|
117
130
|
step: this.getCurrentStepNumber()
|
|
118
131
|
});
|
|
119
132
|
}
|
|
@@ -132,7 +145,10 @@ class SensorPhoneModalComponent {
|
|
|
132
145
|
}
|
|
133
146
|
async registerPhone() {
|
|
134
147
|
try {
|
|
135
|
-
this.gainsightService.triggerEvent(
|
|
148
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
149
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
150
|
+
result: PRODUCT_EXPERIENCE.RESULTS.REGISTER_PHONE_STARTED
|
|
151
|
+
});
|
|
136
152
|
this.deviceId = this.generateDeviceId();
|
|
137
153
|
this.registrationData = this.sensorPhoneService.generateRegistrationData(this.deviceId);
|
|
138
154
|
await this.sensorPhoneService.createPhoneRegistrationRequest(this.deviceId);
|
|
@@ -140,9 +156,17 @@ class SensorPhoneModalComponent {
|
|
|
140
156
|
await this.sensorPhoneService.acceptPhoneRegistrationRequest(this.deviceId);
|
|
141
157
|
const { deviceMo, dashboardMo } = await this.waitForDeviceAndDashboardMos();
|
|
142
158
|
this.onDeviceAndDashboardMosCreated(deviceMo, dashboardMo);
|
|
159
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
160
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
161
|
+
result: PRODUCT_EXPERIENCE.RESULTS.SUCCESS
|
|
162
|
+
});
|
|
143
163
|
}
|
|
144
164
|
catch (error) {
|
|
145
|
-
this.gainsightService.triggerEvent(
|
|
165
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
166
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
167
|
+
result: PRODUCT_EXPERIENCE.RESULTS.FAILED,
|
|
168
|
+
reason: error
|
|
169
|
+
});
|
|
146
170
|
this.onFailure();
|
|
147
171
|
}
|
|
148
172
|
}
|
|
@@ -186,27 +210,21 @@ class SensorPhoneModalComponent {
|
|
|
186
210
|
openDashboard() {
|
|
187
211
|
if (this.dashboardLink) {
|
|
188
212
|
this.router.navigate([this.dashboardLink]);
|
|
189
|
-
this.gainsightService.triggerEvent(
|
|
213
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
214
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
215
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.OPEN_DASHBOARD
|
|
216
|
+
});
|
|
190
217
|
}
|
|
191
218
|
}
|
|
192
219
|
back() {
|
|
193
|
-
this.gainsightService.triggerEvent('connectSmartphone:Back', {
|
|
194
|
-
step: this.getCurrentStepNumber()
|
|
195
|
-
});
|
|
196
220
|
this.stepper.previous();
|
|
197
221
|
}
|
|
198
222
|
next() {
|
|
199
|
-
this.gainsightService.triggerEvent('connectSmartphone:Next', {
|
|
200
|
-
step: this.getCurrentStepNumber()
|
|
201
|
-
});
|
|
202
223
|
this.stepper.next();
|
|
203
224
|
}
|
|
204
225
|
cancel() {
|
|
205
226
|
this.bsModalRef.hide();
|
|
206
227
|
this.deleteDeviceRequest();
|
|
207
|
-
this.gainsightService.triggerEvent('connectSmartphone:Cancel', {
|
|
208
|
-
step: this.getCurrentStepNumber()
|
|
209
|
-
});
|
|
210
228
|
}
|
|
211
229
|
retry() {
|
|
212
230
|
this.success = undefined;
|
|
@@ -215,7 +233,10 @@ class SensorPhoneModalComponent {
|
|
|
215
233
|
}
|
|
216
234
|
this.deleteDeviceRequest();
|
|
217
235
|
this.stepper.selectedIndex = 2;
|
|
218
|
-
this.gainsightService.triggerEvent(
|
|
236
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
237
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
238
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.RETRY
|
|
239
|
+
});
|
|
219
240
|
}
|
|
220
241
|
onFailure() {
|
|
221
242
|
this.success = false;
|