@c8y/ngx-components 1021.25.5 → 1021.29.0

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 (113) hide show
  1. package/alarms/alarm-details.component.d.ts +8 -13
  2. package/alarms/alarm-details.component.d.ts.map +1 -1
  3. package/alarms/alarm-details.service.d.ts +3 -20
  4. package/alarms/alarm-details.service.d.ts.map +1 -1
  5. package/alarms/alarm-info.component.d.ts +0 -1
  6. package/alarms/alarm-info.component.d.ts.map +1 -1
  7. package/branding/shared/data/branding-version.service.d.ts.map +1 -1
  8. package/branding/shared/lazy/branding-theme-form/branding-theme-form.component.d.ts.map +1 -1
  9. package/core/bootstrap/bootstrap.component.d.ts.map +1 -1
  10. package/core/common/geo.service.d.ts.map +1 -1
  11. package/core/common/inter-app.service.d.ts +1 -0
  12. package/core/common/inter-app.service.d.ts.map +1 -1
  13. package/core/plugins/plugins.model.d.ts +3 -1
  14. package/core/plugins/plugins.model.d.ts.map +1 -1
  15. package/core/plugins/plugins.service.d.ts.map +1 -1
  16. package/device-map/bounds-resolver.service.d.ts +12 -0
  17. package/device-map/bounds-resolver.service.d.ts.map +1 -0
  18. package/device-map/c8y-ngx-components-device-map.d.ts.map +1 -0
  19. package/device-map/device-map-navigation.factory.d.ts +9 -0
  20. package/device-map/device-map-navigation.factory.d.ts.map +1 -0
  21. package/device-map/device-map.component.d.ts +10 -0
  22. package/device-map/device-map.component.d.ts.map +1 -0
  23. package/device-map/device-map.feature.d.ts +3 -0
  24. package/device-map/device-map.feature.d.ts.map +1 -0
  25. package/device-map/index.d.ts +6 -0
  26. package/device-map/index.d.ts.map +1 -0
  27. package/device-map/location-resolver.service.d.ts +8 -0
  28. package/device-map/location-resolver.service.d.ts.map +1 -0
  29. package/ecosystem/application-plugins/application-plugins.component.d.ts.map +1 -1
  30. package/ecosystem/application-plugins/orphaned-status-cell-renderer.component.d.ts.map +1 -1
  31. package/esm2022/alarms/alarm-details.component.mjs +14 -30
  32. package/esm2022/alarms/alarm-details.service.mjs +5 -25
  33. package/esm2022/alarms/alarm-info.component.mjs +1 -1
  34. package/esm2022/branding/shared/data/branding-version.service.mjs +9 -5
  35. package/esm2022/branding/shared/lazy/branding-theme-form/branding-theme-form.component.mjs +5 -2
  36. package/esm2022/core/bootstrap/bootstrap.component.mjs +4 -3
  37. package/esm2022/core/common/geo.service.mjs +2 -5
  38. package/esm2022/core/common/inter-app.service.mjs +3 -2
  39. package/esm2022/core/plugins/plugins.model.mjs +2 -1
  40. package/esm2022/core/plugins/plugins.service.mjs +7 -5
  41. package/esm2022/core/version/websdk-plugin-version.factory.mjs +2 -2
  42. package/esm2022/device-map/bounds-resolver.service.mjs +21 -0
  43. package/esm2022/device-map/c8y-ngx-components-device-map.mjs +5 -0
  44. package/esm2022/device-map/device-map-navigation.factory.mjs +25 -0
  45. package/esm2022/device-map/device-map.component.mjs +30 -0
  46. package/esm2022/device-map/device-map.feature.mjs +15 -0
  47. package/esm2022/device-map/index.mjs +6 -0
  48. package/esm2022/device-map/location-resolver.service.mjs +25 -0
  49. package/esm2022/ecosystem/application-plugins/application-plugins.component.mjs +66 -22
  50. package/esm2022/ecosystem/application-plugins/orphaned-status-cell-renderer.component.mjs +7 -1
  51. package/esm2022/location/location.component.mjs +3 -3
  52. package/esm2022/map/map-status.component.mjs +20 -7
  53. package/esm2022/map/map.component.mjs +15 -7
  54. package/esm2022/map/map.model.mjs +2 -2
  55. package/esm2022/map/map.module.mjs +25 -4
  56. package/esm2022/map/map.service.mjs +73 -7
  57. package/esm2022/repository/firmware/list/firmware-list.component.mjs +10 -10
  58. package/esm2022/repository/software/list/software-list.component.mjs +10 -10
  59. package/esm2022/tracking/tracking-marker-popup.component.mjs +10 -3
  60. package/esm2022/tracking/tracking.component.mjs +3 -4
  61. package/esm2022/tracking/tracking.service.mjs +6 -3
  62. package/fesm2022/c8y-ngx-components-alarms.mjs +18 -54
  63. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  64. package/fesm2022/c8y-ngx-components-branding-shared-data.mjs +8 -4
  65. package/fesm2022/c8y-ngx-components-branding-shared-data.mjs.map +1 -1
  66. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +4 -1
  67. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
  68. package/fesm2022/c8y-ngx-components-device-map.mjs +106 -0
  69. package/fesm2022/c8y-ngx-components-device-map.mjs.map +1 -0
  70. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +71 -21
  71. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
  72. package/fesm2022/c8y-ngx-components-ecosystem.mjs +71 -21
  73. package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
  74. package/fesm2022/c8y-ngx-components-location.mjs +2 -2
  75. package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
  76. package/fesm2022/c8y-ngx-components-map.mjs +122 -14
  77. package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
  78. package/fesm2022/c8y-ngx-components-repository-firmware.mjs +9 -9
  79. package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
  80. package/fesm2022/c8y-ngx-components-repository-software.mjs +9 -9
  81. package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
  82. package/fesm2022/c8y-ngx-components-tracking.mjs +16 -7
  83. package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
  84. package/fesm2022/c8y-ngx-components.mjs +14 -12
  85. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  86. package/locales/de.po +13 -1
  87. package/locales/es.po +13 -1
  88. package/locales/fr.po +13 -1
  89. package/locales/ja_JP.po +15 -3
  90. package/locales/ko.po +13 -1
  91. package/locales/locales.pot +12 -0
  92. package/locales/nl.po +13 -1
  93. package/locales/pl.po +13 -1
  94. package/locales/pt_BR.po +13 -1
  95. package/locales/zh_CN.po +13 -1
  96. package/locales/zh_TW.po +13 -1
  97. package/map/map-status.component.d.ts +3 -1
  98. package/map/map-status.component.d.ts.map +1 -1
  99. package/map/map.component.d.ts +2 -1
  100. package/map/map.component.d.ts.map +1 -1
  101. package/map/map.model.d.ts +1 -0
  102. package/map/map.model.d.ts.map +1 -1
  103. package/map/map.module.d.ts +2 -1
  104. package/map/map.module.d.ts.map +1 -1
  105. package/map/map.service.d.ts +27 -2
  106. package/map/map.service.d.ts.map +1 -1
  107. package/package.json +1 -1
  108. package/repository/firmware/list/firmware-list.component.d.ts.map +1 -1
  109. package/repository/software/list/software-list.component.d.ts.map +1 -1
  110. package/tracking/tracking-marker-popup.component.d.ts +5 -1
  111. package/tracking/tracking-marker-popup.component.d.ts.map +1 -1
  112. package/tracking/tracking.component.d.ts.map +1 -1
  113. package/tracking/tracking.service.d.ts.map +1 -1
