@c8y/ngx-components 1021.63.2 → 1021.64.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 (62) hide show
  1. package/core/bottom-drawer/bottom-drawer-ref.d.ts +4 -0
  2. package/core/bottom-drawer/bottom-drawer-ref.d.ts.map +1 -1
  3. package/core/plugins/plugins.model.d.ts +1 -0
  4. package/core/plugins/plugins.model.d.ts.map +1 -1
  5. package/core/plugins/plugins.service.d.ts +5 -2
  6. package/core/plugins/plugins.service.d.ts.map +1 -1
  7. package/ecosystem/application-plugins/application-plugin-readme.component.d.ts +15 -0
  8. package/ecosystem/application-plugins/application-plugin-readme.component.d.ts.map +1 -0
  9. package/ecosystem/application-plugins/application-plugins.component.d.ts +4 -2
  10. package/ecosystem/application-plugins/application-plugins.component.d.ts.map +1 -1
  11. package/ecosystem/application-plugins/application-plugins.module.d.ts +4 -3
  12. package/ecosystem/application-plugins/application-plugins.module.d.ts.map +1 -1
  13. package/ecosystem/application-plugins/install-plugin.component.d.ts +8 -4
  14. package/ecosystem/application-plugins/install-plugin.component.d.ts.map +1 -1
  15. package/ecosystem/application-plugins/plugin-list.component.d.ts +10 -26
  16. package/ecosystem/application-plugins/plugin-list.component.d.ts.map +1 -1
  17. package/ecosystem/application-plugins/plugin-list.service.d.ts +27 -0
  18. package/ecosystem/application-plugins/plugin-list.service.d.ts.map +1 -0
  19. package/ecosystem/packages/package-details/package-details.component.d.ts +7 -9
  20. package/ecosystem/packages/package-details/package-details.component.d.ts.map +1 -1
  21. package/ecosystem/packages/package-versions/package-contents/contents-plugins/contents-plugins.component.d.ts +5 -1
  22. package/ecosystem/packages/package-versions/package-contents/contents-plugins/contents-plugins.component.d.ts.map +1 -1
  23. package/ecosystem/packages/package-versions/package-contents/packages-contents.component.d.ts +6 -3
  24. package/ecosystem/packages/package-versions/package-contents/packages-contents.component.d.ts.map +1 -1
  25. package/ecosystem/packages/package-versions/packages-versions.component.d.ts +9 -2
  26. package/ecosystem/packages/package-versions/packages-versions.component.d.ts.map +1 -1
  27. package/esm2022/core/bottom-drawer/bottom-drawer-ref.mjs +9 -3
  28. package/esm2022/core/plugins/plugins.model.mjs +1 -1
  29. package/esm2022/core/plugins/plugins.service.mjs +25 -5
  30. package/esm2022/ecosystem/application-plugins/application-plugin-readme.component.mjs +26 -0
  31. package/esm2022/ecosystem/application-plugins/application-plugins.component.mjs +26 -11
  32. package/esm2022/ecosystem/application-plugins/application-plugins.module.mjs +6 -3
  33. package/esm2022/ecosystem/application-plugins/install-plugin.component.mjs +21 -15
  34. package/esm2022/ecosystem/application-plugins/plugin-list-item.component.mjs +3 -3
  35. package/esm2022/ecosystem/application-plugins/plugin-list.component.mjs +26 -202
  36. package/esm2022/ecosystem/application-plugins/plugin-list.service.mjs +200 -0
  37. package/esm2022/ecosystem/application-properties/update-application-modal/update-application-modal.component.mjs +1 -1
  38. package/esm2022/ecosystem/packages/package-details/package-details.component.mjs +25 -44
  39. package/esm2022/ecosystem/packages/package-versions/package-contents/contents-plugins/contents-plugins.component.mjs +14 -4
  40. package/esm2022/ecosystem/packages/package-versions/package-contents/packages-contents.component.mjs +13 -6
  41. package/esm2022/ecosystem/packages/package-versions/packages-versions.component.mjs +22 -8
  42. package/esm2022/ecosystem/shared/list-filters/list-filters.component.mjs +3 -3
  43. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +205 -138
  44. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
  45. package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +2 -2
  46. package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  47. package/fesm2022/c8y-ngx-components-ecosystem.mjs +257 -176
  48. package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
  49. package/fesm2022/c8y-ngx-components.mjs +31 -5
  50. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  51. package/locales/de.po +3 -0
  52. package/locales/es.po +3 -0
  53. package/locales/fr.po +3 -0
  54. package/locales/ja_JP.po +3 -0
  55. package/locales/ko.po +3 -0
  56. package/locales/locales.pot +33 -6
  57. package/locales/nl.po +3 -0
  58. package/locales/pl.po +3 -0
  59. package/locales/pt_BR.po +3 -0
  60. package/locales/zh_CN.po +3 -0
  61. package/locales/zh_TW.po +3 -0
  62. package/package.json +1 -1
