From 3b17175b144930503829ea7813a6fa585e839ec8 Mon Sep 17 00:00:00 2001 From: Patrick FIc Date: Thu, 10 Apr 2025 15:00:20 -0700 Subject: [PATCH 1/4] Remove eb paramter that is not supported. --- electron-builder.imex.yml | 1 - electron-builder.rome.yml | 1 - package-lock.json | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/electron-builder.imex.yml b/electron-builder.imex.yml index 572fc94..3d85ad6 100644 --- a/electron-builder.imex.yml +++ b/electron-builder.imex.yml @@ -21,7 +21,6 @@ win: endpoint: https://eus.codesigning.azure.net certificateProfileName: ImEXRPS codeSigningAccountName: ImEX - publisherName: ImEX Systems Inc. nsis: artifactName: ${name}-${version}-setup.${ext} shortcutName: ${productName} diff --git a/electron-builder.rome.yml b/electron-builder.rome.yml index c4fca9c..01ede46 100644 --- a/electron-builder.rome.yml +++ b/electron-builder.rome.yml @@ -21,7 +21,6 @@ win: endpoint: https://eus.codesigning.azure.net certificateProfileName: ImEXRPS codeSigningAccountName: ImEX - publisherName: ImEX Systems Inc. nsis: artifactName: ${name}-${version}-setup.${ext} shortcutName: ${productName} diff --git a/package-lock.json b/package-lock.json index 34a9b01..f45d6e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bodyshop-desktop", - "version": "0.0.1-alpha.0", + "version": "0.0.1-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "bodyshop-desktop", - "version": "0.0.1-alpha.0", + "version": "0.0.1-alpha.2", "hasInstallScript": true, "dependencies": { "@apollo/client": "^3.13.6", From 95b103020f4bd33dacf7028dc0872e8e32675e13 Mon Sep 17 00:00:00 2001 From: Patrick FIc Date: Thu, 10 Apr 2025 15:51:15 -0700 Subject: [PATCH 2/4] Resolve protocol handler in dev on Win32 and correct directory. --- src/main/index.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 5300403..e3e52f8 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -326,7 +326,22 @@ app.whenReady().then(async () => { optimizer.watchWindowShortcuts(window); }); - const isDefaultProtocolClient = app.setAsDefaultProtocolClient(protocol); + let isDefaultProtocolClient; + // remove so we can register each time as we run the app. + app.removeAsDefaultProtocolClient(protocol); + + // If we are running a non-packaged version of the app && on windows + if (process.env.NODE_ENV === "development" && process.platform === "win32") { + // Set the path of electron.exe and your app. + // These two additional parameters are only available on windows. + isDefaultProtocolClient = app.setAsDefaultProtocolClient( + protocol, + process.execPath, + [path.resolve(process.argv[1])], + ); + } else { + isDefaultProtocolClient = app.setAsDefaultProtocolClient(protocol); + } if (isDefaultProtocolClient) { log.info("Protocol handler registered successfully."); } else { @@ -487,6 +502,6 @@ function openMainWindow(): void { function openInExplorer(url: string): void { const folderPath: string = decodeURIComponent(url.split(`${protocol}://`)[1]); - log.info("Opening folder in explorer", path.dirname(folderPath)); - shell.openPath(path.dirname(folderPath)); + log.info("Opening folder in explorer", folderPath); + shell.openPath(folderPath); } From 2ca4e3436bc9471127e5c4adf16bf7950cb7d259 Mon Sep 17 00:00:00 2001 From: Patrick FIc Date: Thu, 10 Apr 2025 17:25:21 -0700 Subject: [PATCH 3/4] Update ENV to include front end. Add notification handling. --- .env.imex | 4 +++- .env.local | 4 +++- .env.rome | 4 +++- src/main/decoder/decoder.ts | 27 +++++++++++++++++++-------- src/main/ipc/ipcMainHandler.user.ts | 8 ++++---- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.env.imex b/.env.imex index 44d4b5c..1d6ab25 100644 --- a/.env.imex +++ b/.env.imex @@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDo VITE_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"} VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql -VITE_COMPANY=IMEX \ No newline at end of file +VITE_COMPANY=IMEX +VITE_FE_URL=https://imex.online +VITE_FE_URL_TEST=https://test.imex.online \ No newline at end of file diff --git a/.env.local b/.env.local index 76ebbaf..5ca67ff 100644 --- a/.env.local +++ b/.env.local @@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDo VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"} VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql -VITE_COMPANY=IMEX \ No newline at end of file +VITE_COMPANY=IMEX +VITE_FE_URL=https://imex.online +VITE_FE_URL_TEST=https://test.imex.online \ No newline at end of file diff --git a/.env.rome b/.env.rome index defbe85..4180038 100644 --- a/.env.rome +++ b/.env.rome @@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "a VITE_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql VITE_FIREBASE_CONFIG_TEST={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"} VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.romeonline.io/v1/graphql -VITE_COMPANY=ROME \ No newline at end of file +VITE_COMPANY=ROME +VITE_FE_URL=https://romeonline.io +VITE_FE_URL_TEST=https://test.romeonline.io \ No newline at end of file diff --git a/src/main/decoder/decoder.ts b/src/main/decoder/decoder.ts index a0f6d1f..9cc021d 100644 --- a/src/main/decoder/decoder.ts +++ b/src/main/decoder/decoder.ts @@ -1,6 +1,6 @@ import { platform } from "@electron-toolkit/utils"; import { UUID } from "crypto"; -import { Notification } from "electron"; +import { Notification, shell } from "electron"; import log from "electron-log/main"; import fs from "fs"; import _ from "lodash"; @@ -173,21 +173,32 @@ async function ImportJob(filepath: string): Promise { }, ); setAppProgressbar(-1); - new Notification({ + const uploadNotification = new Notification({ title: "Job Imported", - body: `Job ${newAvailableJob.cieca_id} imported successfully`, + //subtitle: `${newAvailableJob.ownr_name} - ${newAvailableJob.vehicle_info}`, + body: `${newAvailableJob.ownr_name} - ${newAvailableJob.vehicle_info}. Click to view.`, actions: [{ text: "View Job", type: "button" }], - subtitle: newAvailableJob.ownr_name, - }).show(); + }); + uploadNotification.on("click", () => { + shell.openExternal( + `${ + store.get("app.isTest") + ? import.meta.env.VITE_FE_URL_TEST + : import.meta.env.VITE_FE_URL + }/manage/available`, + ); + }); + uploadNotification.show(); log.debug("Job inserted", insertRecordResult); } catch (error) { log.error("Error encountered while decoding job. ", errorTypeCheck(error)); - new Notification({ + const uploadNotificationFailure = new Notification({ title: "Job Upload Failure", body: errorTypeCheck(error).message, //TODO: Remove after debug. - actions: [{ text: "View Job", type: "button" }], - }).show(); + }); + + uploadNotificationFailure.show(); } } diff --git a/src/main/ipc/ipcMainHandler.user.ts b/src/main/ipc/ipcMainHandler.user.ts index b97f19a..8a4a18f 100644 --- a/src/main/ipc/ipcMainHandler.user.ts +++ b/src/main/ipc/ipcMainHandler.user.ts @@ -11,7 +11,7 @@ import { QUERY_ACTIVE_BODYSHOP_TYPED, QUERY_MASTERDATA_TYPED, } from "../graphql/queries"; -import Store from "../store/store"; +import { default as Store, default as store } from "../store/store"; import { checkForAppUpdatesContinuously } from "../util/checkForAppUpdates"; import { sendIpcToRenderer } from "../util/toRenderer"; @@ -66,9 +66,9 @@ const ipcMainHandleAuthStateChanged = async ( const ipMainHandleResetPassword = async (): Promise => { shell.openExternal( - import.meta.env.VITE_COMPANY === "IMEX" - ? "https://imex.online/resetpassword" - : "https://romeonline.io/resetpassword", + store.get("app.isTest") + ? `${import.meta.env.VITE_FE_URL_TEST}/resetpassword` + : `${import.meta.env.VITE_FE_URL}/resetpassword`, ); }; From 894869dc9eceb2859c5eb0075f341e209219f56a Mon Sep 17 00:00:00 2001 From: Patrick FIc Date: Thu, 10 Apr 2025 17:25:33 -0700 Subject: [PATCH 4/4] sync new version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5874181..ac6cd1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bodyshop-desktop", - "version": "0.0.1-alpha.2", + "version": "0.0.1-alpha.3", "description": "Shop Management System Partner", "main": "./out/main/index.js", "author": "Convenient Brands, LLC",