Skip to content

Commit

Permalink
fix(data-table): UI freeze when big download (#2586)
Browse files Browse the repository at this point in the history
* rebase latest alex merge

* fix(data-table): Fix UI freeze on big export (reproject geom/chunk with worker)
Closes #2580

* Worker structure and cleanup

* Rebase from dynamic fetch PR

* Fix warning and build error

* add comment

* Add message for failed export

* small fix point vs multipoint

* fix comment

* remove old code

---------

Co-authored-by: jolevesq <[email protected]>
  • Loading branch information
jolevesq and jolevesq authored Nov 14, 2024
1 parent a03c902 commit 5c536fd
Show file tree
Hide file tree
Showing 31 changed files with 826 additions and 277 deletions.
137 changes: 72 additions & 65 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
node_modules/
dist/
8 changes: 8 additions & 0 deletions packages/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@
}
]
}
},
{
"files": ["webpack.*.js"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"ecmaVersion": 2018
}
}
]
}
1 change: 1 addition & 0 deletions packages/geoview-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"ajv": "^8.17.1",
"ajv-errors": "^3.0.0",
"axios": "^1.7.7",
"comlink": "4.4.2",
"dayjs": "^1.11.13",
"domhandler": "^5.0.3",
"export-to-csv": "0.2.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/geoview-core/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"open": "Open",
"remove": "Remove",
"view": "View",
"failed": "failed",
"started": "started",
"openFullscreen": "Open in fullscreen",
"closeFullscreen": "Close fullscreen",
"openGuide": "Open guide",
"guide": "Guide",
"fullScreen": "Full screen"
"fullScreen": "Full screen",
"processing": "Processing __param__ element(s) of __param__"
},
"mapnav": {
"arianavbar": "Vertical button group for map navigation",
Expand Down Expand Up @@ -197,7 +200,7 @@
"zoom": "ZOOM",
"details": "DETAILS",
"exportBtn": "Download",
"jsonExportBtn": "Download GeoJSON",
"downloadAsGeoJSON": "Download GeoJSON",
"downloadAsCSV": "Download CSV",
"filterMap": "Filter map",
"stopFilterMap": "Stop filter map",
Expand Down
7 changes: 5 additions & 2 deletions packages/geoview-core/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"open": "Ouvrir",
"remove": "Retirer",
"view": "Vue",
"failed": "a échoué",
"started": "démarré",
"openFullscreen": "Ouvrir en plein écran",
"closeFullscreen": "Fermer le plein écran",
"openGuide": "Ouvrir le guide",
"guide": "Guide",
"fullScreen": "Plein écran"
"fullScreen": "Plein écran",
"processing": "Traitement de __param__ element(s) sur __param__"
},
"mapnav": {
"arianavbar": "Groupe de buttons vertical pour navigation sur la carte",
Expand Down Expand Up @@ -197,7 +200,7 @@
"zoom": "ZOOM",
"details": "DÉTAILS",
"exportBtn": "Télécharger",
"jsonExportBtn": "Télécharger GeoJSON",
"downloadAsGeoJSON": "Télécharger GeoJSON",
"downloadAsCSV": "Télécharger CSV",
"filterMap": "Filtrer la carte",
"clearFilters": "Effacer les filtres",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export abstract class AbstractGeoviewEsriLayerConfig extends AbstractGeoviewLaye
* @static
*/
static convertEsriGeometryTypeToOLGeometryType(esriGeometryType: string): TypeStyleGeometry {
// TODO: Update with style refactor PR (function esriConvertEsriGeometryTypeToOLGeometryType gv-layer/util). Use only one function!
switch (esriGeometryType) {
case 'esriGeometryPoint':
case 'esriGeometryMultipoint':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ export { WfsLayerEntryConfig } from '@config/types/classes/sub-layer-config/leaf
export { GeoJsonLayerEntryConfig } from '@config/types/classes/sub-layer-config/leaf/vector/geojson-layer-entry-config';

/** Valid keys for the geometryType property. */
export type TypeStyleGeometry = 'point' | 'linestring' | 'polygon';
// TODO: Refactor - Layers/Config refactoring. The values here have been renamed to lower case, make sure to lower here and adjust everywhere as part of config migration.
// TODO.CONT: What is the fastest option... change config or all code, see what is the fastest
export type TypeStyleGeometry = 'point' | 'linestring' | 'multilinestring' | 'polygon' | 'multipolygon';

/** Type of Style to apply to the GeoView vector layer source at creation time. */
export type TypeLayerEntryType = 'vector' | 'vector-tile' | 'raster-tile' | 'raster-image' | 'group';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { TypeHTMLElement } from '@/core/types/global-types';
import { createGuideObject } from '@/core/utils/utilities';
import { MapViewer } from '@/geo/map/map-viewer';
import { MapEventProcessor } from './map-event-processor';
import { SnackbarType } from '@/core/utils/notifications';
import { logger } from '@/core/utils/logger';
import { api } from '@/app';

// GV Important: See notes in header of MapEventProcessor file for information on the paradigm to apply when working with UIEventProcessor vs UIState

Expand Down Expand Up @@ -56,6 +58,31 @@ export class AppEventProcessor extends AbstractEventProcessor {
return this.getAppState(mapId).displayTheme;
}

/**
* Adds a snackbar message.
* @param {SnackbarType} type - The type of message.
* @param {string} message - The message.
* @param {string} param - Optional param to replace in the string if it is a key
*/
static addMessage(mapId: string, type: SnackbarType, message: string, param?: string[]): void {
switch (type) {
case 'info':
api.maps[mapId].notifications.showMessage(message, param, false);
break;
case 'success':
api.maps[mapId].notifications.showSuccess(message, param, false);
break;
case 'warning':
api.maps[mapId].notifications.showWarning(message, param, false);
break;
case 'error':
api.maps[mapId].notifications.showError(message, param, false);
break;
default:
break;
}
}

static async addNotification(mapId: string, notif: NotificationDetailsType): Promise<void> {
// because notification is called before map is created, we use the async
// version of getAppStateAsync
Expand Down
Loading

0 comments on commit 5c536fd

Please sign in to comment.