@provoly/dashboard 1.4.17 → 1.4.19

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 (199) hide show
  1. package/admin/components/admin-classes/admin-classes-view/admin-attributes-edit/admin-attributes-edit.component.d.ts +2 -3
  2. package/admin/components/admin-classes/admin-classes-view/admin-attributes-new/admin-attributes-new.component.d.ts +2 -3
  3. package/admin/components/admin-classes/store/admin-class.effects.d.ts +22 -8
  4. package/admin/components/admin-dataset/store/admin-dataset.effects.d.ts +13 -5
  5. package/admin/components/admin-fields/store/fields.effects.d.ts +7 -5
  6. package/admin/store/admin.effects.d.ts +3 -1
  7. package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-edit/admin-abac-rules-edit.component.mjs +3 -3
  8. package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-new/admin-abac-rules-new.component.mjs +3 -3
  9. package/esm2022/admin/components/admin-abac-rules/admin-abac-rules-view/admin-abac-rules-view.component.mjs +3 -3
  10. package/esm2022/admin/components/admin-classes/admin-classes-customize/admin-classes-customize.component.mjs +4 -4
  11. package/esm2022/admin/components/admin-classes/admin-classes-customize/symbol/admin-classes-customize-symbol.component.mjs +2 -2
  12. package/esm2022/admin/components/admin-classes/admin-classes-edit/admin-classes-edit.component.mjs +2 -2
  13. package/esm2022/admin/components/admin-classes/admin-classes-form/admin-classes-form.component.mjs +2 -2
  14. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-edit/admin-attributes-edit.component.mjs +5 -6
  15. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.mjs +3 -3
  16. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-new/admin-attributes-new.component.mjs +5 -6
  17. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-classes-view.component.mjs +4 -4
  18. package/esm2022/admin/components/admin-classes/admin-classes.component.mjs +3 -3
  19. package/esm2022/admin/components/admin-classes/store/admin-class.effects.mjs +14 -13
  20. package/esm2022/admin/components/admin-dataset/admin-dataset.component.mjs +3 -3
  21. package/esm2022/admin/components/admin-dataset/admin-form-dataset/admin-form-dataset.component.mjs +3 -3
  22. package/esm2022/admin/components/admin-dataset/store/admin-dataset.effects.mjs +7 -8
  23. package/esm2022/admin/components/admin-environment/store/environment.effects.mjs +2 -2
  24. package/esm2022/admin/components/admin-fields/admin-fields-edit/admin-fields-edit.component.mjs +2 -2
  25. package/esm2022/admin/components/admin-fields/admin-fields-form/admin-fields-form.component.mjs +2 -2
  26. package/esm2022/admin/components/admin-fields/admin-fields.component.mjs +4 -4
  27. package/esm2022/admin/components/admin-fields/store/fields.effects.mjs +7 -10
  28. package/esm2022/admin/components/admin-links/admin-links-new/admin-links-new.component.mjs +3 -3
  29. package/esm2022/admin/components/admin-links/admin-links.component.mjs +3 -3
  30. package/esm2022/admin/components/admin-links/store/links.effects.mjs +2 -2
  31. package/esm2022/admin/components/admin-menu/admin-menu.component.mjs +2 -2
  32. package/esm2022/admin/components/admin-metadata/admin-metadata.component.mjs +2 -2
  33. package/esm2022/admin/components/admin-metadata-rules/store/metadata-rules.effects.mjs +2 -2
  34. package/esm2022/admin/components/admin-metadata-user/store/admin-metadata-user.effects.mjs +2 -2
  35. package/esm2022/admin/components/admin-predicates/store/predicates.effects.mjs +2 -2
  36. package/esm2022/admin/components/admin-relation-types/admin-relation-types.component.mjs +2 -2
  37. package/esm2022/admin/components/admin-user/store/admin-user.effects.mjs +2 -2
  38. package/esm2022/admin/components/shared/add-category-modal/add-category-modal.component.mjs +2 -2
  39. package/esm2022/admin/store/admin.effects.mjs +2 -2
  40. package/esm2022/components/metadata-editor/store/metadata.effects.mjs +2 -2
  41. package/esm2022/components/text-editor/component/text-editor.component.mjs +2 -2
  42. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +3 -4
  43. package/esm2022/dataset/components/dataset.component.mjs +4 -4
  44. package/esm2022/filters/autocomplete/autocomplete.component.mjs +4 -4
  45. package/esm2022/filters/number/number-filter.component.mjs +2 -2
  46. package/esm2022/filters/text/text-filter.component.mjs +2 -2
  47. package/esm2022/import/components/form/import-form.component.mjs +2 -2
  48. package/esm2022/import/components/list/import-list.component.mjs +2 -2
  49. package/esm2022/import/store/import.effects.mjs +2 -2
  50. package/esm2022/lib/core/components/select/select.component.mjs +2 -2
  51. package/esm2022/lib/core/components/share/access-rights-share-modal/access-rights-share-modal.component.mjs +3 -3
  52. package/esm2022/lib/core/components/snackbar/snackbar.service.mjs +2 -2
  53. package/esm2022/lib/core/components/upload/upload.component.mjs +2 -2
  54. package/esm2022/lib/core/errors/http-error-interceptor.service.mjs +2 -2
  55. package/esm2022/lib/core/model/filter.interface.mjs +1 -1
  56. package/esm2022/lib/core/model/search-mono-class.model.mjs +1 -1
  57. package/esm2022/lib/core/public-api.mjs +3 -1
  58. package/esm2022/lib/core/store/aggregation/backend-aggregation.service.mjs +3 -4
  59. package/esm2022/lib/core/store/category/category.actions.mjs +3 -3
  60. package/esm2022/lib/core/store/category/category.effects.mjs +10 -6
  61. package/esm2022/lib/core/store/class/class.actions.mjs +3 -3
  62. package/esm2022/lib/core/store/class/class.effects.mjs +10 -6
  63. package/esm2022/lib/core/store/config/config.actions.mjs +2 -2
  64. package/esm2022/lib/core/store/config/config.effects.mjs +13 -8
  65. package/esm2022/lib/core/store/config/open-map-tiles.service.mjs +2 -2
  66. package/esm2022/lib/core/store/data-source/data-source.actions.mjs +8 -8
  67. package/esm2022/lib/core/store/data-source/data-source.effects.mjs +21 -21
  68. package/esm2022/lib/core/store/field/field.actions.mjs +3 -3
  69. package/esm2022/lib/core/store/field/field.effects.mjs +10 -6
  70. package/esm2022/lib/core/store/image/image.effects.mjs +2 -2
  71. package/esm2022/lib/core/store/item/item.actions.mjs +1 -1
  72. package/esm2022/lib/core/store/item/item.effects.mjs +3 -3
  73. package/esm2022/lib/core/store/item/item.service.mjs +8 -9
  74. package/esm2022/lib/core/store/relation-types/relation-types.actions.mjs +4 -4
  75. package/esm2022/lib/core/store/relation-types/relation-types.effects.mjs +11 -10
  76. package/esm2022/lib/core/store/search/search.actions.mjs +1 -1
  77. package/esm2022/lib/core/store/search/search.effects.mjs +3 -2
  78. package/esm2022/lib/core/store/search/search.selectors.mjs +3 -1
  79. package/esm2022/lib/core/store/search/search.service.mjs +4 -9
  80. package/esm2022/lib/dashboard/action-bus/effect/action-bus.effects.mjs +2 -2
  81. package/esm2022/lib/dashboard/components/context-menu/context-menu.component.mjs +2 -2
  82. package/esm2022/lib/dashboard/components/context-menu/object-edition/object-edition.component.mjs +2 -2
  83. package/esm2022/lib/dashboard/components/dashboard.component.mjs +8 -9
  84. package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-list/datasource-list.component.mjs +3 -4
  85. package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-selector.component.mjs +2 -2
  86. package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-instanciator.component.mjs +2 -2
  87. package/esm2022/lib/dashboard/filter/components/filter-group/filter-group.component.mjs +3 -3
  88. package/esm2022/lib/dashboard/store/dashboard.effects.mjs +2 -2
  89. package/esm2022/lib/dashboard/store/manifest.service.mjs +2 -2
  90. package/esm2022/lib/dashboard/store/refresh.service.mjs +2 -2
  91. package/esm2022/lib/dashboard/store/wms.service.mjs +2 -2
  92. package/esm2022/notification/components/notification/content/notification-content.component.mjs +2 -2
  93. package/esm2022/pipeline/components/pipeline-editor/pipeline-editor.component.mjs +3 -5
  94. package/esm2022/pipeline/factory/pipeline-component-factory.service.mjs +2 -2
  95. package/esm2022/pipeline/store/pipeline.effects.mjs +2 -2
  96. package/esm2022/pipeline-components/input-datasource/component/input-datasource.component.mjs +2 -3
  97. package/esm2022/pipeline-components/input-datasource/input-datasource.module.mjs +2 -2
  98. package/esm2022/pipeline-components/output-dataset/component/output-dataset.component.mjs +2 -2
  99. package/esm2022/pipeline-components/output-dataset/output-dataset.module.mjs +2 -2
  100. package/esm2022/restitution/components/restitution/restitution.component.mjs +5 -5
  101. package/esm2022/search/search-fulltext/store/search-fulltext.effects.mjs +2 -2
  102. package/esm2022/search/search-home/search-home.component.mjs +3 -4
  103. package/esm2022/search/search-mono-class/components/search-mono-class/search-mono-class.component.mjs +2 -2
  104. package/esm2022/search/search-mono-class/components/search-order/search-order.component.mjs +2 -2
  105. package/esm2022/search/search-mono-class/components/search-select-attribute/search-select-attribute.component.mjs +1 -1
  106. package/esm2022/search/search-mono-class/store/search-mono-class.effects.mjs +2 -2
  107. package/esm2022/search/search-multi-class/store/search-multi-class.effects.mjs +2 -2
  108. package/esm2022/search/search-tools/search-tools.component.mjs +5 -6
  109. package/esm2022/toolbox/components/filter-settings/filter-settings.component.mjs +2 -2
  110. package/esm2022/toolbox/components/named-query/named-query.component.mjs +2 -2
  111. package/esm2022/toolbox/components/select-grid-layout/select-grid-layout.component.mjs +2 -2
  112. package/esm2022/toolbox/components/toolbox.component.mjs +2 -2
  113. package/esm2022/tooltips/attribute/attribute-tooltip.component.mjs +2 -2
  114. package/esm2022/widgets/widget-analytic/component/widget-analytic.component.mjs +2 -2
  115. package/esm2022/widgets/widget-chart/component/widget-chart.component.mjs +2 -2
  116. package/esm2022/widgets/widget-detail/component/widget-detail.component.mjs +2 -2
  117. package/esm2022/widgets/widget-graph/component/widget-graph.component.mjs +10 -13
  118. package/esm2022/widgets/widget-image/component/widget-image.component.mjs +2 -2
  119. package/esm2022/widgets/widget-table/component/widget-table.component.mjs +3 -3
  120. package/esm2022/widgets/widget-table/get-value/get-value.pipe.mjs +2 -2
  121. package/esm2022/widgets/widget-table/resizable/resizable.directive.mjs +2 -2
  122. package/esm2022/widgets/widget-template/component/widget-template.component.mjs +2 -2
  123. package/esm2022/widgets/widget-tile/component/widget-tile.component.mjs +2 -2
  124. package/esm2022/widgets/widget-vega/component/widget-vega.component.mjs +2 -2
  125. package/fesm2022/provoly-dashboard-admin.mjs +121 -123
  126. package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
  127. package/fesm2022/provoly-dashboard-components-metadata-editor.mjs +12 -13
  128. package/fesm2022/provoly-dashboard-components-metadata-editor.mjs.map +1 -1
  129. package/fesm2022/provoly-dashboard-components-text-editor.mjs +1 -2
  130. package/fesm2022/provoly-dashboard-components-text-editor.mjs.map +1 -1
  131. package/fesm2022/provoly-dashboard-dataset.mjs +5 -6
  132. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  133. package/fesm2022/provoly-dashboard-filters-autocomplete.mjs +3 -3
  134. package/fesm2022/provoly-dashboard-filters-autocomplete.mjs.map +1 -1
  135. package/fesm2022/provoly-dashboard-filters-number.mjs +1 -2
  136. package/fesm2022/provoly-dashboard-filters-number.mjs.map +1 -1
  137. package/fesm2022/provoly-dashboard-filters-text.mjs +1 -2
  138. package/fesm2022/provoly-dashboard-filters-text.mjs.map +1 -1
  139. package/fesm2022/provoly-dashboard-import.mjs +5 -6
  140. package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
  141. package/fesm2022/provoly-dashboard-notification.mjs +3 -4
  142. package/fesm2022/provoly-dashboard-notification.mjs.map +1 -1
  143. package/fesm2022/provoly-dashboard-pipeline-components-input-datasource.mjs +2 -3
  144. package/fesm2022/provoly-dashboard-pipeline-components-input-datasource.mjs.map +1 -1
  145. package/fesm2022/provoly-dashboard-pipeline-components-output-dataset.mjs +2 -2
  146. package/fesm2022/provoly-dashboard-pipeline-components-output-dataset.mjs.map +1 -1
  147. package/fesm2022/provoly-dashboard-pipeline.mjs +16 -18
  148. package/fesm2022/provoly-dashboard-pipeline.mjs.map +1 -1
  149. package/fesm2022/provoly-dashboard-restitution.mjs +4 -4
  150. package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
  151. package/fesm2022/provoly-dashboard-search.mjs +19 -20
  152. package/fesm2022/provoly-dashboard-search.mjs.map +1 -1
  153. package/fesm2022/provoly-dashboard-toolbox.mjs +3 -4
  154. package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
  155. package/fesm2022/provoly-dashboard-tooltips-attribute.mjs +1 -2
  156. package/fesm2022/provoly-dashboard-tooltips-attribute.mjs.map +1 -1
  157. package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs +1 -2
  158. package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs.map +1 -1
  159. package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs +1 -2
  160. package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs.map +1 -1
  161. package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs +1 -2
  162. package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs.map +1 -1
  163. package/fesm2022/provoly-dashboard-widgets-widget-graph.mjs +8 -12
  164. package/fesm2022/provoly-dashboard-widgets-widget-graph.mjs.map +1 -1
  165. package/fesm2022/provoly-dashboard-widgets-widget-image.mjs +1 -1
  166. package/fesm2022/provoly-dashboard-widgets-widget-image.mjs.map +1 -1
  167. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs +2 -3
  168. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs.map +1 -1
  169. package/fesm2022/provoly-dashboard-widgets-widget-template.mjs +1 -2
  170. package/fesm2022/provoly-dashboard-widgets-widget-template.mjs.map +1 -1
  171. package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs +1 -2
  172. package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs.map +1 -1
  173. package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +1 -2
  174. package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
  175. package/fesm2022/provoly-dashboard.mjs +986 -981
  176. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  177. package/lib/core/model/filter.interface.d.ts +1 -0
  178. package/lib/core/model/search-mono-class.model.d.ts +4 -2
  179. package/lib/core/public-api.d.ts +2 -0
  180. package/lib/core/store/category/category.actions.d.ts +7 -3
  181. package/lib/core/store/category/category.effects.d.ts +4 -2
  182. package/lib/core/store/class/class.actions.d.ts +7 -3
  183. package/lib/core/store/class/class.effects.d.ts +4 -2
  184. package/lib/core/store/config/config.actions.d.ts +5 -1
  185. package/lib/core/store/config/config.effects.d.ts +12 -4
  186. package/lib/core/store/data-source/data-source.actions.d.ts +23 -11
  187. package/lib/core/store/data-source/data-source.effects.d.ts +23 -15
  188. package/lib/core/store/field/field.actions.d.ts +7 -3
  189. package/lib/core/store/field/field.effects.d.ts +4 -2
  190. package/lib/core/store/item/item.actions.d.ts +4 -0
  191. package/lib/core/store/item/item.service.d.ts +1 -5
  192. package/lib/core/store/relation-types/relation-types.actions.d.ts +9 -5
  193. package/lib/core/store/relation-types/relation-types.effects.d.ts +8 -6
  194. package/lib/core/store/search/search.actions.d.ts +2 -0
  195. package/lib/core/store/search/search.selectors.d.ts +5 -0
  196. package/lib/core/store/search/search.service.d.ts +1 -1
  197. package/package.json +31 -31
  198. package/search/search-mono-class/store/search-mono-class.effects.d.ts +1 -1
  199. package/widgets/widget-graph/component/widget-graph.component.d.ts +2 -5
@@ -3,7 +3,7 @@ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
3
3
  import * as i3 from '@angular/common';
4
4
  import { CommonModule, AsyncPipe, DOCUMENT } from '@angular/common';
5
5
  import * as i1$1 from '@angular/common/http';
6
- import { HttpHeaders, HttpUrlEncodingCodec, HttpParams, HttpClientModule } from '@angular/common/http';
6
+ import { HttpHeaders, HttpParams, HttpUrlEncodingCodec, HttpClientModule } from '@angular/common/http';
7
7
  import * as i0 from '@angular/core';
8
8
  import { InjectionToken, Injectable, Directive, Optional, Inject, Input, Component, Pipe, ChangeDetectionStrategy, HostBinding, NgModule, Injector, EventEmitter, Output, TemplateRef, ViewChild, SecurityContext, ContentChildren, forwardRef, HostListener, ViewContainerRef, ViewChildren, ViewEncapsulation, createNgModule } from '@angular/core';
9
9
  import * as i2 from '@angular/router';
@@ -12,13 +12,12 @@ import * as i1$2 from '@ngrx/effects';
12
12
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
13
13
  import * as i1 from '@ngrx/store';
14
14
  import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
15
- import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, mergeMap, from as from$1, forkJoin, catchError as catchError$1, startWith, throwError, take, withLatestFrom as withLatestFrom$1, tap as tap$1, combineLatestWith, merge, distinctUntilChanged as distinctUntilChanged$1, groupBy, EMPTY, share, ReplaySubject, delay, fromEvent, auditTime, interval } from 'rxjs';
15
+ import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, distinctUntilChanged, mergeMap, from as from$1, withLatestFrom, catchError, forkJoin, startWith, tap, throwError, take, combineLatestWith, merge, groupBy, EMPTY, share, ReplaySubject, delay, fromEvent, auditTime, interval } from 'rxjs';
16
16
  import * as i3$1 from '@angular/platform-browser';
17
17
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
18
18
  import * as i3$2 from '@angular/cdk/a11y';
19
19
  import { A11yModule } from '@angular/cdk/a11y';
20
20
  import equal from 'fast-deep-equal/es6';
21
- import { distinctUntilChanged, filter as filter$1, debounceTime as debounceTime$1, mergeMap as mergeMap$1, map as map$1, catchError, withLatestFrom, tap, delay as delay$1 } from 'rxjs/operators';
22
21
  import { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';
23
22
  import { Style, Icon } from 'ol/style';
24
23
  import { createEntityAdapter } from '@ngrx/entity';
@@ -1645,11 +1644,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
1645
1644
  }] });
1646
1645
 
1647
1646
  const DataSourceActions = {
1648
- load: createAction('[Datasource] load'),
1647
+ load: createAction('[Datasource] load', props()),
1649
1648
  namedQuery: {
1650
- load: createAction('[NamedQuery] load'),
1651
- loaded: createAction('[NamedQuery] loaded', props()),
1652
- failure: createAction('[NamedQuery] failure', props()),
1649
+ load: createAction('[NamedQuery] (bus) load', props()),
1650
+ loaded: createAction('[NamedQuery] (bus) loaded', props()),
1651
+ failure: createAction('[NamedQuery] (bus) failure', props()),
1653
1652
  post: createAction('[NamedQuery] post', props()),
1654
1653
  delete: createAction('[NamedQuery] delete', props()),
1655
1654
  addFavorite: createAction('[NamedQuery] add favorite', props()),
@@ -1662,9 +1661,9 @@ const DataSourceActions = {
1662
1661
  stopRename: createAction('[NamedQuery] stop rename')
1663
1662
  },
1664
1663
  dataset: {
1665
- loadDataset: createAction('[Dataset] load datasets'),
1666
- loadedDataset: createAction('[Dataset] loaded datasets', props()),
1667
- failure: createAction('[Dataset] failure effect Dataset', props()),
1664
+ loadDataset: createAction('[Dataset] (bus) load datasets', props()),
1665
+ loadedDataset: createAction('[Dataset] (bus) loaded datasets', props()),
1666
+ failure: createAction('[Dataset] (bus) failure effect Dataset', props()),
1668
1667
  listVersions: createAction('[Dataset] Get Dataset versions', props()),
1669
1668
  listVersionsSuccess: createAction('[Dataset] Get Dataset versions Success', props()),
1670
1669
  listVersionsFailure: createAction('[Dataset] Get Dataset versions Failure'),
@@ -1910,7 +1909,7 @@ const ConfigActions = {
1910
1909
  defineUrls: createAction('[Config] (bus) defining urls', props()),
1911
1910
  updateIcons: createAction('[Config] (bus) updating icons', props()),
1912
1911
  saveIcons: createAction('[Config] (bus) saving icons', props()),
1913
- loadCustomization: createAction('[Config] (bus) load all class customization'),
1912
+ loadCustomization: createAction('[Config] (bus) load all class customization', props()),
1914
1913
  loadedCustomization: createAction('[Config] (bus) customization loaded', props()),
1915
1914
  getMapStyles: createAction('[Config] get map styles'),
1916
1915
  defineMapStyles: createAction('[Config] (bus) defining map styles', props()),
@@ -2972,7 +2971,7 @@ class PryUploadComponent {
2972
2971
  asyncEmit(file) {
2973
2972
  const tmpSub = this.store
2974
2973
  .select(ImagesSelectors.lastAdded)
2975
- .pipe(filter$1((image) => !!image))
2974
+ .pipe(filter((image) => !!image))
2976
2975
  .subscribe((name) => {
2977
2976
  this.uploaded.emit(name);
2978
2977
  this.uploadedFile.emit(file);
@@ -3004,9 +3003,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
3004
3003
  }] } });
3005
3004
 
3006
3005
  const ClassActions = {
3007
- load: createAction('[Class] Load Classes'),
3006
+ load: createAction('[Class] (bus) Load Classes', props()),
3008
3007
  loadSuccess: createAction('[Class Api] (bus) Load Classes Success', props()),
3009
- loadFailure: createAction('[Class Api] Load Classes Failure', props()),
3008
+ loadFailure: createAction('[Class Api] (bus) Load Classes Failure', props()),
3010
3009
  loadDatasetCount: createAction('[Class Api] Load DatasetCount'),
3011
3010
  loadDatasetCountSuccess: createAction('[Class Api] Load DatasetCount Success', props()),
3012
3011
  loadDatasetCountFailure: createAction('[Class Api] Load DatasetCount Failure', props())
@@ -3377,44 +3376,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
3377
3376
  }] } });
3378
3377
 
3379
3378
  const CategoryActions = {
3380
- load: createAction('[Category] Load Categories'),
3379
+ load: createAction('[Category] (bus) Load Categories', props()),
3381
3380
  loadSuccess: createAction('[Category Api] (bus) Load Categories Success', props()),
3382
- loadFailure: createAction('[Category Api] Load Categories Failure', props())
3381
+ loadFailure: createAction('[Category Api] (bus) Load Categories Failure', props())
3383
3382
  };
3384
3383
 
