@c8y/ngx-components 1018.0.215 → 1018.0.219

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.
@@ -21,7 +21,7 @@ import { tap, switchMap, shareReplay, takeUntil, map } from 'rxjs/operators';
21
21
  import * as i6 from 'ngx-bootstrap/dropdown';
22
22
  import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
23
23
  import { PopoverModule } from 'ngx-bootstrap/popover';
24
- import { uniq } from 'lodash-es';
24
+ import { pick, uniq } from 'lodash-es';
25
25
  import { LicenseConfirmModule } from '@c8y/ngx-components/ecosystem/license-confirm';
26
26
 
27
27
  class ActivityLogComponent {
@@ -1219,12 +1219,21 @@ class DeployApplicationComponent {
1219
1219
  }
1220
1220
  try {
1221
1221
  this.deployedApp = await this.ecosystemService.deployApp(this.package, formGroupValue, this.model);
1222
+ const applicationCustomEventInfo = pick(this.package, [
1223
+ 'id',
1224
+ 'name',
1225
+ 'contextPath',
1226
+ 'label',
1227
+ 'key'
1228
+ ]);
1222
1229
  this.deployedWithSuccess = true;
1223
1230
  this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.DEPLOY_APPLICATION, {
1224
1231
  component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.DEPLOY_APPLICATION,
1225
1232
  action: PRODUCT_EXPERIENCE.APPLICATIONS.ACTIONS.DEPLOY_APPLICATION,
1226
1233
  result: PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.DEPLOYED,
1227
- url: this.CURRENT_LOCATION
1234
+ url: this.CURRENT_LOCATION,
1235
+ ...applicationCustomEventInfo,
1236
+ package: this.deployedApp?.manifest?.package ?? null
1228
1237
  });
1229
1238
  }
1230
1239
  catch (error) {
@@ -1233,7 +1242,8 @@ class DeployApplicationComponent {
1233
1242
  component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.DEPLOY_APPLICATION,
1234
1243
  action: PRODUCT_EXPERIENCE.APPLICATIONS.ACTIONS.DEPLOY_APPLICATION,
1235
1244
  result: PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.SERVER_FAILURE,
1236
- url: this.CURRENT_LOCATION
1245
+ url: this.CURRENT_LOCATION,
1246
+ error
1237
1247
  });
1238
1248
  }
1239
1249
  finally {
@@ -1393,11 +1403,6 @@ class PluginListComponent {
1393
1403
  await this.updateAppRemotes(plugin, 'install');
1394
1404
  }
1395
1405
  async uninstallPlugin(plugin) {
1396
- this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.PACKAGE_PLUGINS, {
1397
- component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.PLUGIN_LIST,
1398
- action: PRODUCT_EXPERIENCE.APPLICATIONS.ACTIONS.INSTALL_PLUGIN,
1399
- url: this.CURRENT_LOCATION
1400
- });
1401
1406
  await this.updateAppRemotes(plugin, 'uninstall');
1402
1407
  }
1403
1408
  async updateAppRemotes(plugin, updateType) {
@@ -1444,22 +1449,40 @@ class PluginListComponent {
1444
1449
  })
1445
1450
  : this.translateService.instant(gettext('Plugin uninstalled from app "{{ appName }}".'), { appName: app.name });
1446
1451
  this.alertService.success(successText);
1447
- this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.PACKAGE_PLUGINS, {
1448
- component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.PLUGIN_LIST,
1449
- result: PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.PLUGIN_INSTALLED,
1450
- url: this.CURRENT_LOCATION
1451
- });
1452
+ this.onUpdateEventHandleGS(plugin, app, updateType);
1452
1453
  }
1453
- catch {
1454
+ catch (error) {
1454
1455
  this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.PACKAGE_PLUGINS, {
1455
1456
  component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.PLUGIN_LIST,
1456
1457
  result: PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.SERVER_FAILURE,
1457
- url: this.CURRENT_LOCATION
1458
+ url: this.CURRENT_LOCATION,
1459
+ error
1458
1460
  });
1459
1461
  }
1460
1462
  }
1461
1463
  this.updatingPluginId[updateType] = '';
1462
1464
  }
1465
+ onUpdateEventHandleGS(plugin, app, updateType) {
1466
+ const pluginCustomEventInfo = pick(plugin, [
1467
+ 'name',
1468
+ 'contextPath',
1469
+ 'module',
1470
+ 'version',
1471
+ 'type',
1472
+ 'id'
1473
+ ]);
1474
+ const gsEventResult = updateType === 'install'
1475
+ ? PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.PLUGIN_INSTALLED
1476
+ : PRODUCT_EXPERIENCE.APPLICATIONS.RESULTS.PLUGIN_REMOVED;
1477
+ this.gainsightService.triggerEvent(PRODUCT_EXPERIENCE.APPLICATIONS.EVENTS.PACKAGE_PLUGINS, {
1478
+ component: PRODUCT_EXPERIENCE.APPLICATIONS.COMPONENTS.PLUGIN_LIST,
1479
+ result: gsEventResult,
1480
+ url: this.CURRENT_LOCATION,
1481
+ ...pluginCustomEventInfo,
1482
+ targetApplicationName: app.name,
1483
+ targetApplicationContextPath: app.contextPath
1484
+ });
1485
+ }
1463
1486
  async getAppsForUpdate(plugin, updateType) {
1464
1487
  let apps = (await this.ecosystemService.getWebApplications()).filter(app => this.ecosystemService.isOwner(app) && app.type !== ApplicationType.EXTERNAL);
1465
1488
  if (updateType === 'install') {