@c8y/ngx-components 1017.0.507 → 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.
- package/core/header/right-drawer/right-drawer.component.d.ts +22 -0
- package/core/shared/core.model.d.ts +22 -0
- package/device-grid/device-grid.service.d.ts +3 -4
- package/esm2020/core/action-bar/action-bar.component.mjs +10 -7
- package/esm2020/core/header/right-drawer/right-drawer.component.mjs +5 -3
- package/esm2020/core/shared/core.model.mjs +15 -0
- 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 +25 -7
- 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 +25 -7
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +3 -6
- package/locales/es.po +3 -6
- package/locales/fr.po +5 -8
- package/locales/ja_JP.po +27 -19
- package/locales/ko.po +14 -17
- package/locales/nl.po +4 -7
- package/locales/pl.po +3 -6
- package/locales/pt_BR.po +3 -6
- package/locales/ru.po +0 -3
- package/locales/zh_CN.po +0 -3
- package/locales/zh_TW.po +0 -3
- 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) {
|
|
@@ -117,7 +128,9 @@ class SensorPhoneModalComponent {
|
|
|
117
128
|
this.resultTitle = gettext('Result');
|
|
118
129
|
}
|
|
119
130
|
onKeydownHandler() {
|
|
120
|
-
this.gainsightService.triggerEvent(
|
|
131
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
132
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
133
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.ESCAPE,
|
|
121
134
|
step: this.getCurrentStepNumber()
|
|
122
135
|
});
|
|
123
136
|
}
|
|
@@ -136,7 +149,10 @@ class SensorPhoneModalComponent {
|
|
|
136
149
|
}
|
|
137
150
|
async registerPhone() {
|
|
138
151
|
try {
|
|
139
|
-
this.gainsightService.triggerEvent(
|
|
152
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
153
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
154
|
+
result: PRODUCT_EXPERIENCE.RESULTS.REGISTER_PHONE_STARTED
|
|
155
|
+
});
|
|
140
156
|
this.deviceId = this.generateDeviceId();
|
|
141
157
|
this.registrationData = this.sensorPhoneService.generateRegistrationData(this.deviceId);
|
|
142
158
|
await this.sensorPhoneService.createPhoneRegistrationRequest(this.deviceId);
|
|
@@ -144,9 +160,17 @@ class SensorPhoneModalComponent {
|
|
|
144
160
|
await this.sensorPhoneService.acceptPhoneRegistrationRequest(this.deviceId);
|
|
145
161
|
const { deviceMo, dashboardMo } = await this.waitForDeviceAndDashboardMos();
|
|
146
162
|
this.onDeviceAndDashboardMosCreated(deviceMo, dashboardMo);
|
|
163
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
164
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
165
|
+
result: PRODUCT_EXPERIENCE.RESULTS.SUCCESS
|
|
166
|
+
});
|
|
147
167
|
}
|
|
148
168
|
catch (error) {
|
|
149
|
-
this.gainsightService.triggerEvent(
|
|
169
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
170
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
171
|
+
result: PRODUCT_EXPERIENCE.RESULTS.FAILED,
|
|
172
|
+
reason: error
|
|
173
|
+
});
|
|
150
174
|
this.onFailure();
|
|
151
175
|
}
|
|
152
176
|
}
|
|
@@ -190,29 +214,23 @@ class SensorPhoneModalComponent {
|
|
|
190
214
|
openDashboard() {
|
|
191
215
|
if (this.dashboardLink) {
|
|
192
216
|
this.router.navigate([this.dashboardLink]);
|
|
193
|
-
this.gainsightService.triggerEvent(
|
|
217
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
218
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
219
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.OPEN_DASHBOARD
|
|
220
|
+
});
|
|
194
221
|
}
|
|
195
222
|
}
|
|
196
223
|
back() {
|
|
197
|
-
this.gainsightService.triggerEvent('connectSmartphone:Back', {
|
|
198
|
-
step: this.getCurrentStepNumber()
|
|
199
|
-
});
|
|
200
224
|
this.stepper.previous();
|
|
201
225
|
}
|
|
202
226
|
next($event) {
|
|
203
227
|
const { step } = $event;
|
|
204
228
|
step.completed = true;
|
|
205
|
-
this.gainsightService.triggerEvent('connectSmartphone:Next', {
|
|
206
|
-
step: this.getCurrentStepNumber()
|
|
207
|
-
});
|
|
208
229
|
this.stepper.next();
|
|
209
230
|
}
|
|
210
231
|
cancel() {
|
|
211
232
|
this.bsModalRef.hide();
|
|
212
233
|
this.deleteDeviceRequest();
|
|
213
|
-
this.gainsightService.triggerEvent('connectSmartphone:Cancel', {
|
|
214
|
-
step: this.getCurrentStepNumber()
|
|
215
|
-
});
|
|
216
234
|
}
|
|
217
235
|
retry() {
|
|
218
236
|
this.success = undefined;
|
|
@@ -221,7 +239,10 @@ class SensorPhoneModalComponent {
|
|
|
221
239
|
}
|
|
222
240
|
this.deleteDeviceRequest();
|
|
223
241
|
this.stepper.selectedIndex = 2;
|
|
224
|
-
this.gainsightService.triggerEvent(
|
|
242
|
+
this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.EVENTS.CONNECT_SMARTPHONE, {
|
|
243
|
+
component: PRODUCT_EXPERIENCE.COMPONENTS.SENSOR_PHONE_MODAL,
|
|
244
|
+
action: PRODUCT_EXPERIENCE.ACTIONS.RETRY
|
|
245
|
+
});
|
|
225
246
|
}
|
|
226
247
|
onFailure() {
|
|
227
248
|
this.success = false;
|