@provoly/dashboard 1.2.11 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/esm2022/lib/core/model/widget-table-manifest.interface.mjs +9 -2
  2. package/esm2022/lib/dashboard/components/dashboard.component.mjs +2 -2
  3. package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-factory.service.mjs +2 -2
  4. package/esm2022/lib/dashboard/store/dashboard.effects.mjs +4 -3
  5. package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +3 -2
  6. package/esm2022/lib/dashboard/store/dashboard.selectors.mjs +2 -2
  7. package/esm2022/lib/dashboard/store/manifest-utils.class.mjs +23 -2
  8. package/esm2022/mock/provoly-dashboard-mock.mjs +5 -0
  9. package/esm2022/mock/public-api.mjs +3 -0
  10. package/esm2022/mock/service/mock-i18n.service.mjs +13 -0
  11. package/esm2022/mock/service/mock-overlay.service.mjs +44 -0
  12. package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +3 -3
  13. package/esm2022/toolbox/components/refresh-datasets/refresh-datasets.component.mjs +2 -2
  14. package/esm2022/toolbox/components/save-view/save-view.component.mjs +2 -8
  15. package/esm2022/toolbox/shared/presentation-form/presentation-form.component.mjs +10 -4
  16. package/esm2022/widgets/widget-table/component/widget-table.component.mjs +19 -4
  17. package/esm2022/widgets/widget-table/expand-value/expand-value.component.mjs +3 -3
  18. package/fesm2022/provoly-dashboard-mock.mjs +63 -0
  19. package/fesm2022/provoly-dashboard-mock.mjs.map +1 -0
  20. package/fesm2022/provoly-dashboard-presentation.mjs +2 -2
  21. package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
  22. package/fesm2022/provoly-dashboard-toolbox.mjs +10 -10
  23. package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
  24. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs +26 -11
  25. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs.map +1 -1
  26. package/fesm2022/provoly-dashboard.mjs +37 -8
  27. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  28. package/lib/core/model/widget-table-manifest.interface.d.ts +14 -0
  29. package/lib/dashboard/store/dashboard.effects.d.ts +7 -0
  30. package/lib/dashboard/store/manifest-utils.class.d.ts +2 -0
  31. package/mock/index.d.ts +5 -0
  32. package/mock/public-api.d.ts +2 -0
  33. package/mock/service/mock-i18n.service.d.ts +9 -0
  34. package/mock/service/mock-overlay.service.d.ts +30 -0
  35. package/package.json +7 -1
  36. package/styles/base/_utils.scss +4 -0
  37. package/styles/components/_a-expandable-value.scss +0 -5
  38. package/styles/components/_a-table.scss +10 -3
  39. package/styles-theme/components-theme/_a-table.theme.scss +6 -0
  40. package/toolbox/components/save-view/save-view.component.d.ts +0 -1
  41. package/toolbox/shared/presentation-form/presentation-form.component.d.ts +2 -1
  42. package/widgets/widget-table/component/widget-table.component.d.ts +3 -1
@@ -3977,7 +3977,7 @@ const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.p
3977
3977
  const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
3978
3978
  const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
3979
3979
  .map((window, idx) => ({ windowIndex: idx, widgets: window.widgets }))
