@provoly/dashboard 0.14.9 → 0.14.11

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 (100) hide show
  1. package/admin/components/admin-layout/admin-layout.component.d.ts +5 -3
  2. package/assets/svgs/map.svg +1 -1
  3. package/components/metadata-editor/metadata-editor.component.d.ts +1 -3
  4. package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +1 -1
  5. package/esm2022/admin/components/admin-layout/admin-layout.component.mjs +10 -7
  6. package/esm2022/admin/components/admin-user/admin-user-select/admin-user-select.component.mjs +1 -1
  7. package/esm2022/admin/i18n/en.translations.mjs +2 -2
  8. package/esm2022/admin/i18n/fr.translations.mjs +5 -5
  9. package/esm2022/components/metadata-editor/metadata-editor.component.mjs +8 -29
  10. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +2 -2
  11. package/esm2022/lib/core/components/about/about.component.mjs +29 -0
  12. package/esm2022/lib/core/components/about/pry-about.module.mjs +21 -0
  13. package/esm2022/lib/core/components/icon/icon.component.mjs +5 -1
  14. package/esm2022/lib/core/i18n/en.translations.mjs +13 -2
  15. package/esm2022/lib/core/i18n/fr.translations.mjs +13 -2
  16. package/esm2022/lib/core/i18n/i18n.pipe.mjs +4 -3
  17. package/esm2022/lib/core/i18n/i18n.service.mjs +5 -5
  18. package/esm2022/lib/core/model/widget-map-manifest.interface.mjs +1 -1
  19. package/esm2022/lib/core/public-api.mjs +3 -1
  20. package/esm2022/lib/core/store/class/class.effects.mjs +1 -1
  21. package/esm2022/lib/core/store/config/config.actions.mjs +5 -2
  22. package/esm2022/lib/core/store/config/config.effects.mjs +4 -1
  23. package/esm2022/lib/core/store/config/config.reducer.mjs +10 -3
  24. package/esm2022/lib/core/store/config/config.selectors.mjs +6 -4
  25. package/esm2022/lib/core/store/config/config.service.mjs +36 -2
  26. package/esm2022/lib/core/store/config/versions.interface.mjs +2 -0
  27. package/esm2022/lib/core/toolbox/toolbox-manifest.service.mjs +15 -1
  28. package/esm2022/lib/core/toolbox/toolbox-menu.service.mjs +3 -17
  29. package/esm2022/lib/dashboard/components/manifests/manifests.component.mjs +3 -1
  30. package/esm2022/lib/dashboard/components/widgets/base-widget.component.mjs +3 -2
  31. package/esm2022/lib/dashboard/store/dashboard.actions.mjs +2 -2
  32. package/esm2022/lib/dashboard/store/dashboard.effects.mjs +12 -4
  33. package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +7 -1
  34. package/esm2022/lib/dashboard/store/manifest.service.mjs +2 -3
  35. package/esm2022/notification/store/notification.effects.mjs +3 -3
  36. package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +23 -18
  37. package/esm2022/presentation/components/presentation.component.mjs +18 -18
  38. package/esm2022/presentation/style/css.component.mjs +2 -2
  39. package/esm2022/restitution/components/restitution-list/restitution-list.component.mjs +3 -3
  40. package/esm2022/restitution/components/restitution-list-item/restitution-list-item.component.mjs +6 -3
  41. package/esm2022/supervision/components/supervision-integration-errors/supervision-integration-errors-select/supervision-integration-errors-select.component.mjs +6 -3
  42. package/esm2022/supervision/components/supervision-integration-errors/supervision-integration-errors.component.mjs +2 -2
  43. package/esm2022/supervision/components/supervision-layout/supervision-layout.component.mjs +2 -2
  44. package/esm2022/supervision/components/supervision.component.mjs +2 -2
  45. package/esm2022/supervision/store/supervision.actions.mjs +1 -1
  46. package/esm2022/supervision/store/supervision.reducer.mjs +3 -2
  47. package/esm2022/supervision/store/supervision.selectors.mjs +2 -2
  48. package/esm2022/tooltips/attribute/attribute-tooltip.component.mjs +18 -11
  49. package/esm2022/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.mjs +20 -6
  50. package/esm2022/widgets/widget-aggregated-chart/i18n/fr.translations.mjs +1 -2
  51. package/esm2022/widgets/widget-map/component/widget-map-layer.service.mjs +2 -2
  52. package/fesm2022/provoly-dashboard-admin.mjs +15 -12
  53. package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
  54. package/fesm2022/provoly-dashboard-components-metadata-editor.mjs +7 -28
  55. package/fesm2022/provoly-dashboard-components-metadata-editor.mjs.map +1 -1
  56. package/fesm2022/provoly-dashboard-dataset.mjs +1 -1
  57. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  58. package/fesm2022/provoly-dashboard-notification.mjs +2 -2
  59. package/fesm2022/provoly-dashboard-notification.mjs.map +1 -1
  60. package/fesm2022/provoly-dashboard-presentation.mjs +41 -37
  61. package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
  62. package/fesm2022/provoly-dashboard-restitution.mjs +7 -4
  63. package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
  64. package/fesm2022/provoly-dashboard-supervision.mjs +11 -8
  65. package/fesm2022/provoly-dashboard-supervision.mjs.map +1 -1
  66. package/fesm2022/provoly-dashboard-tooltips-attribute.mjs +17 -10
  67. package/fesm2022/provoly-dashboard-tooltips-attribute.mjs.map +1 -1
  68. package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs +19 -6
  69. package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs.map +1 -1
  70. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +1 -1
  71. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
  72. package/fesm2022/provoly-dashboard.mjs +184 -56
  73. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  74. package/lib/core/components/about/about.component.d.ts +12 -0
  75. package/lib/core/components/about/pry-about.module.d.ts +10 -0
  76. package/lib/core/i18n/en.translations.d.ts +11 -0
  77. package/lib/core/i18n/fr.translations.d.ts +11 -0
  78. package/lib/core/i18n/i18n.service.d.ts +2 -2
  79. package/lib/core/model/widget-map-manifest.interface.d.ts +2 -0
  80. package/lib/core/public-api.d.ts +2 -0
  81. package/lib/core/store/config/config.actions.d.ts +12 -0
  82. package/lib/core/store/config/config.effects.d.ts +6 -0
  83. package/lib/core/store/config/config.reducer.d.ts +2 -0
  84. package/lib/core/store/config/config.selectors.d.ts +1 -0
  85. package/lib/core/store/config/config.service.d.ts +2 -0
  86. package/lib/core/store/config/versions.interface.d.ts +10 -0
  87. package/lib/dashboard/store/dashboard.actions.d.ts +4 -4
  88. package/lib/dashboard/store/manifest.service.d.ts +1 -1
  89. package/package.json +25 -25
  90. package/presentation/components/add-edit-presentation/add-edit-presentation.component.d.ts +4 -3
  91. package/presentation/components/presentation.component.d.ts +2 -2
  92. package/presentation/style/_o-pry-new-presentation.scss +7 -0
  93. package/restitution/components/restitution-list-item/restitution-list-item.component.d.ts +3 -2
  94. package/styles/layout/_o-base-layout.scss +8 -1
  95. package/supervision/components/supervision-integration-errors/supervision-integration-errors-select/supervision-integration-errors-select.component.d.ts +1 -1
  96. package/supervision/store/supervision.actions.d.ts +2 -2
  97. package/supervision/store/supervision.reducer.d.ts +1 -1
  98. package/supervision/store/supervision.selectors.d.ts +1 -1
  99. package/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.d.ts +7 -0
  100. package/widgets/widget-aggregated-chart/i18n/fr.translations.d.ts +0 -1