@@ -2230,6 +2230,12 @@ class OrphanedStatusCellRendererComponent {
2230
2230
  text: gettext('LATEST`plugin status`'),
2231
2231
  class: 'label-success'
2232
2232
  };
2233
+ case ApplicationPluginStatus.AUTO:
2234
+ return {
2235
+ value: statusValue,
2236
+ text: gettext('AUTO`plugin status`'),
2237
+ class: 'label-success'
2238
+ };
2233
2239
  default:
2234
2240
  return null;
2235
2241
  }
@@ -2354,8 +2360,25 @@ class ApplicationPluginsComponent {
2354
2360
  this.allAvailablePlugins$
2355
2361
  ]).pipe(map(([remotePlugins, allPlugins]) => this.getInstalledPlugins(allPlugins, remotePlugins)), shareReplay(1));
2356
2362
  this.orphanedPlugins$ = this.installedPlugins$.pipe(map(plugins => plugins.filter(p => p.status === ApplicationPluginStatus.ORPHANED)));
2357
- this.isStandard$ = combineLatest([this.installedPlugins$, this.selfPlugins$]).pipe(map(([installedPlugins, selfPlugins]) => installedPlugins.filter(p => selfPlugins.some(selfPlugin => selfPlugin.id === p.id))
2358
- .length === selfPlugins.length && installedPlugins.length === selfPlugins.length));
2363
+ this.isStandard$ = combineLatest([this.installedPlugins$, this.selfPlugins$]).pipe(map(([installedPlugins, selfPlugins]) => {
2364
+ const manifestRemotes = this.app?.manifest?.remotes || {};
2365
+ // ensure that every installed plugin is a self plugin or a plugin from the manifest
2366
+ const allInstalledPluginsAreSelf = installedPlugins.every(p => selfPlugins.some(selfPlugin => selfPlugin.id === p.id) ||
2367
+ (Array.isArray(manifestRemotes[p.contextPath]) &&
2368
+ manifestRemotes[p.contextPath].includes(p.module)));
2369
+ // ensure that every self plugin is installed
2370
+ const allSelfPluginsAreInstalled = selfPlugins.every(selfPlugin => installedPlugins.some(p => p.id === selfPlugin.id));
2371
+ const configRemotes = this.app?.config?.remotes || {};
2372
+ // ensure that every remote from the manifest is in the config
2373
+ // if no config exists we are also all good
2374
+ const everyRemoteFromManifestIsInConfig = !this.app?.config?.remotes ||
2375
+ Object.keys(manifestRemotes).every(contextPath => Array.isArray(configRemotes[contextPath]) &&
2376
+ Array.isArray(manifestRemotes[contextPath]) &&
2377
+ manifestRemotes[contextPath].every(module => configRemotes[contextPath].includes(module)));
2378
+ return (allInstalledPluginsAreSelf &&
2379
+ allSelfPluginsAreInstalled &&
2380
+ everyRemoteFromManifestIsInConfig);
2381
+ }));
2359
2382
  this.title = gettext('Installed plugins');