3385
- class CategoryService {
3386
- constructor(httpClient, store) {
3387
- this.httpClient = httpClient;
3388
- this.store = store;
3389
- }
3390
- getCategories() {
3391
- return this.store
3392
- .select(ConfigSelectors.refUrl)
3393
- .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/categories`))));
3394
- }
3395
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3396
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, providedIn: 'root' }); }
3397
- }
3398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, decorators: [{
3399
- type: Injectable,
3400
- args: [{
3401
- providedIn: 'root'
3402
- }]
3403
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
3404
-
3405
- class CategoryEffects {
3406
- constructor(actions$, categoryService) {
3407
- this.actions$ = actions$;
3408
- this.categoryService = categoryService;
3409
- this.loadCategories$ = createEffect(() => this.actions$.pipe(ofType(CategoryActions.load), debounceTime$1(200), mergeMap$1((action) => this.categoryService.getCategories().pipe(map$1((categories) => CategoryActions.loadSuccess({ categories })), catchError((error) => [CategoryActions.loadFailure({ error: error })])))));
3410
- }
3411
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, deps: [{ token: i1$2.Actions }, { token: CategoryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3412
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects }); }
3413
- }
3414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, decorators: [{
3415
- type: Injectable
3416
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: CategoryService }] });
3417
-
3418
3384
  const categoriesFeatureKey = '@pry/model/categories';
3419
3385
  function sortByName$1(a, b) {
3420
3386
  return a.name.localeCompare(b.name);
@@ -3431,49 +3397,410 @@ function categoryReducer(state, action) {
3431
3397
  return internalReducer$2(state, action);
3432
3398
  }
3433
3399
 
3434
- class ClassService {
3435
- constructor(httpClient, store) {
3436
- this.httpClient = httpClient;
3437
- this.store = store;
3438
- }
3439
- /**
3440
- * Returns the list of business classes
3441
- */
3442
- getClasses() {
3443
- return this.store
3444
- .select(ConfigSelectors.refUrl)
3445
- .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class`))));
3446
- }
3447
- getDatasetCounts() {
3448
- return this.store
3449
- .select(ConfigSelectors.refUrl)
3450
- .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class/datasets/count`))));
3451
- }
3452
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3453
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, providedIn: 'root' }); }
3454
- }
3455
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, decorators: [{
3456
- type: Injectable,
3457
- args: [{
3458
- providedIn: 'root'
3459
- }]
3460
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
3400
+ const feature$5 = createFeatureSelector(categoriesFeatureKey);
3401
+ const entities$1 = createSelector(feature$5, selectEntities$1);
3402
+ const categories = createSelector(feature$5, selectAll$1);
3403
+ const CategorySelectors = {
3404
+ feature: feature$5,
3405
+ entities: entities$1,
3406
+ categories
3407
+ };
3461
3408
 
3462
- class ClassEffects {
3463
- constructor(actions$, classService) {
3464
- this.actions$ = actions$;
3465
- this.classService = classService;
3466
- this.loadClasses$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.load), debounceTime$1(200), mergeMap$1((action) => this.classService.getClasses().pipe(map$1((classes) => ClassActions.loadSuccess({ classes })), catchError((error) => [ClassActions.loadFailure({ error: error })])))));
3467
- this.loadDatasetCount$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.loadDatasetCount), mergeMap$1((action) => this.classService.getDatasetCounts().pipe(map$1((datasetCounts) => {
3468
- return ClassActions.loadDatasetCountSuccess({ datasetCounts: datasetCounts });
3469
- }), catchError((error) => [ClassActions.loadDatasetCountFailure({ error: error })])))));
3409
+ var DashboardGridLayout;
3410
+ (function (DashboardGridLayout) {
3411
+ DashboardGridLayout["FULL"] = "1";
3412
+ DashboardGridLayout["THIRD_VERTICAL"] = "1/3v";
3413
+ DashboardGridLayout["THIRD_HORIZONTAL"] = "1/3h";
3414
+ DashboardGridLayout["HALF_VERTICAL"] = "1/2v";
3415
+ DashboardGridLayout["HALF_HORIZONTAL"] = "1/2h";
3416
+ DashboardGridLayout["QUARTER"] = "1/4";
3417
+ DashboardGridLayout["MANUAL"] = "0";
3418
+ })(DashboardGridLayout || (DashboardGridLayout = {}));
3419
+
3420
+ var ViewMode;
3421
+ (function (ViewMode) {
3422
+ ViewMode["CATALOG"] = "catalog";
3423
+ ViewMode["CONSULT"] = "consult";
3424
+ ViewMode["CREATION"] = "creation";
3425
+ ViewMode["EDITION"] = "edition";
3426
+ ViewMode["EDITOR"] = "editor";
3427
+ ViewMode["SEARCH"] = "search";
3428
+ ViewMode["CUSTOM"] = "custom";
3429
+ })(ViewMode || (ViewMode = {}));
3430
+ const DashboardActions = {
3431
+ join: createAction('[Dashboard] joined', props()),
3432
+ leave: createAction('[Dashboard] leave', props()),
3433
+ updateManifest: createAction('[Dashboard] (bus) updating manifest', props()),
3434
+ updateManifestAfterFetch: createAction('[Dashboard] (bus) updating manifest after fetch', props()),
3435
+ updateManifestWithoutActivation: createAction('[Dashboard] (bus) updating manifest but do not activate it', props()),
3436
+ updateManifestAfterTenantJoin: createAction('[Dashboard] (bus) updating manifest after tenant join', props()),
3437
+ updateManifestAfterTenantLeave: createAction('[Dashboard] (bus) updating manifest after tenant leave', props()),
3438
+ selectPresentation: createAction('[Dashboard] (bus) selectPresentation', props()),
3439
+ setInitialPresentation: createAction('[Dashboard] (bus) set initial presentation', props()),
3440
+ declareSenderId: createAction('[Dashboard] self-updating manifest', props()),
3441
+ updateDashboardManifest: createAction('[Dashboard] updating dashboard view', props()),
3442
+ updateWidgetManifest: createAction('[Dashboard] updating widget view', props()),
3443
+ addWidgetToPresentation: createAction('[Dashboard] add widget to presentation', props()),
3444
+ updateWidgetInPresentation: createAction('[Dashboard] update widget in presentation', props()),
3445
+ requestAllRoutes: createAction('[Dashboard] (bus) requesting route update'),
3446
+ requestManifestsToEmit: createAction('[Dashboard] (bus) pre-save manifest, asking all widgets to emit'),
3447
+ updateRouteManifest: createAction('[Dashboard] (bus) updating route', props()),
3448
+ fetchManifestsList: createAction('[Dashboard] (bus) fetching available manifests'),
3449
+ setRefreshRate: createAction('[Dashboard] (bus) setting refreshRate', props()),
3450
+ updateManifestsList: createAction('[Dashboard] (bus) received manifests list', props()),
3451
+ fetchStaticManifest: createAction('[Dashboard] (bus) fetching staticManifest', props()),
3452
+ fetchMoreItems: createAction('[Dashboard] (bus) fetching more items', props()),
3453
+ endLoading: createAction('[Dashboard] end loading'),
3454
+ updateStaticManifest: createAction('[Dashboard] (bus) received staticManifest', props()),
3455
+ loadManifest: createAction('[Dashboard] (bus) load manifest', props()),
3456
+ loadAndActivateManifest: createAction('[Dashboard] (bus) load and activate manifest', props()),
3457
+ downloadManifest: createAction('[Dashboard] download manifest', props()),
3458
+ confirmManifestDeletion: createAction('[Dashboard] confirm manifest deletion', props()),
3459
+ deleteManifest: createAction('[Dashboard] deleting manifest', props()),
3460
+ saveManifest: createAction('[Dashboard] save manifest', props()),
3461
+ solveCollisions: createAction('[Dashboard] solving collisions'),
3462
+ clearManifest: createAction('[Dashboard] clear manifest'),
3463
+ followManifestRoute: createAction('[Dashboard] (bus) follow manifest route'),
3464
+ moveWidget: createAction('[Dashboard] moving widget', props()),
3465
+ maximizeWidget: createAction('[Dashboard] maximize widget', props()),
3466
+ assertResultSets: createAction('[Dashboard] assert resultSet', props()),
3467
+ updateResultSet: createAction('[Dashboard] (bus) received named resultSet (not-active-action)', props()),
3468
+ addRelationsToResultSets: createAction('[Dashboard] (bus) add relations to resultSet', props()),
3469
+ removeRelationsFromResultSets: createAction('[Dashboard] (bus) remove relations from resultSet', props()),
3470
+ addItemToResultSets: createAction('[Dashboard] (bus) add item to resultSet', props()),
3471
+ startingMissingViews: createAction('[Dashboard] opening missing views for manifest'),
3472
+ setAvailableNamedQueries: createAction('[Dashboard] (bus) set available rs names', props()),
3473
+ setDefaultDatasource: createAction('[Dashboard] set current rs name', props()),
3474
+ updateDashboardParams: createAction('[Dashboard] set dashboard cell params', props()),
3475
+ toggleEditionMode: createAction('[Dashboard] toggle edition mode', props()),
3476
+ select: createAction('[Dashboard] (bus) select item', props()),
3477
+ selectMany: createAction('[Dashboard] (bus) select items', props()),
3478
+ invertSelection: createAction('[Dashboard] (bus) invert selection'),
3479
+ fetchObjectsDetails: createAction('[Dashboard] fetch objects details', props()),
3480
+ updateObjectsDetails: createAction('[Dashboard] (bus) update objects details', props()),
3481
+ explore: createAction('[Dashboard] (bus) isolate in data set', props()),
3482
+ detail: createAction('[Dashboard] (bus) add detail view', props()),
3483
+ proximity: createAction('[Dashboard] proximity search', props()),
3484
+ multiSnackBar: createAction('[Dashboard] (bus) display snack message', props()),
3485
+ quickOrder: createAction('[Dashboard] (bus) quick order', props()),
3486
+ setGridLayout: createAction('[Dashboard] set grid layout', props()),
3487
+ propagateGridLayout: createAction('[Dashboard] (bus) change grid layout', props()),
3488
+ createTab: createAction('[Dashboard] (bus) create new tab'),
3489
+ restoreInitialManifest: createAction('[Dashboard] (bus) restoring missing tabs'),
3490
+ setFilters: createAction('[Dashboard] (bus) set datasource filters', props()),
3491
+ updateFilters: createAction('[Dashboard] (bus) update datasource filters', props()),
3492
+ removeFilter: createAction('[Dashboard] (bus) remove filter in presentation', props()),
3493
+ removeFilters: createAction('[Dashboard] (bus) remove filters'),
3494
+ updateFilterValue: createAction('[Dashboard] (bus) update filter value', props()),
3495
+ clearAllFilterValues: createAction('[Dashboard] (bus) clear all filter values'),
3496
+ dispatchFilters: createAction('[Dashboard] (bus) apply filters to presentation datasources', props()),
3497
+ resetWmsFeatures: createAction('[Widget map] Reset Wms layer features', props()),
3498
+ getWmsFeatures: createAction('[Widget map] Get Wms layer features', props()),
3499
+ addWmsFeatures: createAction('[Widget map] Set Wms layer features', props()),
3500
+ getWfsFeatures: createAction('[Widget map] Get wfs Features for point', props()),
3501
+ getWfsFeaturesForPointStackTooltips: createAction('[Widget map] Get wfs Features for showing stack tooltips', props()),
3502
+ updateDisplayOptions: createAction('[Dashboard/Display] (bus) Update displayed dashboard management features', props()),
3503
+ getCapability: createAction('[Widget map] Get Wms capability', props()),
3504
+ updateCapability: createAction('[Widget map] Store Wms capability', props()),
3505
+ addManifestMetadata: createAction('[Dashboard] Add manifest metadata', props()),
3506
+ deleteManifestMetadata: createAction('[Dashboard] Delete manifest metadata', props()),
3507
+ triggerAggregate: createAction('[Dashboard] (bus) Triggering aggregates for datasource', props()),
3508
+ loadPresentation: createAction('[Dashboard] load presentation', props())
3509
+ };
3510
+
3511
+ const BASE_DISPLAY_OPTIONS = {
3512
+ presentationTitle: true,
3513
+ search: false,
3514
+ catalog: false,
3515
+ useFilters: false,
3516
+ toolbox: {
3517
+ edit_action: false,
3518
+ save_view: false,
3519
+ save_view_as: false,
3520
+ filter_settings: false,
3521
+ new_tab: false,
3522
+ clear_view: false,
3523
+ default_size: false,
3524
+ refresh_datasets: false,
3525
+ automate_refresh: false,
3526
+ edit_presentation_content: false,
3527
+ share: false,
3528
+ delete: false,
3529
+ dashboard_details: false,
3530
+ edit_presentation: false
3531
+ },
3532
+ edit_toggle: false,
3533
+ widgetContextMenu: {
3534
+ datasourceSelection: true,
3535
+ parameters: true,
3536
+ window: true,
3537
+ maximize: true,
3538
+ addToCatalog: true,
3539
+ delete: true,
3540
+ changeSpot: true
3541
+ }
3542
+ };
3543
+ function getDisplayOptions(mode) {
3544
+ switch (mode) {
3545
+ case ViewMode.CONSULT:
3546
+ return {
3547
+ ...BASE_DISPLAY_OPTIONS,
3548
+ useFilters: true,
3549
+ toolbox: {
3550
+ ...BASE_DISPLAY_OPTIONS.toolbox,
3551
+ save_view_as: true,
3552
+ refresh_datasets: true,
3553
+ edit_presentation_content: true,
3554
+ share: true,
3555
+ delete: true,
3556
+ dashboard_details: true,
3557
+ edit_presentation: true
3558
+ },
3559
+ widgetContextMenu: false
3560
+ };
3561
+ case ViewMode.SEARCH:
3562
+ return {
3563
+ ...BASE_DISPLAY_OPTIONS,
3564
+ presentationTitle: false,
3565
+ search: true,
3566
+ toolbox: { ...BASE_DISPLAY_OPTIONS.toolbox, clear_view: true, default_size: true, refresh_datasets: true },
3567
+ edit_toggle: true
3568
+ };
3569
+ case ViewMode.EDITION:
3570
+ case ViewMode.CREATION:
3571
+ return {
3572
+ ...BASE_DISPLAY_OPTIONS,
3573
+ catalog: true,
3574
+ useFilters: true,
3575
+ toolbox: {
3576
+ edit_action: false,
3577
+ save_view: true,
3578
+ save_view_as: true,
3579
+ filter_settings: true,
3580
+ new_tab: true,
3581
+ clear_view: true,
3582
+ default_size: true,
3583
+ refresh_datasets: true,
3584
+ automate_refresh: true,
3585
+ edit_presentation_content: false,
3586
+ share: true,
3587
+ delete: false,
3588
+ dashboard_details: true,
3589
+ edit_presentation: true
3590
+ },
3591
+ edit_toggle: true,
3592
+ widgetContextMenu: true
3593
+ };
3594
+ default:
3595
+ return BASE_DISPLAY_OPTIONS;
3470
3596
  }
3471
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, deps: [{ token: i1$2.Actions }, { token: ClassService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3472
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects }); }
3473
3597
  }
3474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, decorators: [{
3475
- type: Injectable
3476
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: ClassService }] });
3598
+
3599
+ const NEW_WINDOW_TARGET = -1;
3600
+ const feature$4 = createFeatureSelector('@pry/dashboard');
3601
+ const manifests = createSelector(feature$4, (state) => state?.manifests);
3602
+ const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf(manifests.sender));
3603
+ const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
3604
+ const globalManifest = createSelector(manifests,
3605
+ // @ts-ignore
3606
+ (manifests) => ({ windows: [], ...manifests?.manifest }) ?? { windows: [] });
3607
+ const staticManifest = createSelector(manifests,
3608
+ // @ts-ignore
3609
+ (manifests) => ({ windows: [], ...manifests?.staticManifest }) ?? { windows: [] });
3610
+ const loading = createSelector(manifests, (manifests) => !!manifests?.loading);
3611
+ const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
3612
+ const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
3613
+ const gridLayout = createSelector(windowManifest, (manifest) => ((manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL));
3614
+ const memoizeWidgetManifest = {};
3615
+ const widgetManifest = (index) => {
3616
+ if (!memoizeWidgetManifest[index]) {
3617
+ memoizeWidgetManifest[index] = createSelector(windowManifest, (windowManifest) => windowManifest.widgets[index] ??
3618
+ {
3619
+ type: 'placeholder',
3620
+ layout: { x: 1, y: 1, width: 1, height: 1 }
3621
+ });
3622
+ }
3623
+ return memoizeWidgetManifest[index];
3624
+ };
3625
+ const manifestsList = createSelector(manifests, (manifests) => manifests.list);
3626
+ const tenants = createSelector(manifests, (manifests) => manifests.tenants ?? []);
3627
+ const targetTenantsIndexes = createSelector(manifests, rank, (manifests, rank) => [
3628
+ NEW_WINDOW_TARGET,
3629
+ ...(manifests.tenants ?? []).map((ten, idx) => idx).filter((idx) => idx !== rank)
3630
+ ]);
3631
+ const results = createSelector(feature$4, (state) => state?.results);
3632
+ const resultSets = createSelector(results, (results) => results.resultSets ?? {});
3633
+ const resultSetsParams = createSelector(results, (results) => results.resultSetsParams ?? {});
3634
+ const namedQueriesNames = createSelector(resultSets, (state) => Object.keys(state) ?? []);
3635
+ const availableNamedQueries = createSelector(results, (results) => {
3636
+ return [...new Set([...results.availableDatasourceNames, ...Object.keys(results.resultSets)])];
3637
+ });
3638
+ const defaultDatasourceNames = createSelector(results, (results) => results.defaultDatasource ?? 'current');
3639
+ const selectedItemIds = createSelector(results, (results) => results.selectedItems ?? []);
3640
+ const objectDetails = createSelector(results, (results) => results.objectDetails ?? {});
3641
+ const quickOrder = createSelector(results, (results) => results.quickOrder ?? {});
3642
+ const allItems = createSelector(results, (results) => Object.keys(results.resultSets)
3643
+ .map((rsKey) => Object.keys(results.resultSets[rsKey].items)
3644
+ .map((classKey) => results.resultSets[rsKey].items[classKey])
3645
+ .reduce((p, c) => [...p, ...c], []))
3646
+ .reduce((p, c) => [...p, ...c], []));
3647
+ const getItemsByIds = (ids) => createSelector(allItems, (items) => items.filter((item) => ids.includes(item.id)));
3648
+ const selectedItems = createSelector(selectedItemIds, allItems, (itemNames, allItems) => itemNames.map((name) => allItems.find((it) => it.id === name)) ?? []);
3649
+ const dashboard = createSelector(feature$4, (state) => state?.dashboard ?? {});
3650
+ const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.params ?? {});
3651
+ const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
3652
+ const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
3653
+ .map((window, idx) => ({ windowIndex: idx, widgets: window.widgets }))
3654
+ .map(({ windowIndex, widgets }) => (widgets ?? []).map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
3655
+ .filter((rsName) => rsName !== undefined)
3656
+ .map((rsName) => ({
3657
+ rsName,
3658
+ windowIndex,
3659
+ type: widget.type,
3660
+ layout: widget.layout
3661
+ }))))
3662
+ .reduce((p, c) => [...p, ...c], [])
3663
+ .reduce((p, c) => [...p, ...c], [])
3664
+ .reduce((p, c) => ({ ...p, [c.rsName ?? '']: [...(p[c.rsName ?? ''] || []), { ...c }] }), {}));
3665
+ const presentation = createSelector(feature$4, (state) => state?.presentation);
3666
+ const isCurrentPresentationModified = createSelector(presentation, globalManifest, (state, global) => !equal(global, state.initial));
3667
+ const currentManifest = createSelector(feature$4, (state) => state?.presentation.current);
3668
+ const filters = createSelector(feature$4, (state) => state?.manifests.manifest.filters ?? []);
3669
+ const datasourceFilters = createSelector(feature$4, (state) => state?.manifests.manifest.filters
3670
+ ? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
3671
+ attribute: attribute.id,
3672
+ operator: filter.operator ?? '',
3673
+ value: filter.value,
3674
+ type: filter.type
3675
+ })),
3676
+ obj), {})
3677
+ : {});
3678
+ const memoizeFeatures = {};
3679
+ const wmsFeatures = (componentId) => {
3680
+ if (!memoizeFeatures[componentId]) {
3681
+ memoizeFeatures[componentId] = createSelector(feature$4, (state) => state.wmsFeatures[componentId] ?? []);
3682
+ }
3683
+ return memoizeFeatures[componentId];
3684
+ };
3685
+ const displayOptions = createSelector(feature$4, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
3686
+ const capabilities = createSelector(feature$4, (state) => state?.capabilities);
3687
+ const DashboardSelectors = {
3688
+ feature: feature$4,
3689
+ rank,
3690
+ currentManifestId,
3691
+ globalManifest,
3692
+ refreshRates,
3693
+ windowManifest,
3694
+ widgetManifest,
3695
+ manifestsList,
3696
+ gridLayout,
3697
+ tenants,
3698
+ resultSets,
3699
+ resultSetsParams,
3700
+ namedQueriesNames,
3701
+ namedQueriesUses,
3702
+ availableNamedQueries,
3703
+ defaultDatasourceNames,
3704
+ selectedItemIds,
3705
+ allItems,
3706
+ getItemsByIds,
3707
+ selectedItems,
3708
+ objectDetails,
3709
+ targetTenantsIndexes,
3710
+ dashboard,
3711
+ dashboardCellParams,
3712
+ dashboardEditionMode,
3713
+ staticManifest,
3714
+ loading,
3715
+ quickOrder,
3716
+ presentation,
3717
+ currentManifest,
3718
+ filters,
3719
+ isCurrentPresentationModified,
3720
+ datasourceFilters,
3721
+ wmsFeatures,
3722
+ displayOptions,
3723
+ capabilities
3724
+ };
3725
+
3726
+ class CategoryService {
3727
+ constructor(httpClient, store) {
3728
+ this.httpClient = httpClient;
3729
+ this.store = store;
3730
+ }
3731
+ getCategories() {
3732
+ return this.store
3733
+ .select(ConfigSelectors.refUrl)
3734
+ .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/categories`))));
3735
+ }
3736
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3737
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, providedIn: 'root' }); }
3738
+ }
3739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryService, decorators: [{
3740
+ type: Injectable,
3741
+ args: [{
3742
+ providedIn: 'root'
3743
+ }]
3744
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
3745
+
3746
+ class CategoryEffects {
3747
+ constructor(actions$, categoryService, store) {
3748
+ this.actions$ = actions$;
3749
+ this.categoryService = categoryService;
3750
+ this.store = store;
3751
+ this.loadCategories$ = createEffect(() => this.actions$.pipe(ofType(CategoryActions.load), withLatestFrom(this.store.select(CategorySelectors.categories), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, categories, rank]) => (action.force || categories.length === 0) && rank === 0), mergeMap((action) => this.categoryService.getCategories().pipe(map((categories) => CategoryActions.loadSuccess({ categories })), catchError((error) => [CategoryActions.loadFailure({ error: error })])))));
3752
+ }
3753
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, deps: [{ token: i1$2.Actions }, { token: CategoryService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3754
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects }); }
3755
+ }
3756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: CategoryEffects, decorators: [{
3757
+ type: Injectable
3758
+ }], ctorParameters: () => [{ type: i1$2.Actions }, { type: CategoryService }, { type: i1.Store }] });
3759
+
3760
+ class ClassService {
3761
+ constructor(httpClient, store) {
3762
+ this.httpClient = httpClient;
3763
+ this.store = store;
3764
+ }
3765
+ /**
3766
+ * Returns the list of business classes
3767
+ */
3768
+ getClasses() {
3769
+ return this.store
3770
+ .select(ConfigSelectors.refUrl)
3771
+ .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class`))));
3772
+ }
3773
+ getDatasetCounts() {
3774
+ return this.store
3775
+ .select(ConfigSelectors.refUrl)
3776
+ .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/model/class/datasets/count`))));
3777
+ }
3778
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3779
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, providedIn: 'root' }); }
3780
+ }
3781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassService, decorators: [{
3782
+ type: Injectable,
3783
+ args: [{
3784
+ providedIn: 'root'
3785
+ }]
3786
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
3787
+
3788
+ class ClassEffects {
3789
+ constructor(actions$, classService, store) {
3790
+ this.actions$ = actions$;
3791
+ this.classService = classService;
3792
+ this.store = store;
3793
+ this.loadClasses$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.load), withLatestFrom(this.store.select(ClassSelectors.classes), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, classes, rank]) => (action.force || classes.length === 0) && rank === 0), mergeMap(() => this.classService.getClasses().pipe(map((classes) => ClassActions.loadSuccess({ classes })), catchError((error) => [ClassActions.loadFailure({ error: error })])))));
3794
+ this.loadDatasetCount$ = createEffect(() => this.actions$.pipe(ofType(ClassActions.loadDatasetCount), mergeMap((action) => this.classService.getDatasetCounts().pipe(map((datasetCounts) => {
3795
+ return ClassActions.loadDatasetCountSuccess({ datasetCounts: datasetCounts });
3796
+ }), catchError((error) => [ClassActions.loadDatasetCountFailure({ error: error })])))));
3797
+ }
3798
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, deps: [{ token: i1$2.Actions }, { token: ClassService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
3799
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects }); }
3800
+ }
3801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ClassEffects, decorators: [{
3802
+ type: Injectable
3803
+ }], ctorParameters: () => [{ type: i1$2.Actions }, { type: ClassService }, { type: i1.Store }] });
3477
3804
 
3478
3805
  const SYMBOL_DOMAIN = 'symbol';
3479
3806
  const TABLE_ATTR_DOMAIN = 'tableAttr';
