Update ENV to include front end. Add notification handling.

This commit is contained in:
Patrick FIc
2025-04-10 17:25:21 -07:00
parent 95b103020f
commit 2ca4e3436b
5 changed files with 32 additions and 15 deletions

View File

@@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDo
VITE_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql 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_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_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
VITE_COMPANY=IMEX VITE_COMPANY=IMEX
VITE_FE_URL=https://imex.online
VITE_FE_URL_TEST=https://test.imex.online

View File

@@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDo
VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql 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_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_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
VITE_COMPANY=IMEX VITE_COMPANY=IMEX
VITE_FE_URL=https://imex.online
VITE_FE_URL_TEST=https://test.imex.online

View File

@@ -2,4 +2,6 @@ VITE_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "a
VITE_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql 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_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_GRAPHQL_ENDPOINT_TEST=https://db.test.romeonline.io/v1/graphql
VITE_COMPANY=ROME VITE_COMPANY=ROME
VITE_FE_URL=https://romeonline.io
VITE_FE_URL_TEST=https://test.romeonline.io

View File

@@ -1,6 +1,6 @@
import { platform } from "@electron-toolkit/utils"; import { platform } from "@electron-toolkit/utils";
import { UUID } from "crypto"; import { UUID } from "crypto";
import { Notification } from "electron"; import { Notification, shell } from "electron";
import log from "electron-log/main"; import log from "electron-log/main";
import fs from "fs"; import fs from "fs";
import _ from "lodash"; import _ from "lodash";
@@ -173,21 +173,32 @@ async function ImportJob(filepath: string): Promise<void> {
}, },
); );
setAppProgressbar(-1); setAppProgressbar(-1);
new Notification({ const uploadNotification = new Notification({
title: "Job Imported", 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" }], 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); log.debug("Job inserted", insertRecordResult);
} catch (error) { } catch (error) {
log.error("Error encountered while decoding job. ", errorTypeCheck(error)); log.error("Error encountered while decoding job. ", errorTypeCheck(error));
new Notification({ const uploadNotificationFailure = new Notification({
title: "Job Upload Failure", title: "Job Upload Failure",
body: errorTypeCheck(error).message, //TODO: Remove after debug. body: errorTypeCheck(error).message, //TODO: Remove after debug.
actions: [{ text: "View Job", type: "button" }], });
}).show();
uploadNotificationFailure.show();
} }
} }

View File

@@ -11,7 +11,7 @@ import {
QUERY_ACTIVE_BODYSHOP_TYPED, QUERY_ACTIVE_BODYSHOP_TYPED,
QUERY_MASTERDATA_TYPED, QUERY_MASTERDATA_TYPED,
} from "../graphql/queries"; } from "../graphql/queries";
import Store from "../store/store"; import { default as Store, default as store } from "../store/store";
import { checkForAppUpdatesContinuously } from "../util/checkForAppUpdates"; import { checkForAppUpdatesContinuously } from "../util/checkForAppUpdates";
import { sendIpcToRenderer } from "../util/toRenderer"; import { sendIpcToRenderer } from "../util/toRenderer";
@@ -66,9 +66,9 @@ const ipcMainHandleAuthStateChanged = async (
const ipMainHandleResetPassword = async (): Promise<void> => { const ipMainHandleResetPassword = async (): Promise<void> => {
shell.openExternal( shell.openExternal(
import.meta.env.VITE_COMPANY === "IMEX" store.get("app.isTest")
? "https://imex.online/resetpassword" ? `${import.meta.env.VITE_FE_URL_TEST}/resetpassword`
: "https://romeonline.io/resetpassword", : `${import.meta.env.VITE_FE_URL}/resetpassword`,
); );
}; };