@@ -4850,9 +4850,10 @@ class PluginsService {
4850
4850
  }
4851
4851
  return `${contextPath}@${version}/${moduleName}`;
4852
4852
  }
4853
- constructor(applicationService, appStateService) {
4853
+ constructor(applicationService, appStateService, client) {
4854
4854
  this.applicationService = applicationService;
4855
4855
  this.appStateService = appStateService;
4856
+ this.client = client;
4856
4857
  }
4857
4858
  /**
4858
4859
  * Fetches a list of available packages.
@@ -5099,6 +5100,25 @@ class PluginsService {
5099
5100
  }));
5100
5101
  return extendedPlugins;
5101
5102
  }
5103
+ async getReadmeFileContent(baseUrl) {
5104
+ const readmeFile = await this.getReadmeFile(baseUrl);
5105
+ if (readmeFile.status === 200) {
5106
+ return await readmeFile.text();
5107
+ }
5108
+ return '';
5109
+ }
5110
+ async getReadmeFile(baseUrl) {
5111
+ let result;
5112
+ const options = {
5113
+ method: 'GET',
5114
+ headers: { 'Content-Type': 'text/markdown' }
5115
+ };
5116
+ result = await this.client.fetch(`${baseUrl}README.md`, options);
5117
+ if (result && result.status === 404) {
5118
+ result = await this.client.fetch(`${baseUrl}readme.md`, options);
5119
+ }
5120
+ return result;
5121
+ }
5102
5122
  isSelfScopedPlugin(plugin, contextPath) {
5103
5123
  return (plugin.scope === PluginsExportScopes.SELF &&
5104
5124
  (!contextPath || plugin.contextPath === contextPath));
@@ -5212,12 +5232,12 @@ class PluginsService {
5212
5232
  const [contextPath, moduleName] = id.split('/');
5213
5233
  return { contextPath, moduleName };
5214
5234
  }
5215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PluginsService, deps: [{ token: i1.ApplicationService }, { token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5235
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PluginsService, deps: [{ token: i1.ApplicationService }, { token: AppStateService }, { token: i1.FetchClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
5216
5236
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PluginsService }); }
5217
5237
  }
5218
5238
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PluginsService, decorators: [{
5219
5239
  type: Injectable
5220
- }], ctorParameters: () => [{ type: i1.ApplicationService }, { type: AppStateService }] });
5240
+ }], ctorParameters: () => [{ type: i1.ApplicationService }, { type: AppStateService }, { type: i1.FetchClient }] });
5221
5241
 
5222
5242
  class PluginsModule {
5223
5243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PluginsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -22984,7 +23004,7 @@ class BottomDrawerRef {
22984
23004
  this.options = options;
22985
23005
  this.closedSubject$ = new Subject();
22986
23006
  this.closedObs$ = this.closedSubject$.asObservable().pipe(shareReplay());
22987
- this.attachDrawerToView(component);
23007
+ this.instance = this.attachDrawerToView(component);
22988
23008
  }
22989
23009
  /**
22990
23010
  * Closes the bottom drawer behind the reference.
@@ -23011,6 +23031,7 @@ class BottomDrawerRef {
23011
23031
  assign$1(contentComponentRef.instance, this.options?.initialState);
23012
23032
  this.drawerComponentRef.changeDetectorRef.detectChanges();
23013
23033
  this.handleNavigation();
23034
+ return contentComponentRef.instance;
23014
23035
  }
23015
23036
  detachDrawerFromView() {
23016
23037
  this.drawerComponentRef.instance.hide();
@@ -23026,7 +23047,12 @@ class BottomDrawerRef {
23026
23047
  handleNavigation() {
23027
23048
  if (!this.options || !(this.options.closeOnNavigation === false)) {
23028
23049
  this.router.events
23029
- .pipe(filter(event => event instanceof NavigationStart), take(1), takeUntil(this.onClosed$))
23050
+ .pipe(filter(event => event instanceof NavigationStart), filter(({ url: targetUrl }) => {
23051
+ const currentUrlWithoutParams = this.router.url.split('?')[0];
23052
+ const targetUrlWithoutParams = targetUrl.split('?')[0];
23053
+ // this check is not to close the drawer when the query params change, e.g. when filter is applied to the list
23054
+ return currentUrlWithoutParams !== targetUrlWithoutParams;
23055
+ }), take(1), takeUntil(this.onClosed$))
23030
23056
  .subscribe(() => this.close());
23031
23057
  }
23032
23058
  }