@@ -3537,7 +3864,7 @@ class ConfigService {
3537
3864
  * Get a list of all widgets from catalog
3538
3865
  */
3539
3866
  getAllWidgets() {
3540
- return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/widget/catalog`))), catchError$1((error) => {
3867
+ return this.store.select(ConfigSelectors.refUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/widget/catalog`))), catchError((error) => {
3541
3868
  if (error.error instanceof Error) {
3542
3869
  // A client-side or network error occurred
3543
3870
  if (ConfigService.warn) {
@@ -3566,7 +3893,7 @@ class ConfigService {
3566
3893
  }));
3567
3894
  }
3568
3895
  handleBackendVersion(url) {
3569
- return this.httpClient.get(encodeURI(url)).pipe(catchError$1(() => of({})));
3896
+ return this.httpClient.get(encodeURI(url)).pipe(catchError(() => of({})));
3570
3897
  }
3571
3898
  getAllVersions() {
3572
3899
  return combineLatest([
@@ -3582,7 +3909,7 @@ class ConfigService {
3582
3909
  this.handleBackendVersion(`${replay}/about/version`),
3583
3910
  this.handleBackendVersion(`${exec}/about/version`),
3584
3911
  this.handleBackendVersion(`${transfo}/about/version`),
3585
- this.httpClient.get(encodeURI(`/assets/pry.version`)).pipe(startWith({}), map((version) => (version ? { libVersion: version } : {})), catchError$1(() => of({})))
3912
+ this.httpClient.get(encodeURI(`/assets/pry.version`)).pipe(startWith({}), map((version) => (version ? { libVersion: version } : {})), catchError(() => of({})))
3586
3913
  ];
3587
3914
  return combineLatest(allVersions).pipe(map(([refVersion, dataVersion, replayVersion, execVersion, tranfoVersion, frontend]) => {
3588
3915
  const versions = {};
@@ -3621,7 +3948,7 @@ class OpenMapTilesService {
3621
3948
  this.pRegexp = new RegExp(/<p class="identifier">(.*?)<.p>/gm);
3622
3949
  }
3623
3950
  getStyles() {
3624
- return this.store.select(ConfigSelectors.mapUrl).pipe(filter$1((mapUrl) => !!mapUrl), mergeMap((url) => this.httpClient.get(encodeURI(`${url}`), { responseType: 'text' })), map((html) => {
3951
+ return this.store.select(ConfigSelectors.mapUrl).pipe(filter((mapUrl) => !!mapUrl), mergeMap((url) => this.httpClient.get(encodeURI(`${url}`), { responseType: 'text' })), map((html) => {
3625
3952
  const h3matches = html.match(this.h3Regexp);
3626
3953
  const pMatches = html.match(this.pRegexp);
3627
3954
  return (h3matches
@@ -3652,20 +3979,25 @@ class ConfigEffects {
3652
3979
  this.snackBar = snackBar;
3653
3980
  this.translateService = translateService;
3654
3981
  this.pryDialog = pryDialog;
3655
- this.mapStyles$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.getMapStyles), withLatestFrom(this.store.select(ConfigSelectors.mapStyles)), filter$1(([action, mapStyles]) => !mapStyles || mapStyles.length === 0), mergeMap$1(([action]) => this.openMapTilesService.getStyles().pipe(map$1((styles) => ConfigActions.defineMapStyles({ styles }))))));
3656
- this.saveIconDefinitions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveIcons), mergeMap$1((action) => this.configService
3982
+ this.mapStyles$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.getMapStyles), withLatestFrom(this.store.select(ConfigSelectors.mapStyles)), filter(([action, mapStyles]) => !mapStyles || mapStyles.length === 0), mergeMap(([action]) => this.openMapTilesService.getStyles().pipe(map((styles) => ConfigActions.defineMapStyles({ styles }))))));
3983
+ this.saveIconDefinitions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveIcons), mergeMap((action) => this.configService
3657
3984
  .saveDefinitions(action.definitions, SYMBOL_DOMAIN)
3658
- .pipe(map$1(() => ConfigActions.loadCustomization())))));
3659
- this.saveTableAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTableDefaultAttributes), mergeMap$1((action) => this.configService
3985
+ .pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
3986
+ this.saveTableAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTableDefaultAttributes), mergeMap((action) => this.configService
3660
3987
  .saveDefinitions(action.definitions, TABLE_ATTR_DOMAIN)
3661
- .pipe(map$1(() => ConfigActions.loadCustomization())))));
3662
- this.saveTileAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTileAttributes), mergeMap$1((action) => this.configService
3988
+ .pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
3989
+ this.saveTileAttributes$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTileAttributes), mergeMap((action) => this.configService
3663
3990
  .saveDefinitions(action.definitions, TILE_ATTR_DOMAIN)
3664
- .pipe(map$1(() => ConfigActions.loadCustomization())))));
3665
- this.saveTemplates$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTooltip), mergeMap$1((action) => this.configService
3991
+ .pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
3992
+ this.saveTemplates$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveTooltip), mergeMap((action) => this.configService
3666
3993
  .saveDefinitions(action.definitions, TOOLTIPS_DOMAIN)
3667
- .pipe(map$1(() => ConfigActions.loadCustomization())))));
3668
- this.getCustomization$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadCustomization), debounceTime(100), mergeMap$1((action) => this.configService.getAllClassParams().pipe(mergeMap$1((allDefinitions) => {
3994
+ .pipe(map(() => ConfigActions.loadCustomization({ force: true }))))));
3995
+ this.getCustomization$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadCustomization), withLatestFrom(this.store.select(ConfigSelectors.iconDefinitions), this.store.select(ConfigSelectors.tableDefaultAttributesDefinitions), this.store.select(ConfigSelectors.tooltipDefinitions), this.store.select(ConfigSelectors.tileAttributesDefinitions), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, iconsDef, tableDef, tooltipDef, tileDef, rank]) => (action.force ||
3996
+ (Object.keys(iconsDef).length === 0 &&
3997
+ Object.keys(tableDef).length === 0 &&
3998
+ Object.keys(tooltipDef).length === 1 &&
3999
+ Object.keys(tileDef).length === 0)) &&
4000
+ rank === 0), mergeMap((action) => this.configService.getAllClassParams().pipe(mergeMap((allDefinitions) => {
3669
4001
  const icons = allDefinitions
3670
4002
  .filter((def) => def.domain === SYMBOL_DOMAIN)
3671
4003
  .reduce((p, c) => ({
@@ -3698,10 +4030,10 @@ class ConfigEffects {
3698
4030
  }), {});
3699
4031
  return [ConfigActions.loadedCustomization({ icons, tableAttributes, tooltips, filters, tileAttributes })];
3700
4032
  })))));
3701
- this.saveWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveWidget), mergeMap$1((action) => this.configService.saveWidget(action.widget).pipe(tap(() => this.snackBar.open({
4033
+ this.saveWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.saveWidget), mergeMap((action) => this.configService.saveWidget(action.widget).pipe(tap(() => this.snackBar.open({
3702
4034
  message: this.translateService.instant('@pry.toolbox.catalog.saved', { viewId: action.widget.name }),
3703
4035
  type: 'success'
3704
- })), map$1(() => ConfigActions.loadWidgets()), catchError$1((error) => {
4036
+ })), map(() => ConfigActions.loadWidgets()), catchError((error) => {
3705
4037
  this.snackBar.open({
3706
4038
  message: this.translateService.instant('@pry.toolbox.catalog.saveErrorCode.' + +(error.error?.code ?? 'UNKNOWN'), {
3707
4039
  name: action.widget.name
@@ -3728,9 +4060,9 @@ class ConfigEffects {
3728
4060
  };
3729
4061
  this.pryDialog.open(PryDialogConfirmComponent, { data });
3730
4062
  })), { dispatch: false });
3731
- this.deleteRestitution$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.deleteRestitution), mergeMap$1((action) => this.configService.deleteRestitution(action.id).pipe(map$1(() => ConfigActions.loadWidgets())))));
3732
- this.loadWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadWidgets), mergeMap$1((action) => this.configService.getAllWidgets().pipe(map$1((widgets) => ConfigActions.loadedWidgets({ widgets }))))));
3733
- this.loadChartOption$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadChartOption), withLatestFrom(this.store.select(ConfigSelectors.chartOption)), map$1(([action, chartOptions]) => {
4063
+ this.deleteRestitution$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.deleteRestitution), mergeMap((action) => this.configService.deleteRestitution(action.id).pipe(map(() => ConfigActions.loadWidgets())))));
4064
+ this.loadWidget$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadWidgets), mergeMap((action) => this.configService.getAllWidgets().pipe(map((widgets) => ConfigActions.loadedWidgets({ widgets }))))));
4065
+ this.loadChartOption$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadChartOption), withLatestFrom(this.store.select(ConfigSelectors.chartOption)), map(([action, chartOptions]) => {
3734
4066
  const chartOption = {
3735
4067
  type: chartOptions.type ?? ChartOptionDefault.type,
3736
4068
  subType: chartOptions.subType ?? ChartOptionDefault.subType,
@@ -3739,10 +4071,10 @@ class ConfigEffects {
3739
4071
  };
3740
4072
  return ConfigActions.loadedChartOption({ chartOption });
3741
4073
  })));
3742
- this.loadVersions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadVersions), mergeMap$1((action) => this.configService.getAllVersions().pipe(map$1((versionsData) => {
4074
+ this.loadVersions$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadVersions), mergeMap((action) => this.configService.getAllVersions().pipe(map((versionsData) => {
3743
4075
  return ConfigActions.loadVersionsSuccess({ versions: versionsData });
3744
- }), catchError$1((error) => [ConfigActions.loadVersionsFailure({ error: error })])))));
3745
- this.loadAccessGroups$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadAccessGroups), withLatestFrom(this.store.select(ConfigSelectors.accessGroups)), filter$1(([_, groups]) => groups.length === 0), mergeMap$1((_) => this.configService.getAccessGroups().pipe(map$1((groups) => ConfigActions.loadAccessGroupsSuccess({ groups })), catchError$1((error) => {
4076
+ }), catchError((error) => [ConfigActions.loadVersionsFailure({ error: error })])))));
4077
+ this.loadAccessGroups$ = createEffect(() => this.actions$.pipe(ofType(ConfigActions.loadAccessGroups), withLatestFrom(this.store.select(ConfigSelectors.accessGroups)), filter(([_, groups]) => groups.length === 0), mergeMap((_) => this.configService.getAccessGroups().pipe(map((groups) => ConfigActions.loadAccessGroupsSuccess({ groups })), catchError((error) => {
3746
4078
  this.snackBar.open({
3747
4079
  message: error,
3748
4080
  type: 'error'
@@ -3764,360 +4096,43 @@ class ContextMenuEffects {
3764
4096
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, deps: [{ token: i1$2.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
3765
4097
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects }); }
3766
4098
  }
3767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, decorators: [{
3768
- type: Injectable
3769
- }], ctorParameters: () => [{ type: i1$2.Actions }] });
3770
-
3771
- const ContextMenuActions = {
3772
- open: createAction('[ContextMenu] open', props()),
3773
- hide: createAction('[ContextMenu] hide')
3774
- };
3775
-
3776
- const contextMenuFeatureKey = '@pry/context-menu';
3777
- const initialContextMenuState = {
3778
- opened: false,
3779
- clientX: 0,
3780
- clientY: 0,
3781
- itemId: '',
3782
- from: '',
3783
- resultSet: undefined,
3784
- coordinates: undefined,
3785
- allowObjectCreation: false
3786
- };
3787
- const contextMenuReducer = createReducer(initialContextMenuState, on(ContextMenuActions.open, (state, action) => ({
3788
- ...state,
3789
- opened: true,
3790
- clientX: action.clientX,
3791
- clientY: action.clientY,
3792
- itemId: action.itemId,
3793
- resultSet: action.resultSet,
3794
- from: action.from,
3795
- coordinates: action.coordinates,
3796
- allowObjectCreation: action.allowObjectCreation
3797
- })), on(ContextMenuActions.hide, (state, action) => ({
3798
- ...state,
3799
- opened: false,
3800
- itemId: '',
3801
- resultSet: undefined,
3802
- from: ''
3803
- })));
3804
-
3805
- var ViewMode;
3806
- (function (ViewMode) {
3807
- ViewMode["CATALOG"] = "catalog";
3808
- ViewMode["CONSULT"] = "consult";
3809
- ViewMode["CREATION"] = "creation";
3810
- ViewMode["EDITION"] = "edition";
3811
- ViewMode["EDITOR"] = "editor";
3812
- ViewMode["SEARCH"] = "search";
3813
- ViewMode["CUSTOM"] = "custom";
3814
- })(ViewMode || (ViewMode = {}));
3815
- const DashboardActions = {
3816
- join: createAction('[Dashboard] joined', props()),
3817
- leave: createAction('[Dashboard] leave', props()),
3818
- updateManifest: createAction('[Dashboard] (bus) updating manifest', props()),
3819
- updateManifestAfterFetch: createAction('[Dashboard] (bus) updating manifest after fetch', props()),
3820
- updateManifestWithoutActivation: createAction('[Dashboard] (bus) updating manifest but do not activate it', props()),
3821
- updateManifestAfterTenantJoin: createAction('[Dashboard] (bus) updating manifest after tenant join', props()),
3822
- updateManifestAfterTenantLeave: createAction('[Dashboard] (bus) updating manifest after tenant leave', props()),
3823
- selectPresentation: createAction('[Dashboard] (bus) selectPresentation', props()),
3824
- setInitialPresentation: createAction('[Dashboard] (bus) set initial presentation', props()),
3825
- declareSenderId: createAction('[Dashboard] self-updating manifest', props()),
3826
- updateDashboardManifest: createAction('[Dashboard] updating dashboard view', props()),
3827
- updateWidgetManifest: createAction('[Dashboard] updating widget view', props()),
3828
- addWidgetToPresentation: createAction('[Dashboard] add widget to presentation', props()),
3829
- updateWidgetInPresentation: createAction('[Dashboard] update widget in presentation', props()),
3830
- requestAllRoutes: createAction('[Dashboard] (bus) requesting route update'),
3831
- requestManifestsToEmit: createAction('[Dashboard] (bus) pre-save manifest, asking all widgets to emit'),
3832
- updateRouteManifest: createAction('[Dashboard] (bus) updating route', props()),
3833
- fetchManifestsList: createAction('[Dashboard] (bus) fetching available manifests'),
3834
- setRefreshRate: createAction('[Dashboard] (bus) setting refreshRate', props()),
3835
- updateManifestsList: createAction('[Dashboard] (bus) received manifests list', props()),
3836
- fetchStaticManifest: createAction('[Dashboard] (bus) fetching staticManifest', props()),
3837
- fetchMoreItems: createAction('[Dashboard] (bus) fetching more items', props()),
3838
- endLoading: createAction('[Dashboard] end loading'),
3839
- updateStaticManifest: createAction('[Dashboard] (bus) received staticManifest', props()),
3840
- loadManifest: createAction('[Dashboard] (bus) load manifest', props()),
3841
- loadAndActivateManifest: createAction('[Dashboard] (bus) load and activate manifest', props()),
3842
- downloadManifest: createAction('[Dashboard] download manifest', props()),
3843
- confirmManifestDeletion: createAction('[Dashboard] confirm manifest deletion', props()),
3844
- deleteManifest: createAction('[Dashboard] deleting manifest', props()),
3845
- saveManifest: createAction('[Dashboard] save manifest', props()),
3846
- solveCollisions: createAction('[Dashboard] solving collisions'),
3847
- clearManifest: createAction('[Dashboard] clear manifest'),
3848
- followManifestRoute: createAction('[Dashboard] (bus) follow manifest route'),
3849
- moveWidget: createAction('[Dashboard] moving widget', props()),
3850
- maximizeWidget: createAction('[Dashboard] maximize widget', props()),
3851
- assertResultSets: createAction('[Dashboard] assert resultSet', props()),
3852
- updateResultSet: createAction('[Dashboard] (bus) received named resultSet (not-active-action)', props()),
3853
- addRelationsToResultSets: createAction('[Dashboard] (bus) add relations to resultSet', props()),
3854
- removeRelationsFromResultSets: createAction('[Dashboard] (bus) remove relations from resultSet', props()),
3855
- addItemToResultSets: createAction('[Dashboard] (bus) add item to resultSet', props()),
3856
- startingMissingViews: createAction('[Dashboard] opening missing views for manifest'),
3857
- setAvailableNamedQueries: createAction('[Dashboard] (bus) set available rs names', props()),
3858
- setDefaultDatasource: createAction('[Dashboard] set current rs name', props()),
3859
- updateDashboardParams: createAction('[Dashboard] set dashboard cell params', props()),
3860
- toggleEditionMode: createAction('[Dashboard] toggle edition mode', props()),
3861
- select: createAction('[Dashboard] (bus) select item', props()),
3862
- selectMany: createAction('[Dashboard] (bus) select items', props()),
3863
- invertSelection: createAction('[Dashboard] (bus) invert selection'),
3864
- fetchObjectsDetails: createAction('[Dashboard] fetch objects details', props()),
3865
- updateObjectsDetails: createAction('[Dashboard] (bus) update objects details', props()),
3866
- explore: createAction('[Dashboard] (bus) isolate in data set', props()),
3867
- detail: createAction('[Dashboard] (bus) add detail view', props()),
3868
- proximity: createAction('[Dashboard] proximity search', props()),
3869
- multiSnackBar: createAction('[Dashboard] (bus) display snack message', props()),
3870
- quickOrder: createAction('[Dashboard] (bus) quick order', props()),
3871
- setGridLayout: createAction('[Dashboard] set grid layout', props()),
3872
- propagateGridLayout: createAction('[Dashboard] (bus) change grid layout', props()),
3873
- createTab: createAction('[Dashboard] (bus) create new tab'),
3874
- restoreInitialManifest: createAction('[Dashboard] (bus) restoring missing tabs'),
3875
- setFilters: createAction('[Dashboard] (bus) set datasource filters', props()),
3876
- updateFilters: createAction('[Dashboard] (bus) update datasource filters', props()),
3877
- removeFilter: createAction('[Dashboard] (bus) remove filter in presentation', props()),
3878
- removeFilters: createAction('[Dashboard] (bus) remove filters'),
3879
- updateFilterValue: createAction('[Dashboard] (bus) update filter value', props()),
3880
- clearAllFilterValues: createAction('[Dashboard] (bus) clear all filter values'),
3881
- dispatchFilters: createAction('[Dashboard] (bus) apply filters to presentation datasources', props()),
3882
- resetWmsFeatures: createAction('[Widget map] Reset Wms layer features', props()),
3883
- getWmsFeatures: createAction('[Widget map] Get Wms layer features', props()),
3884
- addWmsFeatures: createAction('[Widget map] Set Wms layer features', props()),
3885
- getWfsFeatures: createAction('[Widget map] Get wfs Features for point', props()),
3886
- getWfsFeaturesForPointStackTooltips: createAction('[Widget map] Get wfs Features for showing stack tooltips', props()),
3887
- updateDisplayOptions: createAction('[Dashboard/Display] (bus) Update displayed dashboard management features', props()),
3888
- getCapability: createAction('[Widget map] Get Wms capability', props()),
3889
- updateCapability: createAction('[Widget map] Store Wms capability', props()),
3890
- addManifestMetadata: createAction('[Dashboard] Add manifest metadata', props()),
3891
- deleteManifestMetadata: createAction('[Dashboard] Delete manifest metadata', props()),
3892
- triggerAggregate: createAction('[Dashboard] (bus) Triggering aggregates for datasource', props()),
3893
- loadPresentation: createAction('[Dashboard] load presentation', props())
3894
- };
3895
-
3896
- var DashboardGridLayout;
3897
- (function (DashboardGridLayout) {
3898
- DashboardGridLayout["FULL"] = "1";
3899
- DashboardGridLayout["THIRD_VERTICAL"] = "1/3v";
3900
- DashboardGridLayout["THIRD_HORIZONTAL"] = "1/3h";
3901
- DashboardGridLayout["HALF_VERTICAL"] = "1/2v";
3902
- DashboardGridLayout["HALF_HORIZONTAL"] = "1/2h";
3903
- DashboardGridLayout["QUARTER"] = "1/4";
3904
- DashboardGridLayout["MANUAL"] = "0";
3905
- })(DashboardGridLayout || (DashboardGridLayout = {}));
3906
-
3907
- const BASE_DISPLAY_OPTIONS = {
3908
- presentationTitle: true,
3909
- search: false,
3910
- catalog: false,
3911
- useFilters: false,
3912
- toolbox: {
3913
- edit_action: false,
3914
- save_view: false,
3915
- save_view_as: false,
3916
- filter_settings: false,
3917
- new_tab: false,
3918
- clear_view: false,
3919
- default_size: false,
3920
- refresh_datasets: false,
3921
- automate_refresh: false,
3922
- edit_presentation_content: false,
3923
- share: false,
3924
- delete: false,
3925
- dashboard_details: false,
3926
- edit_presentation: false
3927
- },
3928
- edit_toggle: false,
3929
- widgetContextMenu: {
3930
- datasourceSelection: true,
3931
- parameters: true,
3932
- window: true,
3933
- maximize: true,
3934
- addToCatalog: true,
3935
- delete: true,
3936
- changeSpot: true
3937
- }
3938
- };
3939
- function getDisplayOptions(mode) {
3940
- switch (mode) {
3941
- case ViewMode.CONSULT:
3942
- return {
3943
- ...BASE_DISPLAY_OPTIONS,
3944
- useFilters: true,
3945
- toolbox: {
3946
- ...BASE_DISPLAY_OPTIONS.toolbox,
3947
- save_view_as: true,
3948
- refresh_datasets: true,
3949
- edit_presentation_content: true,
3950
- share: true,
3951
- delete: true,
3952
- dashboard_details: true,
3953
- edit_presentation: true
3954
- },
3955
- widgetContextMenu: false
3956
- };
3957
- case ViewMode.SEARCH:
3958
- return {
3959
- ...BASE_DISPLAY_OPTIONS,
3960
- presentationTitle: false,
3961
- search: true,
3962
- toolbox: { ...BASE_DISPLAY_OPTIONS.toolbox, clear_view: true, default_size: true, refresh_datasets: true },
3963
- edit_toggle: true
3964
- };
3965
- case ViewMode.EDITION:
3966
- case ViewMode.CREATION:
3967
- return {
3968
- ...BASE_DISPLAY_OPTIONS,
3969
- catalog: true,
3970
- useFilters: true,
3971
- toolbox: {
3972
- edit_action: false,
3973
- save_view: true,
3974
- save_view_as: true,
3975
- filter_settings: true,
3976
- new_tab: true,
3977
- clear_view: true,
3978
- default_size: true,
3979
- refresh_datasets: true,
3980
- automate_refresh: true,
3981
- edit_presentation_content: false,
3982
- share: true,
3983
- delete: false,
3984
- dashboard_details: true,
3985
- edit_presentation: true
3986
- },
3987
- edit_toggle: true,
3988
- widgetContextMenu: true
3989
- };
3990
- default:
3991
- return BASE_DISPLAY_OPTIONS;
3992
- }
3993
- }
3994
-
3995
- const NEW_WINDOW_TARGET = -1;
3996
- const feature$5 = createFeatureSelector('@pry/dashboard');
3997
- const manifests = createSelector(feature$5, (state) => state?.manifests);
3998
- const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf(manifests.sender));
3999
- const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
4000
- const globalManifest = createSelector(manifests,
4001
- // @ts-ignore
4002
- (manifests) => ({ windows: [], ...manifests?.manifest }) ?? { windows: [] });
4003
- const staticManifest = createSelector(manifests,
4004
- // @ts-ignore
4005
- (manifests) => ({ windows: [], ...manifests?.staticManifest }) ?? { windows: [] });
4006
- const loading = createSelector(manifests, (manifests) => !!manifests?.loading);
4007
- const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
4008
- const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
4009
- const gridLayout = createSelector(windowManifest, (manifest) => ((manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL));
4010
- const memoizeWidgetManifest = {};
4011
- const widgetManifest = (index) => {
4012
- if (!memoizeWidgetManifest[index]) {
4013
- memoizeWidgetManifest[index] = createSelector(windowManifest, (windowManifest) => windowManifest.widgets[index] ??
4014
- {
4015
- type: 'placeholder',
4016
- layout: { x: 1, y: 1, width: 1, height: 1 }
4017
- });
4018
- }
4019
- return memoizeWidgetManifest[index];
4020
- };
4021
- const manifestsList = createSelector(manifests, (manifests) => manifests.list);
4022
- const tenants = createSelector(manifests, (manifests) => manifests.tenants ?? []);
4023
- const targetTenantsIndexes = createSelector(manifests, rank, (manifests, rank) => [
4024
- NEW_WINDOW_TARGET,
4025
- ...(manifests.tenants ?? []).map((ten, idx) => idx).filter((idx) => idx !== rank)
4026
- ]);
4027
- const results = createSelector(feature$5, (state) => state?.results);
4028
- const resultSets = createSelector(results, (results) => results.resultSets ?? {});
4029
- const resultSetsParams = createSelector(results, (results) => results.resultSetsParams ?? {});
4030
- const namedQueriesNames = createSelector(resultSets, (state) => Object.keys(state) ?? []);
4031
- const availableNamedQueries = createSelector(results, (results) => {
4032
- return [...new Set([...results.availableDatasourceNames, ...Object.keys(results.resultSets)])];
4033
- });
4034
- const defaultDatasourceNames = createSelector(results, (results) => results.defaultDatasource ?? 'current');
4035
- const selectedItemIds = createSelector(results, (results) => results.selectedItems ?? []);
4036
- const objectDetails = createSelector(results, (results) => results.objectDetails ?? {});
4037
- const quickOrder = createSelector(results, (results) => results.quickOrder ?? {});
4038
- const allItems = createSelector(results, (results) => Object.keys(results.resultSets)
4039
- .map((rsKey) => Object.keys(results.resultSets[rsKey].items)
4040
- .map((classKey) => results.resultSets[rsKey].items[classKey])
4041
- .reduce((p, c) => [...p, ...c], []))
4042
- .reduce((p, c) => [...p, ...c], []));
4043
- const getItemsByIds = (ids) => createSelector(allItems, (items) => items.filter((item) => ids.includes(item.id)));
4044
- const selectedItems = createSelector(selectedItemIds, allItems, (itemNames, allItems) => itemNames.map((name) => allItems.find((it) => it.id === name)) ?? []);
4045
- const dashboard = createSelector(feature$5, (state) => state?.dashboard ?? {});
4046
- const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.params ?? {});
4047
- const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
4048
- const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
4049
- .map((window, idx) => ({ windowIndex: idx, widgets: window.widgets }))
4050
- .map(({ windowIndex, widgets }) => (widgets ?? []).map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
4051
- .filter((rsName) => rsName !== undefined)
4052
- .map((rsName) => ({
4053
- rsName,
4054
- windowIndex,
4055
- type: widget.type,
4056
- layout: widget.layout
4057
- }))))
4058
- .reduce((p, c) => [...p, ...c], [])
4059
- .reduce((p, c) => [...p, ...c], [])
4060
- .reduce((p, c) => ({ ...p, [c.rsName ?? '']: [...(p[c.rsName ?? ''] || []), { ...c }] }), {}));
4061
- const presentation = createSelector(feature$5, (state) => state?.presentation);
4062
- const isCurrentPresentationModified = createSelector(presentation, globalManifest, (state, global) => !equal(global, state.initial));
4063
- const currentManifest = createSelector(feature$5, (state) => state?.presentation.current);
4064
- const filters = createSelector(feature$5, (state) => state?.manifests.manifest.filters ?? []);
4065
- const datasourceFilters = createSelector(feature$5, (state) => state?.manifests.manifest.filters
4066
- ? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
4067
- attribute: attribute.id,
4068
- operator: filter.operator ?? '',
4069
- value: filter.value,
4070
- type: filter.type
4071
- })),
4072
- obj), {})
4073
- : {});
4074
- const memoizeFeatures = {};
4075
- const wmsFeatures = (componentId) => {
4076
- if (!memoizeFeatures[componentId]) {
4077
- memoizeFeatures[componentId] = createSelector(feature$5, (state) => state.wmsFeatures[componentId] ?? []);
4078
- }
4079
- return memoizeFeatures[componentId];
4080
- };
4081
- const displayOptions = createSelector(feature$5, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
4082
- const capabilities = createSelector(feature$5, (state) => state?.capabilities);
4083
- const DashboardSelectors = {
4084
- feature: feature$5,
4085
- rank,
4086
- currentManifestId,
4087
- globalManifest,
4088
- refreshRates,
4089
- windowManifest,
4090
- widgetManifest,
4091
- manifestsList,
4092
- gridLayout,
4093
- tenants,
4094
- resultSets,
4095
- resultSetsParams,
4096
- namedQueriesNames,
4097
- namedQueriesUses,
4098
- availableNamedQueries,
4099
- defaultDatasourceNames,
4100
- selectedItemIds,
4101
- allItems,
4102
- getItemsByIds,
4103
- selectedItems,
4104
- objectDetails,
4105
- targetTenantsIndexes,
4106
- dashboard,
4107
- dashboardCellParams,
4108
- dashboardEditionMode,
4109
- staticManifest,
4110
- loading,
4111
- quickOrder,
4112
- presentation,
4113
- currentManifest,
4114
- filters,
4115
- isCurrentPresentationModified,
4116
- datasourceFilters,
4117
- wmsFeatures,
4118
- displayOptions,
4119
- capabilities
4099
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ContextMenuEffects, decorators: [{
4100
+ type: Injectable
4101
+ }], ctorParameters: () => [{ type: i1$2.Actions }] });
4102
+
4103
+ const ContextMenuActions = {
4104
+ open: createAction('[ContextMenu] open', props()),
4105
+ hide: createAction('[ContextMenu] hide')
4106
+ };
4107
+
4108
+ const contextMenuFeatureKey = '@pry/context-menu';
4109
+ const initialContextMenuState = {
4110
+ opened: false,
4111
+ clientX: 0,
4112
+ clientY: 0,
4113
+ itemId: '',
4114
+ from: '',
4115
+ resultSet: undefined,
4116
+ coordinates: undefined,
4117
+ allowObjectCreation: false
4120
4118
  };