@@ -150,18 +150,29 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
150
150
  const ordinate = classes
151
151
  .map((clazz) => clazz.attributes.find((attr) => attr.id === options.ordinate.attribute))
152
152
  .find((attr) => !!attr);
153
+ const groupBy = classes
154
+ .map((clazz) => clazz.attributes.find((attr) => attr.id === options.groupBy?.attribute))
155
+ .find((attr) => !!attr);
153
156
  const abscissaFieldType = fields.find((field) => field.id === abscissa?.field)?.type ?? FieldType.STRING;
154
157
  const ordinateFieldType = fields.find((field) => field.id === ordinate?.field)?.type ?? FieldType.STRING;
158
+ const groupByFieldType = fields.find((field) => field.id === groupBy?.field)?.type ?? FieldType.STRING;
155
159
  return {
156
160
  abscissa: {
157
161
  fieldType: abscissaFieldType,
158
- vegaType: this.translateToVegaType(abscissaFieldType, abscissa?.name ?? '')
162
+ vegaType: this.translateToVegaType(abscissaFieldType, abscissa?.name ?? ''),
163
+ name: abscissa?.name ?? ''
159
164
  },
160
165
  ordinate: {
161
166
  fieldType: ordinateFieldType,
162
167
  vegaType: options.ordinate.operation === Operation.COUNT || options.ordinate.operation === Operation.DISTINCT
163
168
  ? VegaType.QUANTITATIVE
164
- : this.translateToVegaType(ordinateFieldType, ordinate?.name ?? '')
169
+ : this.translateToVegaType(ordinateFieldType, ordinate?.name ?? ''),
170
+ name: ordinate?.name ?? ''
171
+ },
172
+ groupBy: {
173
+ fieldType: groupByFieldType,
174
+ vegaType: this.translateToVegaType(groupByFieldType, groupBy?.name),
175
+ name: groupBy?.name ?? ''
165
176
  }
166
177
  };
