diff --git a/BUILD.md b/BUILD.md index 756b982c..682a69f4 100755 --- a/BUILD.md +++ b/BUILD.md @@ -3,7 +3,7 @@ ### Windows * Install Visual Studio 19 w/ Desktop development with C++ workload * Install Python 2.7 -* Install Node 18.13.0 +* Install Node 18.17.0 * Install Git for windows * Install GTK+ (version 2.22.1, do NOT get version 3) * Install libjpeg-turbo64 @@ -184,8 +184,10 @@ Software source code previously released under an open source license and then m # Releasing a New Version 1. Update package.json version 2. Add a changelog file for the version describing new features added and bugs fixed -3. Commit changes -4. Tag version -5. Build windows, linux and mac installers -6. Notarize mac installers -7. Create release on github for the new version and upload all the installer files +3. Enable Matomo in env +4. Commit changes +5. Tag version +6. Build windows, linux and mac installers +7. Notarize mac installers +8. Create release on github for the new version and upload all the installer files +9. You'll need to generate builds for all different environments in order to have the correct matomo urls \ No newline at end of file diff --git a/changelog/v1.6.2.md b/changelog/v1.6.2.md new file mode 100644 index 00000000..e8296e18 --- /dev/null +++ b/changelog/v1.6.2.md @@ -0,0 +1,30 @@ +# MapCache Desktop - v1.6.2 + +Patch release 1.6.2 + +## New Features + * Matomo user metrics logging added' + * Consent banner added + + +## Bug Fixes + * Fixed shp file import' + +## Previous Versions + * [v1.6.1](https://github.com/ngageoint/mapcache-electron/blob/v1.6.1/changelog/v1.6.1.md) + * [v1.6.0](https://github.com/ngageoint/mapcache-electron/blob/v1.6.0/changelog/v1.6.0.md) + * [v1.5.1](https://github.com/ngageoint/mapcache-electron/blob/v1.5.1/changelog/v1.5.1.md) + * [v1.5.0](https://github.com/ngageoint/mapcache-electron/blob/v1.5.0/changelog/v1.5.0.md) + * [v1.4.0](https://github.com/ngageoint/mapcache-electron/blob/v1.4.0/changelog/v1.4.0.md) + * [v1.3.1](https://github.com/ngageoint/mapcache-electron/blob/v1.3.1/changelog/v1.3.1.md) + * [v1.3.0](https://github.com/ngageoint/mapcache-electron/blob/v1.3.0/changelog/v1.3.0.md) + * [v1.2.0](https://github.com/ngageoint/mapcache-electron/blob/v1.2.0/changelog/v1.2.0.md) + * [v1.1.1](https://github.com/ngageoint/mapcache-electron/blob/v1.1.1/changelog/v1.1.1.md) + * [v1.1.0](https://github.com/ngageoint/mapcache-electron/blob/v1.1.0/changelog/v1.1.0.md) + * [v1.0.9](https://github.com/ngageoint/mapcache-electron/blob/v1.0.9/changelog/v1.0.9.md) + * [v1.0.8](https://github.com/ngageoint/mapcache-electron/blob/v1.0.8/changelog/v1.0.8.md) + * [v1.0.7](https://github.com/ngageoint/mapcache-electron/blob/v1.0.7/changelog/v1.0.7.md) + * [v1.0.6](https://github.com/ngageoint/mapcache-electron/blob/v1.0.6/changelog/v1.0.6.md) + * [v1.0.5](https://github.com/ngageoint/mapcache-electron/blob/v1.0.5/changelog/v1.0.5.md) + * [v1.0.4](https://github.com/ngageoint/mapcache-electron/blob/v1.0.5/changelog/v1.0.4.md) + * [v1.0.3](https://github.com/ngageoint/mapcache-electron/blob/v1.0.5/changelog/v1.0.3.md) diff --git a/package.json b/package.json index 5a4a2fa5..a3d77c44 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapcache", - "version": "1.6.1", + "version": "1.6.2", "description": "Desktop Electron app to create GeoPackages from geospatial data sources.", "author": "Christopher Caldwell (https://github.com/caldwellc)", "scripts": { @@ -67,6 +67,7 @@ "sanitize-html": "^2.7.0", "sax": "^1.2.4", "sharp": "0.32.6", + "shpjs": "4.0.4", "sortablejs": "^1.15.0", "stream-chain": "^2.2.5", "stream-json": "^1.8.0", @@ -75,6 +76,7 @@ "uuid": "^9.0.0", "vector-tile": "^1.3.0", "vue": "^3.3.4", + "vue-matomo": "^4.2.0", "vue-observe-visibility": "^1.0.0", "vue-router": "^4.2.2", "vuetify": "3.5.12", @@ -97,7 +99,8 @@ "better-sqlite3": "8.4.0", "bindings": "git://github.com/caldwellc/node-bindings.git#master", "canvas": "git://github.com/jclark118/empty-module.git#main", - "minimatch": "9.0.5" + "minimatch": "9.0.5", + "rollup": "^3.29.5" }, "contributors": [ { diff --git a/src/lib/env/env.js b/src/lib/env/env.js index 7fa52696..70c8dcf1 100644 --- a/src/lib/env/env.js +++ b/src/lib/env/env.js @@ -29,6 +29,10 @@ const environment = { geopackageLibrariesUrl: 'https://ngageoint.github.io/GeoPackage', eventkitUrl: 'https://eventkit.gs.mil', surveyUrl: 'https://portal.geo.nga.mil/survey123/share/93444389134845e79d79f18a11ab17d3', + matomoUrl: 'https://webanalytics.nga.mil/', + matomoJsUrl: 'https://webanalytics.nga.mil//matomo.js', + matomoSiteId: '', + matomoEnabled: false, preloadedDataSources: [] } diff --git a/src/lib/source/shapefile/ShapeFileSource.js b/src/lib/source/shapefile/ShapeFileSource.js index 3629f5d3..b88a23e0 100644 --- a/src/lib/source/shapefile/ShapeFileSource.js +++ b/src/lib/source/shapefile/ShapeFileSource.js @@ -1,7 +1,7 @@ import fs from 'node:fs' import path from 'node:path' import AdmZip from 'adm-zip' -// import shp from 'shpjs' +import shpjs from 'shpjs' import Source from '../Source' import GeoTIFFSource from '../geotiff/GeoTIFFSource' @@ -86,16 +86,18 @@ export default class ShapeFileSource extends Source { await sleep(250) if (isZip) { - const result = await shp.parseZip(fs.readFileSync(this.filePath)) + let fileBuffer = Buffer.from(fs.readFileSync(this.filePath)) + const result = await shpjs.parseZip(fileBuffer) if (result.length == null) { featureCollections.push(result) } else { featureCollections = result } } else { + const result = await shpjs.parseShp(fs.readFileSync(this.filePath)) featureCollections.push({ type: 'FeatureCollection', - features: shp.parseShp(fs.readFileSync(this.filePath)), + features: result, fileName: name }) } diff --git a/src/lib/vue/vuex/ProjectActions.js b/src/lib/vue/vuex/ProjectActions.js index 7c24e541..4d0de03f 100644 --- a/src/lib/vue/vuex/ProjectActions.js +++ b/src/lib/vue/vuex/ProjectActions.js @@ -553,6 +553,10 @@ function setActiveGeoPackageFeatureLayer (projectId, geopackageId, tableName) { } } +function setConsent (consent) { + return store.dispatch('UIState/setConsent', {consent}) +} + function setDarkTheme (projectId, enabled) { return store.dispatch('UIState/setDarkTheme', { projectId, enabled }) } @@ -724,6 +728,7 @@ export { setActiveGeoPackage, setActiveGeoPackageFeatureLayer, updateStyleKey, + setConsent, setDarkTheme, notifyTab, clearNotification, diff --git a/src/main/lib/MapCacheWindowManager.js b/src/main/lib/MapCacheWindowManager.js index f1f4da71..a886ce10 100644 --- a/src/main/lib/MapCacheWindowManager.js +++ b/src/main/lib/MapCacheWindowManager.js @@ -71,7 +71,8 @@ import { UNDO, REQUEST_TILE_COMPILATION, REQUEST_TILE_COMPILATION_COMPLETED, - CANCEL_TILE_COMPILATION_REQUEST, WEB_VIEW_AUTH_REQUEST, WEB_VIEW_AUTH_CANCEL + CANCEL_TILE_COMPILATION_REQUEST, WEB_VIEW_AUTH_REQUEST, WEB_VIEW_AUTH_CANCEL, + CLOSE_APP } from './ipc/MapCacheIPC' import windowStateKeeper from 'electron-window-state' import WebViewAuth from './auth/WebViewAuth' @@ -541,6 +542,10 @@ class MapCacheWindowManager { const taskId = payload.id await this.mapcacheThreadHelper.cancelTask(taskId, false) }) + + ipcMain.on(CLOSE_APP, () => { + app.quit() + }) } } diff --git a/src/main/lib/ipc/MapCacheIPC.js b/src/main/lib/ipc/MapCacheIPC.js index 5bc6e61b..35fa39fd 100644 --- a/src/main/lib/ipc/MapCacheIPC.js +++ b/src/main/lib/ipc/MapCacheIPC.js @@ -11,6 +11,8 @@ const SHOW_PROJECT = 'show-project' const CLOSE_PROJECT = 'close-project' const CLOSING_PROJECT_WINDOW = 'closing-project-window' const PROCESS_SOURCE = 'process-source' +const CLOSE_APP = 'close-app' + function PROCESS_SOURCE_COMPLETED (id) { return 'process-source-completed-' + id @@ -169,7 +171,8 @@ const MAIN_CHANNELS = [ BUILD_TILE_LAYER, CANCEL_BUILD_TILE_LAYER, WORKER_READY, - LAUNCH_USER_GUIDE + LAUNCH_USER_GUIDE, + CLOSE_APP ] const WORKER_CHANNELS = [ @@ -267,5 +270,6 @@ export { REDO, WEB_VIEW_AUTH_REQUEST, WEB_VIEW_AUTH_RESPONSE, - WEB_VIEW_AUTH_CANCEL + WEB_VIEW_AUTH_CANCEL, + CLOSE_APP } diff --git a/src/preload/mainPreload.js b/src/preload/mainPreload.js index 49cae215..cad86c17 100644 --- a/src/preload/mainPreload.js +++ b/src/preload/mainPreload.js @@ -4,7 +4,7 @@ import path from 'path' import { deleteProjectFolder } from '../lib/vue/vuex/CommonPreloadFunctions' import { createNextAvailableLayerDirectory, createNextAvailableProjectDirectory, createNextAvailableSourceDirectory } from '../lib/util/file/FileUtilities' import { createUniqueID } from '../lib/util/UniqueIDUtilities' -import { GET_APP_VERSION, GET_USER_DATA_DIRECTORY, LAUNCH_WITH_GEOPACKAGE_FILES, OPEN_EXTERNAL, SHOW_PROJECT } from '../main/lib/ipc/MapCacheIPC' +import { GET_APP_VERSION, GET_USER_DATA_DIRECTORY, LAUNCH_WITH_GEOPACKAGE_FILES, OPEN_EXTERNAL, SHOW_PROJECT, CLOSE_APP } from '../main/lib/ipc/MapCacheIPC' import { Context, HtmlCanvasAdapter, SqliteAdapter } from '@ngageoint/geopackage' import { environment } from '../lib/env/env' import { vuexElectronAPI } from './vuexPreload' @@ -45,6 +45,9 @@ contextBridge.exposeInMainWorld('mapcache', { ipcRenderer.send(OPEN_EXTERNAL, link) } }, + closeApp: () => { + ipcRenderer.send(CLOSE_APP) + }, setupGeoPackageContext: () => { Context.setupCustomContext(SqliteAdapter, HtmlCanvasAdapter) }, diff --git a/src/renderer/index.html b/src/renderer/index.html index 7ae22981..9d7866ae 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -6,7 +6,7 @@ MapCache - +