3980
- .map(({ windowIndex, widgets }) => widgets.map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
3980
+ .map(({ windowIndex, widgets }) => (widgets ?? []).map((widget) => (Array.isArray(widget.datasource) ? widget.datasource : [widget.datasource])
3981
3981
  .filter((rsName) => rsName !== undefined)
3982
3982
  .map((rsName) => ({
3983
3983
  rsName,
@@ -8624,7 +8624,7 @@ class WidgetFactoryService {
8624
8624
  const datasources = [];
8625
8625
  const aggregates = [];
8626
8626
  manifest.windows.forEach((windowManifest) => {
8627
- windowManifest.widgets.forEach((widgetManifest) => {
8627
+ (windowManifest.widgets ?? []).forEach((widgetManifest) => {
8628
8628
  this.datasourcesToAutoLoad(widgetManifest).forEach((res) => {
8629
8629
  if (res.datasetId) {
8630
8630
  datasources.push(res);
@@ -9194,7 +9194,7 @@ class DashboardComponent extends SubscriptionnerDirective {
9194
9194
  }
9195
9195
  return wManifest;
9196
9196
  }), distinctUntilChanged((p, c) => equal(p, c)));
9197
- this.nonFillerWidgets$ = this.windowManifest$.pipe(map$1((wManifest) => wManifest.widgets.filter((w) => w.type !== 'filler').length));
9197
+ this.nonFillerWidgets$ = this.windowManifest$.pipe(map$1((wManifest) => (wManifest.widgets ?? []).filter((w) => w.type !== 'filler').length));
9198
9198
  this.subscriptions.add(this.staticDashboard$.subscribe((manifest) => {
9199
9199
  if (!!manifest) {
9200
9200
  const getDataActions = [
@@ -10160,6 +10160,15 @@ const OPERATOR_OPTIONS = [
10160
10160
  { type: 'date', operator: 'OUTSIDE', translation: '@pry.search.operator.outerBoundsDate', twoValues: true }
10161
10161
  ];
10162
10162
 
10163
+ const DEFAULT_TABLE_WIDGET_STYLE = {
10164
+ value: {
10165
+ headerTextAlign: 'center',
10166
+ cellTextAlign: 'center',
10167
+ showVerticalSeparator: false
10168
+ }
10169
+ };
10170
+ const ALIGNMENT_OPTIONS = ['center', 'left', 'right'];
10171
+
10163
10172
  const notificationFeatureKey = '@pry/notification';
10164
10173
 
10165
10174
  /**
@@ -11590,7 +11599,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
11590
11599
  class ManifestUtils {
11591
11600
  static getDatasourcesUsedByManifest(manifest) {
11592
11601
  const mapOfDatasources = manifest.windows
11593
- .map((window) => window.widgets.map((widget) => ({ datasetId: widget.datasource, excludeGeo: widget.type !== 'map' })))
11602
+ .map((window) => (window.widgets ?? []).map((widget) => ({ datasetId: widget.datasource, excludeGeo: widget.type !== 'map' })))
11594
11603
  .flat(3)
11595
11604
  .filter((dataset) => !!dataset.datasetId)
11596
11605
  .map((res) => Array.isArray(res.datasetId)
@@ -11599,6 +11608,25 @@ class ManifestUtils {
11599
11608
  .flat().reduce((p, c) => ({ ...p, [c.datasetId]: { ...p[c.datasetId], ...c } }), {});
11600
11609
  return Object.values(mapOfDatasources);
11601
11610
  }
11611
+ static cleanupManifest(manifest) {
11612
+ return {
11613
+ ...manifest,
11614
+ windows: manifest.windows.map((window) => ManifestUtils.cleanupDashboardManifest(window))
11615
+ };
11616
+ }
11617
+ static cleanupDashboardManifest(window) {
11618
+ return {
11619
+ ...window,
11620
+ grid: {
11621
+ columns: DEFAULT_COLUMNS_NUMBER,
11622
+ rows: DEFAULT_ROWS_NUMBER,
11623
+ layout: DashboardGridLayout.MANUAL,
11624
+ gap: DEFAULT_GAP_PX,
11625
+ ...window.grid
11626
+ },
11627
+ widgets: window.widgets ?? []
11628
+ };
11629
+ }
11602
11630
  }
11603
11631
 
11604
11632
  class ManifestService {
@@ -12022,9 +12050,10 @@ class DashboardEffects {
12022
12050
  type: 'error'
12023
12051
  });
12024
12052
  return throwError(() => error);
12025
- }))), mergeMap$1((manifest) => [
12053
+ }))), withLatestFrom(this.store.select(DashboardSelectors.selectedItemIds)), mergeMap$1(([manifest, selectedIds]) => [
12026
12054
  DashboardActions.fetchManifestsList(),
12027
- DashboardActions.setInitialPresentation({ initial: manifest })
12055
+ DashboardActions.setInitialPresentation({ initial: manifest }),
12056
+ DashboardActions.updateManifest({ manifest, selectedIds })
12028
12057
  ])));
12029
12058
  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 }))))));
12030
12059
  this.confirmManifestDeletion$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.confirmManifestDeletion), tap((action) => {
@@ -12427,7 +12456,7 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
12427
12456
  manifests: {
12428
12457
  ...state.manifests,
12429
12458
  tenants: action.tenants ?? state.manifests.tenants,
12430
- manifest: action.manifest,
12459
+ manifest: ManifestUtils.cleanupManifest(action.manifest),
12431
12460
  currentId: action.manifestId ?? state.manifests.currentId
12432
12461
  },
12433
12462
  // @ts-ignore
@@ -13376,5 +13405,5 @@ function filterLoader(module, prop) {
13376
13405
  * Generated bundle index. Do not edit.
13377
13406
  */
13378
13407
 
13379
- export { 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, DELAY_FOR_HIDE, DashboardActions, DashboardComponent, DashboardGridLayout, DashboardSelectors, DataSourceActions, DataSourceSelectors, DataSourceService, DataWidgetComponent, DatasourceSelectorComponent, DatasourceUtils, DateRangeHighlightPipe, DateUtils, DefaultTooltipComponent, ENV_OPTIONS, EXPLORE_NAMED_QUERY_ID, EllipsisDirective, FIELD_OPTIONS, 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, 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, PryModalStatusComponent, PryModalStatusModule, PryNqColorSelectorComponent, PryObjectEditionComponent, PryOverlayDirective, PryOverlayModule, PryRangeComponent, PryRangeModule, PrySelectComponent, PrySelectImageComponent, PrySelectModule, PryShareComponent, PryShareMode, PryShareModule, PrySinceDateModule, PrySnackbarComponent, PrySnackbarModule, PrySnackbarService, PrySortDataPipe, PrySortHeaderComponent, PrySortHeaderDirective, PrySortModule, PrySortTableDirective, 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, 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 };
13408
+ 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_OPTIONS, 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, 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, PryModalStatusComponent, PryModalStatusModule, PryNqColorSelectorComponent, PryObjectEditionComponent, PryOverlayDirective, PryOverlayModule, PryRangeComponent, PryRangeModule, PrySelectComponent, PrySelectImageComponent, PrySelectModule, PryShareComponent, PryShareMode, PryShareModule, PrySinceDateModule, PrySnackbarComponent, PrySnackbarModule, PrySnackbarService, PrySortDataPipe, PrySortHeaderComponent, PrySortHeaderDirective, PrySortModule, PrySortTableDirective, 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, 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 };
13380
13409
  //# sourceMappingURL=provoly-dashboard.mjs.map