167
178
  }));
@@ -192,6 +203,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
192
203
  ]).pipe(map(([options, types, values, size, display]) => {
193
204
  const isCircular = [GraphType.CIRCULAR, GraphType.DONUT].includes(options.graph.type);
194
205
  const stacked = options.graph.type.startsWith('bar') ? !options.graph.stacked : options.graph.stacked;
206
+ const legendTitle = this.translateService.instant(options.groupBy ? types.groupBy.name ?? '' : '@pry.widget.chart.legendLabel');
195
207
  return mergeDeep({
196
208
  $schema: 'https://vega.github.io/schema/vega-lite/v5.json',
197
209
  title: this.getTitle(options),
@@ -252,7 +264,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
252
264
  : undefined,
253
265
  theta: isCircular ? { field: 'value', type: types.ordinate.vegaType } : undefined,
254
266
  color: {
255
- title: this.translateService.instant(options.groupBy ? '@pry.widget.chart.series' : '@pry.widget.chart.legendLabel'),
267
+ title: legendTitle,
256
268
  field: !isCircular ? 'series' : 'key',
257
269
  legend: options.graph.legend,
258
270
  scale: options.graph.legend ? { scheme: options.groupBy?.color ?? this.schemes[0].id } : undefined
@@ -270,7 +282,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
270
282
  { field: 'value', type: types.ordinate.vegaType, title: options.ordinate.label },
271
283
  {
272
284
  field: 'series',
273
- title: this.translateService.instant('@pry.widget.chart.series'),
285
+ title: legendTitle,
274
286
  type: 'nominal'
275
287
  }
276
288
  ]
@@ -301,7 +313,9 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
301
313
  renderer: 'canvas',
302
314
  formatLocale: this.translateService.instantObject('@pry.widget.chart.numberLocale'),
303
315
  timeFormatLocale: this.translateService.instantObject('@pry.widget.chart.timeFormatLocale')
304
- }).then((result) => (this.view = result.view));
316
+ })
317
+ .then((result) => (this.view = result.view))
318
+ .catch((err) => console.error('Cannot display chart', err));
305
319
  }
306
320
  else {
307
321
  setTimeout(() => this.trigger$.next(), 100);
@@ -801,7 +815,6 @@ const frTranslations = {
801
815
  title: 'Opération'
802
816
  },
803
817
  chooseParameters: "Merci de sélectionner les paramètres afin d'afficher le graphique",
804
- series: 'Regroupement',
805
818
  type: 'Type de graphique',
806
819
  title: 'Titre du graphique',
807
820
  graphType: {