4119
+ const contextMenuReducer = createReducer(initialContextMenuState, on(ContextMenuActions.open, (state, action) => ({
4120
+ ...state,
4121
+ opened: true,
4122
+ clientX: action.clientX,
4123
+ clientY: action.clientY,
4124
+ itemId: action.itemId,
4125
+ resultSet: action.resultSet,
4126
+ from: action.from,
4127
+ coordinates: action.coordinates,
4128
+ allowObjectCreation: action.allowObjectCreation
4129
+ })), on(ContextMenuActions.hide, (state, action) => ({
4130
+ ...state,
4131
+ opened: false,
4132
+ itemId: '',
4133
+ resultSet: undefined,
4134
+ from: ''
4135
+ })));
4121
4136
 
4122
4137
  const SearchActions = {
4123
4138
  search: createAction('[Search] search', props()),
@@ -4130,208 +4145,6 @@ const SearchActions = {
4130
4145
  setPossibleFilterValues: createAction('[Dashboard] (bus) set possible filter values', props())
4131
4146
  };
4132
4147
 
4133
- const operators = [
4134
- 'EQUALS',
4135
- 'CONTAINS',
4136
- 'I_CONTAINS',
4137
- 'GREATER_THAN',
4138
- 'START_WITH',
4139
- 'END_WITH',
4140
- 'LOWER_THAN',
4141
- 'INSIDE',
4142
- 'OUTSIDE',
4143
- 'IN',
4144
- 'NOT_IN'
4145
- ];
4146
- class FilterParamEncoder extends HttpUrlEncodingCodec {
4147
- constructor() {
4148
- super();
4149
- }
4150
- encodeValue(v) {
4151
- const hasOperator = operators.includes(v.split(',')?.[1]);
4152
- if (hasOperator) {
4153
- return v;
4154
- }
4155
- return encodeURIComponent(v);
4156
- }
4157
- }
4158
-
4159
- class DateUtils {
4160
- static formatDate(date) {
4161
- // prettier-ignore
4162
- return `${date.getFullYear()}-${(date.getMonth() + 1 + "").padStart(2, "0")}-${(date.getDate() + "").padStart(2, "0")}T${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
4163
- }
4164
- static onlyPastDateValidator(control) {
4165
- const today = new Date();
4166
- if (new Date(control.value) <= today) {
4167
- return null;
4168
- }
4169
- else {
4170
- return { dateValidator: { valid: false } };
4171
- }
4172
- }
4173
- /**
4174
- * Converts a string date into an ISO-8601 string format
4175
- *
4176
- * Works with this formats :
4177
- * - "YYYY-MM-DD" : '2024-12-31' --> '2024-12-31T00:00:00.000Z'
4178
- * - "MM/DD/YYYY" : '12/31/2024' --> '2024-12-30T23:00:00.000Z' (format FR donc prise en compte de la locale : UTC+1)
4179
- * - "YYYY" : '2025' --> '2025-01-01T00:00:00.000Z'
4180
- *
4181
- * @param dateAsString the date to convert (example : 2024-12-31)
4182
- * @see Date.parse
4183
- * @see Date.toISOString
4184
- */
4185
- static parseToIsoString(dateAsString) {
4186
- try {
4187
- return new Date(Date.parse(dateAsString)).toISOString();
4188
- }
4189
- catch (error) {
4190
- return '';
4191
- }
4192
- }
4193
- static isInTheFuture(date) {
4194
- return new Date(date) > new Date(DateUtils.formatDate(new Date()));
4195
- }
4196
- }
4197
-
4198
- class SearchService {
4199
- constructor(httpClient, store) {
4200
- this.httpClient = httpClient;
4201
- this.store = store;
4202
- this.transformations = [];
4203
- this.filters = {};
4204
- this.limits = {};
4205
- this.datasources = [];
4206
- store.select(DashboardSelectors.datasourceFilters).subscribe((filters) => {
4207
- this.filters = filters;
4208
- });
4209
- store.select(ConfigSelectors.limits).subscribe((limits) => {
4210
- this.limits = limits;
4211
- });
4212
- store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => {
4213
- this.datasources = datasources;
4214
- });
4215
- }
4216
- getItems(id, quickOrder, excludeGeo, searchAfter, linkedItems = []) {
4217
- const params = this.getItemsFilter(id, this.getOrder(quickOrder));
4218
- if (!id) {
4219
- console.warn('Not sending items request with no datasource attached.');
4220
- return of({ items: {}, relations: [] });
4221
- }
4222
- return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => {
4223
- const ds = this.datasources.find((d) => d.id === id);
4224
- return this.httpClient.post(encodeURI(`${url}/data-sources/id/${id}/items`), {
4225
- type: ds?.sourceType === 'namedQuery' ? ds.request.type : NamedQueryTypes.MONO_CLASS,
4226
- excludeGeo: excludeGeo ?? false,
4227
- searchAfter: searchAfter ?? undefined,
4228
- linkedItems
4229
- }, { params });
4230
- }), map((rs) => this.applyTransformations(id, rs)));
4231
- }
4232
- getItemsSerializedParams(id, quickOrder = {}) {
4233
- return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
4234
- }
4235
- getItemsFilter(id, cumulative, includeLimit = true) {
4236
- let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
4237
- if (this.filters[id]) {
4238
- this.filters[id]
4239
- .filter((filter) => filter.value !== null && filter.value !== undefined)
4240
- .forEach((filter) => {
4241
- let valuesToAddToParams = filter.value;
4242
- // INSIDE and OUTSIDE operators uses 2 values but not sent in an array, values are separated by a coma
4243
- // wich must not be encoded (as if values were in an array)
4244
- const isMultiValued = ['INSIDE', 'OUTSIDE'].find((val) => val === filter.operator) !== undefined;
4245
- if (isMultiValued) {
4246
- valuesToAddToParams = filter.value.split(',');
4247
- }
4248
- // date filter value must be send in ISO-8601 format
4249
- if (filter.type === 'date') {
4250
- valuesToAddToParams = isMultiValued
4251
- ? valuesToAddToParams.map((value) => DateUtils.parseToIsoString(value))
4252
- : DateUtils.parseToIsoString(valuesToAddToParams);
4253
- }
4254
- const value = Array.isArray(valuesToAddToParams)
4255
- ? valuesToAddToParams.map((v) => encodeURIComponent(v.toString().split(',').join('\\,'))).join(',')
4256
- : encodeURIComponent(valuesToAddToParams.toString().replace(/,/g, '\\,'));
4257
- params = params.append('filter', `${filter.attribute},${filter.operator},${value}`);
4258
- });
4259
- }
4260
- if (includeLimit) {
4261
- const limit = this.limits[id];
4262
- if (limit) {
4263
- params = params.append('limit', limit);
4264
- }
4265
- }
4266
- return params;
4267
- }
4268
- getOrder(quickOrder) {
4269
- let params = new HttpParams({ encoder: new FilterParamEncoder() });
4270
- if (quickOrder) {
4271
- params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
4272
- }
4273
- else {
4274
- params = params.append('order', 'true,asc');
4275
- }
4276
- return params;
4277
- }
4278
- /**
4279
- * Launch a search request (and saves it as current search)
4280
- * @param condition
4281
- */
4282
- search(condition, id, withLinkedItems = []) {
4283
- return this.store.select(ConfigSelectors.dataUrl).pipe(filter((url) => !!url), take(1), withLatestFrom$1(this.store.select(DashboardSelectors.quickOrder), this.store.select(ConfigSelectors.limits)), mergeMap(([url, quickOrder, limits]) => {
4284
- const params = {};
4285
- if (quickOrder[DEFAULT_NAMED_QUERY_ID]) {
4286
- params['order'] = `${quickOrder[DEFAULT_NAMED_QUERY_ID]?.attribute},${quickOrder[DEFAULT_NAMED_QUERY_ID]?.asc ?? ''}`;
4287
- }
4288
- const otherParams = {};
4289
- if (withLinkedItems.length > 0) {
4290
- if (withLinkedItems.includes('destination')) {
4291
- otherParams['withDestinationItems'] = 'true';
4292
- }
4293
- if (withLinkedItems.includes('source')) {
4294
- otherParams['withSourceItems'] = 'true';
4295
- }
4296
- }
4297
- const _condition = { ...condition, limit: limits[DEFAULT_NAMED_QUERY_ID] ?? limits['default'], ...otherParams };
4298
- return this.httpClient.post(encodeURI(`${url}/items/search`), _condition, { params });
4299
- }), map((rs) => this.applyTransformations(id ?? DEFAULT_NAMED_QUERY_ID, rs)));
4300
- }
4301
- /**
4302
- * Allows to add a transformation function when getting results from backend
4303
- * @param func
4304
- */
4305
- addTransformation(func) {
4306
- this.transformations.push(func);
4307
- }
4308
- /**
4309
- * Apply all transformation functions
4310
- * @param id
4311
- * @param rs
4312
- */
4313
- applyTransformations(id, rs) {
4314
- let transformed = rs;
4315
- this.transformations.forEach((func) => (transformed = func(id, transformed)));
4316
- return transformed;
4317
- }
4318
- autocomplete(attributes, search = '', limit) {
4319
- return this.store.select(ConfigSelectors.dataUrl).pipe(switchMap((url) => this.httpClient.post(encodeURI(`${url}/data-sources/values`), {
4320
- attributes: (attributes ?? []).map((attr) => ({ datasource: attr.datasource, attribute: attr.id })),
4321
- value: search,
4322
- limit
4323
- })));
4324
- }
4325
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
4326
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, providedIn: 'root' }); }
4327
- }
4328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, decorators: [{
4329
- type: Injectable,
4330
- args: [{
4331
- providedIn: 'root'
4332
- }]
4333
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
4334
-
4335
4148
  class DataSourceService {
4336
4149
  constructor(store, httpClient, translateService) {
4337
4150
  this.store = store;
@@ -4457,9 +4270,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
4457
4270
  }], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }, { type: PryI18nService }] });
4458
4271
 
4459
4272
  class DataSourceEffects {
4460
- constructor(actions$, searchService, dataSourceService, snackBar, translate, store, pryDialog) {
4273
+ constructor(actions$, dataSourceService, snackBar, translate, store, pryDialog) {
4461
4274
  this.actions$ = actions$;
4462
- this.searchService = searchService;
4463
4275
  this.dataSourceService = dataSourceService;
4464
4276
  this.snackBar = snackBar;
4465
4277
  this.translate = translate;
@@ -4485,16 +4297,16 @@ class DataSourceEffects {
4485
4297
  actions.push(SearchActions.getDatasourceItems({ id: this.idNamedQuery, excludeGeo: false, from: 'postNameQuery$' }));
4486
4298
  }
4487
4299
  this.idNamedQuery = undefined;
4488
- actions.push(DataSourceActions.namedQuery.load());
4300
+ actions.push(DataSourceActions.namedQuery.load({ force: true }));
4489
4301
  return actions;
4490
4302
  }), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4491
- this.getNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.load), debounceTime(100), switchMap(() => this.dataSourceService.get()), map((namedQueryList) => DataSourceActions.namedQuery.loaded({ list: namedQueryList })), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4303
+ this.getNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.load), withLatestFrom(this.store.select(DataSourceSelectors.getAllNamedQuery), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, nq, rank]) => (action.force || nq.length === 0) && rank === 0), switchMap(() => this.dataSourceService.get()), map((namedQueryList) => DataSourceActions.namedQuery.loaded({ list: namedQueryList })), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4492
4304
  this.loaded$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.loaded), map((action) => {
4493
4305
  return DashboardActions.setAvailableNamedQueries({ names: action.list.map((nq) => nq.id) });
4494
4306
  })));
4495
- this.deleteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.delete), switchMap((props) => this.dataSourceService.delete(props.id).pipe(mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])))));
4496
- this.addFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.addFavorite), switchMap((props) => this.dataSourceService.addFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4497
- this.deleteFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.deleteFavorite), switchMap((props) => this.dataSourceService.deleteFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load()]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4307
+ this.deleteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.delete), switchMap((props) => this.dataSourceService.delete(props.id).pipe(mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])))));
4308
+ this.addFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.addFavorite), switchMap((props) => this.dataSourceService.addFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4309
+ this.deleteFavoriteNamedQuery$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.deleteFavorite), switchMap((props) => this.dataSourceService.deleteFavorite(props.id)), mergeMap(() => [DataSourceActions.namedQuery.load({ force: true })]), catchError((error) => [DataSourceActions.namedQuery.failure({ error })])));
4498
4310
  this.tryEdit$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.namedQuery.edit), withLatestFrom(this.store.select(DataSourceSelectors.editInProgress)), map(([action, inProgress]) => {
4499
4311
  if (!inProgress) {
4500
4312
  return DataSourceActions.namedQuery.openEdit(action);
@@ -4531,10 +4343,13 @@ class DataSourceEffects {
4531
4343
  manifest: widgetManifestCopy
4532
4344
  });
4533
4345
  })));
4534
- this.loadedDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.loadDataset), mergeMap((action) => this.dataSourceService
4346
+ this.loadedDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.loadDataset), withLatestFrom(this.store.select(DataSourceSelectors.datasets), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, dss, rank]) => (action.force || dss.length === 0) && rank === 0), mergeMap(() => this.dataSourceService
4535
4347
  .getDatasets()
4536
4348
  .pipe(map((dsd) => DataSourceActions.dataset.loadedDataset({ datasets: dsd }))))));
4537
- this.loadDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.load), debounceTime(100), mergeMap((action) => [DataSourceActions.namedQuery.load(), DataSourceActions.dataset.loadDataset()])));
4349
+ this.loadDataset$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.load), debounceTime(100), mergeMap((action) => [
4350
+ DataSourceActions.namedQuery.load({ force: action.force }),
4351
+ DataSourceActions.dataset.loadDataset({ force: action.force })
4352
+ ])));
4538
4353
  this.listVersions$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.listVersions), switchMap((action) => this.dataSourceService.getDatasetVersions(action).pipe(map((response) => DataSourceActions.dataset.listVersionsSuccess({
4539
4354
  versions: response.body ?? [],
4540
4355
  totalVersionCount: +(response.headers.get('x-total-count') ?? 0)
@@ -4543,14 +4358,14 @@ class DataSourceEffects {
4543
4358
  this.deactivateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.deactivateDatasetVersion), switchMap((action) => this.dataSourceService.deactivateDatasetVersion(action.versionId).pipe(map(() => DataSourceActions.dataset.deactivateDatasetVersionSuccess({ datasetId: action.datasetId })), catchError((error) => [DataSourceActions.dataset.deactivateDatasetVersionFailure({ error })])))));
4544
4359
  this.activateDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.activateDatasetVersion), switchMap((action) => this.dataSourceService.activateDatasetVersion(action.versionId).pipe(map(() => DataSourceActions.dataset.activateDatasetVersionSuccess({ datasetId: action.datasetId })), catchError((error) => [DataSourceActions.dataset.activateDatasetVersionFailure({ error })])))));
4545
4360
  this.activateOrDeactivateDatasetVersionSuccess$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.activateDatasetVersionSuccess, DataSourceActions.dataset.deactivateDatasetVersionSuccess), map((action) => {
4546
- this.store.dispatch(DataSourceActions.dataset.loadDataset());
4361
+ this.store.dispatch(DataSourceActions.dataset.loadDataset({ force: true }));
4547
4362
  return DataSourceActions.dataset.listVersionsByDatasetId({ id: action.datasetId });
4548
4363
  })));
4549
4364
  this.previewsGetById$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.previews.getById), switchMap((action) => this.dataSourceService.getPreviews(action.id).pipe(map((previews) => DataSourceActions.dataset.previews.getByIdSuccess({ previews })), catchError((error) => [DataSourceActions.dataset.previews.getByIdFailure({ error })])))));
4550
4365
  this.updateDatasetVersionInfo = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.updateDatasetVersionInfo), switchMap((action) => this.dataSourceService
4551
4366
  .updateDatasetVersionInfo(action.version)
4552
4367
  .pipe(map((previews) => DataSourceActions.dataset.updateDatasetVersionInfoSuccess({ version: action.version }))))));
4553
- this.confirmDeleteDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.confirmDeleteVersion), tap$1((action) => {
4368
+ this.confirmDeleteDatasetVersion$ = createEffect(() => this.actions$.pipe(ofType(DataSourceActions.dataset.confirmDeleteVersion), tap((action) => {
4554
4369
  const data = {
4555
4370
  title: '@pry.dataset.version.delete.title',
4556
4371
  message: '@pry.dataset.version.delete.message',
@@ -4574,17 +4389,50 @@ class DataSourceEffects {
4574
4389
  .getCategories()
4575
4390
  .pipe(map((categories) => DataSourceActions.dataset.getCategoriesSuccess({ categories }))))));
4576
4391
  }
4577
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, deps: [{ token: i1$2.Actions }, { token: SearchService }, { token: DataSourceService }, { token: PrySnackbarService }, { token: PryI18nService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4392
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, deps: [{ token: i1$2.Actions }, { token: DataSourceService }, { token: PrySnackbarService }, { token: PryI18nService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4578
4393
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects }); }
4579
4394
  }
4580
4395
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataSourceEffects, decorators: [{
4581
4396
  type: Injectable
4582
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: SearchService }, { type: DataSourceService }, { type: PrySnackbarService }, { type: PryI18nService }, { type: i1.Store }, { type: PryDialogService }] });
4397
+ }], ctorParameters: () => [{ type: i1$2.Actions }, { type: DataSourceService }, { type: PrySnackbarService }, { type: PryI18nService }, { type: i1.Store }, { type: PryDialogService }] });
4583
4398
 
4584
4399
  const FieldActions = {
4585
- load: createAction('[Field] Load Fields'),
4400
+ load: createAction('[Field] (bus) Load Fields', props()),
4586
4401
  loadSuccess: createAction('[Field Api] (bus) Load Fields Success', props()),
4587
- loadFailure: createAction('[Field Api] Load Fields Failure', props())
4402
+ loadFailure: createAction('[Field Api] (bus) Load Fields Failure', props())
4403
+ };
4404
+
4405
+ const fieldsFeatureKey = '@pry/model/fields';
4406
+ function sortByName(a, b) {
4407
+ return a.name.localeCompare(b.name);
4408
+ }
4409
+ const adapter = createEntityAdapter({
4410
+ sortComparer: sortByName
4411
+ });
4412
+ const initialState = adapter.getInitialState({
4413
+ // additional entity state properties
4414
+ });
4415
+ const internalReducer$1 = createReducer(initialState, on(FieldActions.loadSuccess, (state, action) => adapter.setAll(action.fields, state)));
4416
+ const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();
4417
+ function fieldReducer(state, action) {
4418
+ return internalReducer$1(state, action);
4419
+ }
4420
+
4421
+ const feature$3 = createFeatureSelector(fieldsFeatureKey);
4422
+ const entities = createSelector(feature$3, selectEntities);
4423
+ const fields = createSelector(feature$3, selectAll);
4424
+ const memoizeFieldById = {};
4425
+ const fieldById = (id) => {
4426
+ if (!memoizeFieldById[id]) {
4427
+ memoizeFieldById[id] = createSelector(entities, (entities) => entities[id]);
4428
+ }
4429
+ return memoizeFieldById[id];
4430
+ };
4431
+ const FieldSelectors = {
4432
+ feature: feature$3,
4433
+ entities,
4434
+ fields,
4435
+ fieldById
4588
4436
  };
4589
4437
 
4590
4438
  class FieldService {
@@ -4623,40 +4471,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
4623
4471
  }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
4624
4472
 
4625
4473
  class FieldEffects {
4626
- constructor(actions$, fieldService) {
4474
+ constructor(actions$, fieldService, store) {
4627
4475
  this.actions$ = actions$;
4628
4476
  this.fieldService = fieldService;
4629
- this.loadFields$ = createEffect(() => this.actions$.pipe(ofType(FieldActions.load), debounceTime$1(200), mergeMap$1((action) => this.fieldService.getFields().pipe(map$1((fields) => FieldActions.loadSuccess({ fields })), catchError((error) => [FieldActions.loadFailure({ error: error })])))));
4477
+ this.store = store;
4478
+ this.loadFields$ = createEffect(() => this.actions$.pipe(ofType(FieldActions.load), withLatestFrom(this.store.select(FieldSelectors.fields), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, fields, rank]) => (action.force || fields.length === 0) && rank === 0), mergeMap(() => this.fieldService.getFields().pipe(map((fields) => FieldActions.loadSuccess({ fields })), catchError((error) => [FieldActions.loadFailure({ error: error })])))));
4630
4479
  }
4631
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, deps: [{ token: i1$2.Actions }, { token: FieldService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4480
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, deps: [{ token: i1$2.Actions }, { token: FieldService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
4632
4481
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects }); }
4633
4482
  }
4634
4483
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FieldEffects, decorators: [{
4635
4484
  type: Injectable
4636
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: FieldService }] });
4637
-
4638
- const fieldsFeatureKey = '@pry/model/fields';
4639
- function sortByName(a, b) {
4640
- return a.name.localeCompare(b.name);
4641
- }
4642
- const adapter = createEntityAdapter({
4643
- sortComparer: sortByName
4644
- });
4645
- const initialState = adapter.getInitialState({
4646
- // additional entity state properties
4647
- });
4648
- const internalReducer$1 = createReducer(initialState, on(FieldActions.loadSuccess, (state, action) => adapter.setAll(action.fields, state)));
4649
- const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();
4650
- function fieldReducer(state, action) {
4651
- return internalReducer$1(state, action);
4652
- }
4485
+ }], ctorParameters: () => [{ type: i1$2.Actions }, { type: FieldService }, { type: i1.Store }] });
4653
4486
 
4654
4487
  class ImageEffects {
4655
4488
  constructor(actions$, imageService) {
4656
4489
  this.actions$ = actions$;
4657
4490
  this.imageService = imageService;
4658
- this.loadImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.load), debounceTime$1(50), mergeMap$1(() => this.imageService.getImages().pipe(map$1((images) => ImageActions.loadSuccess({ images })), catchError((error) => [ImageActions.loadFailure({ error })])))));
4659
- this.addImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.add), mergeMap$1((action) => this.imageService.upload(action.file, action.mediaType, action.imageType).pipe(mergeMap$1((name) => [ImageActions.load(), ImageActions.added({ name })]), catchError((error) => [ImageActions.loadFailure({ error })])))));
4491
+ this.loadImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.load), debounceTime(50), mergeMap(() => this.imageService.getImages().pipe(map((images) => ImageActions.loadSuccess({ images })), catchError((error) => [ImageActions.loadFailure({ error })])))));
4492
+ this.addImages$ = createEffect(() => this.actions$.pipe(ofType(ImageActions.add), mergeMap((action) => this.imageService.upload(action.file, action.mediaType, action.imageType).pipe(mergeMap((name) => [ImageActions.load(), ImageActions.added({ name })]), catchError((error) => [ImageActions.loadFailure({ error })])))));
4660
4493
  }
4661
4494
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ImageEffects, deps: [{ token: i1$2.Actions }, { token: ImageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4662
4495
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ImageEffects }); }
@@ -4665,16 +4498,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
4665
4498
  type: Injectable
4666
4499
  }], ctorParameters: () => [{ type: i1$2.Actions }, { type: ImageService }] });
4667
4500
 
4668
- const feature$4 = createFeatureSelector(contextMenuFeatureKey);
4669
- const opened = createSelector(feature$4, (state) => state?.opened);
4670
- const position = createSelector(feature$4, (state) => ({ clientX: state?.clientX ?? 0, clientY: state?.clientY ?? 0 }));
4671
- const itemId = createSelector(feature$4, (state) => state.itemId);
4672
- const from = createSelector(feature$4, (state) => state.from);
4673
- const coordinates = createSelector(feature$4, (state) => state.coordinates);
4674
- const resultSet = createSelector(feature$4, (state) => state.resultSet);
4675
- const allowObjectCreation = createSelector(feature$4, (state) => state.allowObjectCreation);
4501
+ const feature$2 = createFeatureSelector(contextMenuFeatureKey);
4502
+ const opened = createSelector(feature$2, (state) => state?.opened);
4503
+ const position = createSelector(feature$2, (state) => ({ clientX: state?.clientX ?? 0, clientY: state?.clientY ?? 0 }));
4504
+ const itemId = createSelector(feature$2, (state) => state.itemId);
4505
+ const from = createSelector(feature$2, (state) => state.from);
4506
+ const coordinates = createSelector(feature$2, (state) => state.coordinates);
4507
+ const resultSet = createSelector(feature$2, (state) => state.resultSet);
4508
+ const allowObjectCreation = createSelector(feature$2, (state) => state.allowObjectCreation);
4676
4509
  const ContextMenuSelectors = {
4677
- feature: feature$4,
4510
+ feature: feature$2,
4678
4511
  opened,
4679
4512
  position,
4680
4513
  itemId,
@@ -4839,7 +4672,7 @@ class ItemService {
4839
4672
  get(id) {
4840
4673
  return this.store
4841
4674
  .select(ConfigSelectors.dataUrl)
4842
- .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/items/${id}`))));
4675
+ .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/items/id/${id}`))));
4843
4676
  }
4844
4677
  /**
4845
4678
  * Returns all items connected by a relation to the node of this id
@@ -4850,15 +4683,14 @@ class ItemService {
4850
4683
  .select(ConfigSelectors.dataUrl)
4851
4684
  .pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/items/id/${id}/relations`))));
