@c8y/ngx-components 1017.0.510 → 1017.0.511

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 (33) hide show
  1. package/core/header/right-drawer/right-drawer.component.d.ts +22 -0
  2. package/core/shared/core.model.d.ts +22 -0
  3. package/device-grid/device-grid.service.d.ts +3 -4
  4. package/esm2020/core/action-bar/action-bar.component.mjs +10 -7
  5. package/esm2020/core/header/right-drawer/right-drawer.component.mjs +5 -3
  6. package/esm2020/core/shared/core.model.mjs +15 -0
  7. package/esm2020/device-grid/device-grid.service.mjs +6 -15
  8. package/esm2020/sensor-phone/sensor-phone-modal.component.mjs +26 -15
  9. package/esm2020/sensor-phone/sensor-phone.model.mjs +13 -0
  10. package/esm2020/sensor-phone/sensor-phone.service.mjs +5 -7
  11. package/esm2020/sub-assets/delete-assets-modal/delete-assets-modal.component.mjs +13 -3
  12. package/esm2020/sub-assets/shared/sub-assets.model.mjs +11 -0
  13. package/fesm2015/c8y-ngx-components-device-grid.mjs +4 -15
  14. package/fesm2015/c8y-ngx-components-device-grid.mjs.map +1 -1
  15. package/fesm2015/c8y-ngx-components-sensor-phone.mjs +40 -19
  16. package/fesm2015/c8y-ngx-components-sensor-phone.mjs.map +1 -1
  17. package/fesm2015/c8y-ngx-components-sub-assets.mjs +22 -2
  18. package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
  19. package/fesm2015/c8y-ngx-components.mjs +25 -7
  20. package/fesm2015/c8y-ngx-components.mjs.map +1 -1
  21. package/fesm2020/c8y-ngx-components-device-grid.mjs +4 -13
  22. package/fesm2020/c8y-ngx-components-device-grid.mjs.map +1 -1
  23. package/fesm2020/c8y-ngx-components-sensor-phone.mjs +40 -19
  24. package/fesm2020/c8y-ngx-components-sensor-phone.mjs.map +1 -1
  25. package/fesm2020/c8y-ngx-components-sub-assets.mjs +22 -2
  26. package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
  27. package/fesm2020/c8y-ngx-components.mjs +25 -7
  28. package/fesm2020/c8y-ngx-components.mjs.map +1 -1
  29. package/package.json +2 -2
  30. package/sensor-phone/sensor-phone.model.d.ts +18 -0
  31. package/sensor-phone/sensor-phone.service.d.ts +2 -3
  32. package/sub-assets/delete-assets-modal/delete-assets-modal.component.d.ts +1 -0
  33. 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) {
@@ -128,7 +139,9 @@ class SensorPhoneModalComponent {
128
139
  this.resultTitle = gettext('Result');
129
140
  }
130
141
  onKeydownHandler() {
131
- this.gainsightService.triggerEvent('connectSmartphone:Escape', {
142
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
143
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
144
+ action: PRODUCT_EXPERIENCE.ACTIONS.ESCAPE,
132
145
  step: this.getCurrentStepNumber()
133
146
  });
134
147
  }
@@ -148,7 +161,10 @@ class SensorPhoneModalComponent {
148
161
  registerPhone() {
149
162
  return __awaiter(this, void 0, void 0, function* () {
150
163
  try {
151
- this.gainsightService.triggerEvent('connectSmartphone:RegisterPhoneStarted');
164
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
165
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
166
+ result: PRODUCT_EXPERIENCE.RESULTS.REGISTER_PHONE_STARTED
167
+ });
152
168
  this.deviceId = this.generateDeviceId();
153
169
  this.registrationData = this.sensorPhoneService.generateRegistrationData(this.deviceId);
154
170
  yield this.sensorPhoneService.createPhoneRegistrationRequest(this.deviceId);
@@ -156,9 +172,17 @@ class SensorPhoneModalComponent {
156
172
  yield this.sensorPhoneService.acceptPhoneRegistrationRequest(this.deviceId);
157
173
  const { deviceMo, dashboardMo } = yield this.waitForDeviceAndDashboardMos();
158
174
  this.onDeviceAndDashboardMosCreated(deviceMo, dashboardMo);
175
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
176
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
177
+ result: PRODUCT_EXPERIENCE.RESULTS.SUCCESS
178
+ });
159
179
  }
160
180
  catch (error) {
161
- this.gainsightService.triggerEvent('connectSmartphone:Failed', { reason: error });
181
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
182
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
183
+ result: PRODUCT_EXPERIENCE.RESULTS.FAILED,
184
+ reason: error
185
+ });
162
186
  this.onFailure();
163
187
  }
164
188
  });
@@ -203,29 +227,23 @@ class SensorPhoneModalComponent {
203
227
  openDashboard() {
204
228
  if (this.dashboardLink) {
205
229
  this.router.navigate([this.dashboardLink]);
206
- this.gainsightService.triggerEvent('connectSmartphone:OpenDashboard');
230
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
231
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
232
+ action: PRODUCT_EXPERIENCE.ACTIONS.OPEN_DASHBOARD
233
+ });
207
234
  }
208
235
  }
209
236
  back() {
210
- this.gainsightService.triggerEvent('connectSmartphone:Back', {
211
- step: this.getCurrentStepNumber()
212
- });
213
237
  this.stepper.previous();
214
238
  }
215
239
  next($event) {
216
240
  const { step } = $event;
217
241
  step.completed = true;
218
- this.gainsightService.triggerEvent('connectSmartphone:Next', {
219
- step: this.getCurrentStepNumber()
220
- });
221
242
  this.stepper.next();
222
243
  }
223
244
  cancel() {
224
245
  this.bsModalRef.hide();
225
246
  this.deleteDeviceRequest();
226
- this.gainsightService.triggerEvent('connectSmartphone:Cancel', {
227
- step: this.getCurrentStepNumber()
228
- });
229
247
  }
230
248
  retry() {
231
249
  this.success = undefined;
@@ -234,7 +252,10 @@ class SensorPhoneModalComponent {
234
252
  }
235
253
  this.deleteDeviceRequest();
236
254
  this.stepper.selectedIndex = 2;
237
- this.gainsightService.triggerEvent('connectSmartphone:Retry');
255
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
256
+ component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
257
+ action: PRODUCT_EXPERIENCE.ACTIONS.RETRY
258
+ });
238
259
  }
239
260
  onFailure() {
240
261
  this.success = false;