@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.
Files changed (51) hide show
  1. package/core/bootstrap/cookie-banner/cookie-banner.service.d.ts +1 -1
  2. package/core/common/ApplicationOptions.d.ts +2 -0
  3. package/core/header/right-drawer/right-drawer.component.d.ts +22 -0
  4. package/core/product-experience/gainsight.service.d.ts +96 -22
  5. package/core/product-experience/index.d.ts +1 -0
  6. package/core/product-experience/product-experience.module.d.ts +18 -5
  7. package/core/product-experience/user-engagements.service.d.ts +109 -0
  8. package/core/shared/core.model.d.ts +22 -0
  9. package/core/user/user-edit-modal.component.d.ts +36 -10
  10. package/core/user/user-edit.component.d.ts +7 -12
  11. package/device-grid/device-grid.service.d.ts +3 -4
  12. package/esm2020/core/action-bar/action-bar.component.mjs +10 -7
  13. package/esm2020/core/bootstrap/cookie-banner/cookie-banner.service.mjs +2 -2
  14. package/esm2020/core/common/ApplicationOptions.mjs +1 -1
  15. package/esm2020/core/dynamic-forms/validation/validation-config.factory.mjs +2 -2
  16. package/esm2020/core/header/right-drawer/right-drawer.component.mjs +5 -3
  17. package/esm2020/core/product-experience/gainsight.service.mjs +174 -71
  18. package/esm2020/core/product-experience/index.mjs +2 -1
  19. package/esm2020/core/product-experience/product-experience.module.mjs +42 -24
  20. package/esm2020/core/product-experience/user-engagements.service.mjs +174 -0
  21. package/esm2020/core/shared/core.model.mjs +15 -0
  22. package/esm2020/core/user/user-edit-modal.component.mjs +73 -45
  23. package/esm2020/core/user/user-edit.component.mjs +38 -43
  24. package/esm2020/device-grid/device-grid.service.mjs +6 -15
  25. package/esm2020/sensor-phone/sensor-phone-modal.component.mjs +26 -15
  26. package/esm2020/sensor-phone/sensor-phone.model.mjs +13 -0
  27. package/esm2020/sensor-phone/sensor-phone.service.mjs +5 -7
  28. package/esm2020/sub-assets/delete-assets-modal/delete-assets-modal.component.mjs +13 -3
  29. package/esm2020/sub-assets/shared/sub-assets.model.mjs +11 -0
  30. package/fesm2015/c8y-ngx-components-device-grid.mjs +4 -15
  31. package/fesm2015/c8y-ngx-components-device-grid.mjs.map +1 -1
  32. package/fesm2015/c8y-ngx-components-sensor-phone.mjs +40 -19
  33. package/fesm2015/c8y-ngx-components-sensor-phone.mjs.map +1 -1
  34. package/fesm2015/c8y-ngx-components-sub-assets.mjs +22 -2
  35. package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
  36. package/fesm2015/c8y-ngx-components.mjs +513 -173
  37. package/fesm2015/c8y-ngx-components.mjs.map +1 -1
  38. package/fesm2020/c8y-ngx-components-device-grid.mjs +4 -13
  39. package/fesm2020/c8y-ngx-components-device-grid.mjs.map +1 -1
  40. package/fesm2020/c8y-ngx-components-sensor-phone.mjs +40 -19
  41. package/fesm2020/c8y-ngx-components-sensor-phone.mjs.map +1 -1
  42. package/fesm2020/c8y-ngx-components-sub-assets.mjs +22 -2
  43. package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
  44. package/fesm2020/c8y-ngx-components.mjs +497 -166
  45. package/fesm2020/c8y-ngx-components.mjs.map +1 -1
  46. package/locales/locales.pot +4 -4
  47. package/package.json +2 -2
  48. package/sensor-phone/sensor-phone.model.d.ts +18 -0
  49. package/sensor-phone/sensor-phone.service.d.ts +2 -3
  50. package/sub-assets/delete-assets-modal/delete-assets-modal.component.d.ts +1 -0
  51. package/sub-assets/shared/sub-assets.model.d.ts +15 -0
@@ -15,12 +15,24 @@ import * as i7 from '@angular/cdk/stepper';
15
15
  import * as i8 from 'angularx-qrcode';
16
16
  import { QRCodeModule } from 'angularx-qrcode';
17
17
 
18
+ const PRODUCT_EXPERIENCE = {
19
+ EVENTS: {
20
+ CONNECT_SMARTPHONE: 'connectSmartphone'
21
+ },
22
+ COMPONENTS: { SENSOR_PHONE_MODAL: 'sensor-phone-modal' },
23
+ ACTIONS: {
24
+ ESCAPE: 'escape',
25
+ OPEN_DASHBOARD: 'openDashboard',
26
+ RETRY: 'retry'
27
+ },
28
+ RESULTS: { FAILED: 'failed', REGISTER_PHONE_STARTED: 'registerPhoneStarted', SUCCESS: 'success' }
29
+ };
30
+
18
31
  class SensorPhoneService {
19
- constructor(ui, inventoryService, deviceRegistrationService, gainsightService) {
32
+ constructor(ui, inventoryService, deviceRegistrationService) {
20
33
  this.ui = ui;
21
34
  this.inventoryService = inventoryService;
22
35
  this.deviceRegistrationService = deviceRegistrationService;
23
- this.gainsightService = gainsightService;
24
36
  this.HTTP_STATUS_CODE = {
25
37
  OK: 200,
26
38
  CREATED: 201
@@ -99,15 +111,14 @@ class SensorPhoneService {
99
111
  if (res.status !== this.HTTP_STATUS_CODE.OK) {
100
112
  throw res;
101
113
  }
102
- this.gainsightService.triggerEvent('connectSmartphone:Success');
103
114
  });
104
115
  }
105
116
  }
106
- 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 }, { token: i5.GainsightService }], target: i0.ɵɵFactoryTarget.Injectable });
117
+ 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 });
107
118
  SensorPhoneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService });
108
119
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SensorPhoneService, decorators: [{
109
120
  type: Injectable
110
- }], ctorParameters: function () { return [{ type: i5.AppStateService }, { type: i2.InventoryService }, { type: i2.DeviceRegistrationService }, { type: i5.GainsightService }]; } });
121
+ }], ctorParameters: function () { return [{ type: i5.AppStateService }, { type: i2.InventoryService }, { type: i2.DeviceRegistrationService }]; } });
111
122
 
112
123
  class SensorPhoneModalComponent {
113
124
  constructor(bsModalRef, sensorPhoneService, renderer, deviceRegistrationService, router, inventoryService, gainsightService) {
@@ -124,7 +135,9 @@ class SensorPhoneModalComponent {
124
135
  this.dashboardLink = '';
125
136
  }
126
137
  onKeydownHandler() {
127
- this.gainsightService.triggerEvent('connectSmartphone:Escape', {
138
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
139
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
140
+ action: PRODUCT_EXPERIENCE.ACTIONS.ESCAPE,
128
141
  step: this.getCurrentStepNumber()
129
142
  });
130
143
  }
@@ -144,7 +157,10 @@ class SensorPhoneModalComponent {
144
157
  registerPhone() {
145
158
  return __awaiter(this, void 0, void 0, function* () {
146
159
  try {
147
- this.gainsightService.triggerEvent('connectSmartphone:RegisterPhoneStarted');
160
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
161
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
162
+ result: PRODUCT_EXPERIENCE.RESULTS.REGISTER_PHONE_STARTED
163
+ });
148
164
  this.deviceId = this.generateDeviceId();
149
165
  this.registrationData = this.sensorPhoneService.generateRegistrationData(this.deviceId);
150
166
  yield this.sensorPhoneService.createPhoneRegistrationRequest(this.deviceId);
@@ -152,9 +168,17 @@ class SensorPhoneModalComponent {
152
168
  yield this.sensorPhoneService.acceptPhoneRegistrationRequest(this.deviceId);
153
169
  const { deviceMo, dashboardMo } = yield this.waitForDeviceAndDashboardMos();
154
170
  this.onDeviceAndDashboardMosCreated(deviceMo, dashboardMo);
171
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
172
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
173
+ result: PRODUCT_EXPERIENCE.RESULTS.SUCCESS
174
+ });
155
175
  }
156
176
  catch (error) {
157
- this.gainsightService.triggerEvent('connectSmartphone:Failed', { reason: error });
177
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
178
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
179
+ result: PRODUCT_EXPERIENCE.RESULTS.FAILED,
180
+ reason: error
181
+ });
158
182
  this.onFailure();
159
183
  }
160
184
  });
@@ -199,27 +223,21 @@ class SensorPhoneModalComponent {
199
223
  openDashboard() {
200
224
  if (this.dashboardLink) {
201
225
  this.router.navigate([this.dashboardLink]);
202
- this.gainsightService.triggerEvent('connectSmartphone:OpenDashboard');
226
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
227
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
228
+ action: PRODUCT_EXPERIENCE.ACTIONS.OPEN_DASHBOARD
229
+ });
203
230
  }
204
231
  }
205
232
  back() {
206
- this.gainsightService.triggerEvent('connectSmartphone:Back', {
207
- step: this.getCurrentStepNumber()
208
- });
209
233
  this.stepper.previous();
210
234
  }
211
235
  next() {
212
- this.gainsightService.triggerEvent('connectSmartphone:Next', {
213
- step: this.getCurrentStepNumber()
214
- });
215
236
  this.stepper.next();
216
237
  }
217
238
  cancel() {
218
239
  this.bsModalRef.hide();
219
240
  this.deleteDeviceRequest();
220
- this.gainsightService.triggerEvent('connectSmartphone:Cancel', {
221
- step: this.getCurrentStepNumber()
222
- });
223
241
  }
224
242
  retry() {
225
243
  this.success = undefined;
@@ -228,7 +246,10 @@ class SensorPhoneModalComponent {
228
246
  }
229
247
  this.deleteDeviceRequest();
230
248
  this.stepper.selectedIndex = 2;
231
- this.gainsightService.triggerEvent('connectSmartphone:Retry');
249
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
250
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
251
+ action: PRODUCT_EXPERIENCE.ACTIONS.RETRY
252
+ });
232
253
  }
233
254
  onFailure() {
234
255
  this.success = false;