4852
4685
  }
4853
- /**
4854
- * Allows to create an item
4855
- * @param item
4856
- */
4857
- create(item) {
4858
- const toSendItem = ItemUtils.ensureItemIdHasCorrectFormat(item);
4686
+ create(item, datasetVersionId, mode = 'MERGE') {
4687
+ const toSendItem = {
4688
+ ...ItemUtils.ensureItemIdHasCorrectFormat(item),
4689
+ datasetVersionId
4690
+ };
4859
4691
  return this.store
4860
4692
  .select(ConfigSelectors.dataUrl)
4861
- .pipe(mergeMap((url) => this.httpClient.post(`${url}/items`, [toSendItem])));
4693
+ .pipe(mergeMap((url) => this.httpClient.post(`${url}/items`, [toSendItem], { params: { updateMode: mode } })));
4862
4694
  }
4863
4695
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ItemService, deps: [{ token: i1.Store }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4864
4696
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ItemService, providedIn: 'root' }); }
@@ -4877,7 +4709,7 @@ class ItemEffects {
4877
4709
  this.store = store;
4878
4710
  this.snackBar = snackBar;
4879
4711
  this.translateService = translateService;
4880
- this.create$ = createEffect(() => this.actions$.pipe(ofType(ItemActions.create), withLatestFrom(this.store.select(ContextMenuSelectors.resultSet)), mergeMap$1(([action, resultSet]) => this.service.create(action.item).pipe(mergeMap$1((items) => items
4712
+ this.create$ = createEffect(() => this.actions$.pipe(ofType(ItemActions.create), withLatestFrom(this.store.select(ContextMenuSelectors.resultSet)), mergeMap(([action, resultSet]) => this.service.create(action.item, action.datasetVersionId, action.mode).pipe(mergeMap((items) => (items ?? (action.item ? [action.item] : []))
4881
4713
  .map((item) => [
4882
4714
  ItemActions.createSuccess({ id: item.id }),
4883
4715
  DashboardActions.addItemToResultSets({ item, resultSet })
@@ -4903,9 +4735,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
4903
4735
  }], ctorParameters: () => [{ type: i1$2.Actions }, { type: ItemService }, { type: i1.Store }, { type: PrySnackbarService }, { type: PryI18nService }] });
4904
4736
 
4905
4737
  const RelationTypesActions = {
4906
- load: createAction('[Relation Types] Load Relation Types'),
4907
- loadSuccess: createAction('[Relation Types Api] Load Relation Types Success', props()),
4908
- loadFailure: createAction('[Relation Types Api] Load Relation Types Failure', props()),
4738
+ load: createAction('[Relation Types] (bus) Load Relation Types', props()),
4739
+ loadSuccess: createAction('[Relation Types Api] (bus) Load Relation Types Success', props()),
4740
+ loadFailure: createAction('[Relation Types Api] (bus) Load Relation Types Failure', props()),
4909
4741
  saveRelationType: createAction('[Relation Types] Save Relation Types', props()),
4910
4742
  saveRelationTypeSuccess: createAction('[Relation Types Api] Save Relation Types Success'),
4911
4743
  saveRelationTypeFailure: createAction('[Relation Types Api] Save Relation Types Failure', props()),
@@ -4924,118 +4756,376 @@ const RelationTypesActions = {
4924
4756
  closeDeleteModale: createAction('[Relation Types] Close delete modal')
4925
4757
  };
4926
4758
 
4759
+ const relationTypesFeatureKey = '@pry/relation-types';
4760
+ const initialRelationTypeState = {
4761
+ relationsTypes: [],
4762
+ loading: false,
4763
+ openModal: false,
4764
+ openDeleteModale: false
4765
+ };
4766
+ const relationTypeReducer = createReducer(initialRelationTypeState, on(RelationTypesActions.load, (state, action) => ({
4767
+ ...state,
4768
+ loading: true
4769
+ })), on(RelationTypesActions.loadSuccess, (state, action) => ({
4770
+ ...state,
4771
+ relationsTypes: [...action.datas],
4772
+ loading: false
4773
+ })), on(RelationTypesActions.loadFailure, (state, action) => ({
4774
+ ...state,
4775
+ loading: false
4776
+ })), on(RelationTypesActions.selectRelationType, (state, action) => ({
4777
+ ...state,
4778
+ selectedRelationType: state.relationsTypes.find((rt) => rt.id === action.id)
4779
+ })), on(RelationTypesActions.unSelectRelationType, (state, action) => ({
4780
+ ...state,
4781
+ selectedRelationType: undefined
4782
+ })), on(RelationTypesActions.openModal, (state, action) => ({
4783
+ ...state,
4784
+ openModal: true
4785
+ })), on(RelationTypesActions.closeModal, (state, action) => ({
4786
+ ...state,
4787
+ openModal: false
4788
+ })));
4789
+
4790
+ const feature$1 = createFeatureSelector(relationTypesFeatureKey);
4791
+ const relationsTypes = createSelector(feature$1, (state) => {
4792
+ const arrayForSort = state?.relationsTypes ? [...state.relationsTypes] : [];
4793
+ return arrayForSort.sort((a, b) => a.name.localeCompare(b.name));
4794
+ });
4795
+ const selectedRelationType = createSelector(feature$1, (state) => state?.selectedRelationType);
4796
+ const openModal = createSelector(feature$1, (state) => state.openModal);
4797
+ const openDeleteModale = createSelector(feature$1, (state) => state.openDeleteModale);
4798
+ const RelationTypesSelectors = {
4799
+ feature: feature$1,
4800
+ relationsTypes,
4801
+ selectedRelationType,
4802
+ openModal,
4803
+ openDeleteModale
4804
+ };
4805
+
4927
4806
  class RelationTypesService {
4928
4807
  constructor(store, httpClient) {
4929
4808
  this.store = store;
4930
4809
  this.httpClient = httpClient;
4931
4810
  }
4932
- addRelationType(id, name) {
4933
- return this.store
4934
- .select(ConfigSelectors.refUrl)
4935
- .pipe(mergeMap((url) => this.httpClient.post(`${url}/relation-types`, { id: id, name: name })));
4811
+ addRelationType(id, name) {
4812
+ return this.store
4813
+ .select(ConfigSelectors.refUrl)
4814
+ .pipe(mergeMap((url) => this.httpClient.post(`${url}/relation-types`, { id: id, name: name })));
4815
+ }
4816
+ getRelationsTypes() {
4817
+ return this.store
4818
+ .select(ConfigSelectors.refUrl)
4819
+ .pipe(mergeMap((url) => this.httpClient.get(`${url}/relation-types`)));
4820
+ }
4821
+ deleteRelationType(id) {
4822
+ return this.store
4823
+ .select(ConfigSelectors.refUrl)
4824
+ .pipe(mergeMap((url) => this.httpClient.delete(`${url}/relation-types/id/${id}`)));
4825
+ }
4826
+ createRelation(sources, destination, relationType, inversion) {
4827
+ let relations = [];
4828
+ if (inversion) {
4829
+ relations = sources.map((source) => ({ source: destination, destination: source, relationType }));
4830
+ }
4831
+ else {
4832
+ relations = sources.map((source) => ({ destination, source, relationType }));
4833
+ }
4834
+ return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.post(`${url}/relations`, relations)), map(() => relations));
4835
+ }
4836
+ deleteRelation(source, destination, relationType) {
4837
+ const relation = { source, destination, relationType };
4838
+ return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.delete(`${url}/relations`, { body: relation })), map(() => relation));
4839
+ }
4840
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, deps: [{ token: i1.Store }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4841
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, providedIn: 'root' }); }
4842
+ }
4843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, decorators: [{
4844
+ type: Injectable,
4845
+ args: [{
4846
+ providedIn: 'root'
4847
+ }]
4848
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }] });
4849
+
4850
+ class RelationTypesEffects {
4851
+ constructor(actions$, service, store, pryDialog) {
4852
+ this.actions$ = actions$;
4853
+ this.service = service;
4854
+ this.store = store;
4855
+ this.pryDialog = pryDialog;
4856
+ this.loadRelationsTypes$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.load), withLatestFrom(this.store.select(RelationTypesSelectors.relationsTypes), this.store.select(DashboardSelectors.rank)), debounceTime(200), filter(([action, relationTypes, rank]) => (action.force || relationTypes.length === 0) && rank === 0), mergeMap((action) => this.service.getRelationsTypes().pipe(map((datas) => RelationTypesActions.loadSuccess({ datas })), catchError((error) => [RelationTypesActions.loadFailure({ error })])))));
4857
+ this.saveRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationType), mergeMap((action) => this.service.addRelationType(action.id, action.name).pipe(map((data) => RelationTypesActions.saveRelationTypeSuccess()), catchError((error) => [RelationTypesActions.saveRelationTypeFailure({ error })])))));
4858
+ this.saveRelationTypeSuccess$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationTypeSuccess), map((action) => {
4859
+ return RelationTypesActions.load({ force: true });
4860
+ })));
4861
+ this.deleteRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelationType), mergeMap((action) => {
4862
+ if (!action.relationType.deletable) {
4863
+ const data = {
4864
+ title: '@pry.admin.infoModalTitle',
4865
+ message: '@pry.admin.relationTypes.deleteModalMessage',
4866
+ actions: [{ id: 0, label: '@pry.admin.closeModale' }]
4867
+ };
4868
+ this.pryDialog.open(PryDialogConfirmComponent, { data });
4869
+ return [];
4870
+ }
4871
+ else {
4872
+ return this.service.deleteRelationType(action.relationType.id).pipe(map((data) => RelationTypesActions.deleteRelationTypeSuccess()), catchError((error) => [RelationTypesActions.deleteRelationTypeFailure({ error })]));
4873
+ }
4874
+ })));
4875
+ this.createRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.createRelation), mergeMap((action) => this.service.createRelation(action.from, action.to, action.typeId, action.inversion).pipe(mergeMap((relations) => [
4876
+ RelationTypesActions.createRelationSuccess(),
4877
+ DashboardActions.addRelationsToResultSets({ relations })
4878
+ ]), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
4879
+ this.deleteRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelation), mergeMap((action) => this.service.deleteRelation(action.from, action.to, action.typeId).pipe(map((relation) => DashboardActions.removeRelationsFromResultSets({ relation })), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
4880
+ }
4881
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, deps: [{ token: i1$2.Actions }, { token: RelationTypesService }, { token: i1.Store }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4882
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects }); }
4883
+ }
4884
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, decorators: [{
4885
+ type: Injectable
4886
+ }], ctorParameters: () => [{ type: i1$2.Actions }, { type: RelationTypesService }, { type: i1.Store }, { type: PryDialogService }] });
4887
+
4888
+ const searchFeatureKey = '@pry/search';
4889
+ const initialSearchState = {
4890
+ searchLoading: [],
4891
+ payload: undefined,
4892
+ id: undefined,
4893
+ possibleFilterValues: {}
4894
+ };
4895
+ const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
4896
+ ...state,
4897
+ searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
4898
+ payload: action.payload,
4899
+ id: action.id
4900
+ })), on(SearchActions.getDatasourceItems, (state, action) => ({
4901
+ ...state,
4902
+ searchLoading: [...new Set([...state.searchLoading, action.id])]
4903
+ })), on(SearchActions.searchSuccess, (state, action) => ({
4904
+ ...state,
4905
+ searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
4906
+ })), on(SearchActions.searchFailure, (state, action) => ({
4907
+ ...state,
4908
+ searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
4909
+ })), on(SearchActions.setSearchLoading, (state, action) => ({
4910
+ ...state,
4911
+ searchLoading: action.start
4912
+ ? [...new Set([...state.searchLoading, ...action.datasources])]
4913
+ : [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
4914
+ })), on(SearchActions.setPossibleFilterValues, (state, { filterId, values }) => ({
4915
+ ...state,
4916
+ possibleFilterValues: {
4917
+ ...state.possibleFilterValues,
4918
+ [filterId]: values
4919
+ }
4920
+ })));
4921
+
4922
+ const feature = createFeatureSelector(searchFeatureKey);
4923
+ const searchLoading = createSelector(feature, (state) => state.searchLoading);
4924
+ const possibleFilterValues = (filterId) => createSelector(feature, (state) => filterId && state.possibleFilterValues[filterId] ? state.possibleFilterValues[filterId] : []);
4925
+ const filterValues = createSelector(feature, (state) => state.possibleFilterValues);
4926
+ const SearchSelectors = {
4927
+ feature,
4928
+ searchLoading,
4929
+ filterValues,
4930
+ possibleFilterValues
4931
+ };
4932
+
4933
+ const operators = [
4934
+ 'EQUALS',
4935
+ 'CONTAINS',
4936
+ 'I_CONTAINS',
4937
+ 'GREATER_THAN',
4938
+ 'START_WITH',
4939
+ 'END_WITH',
4940
+ 'LOWER_THAN',
4941
+ 'INSIDE',
4942
+ 'OUTSIDE',
4943
+ 'IN',
4944
+ 'NOT_IN'
4945
+ ];
4946
+ class FilterParamEncoder extends HttpUrlEncodingCodec {
4947
+ constructor() {
4948
+ super();
4949
+ }
4950
+ encodeValue(v) {
4951
+ const hasOperator = operators.includes(v.split(',')?.[1]);
4952
+ if (hasOperator) {
4953
+ return v;
4954
+ }
4955
+ return encodeURIComponent(v);
4956
+ }
4957
+ }
4958
+
4959
+ class DateUtils {
4960
+ static formatDate(date) {
4961
+ // prettier-ignore
4962
+ return `${date.getFullYear()}-${(date.getMonth() + 1 + "").padStart(2, "0")}-${(date.getDate() + "").padStart(2, "0")}T${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
4963
+ }
4964
+ static onlyPastDateValidator(control) {
4965
+ const today = new Date();
4966
+ if (new Date(control.value) <= today) {
4967
+ return null;
4968
+ }
4969
+ else {
4970
+ return { dateValidator: { valid: false } };
4971
+ }
4972
+ }
4973
+ /**
4974
+ * Converts a string date into an ISO-8601 string format
4975
+ *
4976
+ * Works with this formats :
4977
+ * - "YYYY-MM-DD" : '2024-12-31' --> '2024-12-31T00:00:00.000Z'
4978
+ * - "MM/DD/YYYY" : '12/31/2024' --> '2024-12-30T23:00:00.000Z' (format FR donc prise en compte de la locale : UTC+1)
4979
+ * - "YYYY" : '2025' --> '2025-01-01T00:00:00.000Z'
4980
+ *
4981
+ * @param dateAsString the date to convert (example : 2024-12-31)
4982
+ * @see Date.parse
4983
+ * @see Date.toISOString
4984
+ */
4985
+ static parseToIsoString(dateAsString) {
4986
+ try {
4987
+ return new Date(Date.parse(dateAsString)).toISOString();
4988
+ }
4989
+ catch (error) {
4990
+ return '';
4991
+ }
4992
+ }
4993
+ static isInTheFuture(date) {
4994
+ return new Date(date) > new Date(DateUtils.formatDate(new Date()));
4995
+ }
4996
+ }
4997
+
4998
+ class SearchService {
4999
+ constructor(httpClient, store) {
5000
+ this.httpClient = httpClient;
5001
+ this.store = store;
5002
+ this.transformations = [];
5003
+ this.filters = {};
5004
+ this.limits = {};
5005
+ this.datasources = [];
5006
+ store.select(DashboardSelectors.datasourceFilters).subscribe((filters) => {
5007
+ this.filters = filters;
5008
+ });
5009
+ store.select(ConfigSelectors.limits).subscribe((limits) => {
5010
+ this.limits = limits;
5011
+ });
5012
+ store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => {
5013
+ this.datasources = datasources;
5014
+ });
5015
+ }
5016
+ getItems(id, quickOrder, excludeGeo, searchAfter, linkedItems = []) {
5017
+ const params = this.getItemsFilter(id, this.getOrder(quickOrder));
5018
+ if (!id) {
5019
+ console.warn('Not sending items request with no datasource attached.');
5020
+ return of({ items: {}, relations: [] });
5021
+ }
5022
+ return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => {
5023
+ const ds = this.datasources.find((d) => d.id === id);
5024
+ return this.httpClient.post(encodeURI(`${url}/data-sources/id/${id}/items`), {
5025
+ type: ds?.sourceType === 'namedQuery' ? ds.request.type : NamedQueryTypes.MONO_CLASS,
5026
+ excludeGeo: excludeGeo ?? false,
5027
+ searchAfter: searchAfter ?? undefined,
5028
+ linkedItems,
5029
+ limit: this.limits[id] || this.limits['default']
5030
+ }, { params });
5031
+ }), map((rs) => this.applyTransformations(id, rs)));
4936
5032
  }
4937
- getRelationsTypes() {
4938
- return this.store
4939
- .select(ConfigSelectors.refUrl)
4940
- .pipe(mergeMap((url) => this.httpClient.get(`${url}/relation-types`)));
5033
+ getItemsSerializedParams(id, quickOrder = {}) {
5034
+ return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
4941
5035
  }
4942
- deleteRelationType(id) {
4943
- return this.store
4944
- .select(ConfigSelectors.refUrl)
4945
- .pipe(mergeMap((url) => this.httpClient.delete(`${url}/relation-types/id/${id}`)));
5036
+ getItemsFilter(id, cumulative) {
5037
+ let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
5038
+ if (this.filters[id]) {
5039
+ this.filters[id]
5040
+ .filter((filter) => filter.value !== null && filter.value !== undefined)
5041
+ .forEach((filter) => {
5042
+ let valuesToAddToParams = filter.value;
5043
+ // INSIDE and OUTSIDE operators uses 2 values but not sent in an array, values are separated by a coma
5044
+ // wich must not be encoded (as if values were in an array)
5045
+ const isMultiValued = ['INSIDE', 'OUTSIDE'].find((val) => val === filter.operator) !== undefined;
5046
+ if (isMultiValued) {
5047
+ valuesToAddToParams = filter.value.split(',');
5048
+ }
5049
+ // date filter value must be send in ISO-8601 format
5050
+ if (filter.type === 'date') {
5051
+ valuesToAddToParams = isMultiValued
5052
+ ? valuesToAddToParams.map((value) => DateUtils.parseToIsoString(value))
5053
+ : DateUtils.parseToIsoString(valuesToAddToParams);
5054
+ }
5055
+ const value = Array.isArray(valuesToAddToParams)
5056
+ ? valuesToAddToParams.map((v) => encodeURIComponent(v.toString().split(',').join('\\,'))).join(',')
5057
+ : encodeURIComponent(valuesToAddToParams.toString().replace(/,/g, '\\,'));
5058
+ params = params.append('filter', `${filter.attribute},${filter.operator},${value}`);
5059
+ });
5060
+ }
5061
+ return params;
4946
5062
  }
4947
- createRelation(sources, destination, relationType, inversion) {
4948
- let relations = [];
4949
- if (inversion) {
4950
- relations = sources.map((source) => ({ source: destination, destination: source, relationType }));
5063
+ getOrder(quickOrder) {
5064
+ let params = new HttpParams({ encoder: new FilterParamEncoder() });
5065
+ if (quickOrder) {
5066
+ params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
4951
5067
  }
4952
5068
  else {
4953
- relations = sources.map((source) => ({ destination, source, relationType }));
5069
+ params = params.append('order', 'true,asc');
4954
5070
  }
4955
- return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.post(`${url}/relations`, relations)), map(() => relations));
5071
+ return params;
4956
5072
  }
4957
- deleteRelation(source, destination, relationType) {
4958
- const relation = { source, destination, relationType };
4959
- return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.delete(`${url}/relations`, { body: relation })), map(() => relation));
5073
+ /**
5074
+ * Launch a search request (and saves it as current search)
5075
+ * @param condition
5076
+ */
5077
+ search(condition, id, withLinkedItems = []) {
5078
+ return this.store.select(ConfigSelectors.dataUrl).pipe(filter((url) => !!url), take(1), withLatestFrom(this.store.select(DashboardSelectors.quickOrder), this.store.select(ConfigSelectors.limits)), mergeMap(([url, quickOrder, limits]) => {
5079
+ const params = {};
5080
+ if (quickOrder[DEFAULT_NAMED_QUERY_ID]) {
5081
+ params['order'] = `${quickOrder[DEFAULT_NAMED_QUERY_ID]?.attribute},${quickOrder[DEFAULT_NAMED_QUERY_ID]?.asc ?? ''}`;
5082
+ }
5083
+ const otherParams = {};
5084
+ if (withLinkedItems.length > 0) {
5085
+ if (withLinkedItems.includes('destination')) {
5086
+ otherParams['withDestinationItems'] = 'true';
5087
+ }
5088
+ if (withLinkedItems.includes('source')) {
5089
+ otherParams['withSourceItems'] = 'true';
5090
+ }
5091
+ }
5092
+ const _condition = { ...condition, limit: limits[DEFAULT_NAMED_QUERY_ID] ?? limits['default'], ...otherParams };
5093
+ return this.httpClient.post(encodeURI(`${url}/items/search`), _condition, { params });
5094
+ }), map((rs) => this.applyTransformations(id ?? DEFAULT_NAMED_QUERY_ID, rs)));
4960
5095
  }
4961
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, deps: [{ token: i1.Store }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4962
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, providedIn: 'root' }); }
5096
+ /**
5097
+ * Allows to add a transformation function when getting results from backend
5098
+ * @param func
5099
+ */
5100
+ addTransformation(func) {
5101
+ this.transformations.push(func);
5102
+ }
5103
+ /**
5104
+ * Apply all transformation functions
5105
+ * @param id
5106
+ * @param rs
5107
+ */
5108
+ applyTransformations(id, rs) {
5109
+ let transformed = rs;
5110
+ this.transformations.forEach((func) => (transformed = func(id, transformed)));
5111
+ return transformed;
5112
+ }
5113
+ autocomplete(attributes, search = '', limit) {
5114
+ return this.store.select(ConfigSelectors.dataUrl).pipe(switchMap((url) => this.httpClient.post(encodeURI(`${url}/data-sources/values`), {
5115
+ attributes: (attributes ?? []).map((attr) => ({ datasource: attr.datasource, attribute: attr.id })),
5116
+ value: search,
5117
+ limit
5118
+ })));
5119
+ }
5120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, deps: [{ token: i1$1.HttpClient }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
5121
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, providedIn: 'root' }); }
4963
5122
  }
4964
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesService, decorators: [{
5123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchService, decorators: [{
4965
5124
  type: Injectable,
4966
5125
  args: [{
4967
5126
  providedIn: 'root'
4968
5127
  }]
4969
- }], ctorParameters: () => [{ type: i1.Store }, { type: i1$1.HttpClient }] });
4970
-
4971
- class RelationTypesEffects {
4972
- constructor(actions$, service, router, pryDialog) {
4973
- this.actions$ = actions$;
4974
- this.service = service;
4975
- this.router = router;
4976
- this.pryDialog = pryDialog;
4977
- this.loadRelationsTypes$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.load), debounceTime(100), mergeMap$1((action) => this.service.getRelationsTypes().pipe(map$1((datas) => RelationTypesActions.loadSuccess({ datas })), catchError((error) => [RelationTypesActions.loadFailure({ error })])))));
4978
- this.saveRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationType), mergeMap$1((action) => this.service.addRelationType(action.id, action.name).pipe(map$1((data) => RelationTypesActions.saveRelationTypeSuccess()), catchError((error) => [RelationTypesActions.saveRelationTypeFailure({ error })])))));
4979
- this.saveRelationTypeSuccess$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.saveRelationTypeSuccess), map$1((action) => {
4980
- return RelationTypesActions.load();
4981
- })));
4982
- this.deleteRelationType$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelationType), mergeMap$1((action) => {
4983
- if (!action.relationType.deletable) {
4984
- const data = {
4985
- title: '@pry.admin.infoModalTitle',
4986
- message: '@pry.admin.relationTypes.deleteModalMessage',
4987
- actions: [{ id: 0, label: '@pry.admin.closeModale' }]
4988
- };
4989
- this.pryDialog.open(PryDialogConfirmComponent, { data });
4990
- return [];
4991
- }
4992
- else {
4993
- return this.service.deleteRelationType(action.relationType.id).pipe(map$1((data) => RelationTypesActions.deleteRelationTypeSuccess()), catchError((error) => [RelationTypesActions.deleteRelationTypeFailure({ error })]));
4994
- }
4995
- })));
4996
- this.createRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.createRelation), mergeMap$1((action) => this.service.createRelation(action.from, action.to, action.typeId, action.inversion).pipe(mergeMap$1((relations) => [
4997
- RelationTypesActions.createRelationSuccess(),
4998
- DashboardActions.addRelationsToResultSets({ relations })
4999
- ]), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
5000
- this.deleteRelation$ = createEffect(() => this.actions$.pipe(ofType(RelationTypesActions.deleteRelation), mergeMap$1((action) => this.service.deleteRelation(action.from, action.to, action.typeId).pipe(map$1((relation) => DashboardActions.removeRelationsFromResultSets({ relation })), catchError((error) => [RelationTypesActions.createRelationFailure({ error })])))));
5001
- }
5002
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, deps: [{ token: i1$2.Actions }, { token: RelationTypesService }, { token: i2.Router }, { token: PryDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5003
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects }); }
5004
- }
5005
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RelationTypesEffects, decorators: [{
5006
- type: Injectable
5007
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: RelationTypesService }, { type: i2.Router }, { type: PryDialogService }] });
5008
-
5009
- const relationTypesFeatureKey = '@pry/relation-types';
5010
- const initialRelationTypeState = {
5011
- relationsTypes: [],
5012
- loading: false,
5013
- openModal: false,
5014
- openDeleteModale: false
5015
- };
5016
- const relationTypeReducer = createReducer(initialRelationTypeState, on(RelationTypesActions.load, (state, action) => ({
5017
- ...state,
5018
- loading: true
5019
- })), on(RelationTypesActions.loadSuccess, (state, action) => ({
5020
- ...state,
5021
- relationsTypes: [...action.datas],
5022
- loading: false
5023
- })), on(RelationTypesActions.loadFailure, (state, action) => ({
5024
- ...state,
5025
- loading: false
5026
- })), on(RelationTypesActions.selectRelationType, (state, action) => ({
5027
- ...state,
5028
- selectedRelationType: state.relationsTypes.find((rt) => rt.id === action.id)
5029
- })), on(RelationTypesActions.unSelectRelationType, (state, action) => ({
5030
- ...state,
5031
- selectedRelationType: undefined
5032
- })), on(RelationTypesActions.openModal, (state, action) => ({
5033
- ...state,
5034
- openModal: true
5035
- })), on(RelationTypesActions.closeModal, (state, action) => ({
5036
- ...state,
5037
- openModal: false
5038
- })));
5128
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i1.Store }] });
5039
5129
 
5040
5130
  class BaseWidgetComponent extends SubscriptionnerDirective {
5041
5131
  set widgetIndex(index) {
@@ -5063,13 +5153,13 @@ class BaseWidgetComponent extends SubscriptionnerDirective {
5063
5153
  this._widgetSize$ = new BehaviorSubject({ width: 300, height: 300 });
5064
5154
  this.open$ = new Subject();
5065
5155
  this.manifestModified = new EventEmitter();
5066
- this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged$1((p, v) => equal(p, v)));
5156
+ this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged((p, v) => equal(p, v)));
5067
5157
  this.subscriptions.add(this.manifest$.subscribe((manifest) => (this.manifest = manifest)));
5068
5158
  this.displayHeader$ = this.manifest$.pipe(map((manifest) => manifest.header === undefined || manifest.header));
5069
5159
  this.widgetSize$ = this._widgetSize$.pipe(startWith({
5070
5160
  width: 300,
5071
5161
  height: 300
5072
- }), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height), debounceTime(100), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height));
5162
+ }), distinctUntilChanged((p, c) => p.width === c.width && p.height === c.height), debounceTime(100), distinctUntilChanged((p, c) => p.width === c.width && p.height === c.height));
5073
5163
  document.addEventListener('emit-manifest', () => this.emitManifest());
5074
5164
  }
5075
5165
  ngAfterViewChecked() {
@@ -5276,15 +5366,15 @@ class SearchEffects {
5276
5366
  this.searchService = searchService;
5277
5367
  this.store = store;
5278
5368
  this.widgetFactoryService = widgetFactoryService;
5279
- this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom$1(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.quickOrder), this.store.select(DashboardSelectors.resultSets)), filter(([_, rank]) => rank === 0), filter(([props, rank]) => props.id !== DEFAULT_NAMED_QUERY_ID && props.id !== EXPLORE_NAMED_QUERY_ID), groupBy(([props, rank, quickOrder, rs]) => props.id), mergeMap((group$) => group$.pipe(debounceTime(100), switchMap(([props, rank, quickOrder, rs]) => this.searchService
5369
+ this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.quickOrder), this.store.select(DashboardSelectors.resultSets)), filter(([_, rank]) => rank === 0), filter(([props, rank]) => props.id !== DEFAULT_NAMED_QUERY_ID && props.id !== EXPLORE_NAMED_QUERY_ID), groupBy(([props, rank, quickOrder, rs]) => props.id), mergeMap((group$) => group$.pipe(debounceTime(100), switchMap(([props, rank, quickOrder, rs]) => this.searchService
5280
5370
  .getItems(props.id, quickOrder[props.id], props.excludeGeo, props.next ? rs[props.id].searchAfter : undefined, props.linkedItems)
5281
5371
  .pipe(map((resultSet) => SearchActions.searchSuccess({
5282
5372
  resultSet,
5283
5373
  id: props.id,
5284
5374
  params: this.searchService.getItemsSerializedParams(props.id, quickOrder),
5285
5375
  next: props.next
5286
- })), catchError$1((error) => [SearchActions.searchFailure({ error, id: props.id })])))))));
5287
- this.fetchMore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchMoreItems), withLatestFrom$1(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.resultSets)), filter(([props, rank, rs]) => rank === 0 && !!rs[props.id].searchAfter), debounceTime(300), mergeMap(([props]) => {
5376
+ })), catchError((error) => [SearchActions.searchFailure({ error, id: props.id })])))))));
5377
+ this.fetchMore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchMoreItems), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.resultSets)), filter(([props, rank, rs]) => rank === 0 && !!rs[props.id].searchAfter), debounceTime(300), mergeMap(([props]) => {
5288
5378
  const ds = this.widgetFactoryService.datasourcesToAutoLoad({
5289
5379
  type: props.widgetType,
5290
5380
  datasource: [props.id]
@@ -5303,14 +5393,14 @@ class SearchEffects {
5303
5393
  })));
5304
5394
  this.search$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.search), mergeMap((props) => this.searchService.search(props.payload, props.id, props.linkedItems).pipe(map((resultSet) => {
5305
5395
  return SearchActions.searchSuccess({ resultSet, id: props.id });
5306
- }), catchError$1((error) => [SearchActions.searchFailure({ error, id: props.id })])))));
5396
+ }), catchError((error) => [SearchActions.searchFailure({ error, id: props.id })])))));
5307
5397
  this.searchSuccess$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.searchSuccess), map((action) => DashboardActions.updateResultSet({
5308
5398
  id: action.id ?? DEFAULT_NAMED_QUERY_ID,
5309
5399
  resultSet: action.resultSet,
5310
5400
  params: action.params,
5311
5401
  next: action.next
5312
5402
  }))));
5313
- this.getPossibleFilterValues$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getPossibleFilterValues), mergeMap((action) => this.searchService
5403
+ this.getPossibleFilterValues$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getPossibleFilterValues), withLatestFrom(this.store.select(SearchSelectors.filterValues), this.store.select(DashboardSelectors.rank)), filter(([action, filterValues, rank]) => (action.force || !filterValues[action.filterId] || filterValues[action.filterId].length === 0) && rank === 0), mergeMap(([action]) => this.searchService
5314
5404
  .autocomplete(action.attributes, '', action.limit)
5315
5405
  .pipe(map((values) => SearchActions.setPossibleFilterValues({ filterId: action.filterId, values }))))));
5316
5406
  }
@@ -5321,40 +5411,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
5321
5411
  type: Injectable
5322
5412
  }], ctorParameters: () => [{ type: i1$2.Actions }, { type: SearchService }, { type: i1.Store }, { type: WidgetFactoryService }] });
5323
5413
 
5324
- const searchFeatureKey = '@pry/search';
5325
- const initialSearchState = {
5326
- searchLoading: [],
5327
- payload: undefined,
5328
- id: undefined,
5329
- possibleFilterValues: {}
5330
- };
5331
- const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
5332
- ...state,
5333
- searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
5334
- payload: action.payload,
5335
- id: action.id
5336
- })), on(SearchActions.getDatasourceItems, (state, action) => ({
5337
- ...state,
5338
- searchLoading: [...new Set([...state.searchLoading, action.id])]
5339
- })), on(SearchActions.searchSuccess, (state, action) => ({
5340
- ...state,
5341
- searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
5342
- })), on(SearchActions.searchFailure, (state, action) => ({
5343
- ...state,
5344
- searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
5345
- })), on(SearchActions.setSearchLoading, (state, action) => ({
5346
- ...state,
5347
- searchLoading: action.start
5348
- ? [...new Set([...state.searchLoading, ...action.datasources])]
5349
- : [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
5350
- })), on(SearchActions.setPossibleFilterValues, (state, { filterId, values }) => ({
5351
- ...state,
5352
- possibleFilterValues: {
5353
- ...state.possibleFilterValues,
5354
- [filterId]: values
5355
- }
5356
- })));
5357
-
5358
5414
  class AccordionComponent {
5359
5415
  constructor() { }
5360
5416
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -5527,23 +5583,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
5527
5583
  type: Input
5528
5584
  }] } });
5529
5585
 
5530
- const feature$3 = createFeatureSelector(fieldsFeatureKey);
5531
- const entities$1 = createSelector(feature$3, selectEntities);
5532
- const fields = createSelector(feature$3, selectAll);
5533
- const memoizeFieldById = {};
5534
- const fieldById = (id) => {
5535
- if (!memoizeFieldById[id]) {
5536
- memoizeFieldById[id] = createSelector(entities$1, (entities) => entities[id]);
5537
- }
5538
- return memoizeFieldById[id];
5539
- };
5540
- const FieldSelectors = {
5541
- feature: feature$3,
5542
- entities: entities$1,
5543
- fields,
5544
- fieldById
5545
- };
5546
-
5547
5586
  class TranslateIdPipe {
5548
5587
  constructor(store, translateService, symbolService) {
5549
5588
  this.store = store;
@@ -5797,15 +5836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
5797
5836
  }]
5798
5837
  }], ctorParameters: () => [{ type: PryI18nService }] });
5799
5838
 
5800
- const feature$2 = createFeatureSelector(searchFeatureKey);
5801
- const searchLoading = createSelector(feature$2, (state) => state.searchLoading);
5802
- const possibleFilterValues = (filterId) => createSelector(feature$2, (state) => filterId && state.possibleFilterValues[filterId] ? state.possibleFilterValues[filterId] : []);
5803
- const SearchSelectors = {
5804
- feature: feature$2,
5805
- searchLoading,
5806
- possibleFilterValues
5807
- };
5808
-
5809
5839
  const latLonToGeographicFieldTransformation = (latAttrName, lonAttrName, locAttrName, datasetIds = []) => (id, result) => {
5810
5840
  if (datasetIds.length > 0 && !datasetIds.includes(id)) {
5811
5841
  return result;
@@ -5840,15 +5870,6 @@ const latLonToGeographicFieldTransformation = (latAttrName, lonAttrName, locAttr
5840
5870
  return targetResultSet;
5841
5871
  };
5842
5872
 
5843
- const feature$1 = createFeatureSelector(categoriesFeatureKey);
5844
- const entities = createSelector(feature$1, selectEntities$1);
5845
- const categories = createSelector(feature$1, selectAll$1);
5846
- const CategorySelectors = {
5847
- feature: feature$1,
5848
- entities,
5849
- categories
5850
- };
5851
-
5852
5873
  var PryVisibilityType;
5853
5874
  (function (PryVisibilityType) {
5854
5875
  PryVisibilityType["PRIVATE"] = "PRIVATE";
@@ -5856,22 +5877,6 @@ var PryVisibilityType;
5856
5877
  PryVisibilityType["RESTRICTED"] = "RESTRICTED";
5857
5878
  })(PryVisibilityType || (PryVisibilityType = {}));
5858
5879
 
5859
- const feature = createFeatureSelector(relationTypesFeatureKey);
5860
- const relationsTypes = createSelector(feature, (state) => {
5861
- const arrayForSort = state?.relationsTypes ? [...state.relationsTypes] : [];
5862
- return arrayForSort.sort((a, b) => a.name.localeCompare(b.name));
5863
- });
5864
- const selectedRelationType = createSelector(feature, (state) => state?.selectedRelationType);
5865
- const openModal = createSelector(feature, (state) => state.openModal);
5866
- const openDeleteModale = createSelector(feature, (state) => state.openDeleteModale);
5867
- const RelationTypesSelectors = {
5868
- feature,
5869
- relationsTypes,
5870
- selectedRelationType,
5871
- openModal,
5872
- openDeleteModale
5873
- };
5874
-
5875
5880
  class PryAggregationService {
5876
5881
  aggregate(datasource, options) {
5877
5882
  throw new Error('You must declare the use of an aggregation service. Add PryBackendAggregationService, PryFrontendAggregationService or a custom service');
@@ -5986,7 +5991,7 @@ class PryBackendAggregationService extends PryAggregationService {
5986
5991
  if (options.abscissa && options.abscissa.limit) {
5987
5992
  params = params.set('limit', `${options.abscissa.limit}`);
5988
5993
  }
5989
- params = this.searchService.getItemsFilter(targetDatasource, params, false);
5994
+ params = this.searchService.getItemsFilter(targetDatasource, params);
5990
5995
  const key = `${this.dataUrl}_${targetDatasource}_${params.toString()}`;
5991
5996
  if (!this.cache[key] || this.cache[key].time + 1000 < new Date().getTime()) {
5992
5997
  this.cache[key] = {
@@ -5994,7 +5999,7 @@ class PryBackendAggregationService extends PryAggregationService {
5994
5999
  .get(`${this.dataUrl}/data-sources/id/${targetDatasource}/items/aggregate`, {
5995
6000
  params
5996
6001
  })
5997
- .pipe(debounceTime$1(100), map((result) => ({
6002
+ .pipe(debounceTime(100), map((result) => ({
5998
6003
  ...result,
5999
6004
  operation: options.ordinate.operation === Operation.NONE ? Operation.NONE : result.operation
6000
6005
  })), share()),
@@ -8364,7 +8369,7 @@ class PryAccessRightsShareModalComponent {
8364
8369
  this.data = data;
8365
8370
  this.accessRightsByGroup = {};
8366
8371
  this.disableShareButton$ = new BehaviorSubject(false);
8367
- this.store.dispatch(DataSourceActions.dataset.loadDataset());
8372
+ this.store.dispatch(DataSourceActions.dataset.loadDataset({}));
8368
8373
  this.store.dispatch(ConfigActions.loadAccessGroups());
8369
8374
  this.manifest = this.data.manifest;
8370
8375
  this.accessRightsByGroup = { ...this.manifest.accessRightsByGroup };
@@ -8920,9 +8925,9 @@ class WidgetInstanciatorComponent extends SubscriptionnerDirective {
8920
8925
  }
8921
8926
  ngAfterViewInit() {
8922
8927
  // Dynamically create associated component
8923
- this.widgetManifest$ = combineLatest([this.staticManifest$, this._widgetIndex$]).pipe(distinctUntilChanged$1(), switchMap(([staticManifest, index]) => !!staticManifest ? of(staticManifest) : this.store.select(DashboardSelectors.widgetManifest(index))), distinctUntilChanged$1((p, c) => equal(p, c)));
8928
+ this.widgetManifest$ = combineLatest([this.staticManifest$, this._widgetIndex$]).pipe(distinctUntilChanged(), switchMap(([staticManifest, index]) => !!staticManifest ? of(staticManifest) : this.store.select(DashboardSelectors.widgetManifest(index))), distinctUntilChanged((p, c) => equal(p, c)));
8924
8929
  this.subscriptions.add(this.widgetManifest$
8925
- .pipe(map((widgetManifest) => ({ type: widgetManifest.type, layout: widgetManifest.layout })), distinctUntilChanged$1((p, c) => equal(p, c)), withLatestFrom(this.widgetManifest$), map(([triggering, widgetManifest]) => widgetManifest))
8930
+ .pipe(map((widgetManifest) => ({ type: widgetManifest.type, layout: widgetManifest.layout })), distinctUntilChanged((p, c) => equal(p, c)), withLatestFrom(this.widgetManifest$), map(([triggering, widgetManifest]) => widgetManifest))
8926
8931
  .subscribe((widgetManifest) => {
8927
8932
  this.componentRef.clear();
8928
8933
  this.instanceSubscription?.unsubscribe();
@@ -9057,7 +9062,7 @@ class PryObjectEditionComponent extends SubscriptionnerDirective {
9057
9062
  };
9058
9063
  if (this.object) {
9059
9064
  this.tmpObject = ItemUtils.ensureItemIdHasCorrectFormat(this.tmpObject);
9060
- this.store.dispatch(ItemActions.create({ item: this.tmpObject }));
9065
+ this.store.dispatch(ItemActions.create({ item: this.tmpObject, datasetVersionId: '----TODO PROCIDE DATASET ID FROM USER ----' }));
9061
9066
  if (this.link) {
9062
9067
  relation.from = [this.tmpObject.id];
9063
9068
  this.store.dispatch(RelationTypesActions.createRelation(relation));
@@ -9389,11 +9394,11 @@ class DashboardComponent extends SubscriptionnerDirective {
9389
9394
  this.DashboardGridLayout = DashboardGridLayout;
9390
9395
  this.layout = DashboardGridLayout.MANUAL;
9391
9396
  this.loading$ = this.store.select(DashboardSelectors.loading);
9392
- this.dataFetching$ = this.store.select(SearchSelectors.searchLoading).pipe(delay$1(10));
9397
+ this.dataFetching$ = this.store.select(SearchSelectors.searchLoading).pipe(delay(10));
9393
9398
  this.modeEdition$ = combineLatest([
9394
9399
  this.store.select(DashboardSelectors.dashboardEditionMode),
9395
9400
  this.forceModeEdition$
9396
- ]).pipe(map$1(([storeMode, forceMode]) => (forceMode === undefined ? storeMode : forceMode)));
9401
+ ]).pipe(map(([storeMode, forceMode]) => (forceMode === undefined ? storeMode : forceMode)));
9397
9402
  this.subscriptions.add(this.modeEdition$.subscribe((mode) => {
9398
9403
  this.modeEdition = mode;
9399
9404
  if (!mode) {
@@ -9402,7 +9407,7 @@ class DashboardComponent extends SubscriptionnerDirective {
9402
9407
  }));
9403
9408
  this.targetIndexes$ = this.store.select(DashboardSelectors.targetTenantsIndexes);
9404
9409
  this.subscriptions.add(this.store.select(DashboardSelectors.dashboardCellParams).subscribe((params) => (this.dashboardParams = params)));
9405
- this.windowManifest$ = this.store.select(DashboardSelectors.windowManifest).pipe(combineLatestWith(this.staticDashboard$), switchMap(([windowManifest, staticDashboard]) => (!staticDashboard ? of(windowManifest) : of(staticDashboard))), map$1((_wManifest) => {
9410
+ this.windowManifest$ = this.store.select(DashboardSelectors.windowManifest).pipe(combineLatestWith(this.staticDashboard$), switchMap(([windowManifest, staticDashboard]) => (!staticDashboard ? of(windowManifest) : of(staticDashboard))), map((_wManifest) => {
9406
9411
  const wManifest = structuredClone(_wManifest);
9407
9412
  if (wManifest.grid?.layout && wManifest.grid.layout !== DashboardGridLayout.MANUAL) {
9408
9413
  // Complete with placeholders
@@ -9425,7 +9430,7 @@ class DashboardComponent extends SubscriptionnerDirective {
9425
9430
  }
9426
9431
  return wManifest;
9427
9432
  }), distinctUntilChanged((p, c) => equal(p, c)));
9428
- this.nonFillerWidgets$ = this.windowManifest$.pipe(map$1((wManifest) => (wManifest.widgets ?? []).filter((w) => w.type !== 'filler').length));
9433
+ this.nonFillerWidgets$ = this.windowManifest$.pipe(map((wManifest) => (wManifest.widgets ?? []).filter((w) => w.type !== 'filler').length));
9429
9434
  this.subscriptions.add(this.staticDashboard$.subscribe((manifest) => {
9430
9435
  if (!!manifest) {
9431
9436
  this.store.dispatch(DashboardActions.assertResultSets({
@@ -9438,13 +9443,13 @@ class DashboardComponent extends SubscriptionnerDirective {
9438
9443
  this.store.dispatch(DashboardActions.assertResultSets({}));
9439
9444
  }
9440
9445
  }));
9441
- this.store.dispatch(FieldActions.load());
9442
- this.store.dispatch(ClassActions.load());
9443
- this.store.dispatch(CategoryActions.load());
9446
+ this.store.dispatch(FieldActions.load({}));
9447
+ this.store.dispatch(ClassActions.load({}));
9448
+ this.store.dispatch(CategoryActions.load({}));
9444
9449
  this.store.dispatch(ConfigActions.getMapStyles());
9445
- this.store.dispatch(DataSourceActions.load());
9446
- this.store.dispatch(RelationTypesActions.load());
9447
- this.store.dispatch(ConfigActions.loadCustomization());
9450
+ this.store.dispatch(DataSourceActions.load({}));
9451
+ this.store.dispatch(RelationTypesActions.load({}));
9452
+ this.store.dispatch(ConfigActions.loadCustomization({}));
9448
9453
  this.subscriptions.add(fromEvent(window, 'resize')
9449
9454
  .pipe(auditTime(100))
9450
9455
  .subscribe(() => {
@@ -9456,7 +9461,7 @@ class DashboardComponent extends SubscriptionnerDirective {
9456
9461
  this.calculateView();
9457
9462
  }));
9458
9463
  this.subscriptions.add(fromEvent(window, 'keydown')
9459
- .pipe(map$1(($event) => $event), filter$1(($event) => $event.key === 'L' && $event.ctrlKey && $event.shiftKey))
9464
+ .pipe(map(($event) => $event), filter(($event) => $event.key === 'L' && $event.ctrlKey && $event.shiftKey))
9460
9465
  .subscribe(() => this.store.dispatch(DashboardActions.toggleEditionMode({}))));
9461
9466
  this.subscriptions.add(fromEvent(window, 'mouseup').subscribe(() => {
9462
9467
  this.clearActions();
@@ -9470,16 +9475,16 @@ class DashboardComponent extends SubscriptionnerDirective {
9470
9475
  this.subscriptions.add(this.store.select(DashboardSelectors.gridLayout).subscribe((layout) => {
9471
9476
  this.layout = layout;
9472
9477
  }));
9473
- this.gridTemplateRows$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map$1(([manifest, stacked]) => this.generateRows(stacked && this.manifest
9478
+ this.gridTemplateRows$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => this.generateRows(stacked && this.manifest
9474
9479
  ? this.manifest?.widgets.map((wm) => wm.layout.height).reduce((wm1, wm2) => wm1 + wm2, 0)
9475
9480
  : manifest.grid?.rows ?? DEFAULT_ROWS_NUMBER)));
9476
- this.gridTemplateColumns$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map$1(([manifest, stacked]) => this.generateColumns(stacked ? 1 : manifest.grid?.columns || DEFAULT_COLUMNS_NUMBER)));
9477
- this.backgroundArea$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map$1(([manifest, stacked]) => !stacked
9481
+ this.gridTemplateColumns$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => this.generateColumns(stacked ? 1 : manifest.grid?.columns || DEFAULT_COLUMNS_NUMBER)));
9482
+ this.backgroundArea$ = combineLatest([this.windowManifest$, this.stacked$]).pipe(map(([manifest, stacked]) => !stacked
9478
9483
  ? `1/1/${(manifest.grid?.rows ?? DEFAULT_ROWS_NUMBER) + 1}/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) + 1}`
9479
9484
  : `1/1/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) + 1}/1`));
9480
9485
  this.separators$ = this.store
9481
9486
  .select(DashboardSelectors.gridLayout)
9482
- .pipe(map$1((layout) => layout === DashboardGridLayout.MANUAL ? [] : WidgetPlacementUtils.getLayout(layout)?.places ?? []));
9487
+ .pipe(map((layout) => layout === DashboardGridLayout.MANUAL ? [] : WidgetPlacementUtils.getLayout(layout)?.places ?? []));
9483
9488
  }
9484
9489
  ngOnInit() {
9485
9490
  if (this.displayOptions)
@@ -10606,7 +10611,7 @@ class ActionBusEffects {
10606
10611
  this.busService = busService;
10607
10612
  this.forwardOnBus$ = createEffect(() => this.actions$.pipe(
10608
10613
  // For actions with type containing "(bus)", automatically transfer it on the data-bus to propagate to other windows
10609
- filter$1((action) => action.type.includes('(bus)')), tap((action) => this.busService.postData(action))), { dispatch: false });
10614
+ filter((action) => action.type.includes('(bus)')), tap((action) => this.busService.postData(action))), { dispatch: false });
10610
10615
  }
10611
10616
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ActionBusEffects, deps: [{ token: i1$2.Actions }, { token: i1.Store }, { token: BusService }], target: i0.ɵɵFactoryTarget.Injectable }); }
10612
10617
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: ActionBusEffects }); }
@@ -10769,7 +10774,7 @@ class DataWidgetComponent extends BaseWidgetComponent {
10769
10774
  relations: [],
10770
10775
  merged: resultSetArray.length
10771
10776
  });
10772
- }), distinctUntilChanged$1((p, v) => equal(p, v)));
10777
+ }), distinctUntilChanged((p, v) => equal(p, v)));
10773
10778
  }
10774
10779
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DataWidgetComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
10775
10780
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: DataWidgetComponent, selector: "pry-data-widget", inputs: { openData$: "openData$", staticResultSet: "staticResultSet" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
@@ -10842,7 +10847,7 @@ class PryDatasourceListComponent extends SubscriptionnerDirective {
10842
10847
  this.consultedDataset = new EventEmitter();
10843
10848
  this.datasourceSelected = new EventEmitter();
10844
10849
  this.searchOrCategoryChanged = new EventEmitter();
10845
- this.store.dispatch(DataSourceActions.load());
10850
+ this.store.dispatch(DataSourceActions.load({}));
10846
10851
  this.datasources$ = combineLatest([
10847
10852
  this.store.select(DataSourceSelectors.getDataSourcesSorted),
10848
10853
  this.selectedDatasources$
@@ -10855,7 +10860,7 @@ class PryDatasourceListComponent extends SubscriptionnerDirective {
10855
10860
  this.subscriptions.add(this.selectedCategories$.subscribe((_) => {
10856
10861
  this.searchOrCategoryChanged.next();
10857
10862
  }));
10858
- this.subscriptions.add(this.search$.pipe(debounceTime$1(100)).subscribe((_) => {
10863
+ this.subscriptions.add(this.search$.pipe(debounceTime(100)).subscribe((_) => {
10859
10864
  this.searchOrCategoryChanged.next();
10860
10865
  }));
10861
10866
  }
@@ -10942,7 +10947,7 @@ class DatasourceSelectorComponent extends SubscriptionnerDirective {
10942
10947
  this.itemsChanged.emit(selectedIds);
10943
10948
  this.detectChanges();
10944
10949
  }));
10945
- this.subscriptions.add(this.searchOrCategoryChanged$.pipe(delay$1(50)).subscribe(() => {
10950
+ this.subscriptions.add(this.searchOrCategoryChanged$.pipe(delay(50)).subscribe(() => {
10946
10951
  this.detectChanges();
10947
10952
  }));
10948
10953
  }
@@ -11074,7 +11079,7 @@ class PryWidgetHeaderComponent extends SubscriptionnerDirective {
11074
11079
  this.type = LibraryTypes.ILLUSTRATION;
11075
11080
  this.windowManifest$ = this.store
11076
11081
  .select(DashboardSelectors.windowManifest)
11077
- .pipe(distinctUntilChanged$1((p, c) => equal(p, c)));
11082
+ .pipe(distinctUntilChanged((p, c) => equal(p, c)));
11078
11083
  this.targetIndexes$ = this.store.select(DashboardSelectors.targetTenantsIndexes);
11079
11084
  this.subscriptions.add(this.windowManifest$.subscribe((manifest) => {
11080
11085
  this.windowManifest = manifest;
@@ -11766,11 +11771,11 @@ class FilterGroupComponent {
11766
11771
  }
11767
11772
  }
11768
11773
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterGroupComponent, deps: [{ token: i1.Store }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
11769
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FilterGroupComponent, selector: "pry-filter-group", inputs: { enterTriggerFilter: "enterTriggerFilter", clearTriggerFilter: "clearTriggerFilter" }, ngImport: i0, template: "<pry-filter-group-css></pry-filter-group-css>\n@if (globalManifest$ | async; as manifest) {\n @if (manifest.filters && manifest.filters.length > 0) {\n <div class=\"o-container__filters\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: ["filter", "applyFilter$"], outputs: ["pressedEnter", "cleared"] }, { kind: "component", type: PryFilterGroupCssComponent, selector: "pry-filter-group-css" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
11774
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FilterGroupComponent, selector: "pry-filter-group", inputs: { enterTriggerFilter: "enterTriggerFilter", clearTriggerFilter: "clearTriggerFilter" }, ngImport: i0, template: "<pry-filter-group-css></pry-filter-group-css>\n@if (globalManifest$ | async; as manifest) {\n @if (manifest.filters && manifest.filters.length > 0) {\n <div class=\"o-container__filters\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n @if (filterDescription.type !== 'invisible') {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: ["filter", "applyFilter$"], outputs: ["pressedEnter", "cleared"] }, { kind: "component", type: PryFilterGroupCssComponent, selector: "pry-filter-group-css" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
11770
11775
  }
11771
11776
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterGroupComponent, decorators: [{
11772
11777
  type: Component,
11773
- args: [{ selector: 'pry-filter-group', template: "<pry-filter-group-css></pry-filter-group-css>\n@if (globalManifest$ | async; as manifest) {\n @if (manifest.filters && manifest.filters.length > 0) {\n <div class=\"o-container__filters\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n }\n}\n" }]
11778
+ args: [{ selector: 'pry-filter-group', template: "<pry-filter-group-css></pry-filter-group-css>\n@if (globalManifest$ | async; as manifest) {\n @if (manifest.filters && manifest.filters.length > 0) {\n <div class=\"o-container__filters\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n @if (filterDescription.type !== 'invisible') {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n }\n}\n" }]
11774
11779
  }], ctorParameters: () => [{ type: i1.Store }, { type: Document, decorators: [{
11775
11780
  type: Inject,
11776
11781
  args: [DOCUMENT]
@@ -11914,12 +11919,12 @@ class ManifestService {
11914
11919
  if (!!actual) {
11915
11920
  return this.httpClient
11916
11921
  .put(encodeURI(`${url}/users/me/dashboards/id/${id}/default`), {})
11917
- .pipe(map$1(() => true));
11922
+ .pipe(map(() => true));
11918
11923
  }
11919
11924
  else {
11920
11925
  return this.httpClient
11921
11926
  .delete(encodeURI(`${url}/users/me/dashboards/default`), {})
11922
- .pipe(map$1(() => false));
11927
+ .pipe(map(() => false));
11923
11928
  }
11924
11929
  }));
11925
11930
  }
@@ -11987,7 +11992,7 @@ class RefreshService {
11987
11992
  start() {
11988
11993
  if (!this.subscription) {
11989
11994
  this.subscription = interval(1000)
11990
- .pipe(withLatestFrom(this.store.select(DashboardSelectors.refreshRates), this.store.select(DashboardSelectors.globalManifest)), map$1(([interval, refreshRates, globalManifest]) => {
11995
+ .pipe(withLatestFrom(this.store.select(DashboardSelectors.refreshRates), this.store.select(DashboardSelectors.globalManifest)), map(([interval, refreshRates, globalManifest]) => {
11991
11996
  const datasources = this.widgetFactoryService.getObjectsToAutoLoad(globalManifest).datasources;
11992
11997
  return Object.keys(refreshRates)
11993
11998
  .filter((key) => datasources.map((ds) => ds.datasetId).includes(key))
@@ -12117,7 +12122,7 @@ class DashboardEffects {
12117
12122
  this.wmsService = wmsService;
12118
12123
  this.widgetFactoryService = widgetFactoryService;
12119
12124
  this.i18nService = i18nService;
12120
- this.join$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.join), delay(1000), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.selectedItemIds), this.store.select(DashboardSelectors.presentation), this.store.select(DashboardSelectors.displayOptions)), filter$1(([action, rank, tenants, manifest, resultSets, display]) => rank === 0), debounceTime$1(200), map$1(([action, rank, tenants, manifest, resultSets, selectedIds, presentation, display]) => DashboardActions.updateManifestAfterTenantJoin({
12125
+ this.join$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.join), delay(1000), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.selectedItemIds), this.store.select(DashboardSelectors.presentation), this.store.select(DashboardSelectors.displayOptions)), filter(([action, rank, tenants, manifest, resultSets, display]) => rank === 0), debounceTime(200), map(([action, rank, tenants, manifest, resultSets, selectedIds, presentation, display]) => DashboardActions.updateManifestAfterTenantJoin({
12121
12126
  tenants, // we already have added tenant in the reduce of the "join" action
12122
12127
  manifest: {
12123
12128
  ...manifest,
@@ -12129,7 +12134,7 @@ class DashboardEffects {
12129
12134
  presentation,
12130
12135
  display
12131
12136
  }))));
12132
- this.leave$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.leave), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), filter$1(([action, rank, tenants, manifest]) => rank === 0 || (tenants[0] === action.sender && rank === 1)), map$1(([action, rank, tenants, manifest, selectedIds]) => {
12137
+ this.leave$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.leave), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank, tenants, manifest]) => rank === 0 || (tenants[0] === action.sender && rank === 1)), map(([action, rank, tenants, manifest, selectedIds]) => {
12133
12138
  const leaverRank = tenants.indexOf(action.sender);
12134
12139
  const newTenantsList = [...tenants];
12135
12140
  const newWindowList = [...manifest.windows];
@@ -12146,10 +12151,10 @@ class DashboardEffects {
12146
12151
  selectedIds
12147
12152
  });
12148
12153
  })));
12149
- this.fetchStaticManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchStaticManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter$1(([action, rank]) => rank === 0), mergeMap$1(([action, rank]) => this.manifestService
12154
+ this.fetchStaticManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchStaticManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank]) => rank === 0), mergeMap(([action, rank]) => this.manifestService
12150
12155
  .get(action.id)
12151
- .pipe(map$1((staticManifest) => DashboardActions.updateStaticManifest({ staticManifest }))))));
12152
- this.loadAndActivateManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadAndActivateManifest, DashboardActions.loadManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter$1(([action, rank]) => rank === 0), mergeMap$1(([action, rank, selectedIds]) => this.manifestService.get(action.id).pipe(mergeMap$1((manifest) => {
12156
+ .pipe(map((staticManifest) => DashboardActions.updateStaticManifest({ staticManifest }))))));
12157
+ this.loadAndActivateManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadAndActivateManifest, DashboardActions.loadManifest), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.selectedItemIds)), filter(([action, rank]) => rank === 0), mergeMap(([action, rank, selectedIds]) => this.manifestService.get(action.id).pipe(mergeMap((manifest) => {
12153
12158
  return action.type === DashboardActions.loadAndActivateManifest.type
12154
12159
  ? [
12155
12160
  DashboardActions.updateManifestAfterFetch({ manifest, manifestId: action.id, selectedIds }),
@@ -12157,7 +12162,7 @@ class DashboardEffects {
12157
12162
  ]
12158
12163
  : [DashboardActions.updateManifestWithoutActivation({ manifest, manifestId: action.id, selectedIds })];
12159
12164
  })))));
12160
- this.clearManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.clearManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), map$1(([action, manifest, selectedIds]) => DashboardActions.updateManifestAfterFetch({ manifest, manifestId: '', selectedIds }))));
12165
+ this.clearManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.clearManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, manifest, selectedIds]) => DashboardActions.updateManifestAfterFetch({ manifest, manifestId: '', selectedIds }))));
12161
12166
  this.downloadManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.downloadManifest), tap((action) => this.manifestService.get(action.id).subscribe((manifest) => {
12162
12167
  const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(manifest));
12163
12168
  const dlAnchorElem = document.createElement('a');
@@ -12170,11 +12175,11 @@ class DashboardEffects {
12170
12175
  this.router.navigateByUrl(manifest.route);
12171
12176
  }
12172
12177
  })), { dispatch: false });
12173
- this.endLoadingAfterFollowingManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.followManifestRoute), map$1((action) => DashboardActions.endLoading())));
12174
- this.requestManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestAllRoutes), map$1(() => DashboardActions.updateRouteManifest({ route: this.router.url }))));
12178
+ this.endLoadingAfterFollowingManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.followManifestRoute), map((action) => DashboardActions.endLoading())));
12179
+ this.requestManifestRoute$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestAllRoutes), map(() => DashboardActions.updateRouteManifest({ route: this.router.url }))));
12175
12180
  this.requestManifestsToEmit$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.requestManifestsToEmit), tap(() => document.dispatchEvent(new CustomEvent('emit-manifest')))), { dispatch: false });
12176
- this.dispatchFilter$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.dispatchFilters), map$1(() => DashboardActions.requestManifestsToEmit())));
12177
- this.assertResultSets$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.assertResultSets, DashboardActions.dispatchFilters, DashboardActions.clearAllFilterValues), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.resultSetsParams), this.store.select(DashboardSelectors.quickOrder)), mergeMap$1(([action, manifest, resultSets, resultSetsParams, quickOrder]) => {
12181
+ this.dispatchFilter$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.dispatchFilters), map(() => DashboardActions.requestManifestsToEmit())));
12182
+ this.assertResultSets$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.assertResultSets, DashboardActions.dispatchFilters, DashboardActions.clearAllFilterValues), withLatestFrom(this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.resultSets), this.store.select(DashboardSelectors.resultSetsParams), this.store.select(DashboardSelectors.quickOrder)), mergeMap(([action, manifest, resultSets, resultSetsParams, quickOrder]) => {
12178
12183
  const manifestToCheck = (action.type === DashboardActions.assertResultSets.type ||
12179
12184
  action.type === DashboardActions.dispatchFilters.type) &&
12180
12185
  action.staticManifest
@@ -12213,8 +12218,8 @@ class DashboardEffects {
12213
12218
  }));
12214
12219
  return [...toItemsActions, ...toAggregateActions];
12215
12220
  })));
12216
- this.sendAggregatesEvent$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.triggerAggregate), filter$1((action) => action.id !== DEFAULT_NAMED_QUERY_ID && action.id !== EXPLORE_NAMED_QUERY_ID), tap((action) => window.dispatchEvent(new CustomEvent('datasourceRefresh', { detail: action.id })))), { dispatch: false });
12217
- this.startMissingViewAfterViewUpdate$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterFetch, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.explore, DashboardActions.detail, DashboardActions.restoreInitialManifest, DashboardActions.createTab, DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter$1(([action, rank]) => rank === 0), mergeMap$1((action) => [
12221
+ this.sendAggregatesEvent$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.triggerAggregate), filter((action) => action.id !== DEFAULT_NAMED_QUERY_ID && action.id !== EXPLORE_NAMED_QUERY_ID), tap((action) => window.dispatchEvent(new CustomEvent('datasourceRefresh', { detail: action.id })))), { dispatch: false });
12222
+ this.startMissingViewAfterViewUpdate$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterFetch, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.explore, DashboardActions.detail, DashboardActions.restoreInitialManifest, DashboardActions.createTab, DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter(([action, rank]) => rank === 0), mergeMap((action) => [
12218
12223
  DashboardActions.startingMissingViews(),
12219
12224
  DashboardActions.assertResultSets({}),
12220
12225
  DashboardActions.solveCollisions()
@@ -12222,7 +12227,7 @@ class DashboardEffects {
12222
12227
  this.updateTitle$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateManifest, DashboardActions.updateManifestAfterTenantJoin, DashboardActions.updateManifestAfterTenantLeave, DashboardActions.updateManifestAfterFetch, DashboardActions.declareSenderId), withLatestFrom(this.store.select(DashboardSelectors.rank)), tap(([action, rank]) => {
12223
12228
  this.titleService.changeTitle();
12224
12229
  })), { dispatch: false });
12225
- this.openOther$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.startingMissingViews), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest)), debounceTime$1(1000), filter$1(([action, rank, tenants, manifest]) => rank === 0), tap(([action, rank, tenants, manifest]) => {
12230
+ this.openOther$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.startingMissingViews), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.tenants), this.store.select(DashboardSelectors.globalManifest)), debounceTime(1000), filter(([action, rank, tenants, manifest]) => rank === 0), tap(([action, rank, tenants, manifest]) => {
12226
12231
  manifest.windows.forEach((windowManifest, index) => {
12227
12232
  if (!tenants[index]) {
12228
12233
  // If no window is opened for this part, then open one
@@ -12230,7 +12235,7 @@ class DashboardEffects {
12230
12235
  }
12231
12236
  });
12232
12237
  })), { dispatch: false });
12233
- this.saveManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.saveManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), withLatestFrom(this.store.select(DataSourceSelectors.datasets)), mergeMap$1(([[action, currentManifest], datasets]) => this.manifestService
12238
+ this.saveManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.saveManifest), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), withLatestFrom(this.store.select(DataSourceSelectors.datasets)), mergeMap(([[action, currentManifest], datasets]) => this.manifestService
12234
12239
  .save(action.name, action.manifest ?? currentManifest, action.id, action.description, action.image, action.metadata, action.accessRightsByGroup, action.additionalInformation)
12235
12240
  .pipe(tap((response) => {
12236
12241
  this.snackBar.open({
@@ -12256,7 +12261,7 @@ class DashboardEffects {
12256
12261
  };
12257
12262
  this.pryDialog.open(PryDialogConfirmComponent, { data });
12258
12263
  }
12259
- }), map$1(() => action.manifest ?? currentManifest), catchError((error) => {
12264
+ }), map(() => action.manifest ?? currentManifest), catchError((error) => {
12260
12265
  this.snackBar.open({
12261
12266
  message: this.translateService.instant('@pry.toolbox.manifest.saveErrorCode.' + (error.error?.code ?? 'UNKNOWN'), {
12262
12267
  name: action.name
@@ -12264,12 +12269,12 @@ class DashboardEffects {
12264
12269
  type: 'error'
12265
12270
  });
12266
12271
  return throwError(() => error);
12267
- }))), withLatestFrom(this.store.select(DashboardSelectors.selectedItemIds)), mergeMap$1(([manifest, selectedIds]) => [
12272
+ }))), withLatestFrom(this.store.select(DashboardSelectors.selectedItemIds)), mergeMap(([manifest, selectedIds]) => [
12268
12273
  DashboardActions.fetchManifestsList(),
12269
12274
  DashboardActions.setInitialPresentation({ initial: manifest }),
12270
12275
  DashboardActions.updateManifest({ manifest, selectedIds })
12271
12276
  ])));
12272
- this.listManifests$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchManifestsList), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter$1(([action, rank]) => rank === 0 || rank === -1), debounceTime$1(100), mergeMap$1(([action, rank]) => this.manifestService.list().pipe(map$1((manifests) => DashboardActions.updateManifestsList({ manifests }))))));
12277
+ this.listManifests$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchManifestsList), withLatestFrom(this.store.select(DashboardSelectors.rank)), filter(([action, rank]) => rank === 0 || rank === -1), debounceTime(100), mergeMap(([action, rank]) => this.manifestService.list().pipe(map((manifests) => DashboardActions.updateManifestsList({ manifests }))))));
12273
12278
  this.confirmManifestDeletion$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.confirmManifestDeletion), tap((action) => {
12274
12279
  const data = {
12275
12280
  title: '@pry.widget.modalTitle',
@@ -12288,23 +12293,23 @@ class DashboardEffects {
12288
12293
  };
12289
12294
  this.pryDialog.open(PryDialogConfirmComponent, { data });
12290
12295
  })), { dispatch: false });
12291
- this.deleteManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifest), mergeMap$1((action) => this.manifestService.delete(action.id).pipe(map$1(() => DashboardActions.fetchManifestsList())))));
12292
- this.fetchObjectsDetails$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchObjectsDetails), mergeMap$1((action) => merge(...action.ids.map((id) => this.itemService.get(id)))), map$1((item) => DashboardActions.updateObjectsDetails({ list: { [item.id]: item } }))));
12293
- this.proximitySearch$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.proximity), withLatestFrom(this.store.select(DashboardSelectors.resultSets)), mergeMap$1(([action, resultSets]) => this.itemService.proximity(action.id).pipe(map$1((proxRs) => {
12296
+ this.deleteManifest$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifest), mergeMap((action) => this.manifestService.delete(action.id).pipe(map(() => DashboardActions.fetchManifestsList())))));
12297
+ this.fetchObjectsDetails$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchObjectsDetails), mergeMap((action) => merge(...action.ids.map((id) => this.itemService.get(id)))), map((item) => DashboardActions.updateObjectsDetails({ list: { [item.id]: item } }))));
12298
+ this.proximitySearch$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.proximity), withLatestFrom(this.store.select(DashboardSelectors.resultSets)), mergeMap(([action, resultSets]) => this.itemService.proximity(action.id).pipe(map((proxRs) => {
12294
12299
  return DashboardActions.updateResultSet({
12295
12300
  id: action.targetResultSet,
12296
12301
  resultSet: ResultsetUtils.mergeResultSets(proxRs, resultSets[action.targetResultSet])
12297
12302
  });
12298
12303
  })))));
12299
- this.explore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.explore), mergeMap$1((action) => [DashboardActions.proximity({ id: action.id, targetResultSet: EXPLORE_NAMED_QUERY_ID })])));
12300
- this.detailAsLoadInWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.detail), map$1((action) => DashboardActions.addWidgetToPresentation({
12304
+ this.explore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.explore), mergeMap((action) => [DashboardActions.proximity({ id: action.id, targetResultSet: EXPLORE_NAMED_QUERY_ID })])));
12305
+ this.detailAsLoadInWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.detail), map((action) => DashboardActions.addWidgetToPresentation({
12301
12306
  id: '',
12302
12307
  widgetType: 'detail',
12303
12308
  additionalOptions: {
12304
12309
  itemIds: action.ids
12305
12310
  }
12306
12311
  }))));
12307
- this.updateWidgetInPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateWidgetInPresentation), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), mergeMap$1(([action, manifest]) => {
12312
+ this.updateWidgetInPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.updateWidgetInPresentation), withLatestFrom(this.store.select(DashboardSelectors.globalManifest)), mergeMap(([action, manifest]) => {
12308
12313
  // Check if a widget with same datasource and type already exist in current presentation
12309
12314
  const widgetToMatch = this.toolboxManifestService.get(action.widgetType);
12310
12315
  let additionalMatchingFn;
@@ -12340,7 +12345,7 @@ class DashboardEffects {
12340
12345
  }
12341
12346
  return result;
12342
12347
  })));
12343
- this.addWidgetToPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addWidgetToPresentation), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map$1(([action, layout, _globalManifest, rank, params, selectedIds]) => {
12348
+ this.addWidgetToPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addWidgetToPresentation), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, layout, _globalManifest, rank, params, selectedIds]) => {
12344
12349
  const manifestGlobal = structuredClone(_globalManifest);
12345
12350
  // Create new configuration
12346
12351
  const newOptions = this.toolboxManifestService.get(action.widgetType) ?? {
@@ -12411,7 +12416,7 @@ class DashboardEffects {
12411
12416
  }
12412
12417
  return DashboardActions.updateManifest({ manifest: manifestGlobal, selectedIds });
12413
12418
  })));
12414
- this.moveWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map$1(([action, layout, _globalManifest, rank, params, selectedIds]) => {
12419
+ this.moveWidget$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.moveWidget), withLatestFrom(this.store.select(DashboardSelectors.gridLayout), this.store.select(DashboardSelectors.globalManifest), this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.dashboardCellParams), this.store.select(DashboardSelectors.selectedItemIds)), map(([action, layout, _globalManifest, rank, params, selectedIds]) => {
12415
12420
  const manifestGlobal = structuredClone(_globalManifest);
12416
12421
  const newWindows = [...manifestGlobal.windows];
12417
12422
  // Creating new current window manifest, without moved widget
@@ -12479,16 +12484,16 @@ class DashboardEffects {
12479
12484
  return DashboardActions.updateManifest({ manifest: { ...manifestGlobal, windows: newWindows }, selectedIds });
12480
12485
  })));
12481
12486
  this.multiSnackBar$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.multiSnackBar), tap((action) => this.snackBar.open(action.message))), { dispatch: false });
12482
- this.relaunchAfterOrder$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.quickOrder), map$1((action) => SearchActions.getDatasourceItems({
12487
+ this.relaunchAfterOrder$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.quickOrder), map((action) => SearchActions.getDatasourceItems({
12483
12488
  id: action.datasourceId,
12484
12489
  excludeGeo: true,
12485
12490
  from: 'DashboardEffects.relaunchAfterOrder$'
12486
12491
  }))));
12487
- this.propagateGridLayout$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.windowManifest)), map$1(([action, rank, windowManifest]) => DashboardActions.propagateGridLayout({ manifest: windowManifest, rank }))));
12488
- this.toggleEditionModeIfNotManual$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), filter$1((action) => action.layout !== DashboardGridLayout.MANUAL), map$1(() => DashboardActions.toggleEditionMode({ force: false }))));
12489
- this.getCapability$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getCapability), withLatestFrom(this.store.select(DashboardSelectors.capabilities)), filter$1(([action, capabilities]) => (!!capabilities && !!action.url && (!capabilities[action.url] || !capabilities[action.url].doc)) ||
12490
- !!action.force), mergeMap$1(([action, _]) => this.wmsService.getCapabilities(action.url).pipe(map$1((capability) => DashboardActions.updateCapability({ url: action.url, capability })), startWith(DashboardActions.updateCapability({ url: action.url, capability: null }))))));
12491
- this.getWmsFeatures = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWmsFeatures), mergeMap$1((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), map$1(([action, json]) => {
12492
+ this.propagateGridLayout$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), withLatestFrom(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.windowManifest)), map(([action, rank, windowManifest]) => DashboardActions.propagateGridLayout({ manifest: windowManifest, rank }))));
12493
+ this.toggleEditionModeIfNotManual$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.setGridLayout), filter((action) => action.layout !== DashboardGridLayout.MANUAL), map(() => DashboardActions.toggleEditionMode({ force: false }))));
12494
+ this.getCapability$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getCapability), withLatestFrom(this.store.select(DashboardSelectors.capabilities)), filter(([action, capabilities]) => (!!capabilities && !!action.url && (!capabilities[action.url] || !capabilities[action.url].doc)) ||
12495
+ !!action.force), mergeMap(([action, _]) => this.wmsService.getCapabilities(action.url).pipe(map((capability) => DashboardActions.updateCapability({ url: action.url, capability })), startWith(DashboardActions.updateCapability({ url: action.url, capability: null }))))));
12496
+ this.getWmsFeatures = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWmsFeatures), mergeMap((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), map(([action, json]) => {
12492
12497
  return DashboardActions.addWmsFeatures({
12493
12498
  features: json.features.map((feature) => {
12494
12499
  const result = {
@@ -12504,7 +12509,7 @@ class DashboardEffects {
12504
12509
  componentId: action.componentId
12505
12510
  });
12506
12511
  })));
12507
- this.getWfsFeaturesForPointStack = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWfsFeaturesForPointStackTooltips), mergeMap$1((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), mergeMap$1(([action, wmsJson]) => {
12512
+ this.getWfsFeaturesForPointStack = createEffect(() => this.actions$.pipe(ofType(DashboardActions.getWfsFeaturesForPointStackTooltips), mergeMap((action) => combineLatest([of(action), this.wmsService.getWmsFeatures(action.url)])), mergeMap(([action, wmsJson]) => {
12508
12513
  // check if data is actually a stack of points
12509
12514
  if (wmsJson.features[0] &&
12510
12515
  wmsJson.features[0].properties.count &&
@@ -12513,11 +12518,11 @@ class DashboardEffects {
12513
12518
  let envBBOXCoords = [...wmsJson.features[0].properties.envBBOX.matchAll(/\d+.\d+/g)].map((m) => parseFloat(m[0]));
12514
12519
  return this.wmsService
12515
12520
  .getWfsFeatures(action.url, envBBOXCoords)
12516
- .pipe(map$1((wfsJson) => ({ action, json: wfsJson })));
12521
+ .pipe(map((wfsJson) => ({ action, json: wfsJson })));
12517
12522
  }
12518
12523
  // if data is not a stack just add features without calling wfs service
12519
12524
  return of({ action, json: wmsJson });
12520
- }), map$1(({ action, json }) => DashboardActions.addWmsFeatures({
12525
+ }), map(({ action, json }) => DashboardActions.addWmsFeatures({
12521
12526
  features: json.features.map((feature) => ({
12522
12527
  id: feature.id,
12523
12528
  oClass: action.oClass,
@@ -12531,7 +12536,7 @@ class DashboardEffects {
12531
12536
  console.error('Error while fetching WFS features', error);
12532
12537
  return of(DashboardActions.addWmsFeatures({ features: [], componentId: 'error' }));
12533
12538
  })));
12534
- this.addManifestMetadata = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addManifestMetadata), mergeMap$1((action) => this.manifestService.addMetadata(action.presentationId, action.metadataId, action.value).pipe(map$1(() => DashboardActions.fetchManifestsList()), catchError((error) => {
12539
+ this.addManifestMetadata = createEffect(() => this.actions$.pipe(ofType(DashboardActions.addManifestMetadata), mergeMap((action) => this.manifestService.addMetadata(action.presentationId, action.metadataId, action.value).pipe(map(() => DashboardActions.fetchManifestsList()), catchError((error) => {
12535
12540
  if (error.status === 404) {
12536
12541
  this.snackBar.open({
12537
12542
  type: 'error',
@@ -12542,16 +12547,16 @@ class DashboardEffects {
12542
12547
  }
12543
12548
  return throwError(() => error);
12544
12549
  })))));
12545
- this.deleteManifestMetadata$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifestMetadata), mergeMap$1((action) => this.manifestService
12550
+ this.deleteManifestMetadata$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.deleteManifestMetadata), mergeMap((action) => this.manifestService
12546
12551
  .deleteMetadata(action.presentationId, action.metadataId)
12547
- .pipe(map$1(() => DashboardActions.fetchManifestsList())))));
12552
+ .pipe(map(() => DashboardActions.fetchManifestsList())))));
12548
12553
  this.loadPresentation$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.loadPresentation), tap(() => this.store.dispatch(DashboardActions.updateManifest({
12549
12554
  manifest: { windows: [] },
12550
12555
  selectedIds: []
12551
12556
  }))), tap((action) => this.store.dispatch(DashboardActions.selectPresentation({
12552
12557
  presentation: action.presentation,
12553
12558
  viewMode: action.viewMode
12554
- }))), tap((action) => this.titleService.changeTitle(action.presentation.name)), mergeMap$1((action) => this.manifestService.get(action.presentation.id).pipe(mergeMap$1((manifest) => [
12559
+ }))), tap((action) => this.titleService.changeTitle(action.presentation.name)), mergeMap((action) => this.manifestService.get(action.presentation.id).pipe(mergeMap((manifest) => [
12555
12560
  DashboardActions.updateManifest({
12556
12561
  manifest,
12557
12562
  selectedIds: [],
@@ -13596,5 +13601,5 @@ function filterLoader(module, prop) {
13596
13601
  * Generated bundle index. Do not edit.
13597
13602
  */
13598
13603
 
13599
- export { ALIGNMENT_OPTIONS, AUTHENTICATED_USERS_GROUP, AccordionComponent, AccordionItemComponent, Aggregation, BASE_DISPLAY_OPTIONS, BaseFilterComponent, BaseFilterModule, BaseLayoutComponent, BaseMenuComponent, BaseToolboxComponent, BaseTooltipComponent, BaseTooltipModule, BaseWidgetComponent, BaseWidgetModule, BusService, CategoryActions, CategorySelectors, CategoryService, ChartOptionDefault, ChipsSelectorComponent, ClassActions, ClassSelectors, ClassService, ConfigActions, ConfigSelectors, ConfigService, ContextMenuActions, ContextMenuComponent, ContextMenuSelectors, DEFAULT_CATEGORY_UUID, DEFAULT_COLUMNS_NUMBER, DEFAULT_DASHBOARD_ICON_URL, DEFAULT_GAP_PX, DEFAULT_ICON_URL, DEFAULT_MSG_TIMEOUT, DEFAULT_NAMED_QUERY_ID, DEFAULT_PROJECTION, DEFAULT_RESTITUTION_ICON_URL, DEFAULT_ROWS_NUMBER, DEFAULT_ROW_HEIGHT_PX, DEFAULT_SEARCH_LIMIT_NUMBER, DEFAULT_TABLE_WIDGET_STYLE, DELAY_FOR_HIDE, DashboardActions, DashboardComponent, DashboardGridLayout, DashboardSelectors, DataSourceActions, DataSourceSelectors, DataSourceService, DataWidgetComponent, DatasourceSelectorComponent, DatasourceUtils, DateRangeHighlightPipe, DateUtils, DefaultTooltipComponent, ENV_OPTIONS, EXPLORE_NAMED_QUERY_ID, EllipsisDirective, FIELD_I18N, FIELD_UUID, FILTERS_DOMAIN, FILTER_DEFINITION, FieldActions, FieldSelectors, FieldService, FieldType, FilterFactoryService, FilterGroupComponent, FilterInstanciatorComponent, FilterParamEncoder, GeoMetadata, GeometricFieldTypes, GetSecuredImagePipe, GraphType, HTTP_ORIGIN_METADATA, I18nPipe, INTERNALLY_STORED_IMAGE_PREFIX, IconPosition, ImageActions, ImageService, ImagesSelectors, ItemUtils, LibraryTypes, LoopScrollColumnComponent, METADATA_TYPE, META_OPTIONS, MIME_TYPE_RESULTSET, MIME_TYPE_WIDGET_MANIFEST, MIME_TYPE_WIDGET_SIZE, MIME_TYPE_WIDGET_TYPE, ManifestService, ManifestUtils, ManifestsComponent, MarkSubType, MarkType, MetadataComponent, NON_EXCLUDE_GEO_WIDGET_TYPES, NamedQueryTypes, NumericFieldTypes, OPERATOR_OPTIONS, Operation, PRY_ACCESS_GUARD, PRY_ACCESS_TOKEN, PRY_CUSTOMEVENT_TYPE, PRY_DIALOG_DATA, PRY_GEOAUTH_TOKEN, PUBLIC_GROUP, PryAboutComponent, PryAboutModule, PryAccessDirective, PryAccessRightsShareComponent, PryAccessRightsShareModalComponent, PryAccessUtils, PryAggregationService, PryBackendAggregationService, PryBaseAccess, PryBaseAccessGuard, PryChipsSelectorModule, PryCoreModule, PryDashboardModule, PryDatasetType, PryDatasourceCardComponent, PryDatasourceListComponent, PryDatePickerComponent, PryDatePickerModule, PryDefaultAccessGuard, PryDefaultAccessService, PryDefaultGeoAuthService, PryDialogConfirmComponent, PryDialogRef, PryDialogService, PryEditInputComponent, PryEditInputModule, PryFilterGroupCssComponent, PryFrontendAggregationService, PryGeoAuthService, PryGroupShareComponent, PryHiddenWhenOverlay, PryHiddenWhenOverlayDirective, PryHttpErrorInterceptorService, PryI18nModule, PryI18nService, PryIconComponent, PryIconModule, PryModalComponent, PryModalModule, PryNqColorSelectorComponent, PryObjectEditionComponent, PryOverlayDirective, PryOverlayModule, PryRangeComponent, PryRangeModule, PrySelectComponent, PrySelectImageComponent, PrySelectModule, PryShareComponent, PryShareMode, PryShareModule, PrySinceDateModule, PrySnackbarComponent, PrySnackbarModule, PrySnackbarService, PrySortDataPipe, PrySortHeaderComponent, PrySortHeaderDirective, PrySortModule, PrySortTableDirective, PryStatusModalComponent, PryStatusModalModule, PryTimePickerComponent, PryTitleService, PryToggleComponent, PryToggleModule, PryUploadComponent, PryVisibilityType, PryWidgetHeaderComponent, READ_ACCESS, RawService, RelationTypesActions, RelationTypesSelectors, RelationTypesService, ResultSetSizePipe, ResultsetUtils, SYMBOL_DOMAIN, SYSTEM_GROUPS, SearchActions, SearchSelectors, SearchService, SettingsComponent, SinceDatePipe, SubscriptionnerDirective, SymbolService, TABLE_ATTR_DOMAIN, TILE_ATTR_DOMAIN, TOOLTIPS_DOMAIN, TOOLTIP_DEFINITION, TabComponent, TabGroupComponent, TextFieldTypes, ToolboxManifestService, ToolboxMenuService, TooltipFactoryService, TooltipMode, TranslateIdPipe, TranslateItemToSymbolPipe, UNKNOWN_DATASOURCE, USE_CURRENT_RESULTSET, VARIABLE_TYPE, VegaColorType, VegaType, ViewMode, VizualizeRawComponent, WIDGET_DEFINITION, WIDGET_HEADER_HEIGHT, WRITE_ACCESS, WebsocketService, WidgetFactoryService, WidgetInstanciatorComponent, WidgetPlaceholderComponent, WidgetPlacementUtils, WmsService, adapter$2 as adapter, aggregationDefault, baseItemProperties, canManifestBeMadePublic, classReducer, classesFeatureKey, compareOperationFunctions, contextMenuFeatureKey, contextMenuReducer, createPlacedWidgetCopy, dashboardFeatureKey, dashboardInitialState, dashboardReducer, dataSourceFeatureKey, dataSourceReducer, deepMerge, defaultColors, defaultMenuStructure, enTranslations$1 as enTranslations, filterLoader, frTranslations$1 as frTranslations, getAccessArray, getAccessRightsArrayByGroup, getAccessRightsStringByGroup, getAccessString, getCommonDatasourceGroupsForManifest, getDisplayOptions, getGroupLabel, getGroupLabelByName, getShareLevel, httpErrorOptions, imageFeatureKey, imageReducer, initialClassState, initialContextMenuState, initialDataSourceState, initialImageState, initialSearchState, latLonToGeographicFieldTransformation, markTypesDefault, notificationFeatureKey, orderWidgetsAccordingToPlacement, searchFeatureKey, searchReducer, selectAll$2 as selectAll, selectEntities$2 as selectEntities, solveCollisions, solvingCollisionOptions, sortByName$2 as sortByName, subTypesDefault, tooltipLoader, vegaColorSchemesDefault, widgetLoader, widgetMapConfig };
13604
+ export { ALIGNMENT_OPTIONS, AUTHENTICATED_USERS_GROUP, AccordionComponent, AccordionItemComponent, Aggregation, BASE_DISPLAY_OPTIONS, BaseFilterComponent, BaseFilterModule, BaseLayoutComponent, BaseMenuComponent, BaseToolboxComponent, BaseTooltipComponent, BaseTooltipModule, BaseWidgetComponent, BaseWidgetModule, BusService, CategoryActions, CategorySelectors, CategoryService, ChartOptionDefault, ChipsSelectorComponent, ClassActions, ClassSelectors, ClassService, ConfigActions, ConfigSelectors, ConfigService, ContextMenuActions, ContextMenuComponent, ContextMenuSelectors, DEFAULT_CATEGORY_UUID, DEFAULT_COLUMNS_NUMBER, DEFAULT_DASHBOARD_ICON_URL, DEFAULT_GAP_PX, DEFAULT_ICON_URL, DEFAULT_MSG_TIMEOUT, DEFAULT_NAMED_QUERY_ID, DEFAULT_PROJECTION, DEFAULT_RESTITUTION_ICON_URL, DEFAULT_ROWS_NUMBER, DEFAULT_ROW_HEIGHT_PX, DEFAULT_SEARCH_LIMIT_NUMBER, DEFAULT_TABLE_WIDGET_STYLE, DELAY_FOR_HIDE, DashboardActions, DashboardComponent, DashboardGridLayout, DashboardSelectors, DataSourceActions, DataSourceSelectors, DataSourceService, DataWidgetComponent, DatasourceSelectorComponent, DatasourceUtils, DateRangeHighlightPipe, DateUtils, DefaultTooltipComponent, ENV_OPTIONS, EXPLORE_NAMED_QUERY_ID, EllipsisDirective, FIELD_I18N, FIELD_UUID, FILTERS_DOMAIN, FILTER_DEFINITION, FieldActions, FieldSelectors, FieldService, FieldType, FilterFactoryService, FilterGroupComponent, FilterInstanciatorComponent, FilterParamEncoder, GeoMetadata, GeometricFieldTypes, GetSecuredImagePipe, GraphType, HTTP_ORIGIN_METADATA, I18nPipe, INTERNALLY_STORED_IMAGE_PREFIX, IconPosition, ImageActions, ImageService, ImagesSelectors, ItemActions, ItemService, ItemUtils, LibraryTypes, LoopScrollColumnComponent, METADATA_TYPE, META_OPTIONS, MIME_TYPE_RESULTSET, MIME_TYPE_WIDGET_MANIFEST, MIME_TYPE_WIDGET_SIZE, MIME_TYPE_WIDGET_TYPE, ManifestService, ManifestUtils, ManifestsComponent, MarkSubType, MarkType, MetadataComponent, NON_EXCLUDE_GEO_WIDGET_TYPES, NamedQueryTypes, NumericFieldTypes, OPERATOR_OPTIONS, Operation, PRY_ACCESS_GUARD, PRY_ACCESS_TOKEN, PRY_CUSTOMEVENT_TYPE, PRY_DIALOG_DATA, PRY_GEOAUTH_TOKEN, PUBLIC_GROUP, PryAboutComponent, PryAboutModule, PryAccessDirective, PryAccessRightsShareComponent, PryAccessRightsShareModalComponent, PryAccessUtils, PryAggregationService, PryBackendAggregationService, PryBaseAccess, PryBaseAccessGuard, PryChipsSelectorModule, PryCoreModule, PryDashboardModule, PryDatasetType, PryDatasourceCardComponent, PryDatasourceListComponent, PryDatePickerComponent, PryDatePickerModule, PryDefaultAccessGuard, PryDefaultAccessService, PryDefaultGeoAuthService, PryDialogConfirmComponent, PryDialogRef, PryDialogService, PryEditInputComponent, PryEditInputModule, PryFilterGroupCssComponent, PryFrontendAggregationService, PryGeoAuthService, PryGroupShareComponent, PryHiddenWhenOverlay, PryHiddenWhenOverlayDirective, PryHttpErrorInterceptorService, PryI18nModule, PryI18nService, PryIconComponent, PryIconModule, PryModalComponent, PryModalModule, PryNqColorSelectorComponent, PryObjectEditionComponent, PryOverlayDirective, PryOverlayModule, PryRangeComponent, PryRangeModule, PrySelectComponent, PrySelectImageComponent, PrySelectModule, PryShareComponent, PryShareMode, PryShareModule, PrySinceDateModule, PrySnackbarComponent, PrySnackbarModule, PrySnackbarService, PrySortDataPipe, PrySortHeaderComponent, PrySortHeaderDirective, PrySortModule, PrySortTableDirective, PryStatusModalComponent, PryStatusModalModule, PryTimePickerComponent, PryTitleService, PryToggleComponent, PryToggleModule, PryUploadComponent, PryVisibilityType, PryWidgetHeaderComponent, READ_ACCESS, RawService, RelationTypesActions, RelationTypesSelectors, RelationTypesService, ResultSetSizePipe, ResultsetUtils, SYMBOL_DOMAIN, SYSTEM_GROUPS, SearchActions, SearchSelectors, SearchService, SettingsComponent, SinceDatePipe, SubscriptionnerDirective, SymbolService, TABLE_ATTR_DOMAIN, TILE_ATTR_DOMAIN, TOOLTIPS_DOMAIN, TOOLTIP_DEFINITION, TabComponent, TabGroupComponent, TextFieldTypes, ToolboxManifestService, ToolboxMenuService, TooltipFactoryService, TooltipMode, TranslateIdPipe, TranslateItemToSymbolPipe, UNKNOWN_DATASOURCE, USE_CURRENT_RESULTSET, VARIABLE_TYPE, VegaColorType, VegaType, ViewMode, VizualizeRawComponent, WIDGET_DEFINITION, WIDGET_HEADER_HEIGHT, WRITE_ACCESS, WebsocketService, WidgetFactoryService, WidgetInstanciatorComponent, WidgetPlaceholderComponent, WidgetPlacementUtils, WmsService, adapter$2 as adapter, aggregationDefault, baseItemProperties, canManifestBeMadePublic, classReducer, classesFeatureKey, compareOperationFunctions, contextMenuFeatureKey, contextMenuReducer, createPlacedWidgetCopy, dashboardFeatureKey, dashboardInitialState, dashboardReducer, dataSourceFeatureKey, dataSourceReducer, deepMerge, defaultColors, defaultMenuStructure, enTranslations$1 as enTranslations, filterLoader, frTranslations$1 as frTranslations, getAccessArray, getAccessRightsArrayByGroup, getAccessRightsStringByGroup, getAccessString, getCommonDatasourceGroupsForManifest, getDisplayOptions, getGroupLabel, getGroupLabelByName, getShareLevel, httpErrorOptions, imageFeatureKey, imageReducer, initialClassState, initialContextMenuState, initialDataSourceState, initialImageState, initialSearchState, latLonToGeographicFieldTransformation, markTypesDefault, notificationFeatureKey, orderWidgetsAccordingToPlacement, searchFeatureKey, searchReducer, selectAll$2 as selectAll, selectEntities$2 as selectEntities, solveCollisions, solvingCollisionOptions, sortByName$2 as sortByName, subTypesDefault, tooltipLoader, vegaColorSchemesDefault, widgetLoader, widgetMapConfig };
13600
13605
  //# sourceMappingURL=provoly-dashboard.mjs.map