2360
2383
  this.loadMoreItemsLabel = gettext('Load more packages');
2361
2384
  this.loadingItemsLabel = gettext('Loading packages…');
@@ -2387,9 +2410,16 @@ class ApplicationPluginsComponent {
2387
2410
  {
2388
2411
  name: 'Version',
2389
2412
  header: gettext('Version'),
2390
- path: 'displayVersion',
2413
+ path: 'version',
2391
2414
  filterable: false
2392
2415
  },
2416
+ {
2417
+ name: 'Tag',
2418
+ header: gettext('Tag`noun`'),
2419
+ path: 'installedViaTag',
2420
+ filterable: false,
2421
+ cellRendererComponent: LabelCellRendererComponent
2422
+ },
2393
2423
  {
2394
2424
  name: 'description',
2395
2425
  header: gettext('Description'),
@@ -2661,29 +2691,46 @@ class ApplicationPluginsComponent {
2661
2691
  }
2662
2692
  getInstallModalInitState() {
2663
2693
  return {
2664
- plugins$: combineLatest([
2665
- this.allAvailablePlugins$,
2666
- this.installedPlugins$.pipe(map(plugins => plugins.map(p => p.id)))
2667
- ]).pipe(map(([allPlugins, installedPlugins]) => {
2668
- const plugins = [];
2669
- allPlugins.map(p => plugins.push({
2670
- ...p,
2671
- installed: !!installedPlugins.includes(p.id)
2672
- }));
2673
- return plugins;
2694
+ plugins$: combineLatest([this.allAvailablePlugins$, this.installedPlugins$]).pipe(map(([allPlugins, installedPlugins]) => {
2695
+ // to not mutate the original array and objects contained in it
2696
+ const allPluginsAsNewObjects = allPlugins.map(p => ({ ...p }));
2697
+ for (const plugin of installedPlugins) {
2698
+ let installedPlugin = allPluginsAsNewObjects.find(p => p.id === plugin.id);
2699
+ if (!installedPlugin && plugin.installedViaTag) {
2700
+ installedPlugin = allPluginsAsNewObjects.find(p => p.contextPath === plugin.contextPath &&
2701
+ p.module === plugin.module &&
2702
+ p.tags?.includes(plugin.installedViaTag));
2703
+ }
2704
+ if (installedPlugin) {
2705
+ installedPlugin.installed = true;
2706
+ continue;
2707
+ }
2708
+ }
2709
+ return allPluginsAsNewObjects.map(p => ({ ...p, installed: !!p.installed }));
2674
2710
  }), shareReplay(1))
2675
2711
  };
2676
2712
  }
2677
2713
  getOrphanedPlugins(orphanedPluginIds, allPlugins) {
2678
2714
  const orphanedPlugins = orphanedPluginIds.map(p => this.extractDetails(p));
2679
2715
  const orphanedPluginsUpdated = orphanedPlugins.map(p => {
2716
+ const pluginWithMatchingTag = allPlugins.find(tmp => tmp.contextPath === p.contextPath &&
2717
+ tmp.module === p.module &&
2718
+ tmp.tags?.includes(p.version || 'latest'));
2719
+ if (pluginWithMatchingTag) {
2720
+ return {
2721
+ ...pluginWithMatchingTag,
2722
+ id: p.id,
2723
+ status: ApplicationPluginStatus.AUTO,
2724
+ installedViaTag: p.version || 'latest'
2725
+ };
2726
+ }
2680
2727
  const pluginInDifferentVersion = allPlugins.find(tmp => tmp.contextPath === p.contextPath && tmp.module === p.module);
2681
2728
  if (pluginInDifferentVersion) {
2682
2729
  return {
2683
2730
  ...pluginInDifferentVersion,
2684
- version: p.version || pluginInDifferentVersion.version,
2731
+ version: p.version,
2685
2732
  id: p.id,
2686
- status: p.version ? ApplicationPluginStatus.OUTDATED : ApplicationPluginStatus.LATEST
2733
+ status: ApplicationPluginStatus.OUTDATED
2687
2734
  };
2688
2735
  }
2689
2736
  return p;
@@ -2716,12 +2763,15 @@ class ApplicationPluginsComponent {
2716
2763
  }));
2717
2764
  const orphanedPluginIds = remotePlugins.filter(r => !availablePlugins.find(plugin => plugin.id === r));
2718
2765
  const orphanedPlugins = this.getOrphanedPlugins(orphanedPluginIds, allPlugins);
2719
- const { actuallyOrphanedPlugins, revokedPlugins } = this.splitOrphanedPluginsIntoOrphanedAndRevokedPlugins(allPlugins, orphanedPlugins);
2720
- return [...availablePlugins, ...revokedPlugins, ...actuallyOrphanedPlugins].map(plugin => ({
2721
- ...plugin,
2722
- // adding 'v' prefix so version string is not treated as date in data grid
2723
- displayVersion: 'v' + plugin.version
2724
- }));
2766
+ const notActuallyOrphanedPlugins = orphanedPlugins.filter(p => p.status === ApplicationPluginStatus.AUTO);
2767
+ const orphanedOrRevokedPlugins = orphanedPlugins.filter(p => p.status !== ApplicationPluginStatus.AUTO);
2768
+ const { actuallyOrphanedPlugins, revokedPlugins } = this.splitOrphanedPluginsIntoOrphanedAndRevokedPlugins(allPlugins, orphanedOrRevokedPlugins);
2769
+ return [
2770
+ ...availablePlugins,
2771
+ ...notActuallyOrphanedPlugins,
2772
+ ...revokedPlugins,
2773
+ ...actuallyOrphanedPlugins
2774
+ ];
2725
2775
  }
2726
2776
  extractDetails(pluginId) {
2727
2777
  const contextPath = this.getStringMatchingRegex(pluginId, /^[^@]*(@|\/)/);