@provoly/dashboard 0.12.2 → 0.12.3

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 (30) hide show
  1. package/esm2022/admin/store/admin.service.mjs +2 -2
  2. package/esm2022/import/components/import.component.mjs +25 -9
  3. package/esm2022/import/i18n/en.translations.mjs +4 -2
  4. package/esm2022/import/i18n/fr.translations.mjs +4 -2
  5. package/esm2022/import/store/import.actions.mjs +1 -1
  6. package/esm2022/import/store/import.effects.mjs +5 -3
  7. package/esm2022/import/store/import.reducer.mjs +1 -1
  8. package/esm2022/import/store/import.selectors.mjs +3 -1
  9. package/esm2022/import/store/import.service.mjs +12 -5
  10. package/esm2022/lib/core/components/upload/upload.component.mjs +2 -2
  11. package/esm2022/lib/dashboard/store/dashboard.effects.mjs +2 -1
  12. package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +9 -5
  13. package/esm2022/toolbox/components/save-view/save-view.component.mjs +3 -3
  14. package/fesm2022/provoly-dashboard-admin.mjs +1 -1
  15. package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
  16. package/fesm2022/provoly-dashboard-import.mjs +47 -16
  17. package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
  18. package/fesm2022/provoly-dashboard-toolbox.mjs +2 -2
  19. package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
  20. package/fesm2022/provoly-dashboard.mjs +10 -5
  21. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  22. package/import/components/import.component.d.ts +11 -5
  23. package/import/i18n/en.translations.d.ts +3 -1
  24. package/import/i18n/fr.translations.d.ts +2 -0
  25. package/import/store/import.actions.d.ts +4 -2
  26. package/import/store/import.effects.d.ts +1 -1
  27. package/import/store/import.reducer.d.ts +1 -1
  28. package/import/store/import.selectors.d.ts +2 -1
  29. package/import/store/import.service.d.ts +1 -1
  30. package/package.json +25 -25
@@ -2972,7 +2972,7 @@ class PryUploadComponent {
2972
2972
  }));
2973
2973
  this.asyncEmit(files[0]);
2974
2974
  break;
2975
- case 'csv':
2975
+ case 'files':
2976
2976
  this.uploaded.emit(files[0].name);
2977
2977
  this.uploadedFile.emit(files[0]);
2978
2978
  break;
@@ -9726,6 +9726,7 @@ class DashboardEffects {
9726
9726
  return DashboardActions.addWmsFeatures({
9727
9727
  features: json.features.map((feature) => {
9728
9728
  const result = {
9729
+ id: feature.id,
9729
9730
  oClass: action.oClass,
9730
9731
  coordinates: action.coordinates,
9731
9732
  values: { properties: [] }
@@ -10330,10 +10331,14 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
10330
10331
  }), on(DashboardActions.getWmsFeatures, (state, action) => ({
10331
10332
  ...state,
10332
10333
  wmsFeatures: []
10333
- })), on(DashboardActions.addWmsFeatures, (state, action) => ({
10334
- ...state,
10335
- wmsFeatures: [...state.wmsFeatures, ...action.features]
10336
- })));
10334
+ })), on(DashboardActions.addWmsFeatures, (state, action) => {
10335
+ const allFeatures = [...state.wmsFeatures, ...action.features];
10336
+ const deDupedIds = [...new Set(allFeatures.map((feat) => feat.id))];
10337
+ return {
10338
+ ...state,
10339
+ wmsFeatures: deDupedIds.map((id) => allFeatures.find((feat) => feat.id === id))
10340
+ };
10341
+ }));
10337
10342
  function dashboardReducer(state, action) {
10338
10343
  return internalReducer(state, action);
10339
10344
  }