diff --git a/src/main/decoder/decode-ttl.interface.ts b/src/main/decoder/decode-ttl.interface.ts index 67e2c8b..52662d8 100644 --- a/src/main/decoder/decode-ttl.interface.ts +++ b/src/main/decoder/decode-ttl.interface.ts @@ -1,7 +1,7 @@ export interface DecodedTtl { clm_total: number; depreciation_taxes: number; - cieca_ttl: DecodedTtlLine; + cieca_ttl: { data: DecodedTtlLine }; } export interface DecodedTtlLine { diff --git a/src/main/decoder/decode-ttl.ts b/src/main/decoder/decode-ttl.ts index 02b729d..2bd10ec 100644 --- a/src/main/decoder/decode-ttl.ts +++ b/src/main/decoder/decode-ttl.ts @@ -47,6 +47,10 @@ const DecodeTtl = async ( //Apply business logic transfomrations. - return { clm_total: 0, depreciation_taxes: 0, cieca_ttl: rawTtlData }; + return { + clm_total: 0, + depreciation_taxes: 0, + cieca_ttl: { data: rawTtlData }, + }; }; export default DecodeTtl; diff --git a/src/main/decoder/decoder.ts b/src/main/decoder/decoder.ts index 8a73220..b9e8f45 100644 --- a/src/main/decoder/decoder.ts +++ b/src/main/decoder/decoder.ts @@ -45,7 +45,8 @@ async function ImportJob(filepath: string): Promise { const pfm: DecodedPfm = await DecodePfm(extensionlessFilePath); const pfo: DecodedPfo = await DecodePfo(extensionlessFilePath); // TODO: This will be the `cieca_pfo` object const stl: DecodedStl[] = await DecodeStl(extensionlessFilePath); // TODO: This will be the `cieca_stl` object - const ttl: DecodedTtl = await DecodeTtl(extensionlessFilePath); // + const ttl: DecodedTtl = await DecodeTtl(extensionlessFilePath); + log.debug("EMS Object", { ad1, ad2, diff --git a/src/main/ipc/ipcMainConfig.ts b/src/main/ipc/ipcMainConfig.ts index 0eaff7c..df91576 100644 --- a/src/main/ipc/ipcMainConfig.ts +++ b/src/main/ipc/ipcMainConfig.ts @@ -37,8 +37,8 @@ const logIpcMessages = (): void => { }); }; -ipcMain.on(ipcTypes.toMain.test, (payload: any) => - console.log("** Verify that ipcMain is loaded and working.", payload) +ipcMain.on(ipcTypes.toMain.test, () => + console.log("** Verify that ipcMain is loaded and working.") ); //Auth handler @@ -48,18 +48,15 @@ ipcMain.on(ipcTypes.toMain.authStateChanged, ipcMainHandleAuthStateChanged); if (import.meta.env.DEV) { log.debug("[IPC Debug Functions] Adding Debug Handlers"); - ipcMain.on( - ipcTypes.toMain.debug.decodeEstimate, - async (event, payload): Promise => { - const relativeEmsFilepath = `_reference/ems/MPI_1/3698420.ENV`; - // Get the app's root directory and create an absolute path - const rootDir = app.getAppPath(); - const absoluteFilepath = path.join(rootDir, relativeEmsFilepath); + ipcMain.on(ipcTypes.toMain.debug.decodeEstimate, async (): Promise => { + const relativeEmsFilepath = `_reference/ems/MPI_1/3698420.ENV`; + // Get the app's root directory and create an absolute path + const rootDir = app.getAppPath(); + const absoluteFilepath = path.join(rootDir, relativeEmsFilepath); - log.debug("[IPC Debug Function] Decode test Estimate", absoluteFilepath); - await ImportJob(absoluteFilepath); - } - ); + log.debug("[IPC Debug Function] Decode test Estimate", absoluteFilepath); + await ImportJob(absoluteFilepath); + }); } //Settings Handlers diff --git a/src/main/ipc/ipcMainHandler.settings.ts b/src/main/ipc/ipcMainHandler.settings.ts index 8e8c5e2..690ea76 100644 --- a/src/main/ipc/ipcMainHandler.settings.ts +++ b/src/main/ipc/ipcMainHandler.settings.ts @@ -3,11 +3,11 @@ import log from "electron-log/main"; import _ from "lodash"; import Store from "../store/store"; -const SettingsWatchedFilePathsAdd = async (event: IpcMainInvokeEvent) => { +const SettingsWatchedFilePathsAdd = async (): Promise => { const mainWindow = BrowserWindow.getAllWindows()[0]; //TODO: Filter to only main window once a proper key has been set. if (!mainWindow) { log.error("No main window found when trying to open dialog"); - return; + return []; } const result = await dialog.showOpenDialog(mainWindow, { properties: ["openDirectory"], @@ -25,7 +25,7 @@ const SettingsWatchedFilePathsAdd = async (event: IpcMainInvokeEvent) => { const SettingsWatchedFilePathsRemove = async ( event: IpcMainInvokeEvent, path: string -) => { +): Promise => { Store.set( "settings.filepaths", _.without(Store.get("settings.filepaths"), path) @@ -34,8 +34,8 @@ const SettingsWatchedFilePathsRemove = async ( return Store.get("settings.filepaths"); }; -const SettingsWatchedFilePathsGet = async (event: IpcMainInvokeEvent) => { - const filepaths = Store.get("settings.filepaths"); +const SettingsWatchedFilePathsGet = async (): Promise => { + const filepaths: string[] = Store.get("settings.filepaths") || []; return filepaths; }; diff --git a/src/main/ipc/ipcMainHandler.user.ts b/src/main/ipc/ipcMainHandler.user.ts index a593283..1899009 100644 --- a/src/main/ipc/ipcMainHandler.user.ts +++ b/src/main/ipc/ipcMainHandler.user.ts @@ -5,7 +5,7 @@ import Store from "../store/store"; const ipcMainHandleAuthStateChanged = async ( event: IpcMainEvent, user: User | null -) => { +): Promise => { Store.set("user", user); }; diff --git a/src/main/watcher/watcher.ts b/src/main/watcher/watcher.ts index eb8f0ee..3237133 100644 --- a/src/main/watcher/watcher.ts +++ b/src/main/watcher/watcher.ts @@ -9,8 +9,8 @@ import ImportJob from "../decoder/decoder"; let watcher: FSWatcher; async function StartWatcher(): Promise { - const filePaths = store.get("settings.filepaths") || []; - log.info("Use polling? ", store.get("settings.polling").enabled); + const filePaths: string[] = store.get("settings.filepaths") || []; + if (filePaths.length === 0) { new Notification({ //TODO: Add Translations diff --git a/src/renderer/src/components/ErrorBoundaryFallback/ErrorBoundaryFallback.tsx b/src/renderer/src/components/ErrorBoundaryFallback/ErrorBoundaryFallback.tsx index e347cb0..7a42570 100644 --- a/src/renderer/src/components/ErrorBoundaryFallback/ErrorBoundaryFallback.tsx +++ b/src/renderer/src/components/ErrorBoundaryFallback/ErrorBoundaryFallback.tsx @@ -12,7 +12,11 @@ const ErrorBoundaryFallback: React.FC = ({ status={"500"} title={t("app.errors.errorboundary")} subTitle={error?.message} - extra={[]} + extra={[ + , + ]} /> ); }; diff --git a/src/renderer/src/components/Settings/Settings.Watcher.tsx b/src/renderer/src/components/Settings/Settings.Watcher.tsx index 5828233..1ee62de 100644 --- a/src/renderer/src/components/Settings/Settings.Watcher.tsx +++ b/src/renderer/src/components/Settings/Settings.Watcher.tsx @@ -5,7 +5,7 @@ import ipcTypes from "../../../../util/ipcTypes.json"; const SettingsWatcher: React.FC = () => { const { t } = useTranslation(); - const handleStart = () => { + const handleStart = (): void => { window.electron.ipcRenderer.send(ipcTypes.toMain.watcher.start); }; diff --git a/src/renderer/src/components/SignInForm/SignInForm.tsx b/src/renderer/src/components/SignInForm/SignInForm.tsx index bf27878..0e8cc06 100644 --- a/src/renderer/src/components/SignInForm/SignInForm.tsx +++ b/src/renderer/src/components/SignInForm/SignInForm.tsx @@ -5,15 +5,13 @@ import log from "electron-log/renderer"; import { signInWithEmailAndPassword } from "firebase/auth"; import errorTypeCheck from "../../../../util/errorTypeCheck"; -type SignInFormProps = {}; - type FieldType = { username: string; password: string; remember?: string; }; -const SignInForm: React.FC = ({}) => { +const SignInForm: React.FC = () => { const onFinish: FormProps["onFinish"] = async (values) => { log.info("Form submitted successfully:", values); const { username, password } = values; diff --git a/src/renderer/src/util/firebase.ts b/src/renderer/src/util/firebase.ts index 10f885c..b506ba9 100644 --- a/src/renderer/src/util/firebase.ts +++ b/src/renderer/src/util/firebase.ts @@ -1,5 +1,5 @@ import { initializeApp } from "firebase/app"; -import { getAuth, updatePassword, updateProfile } from "firebase/auth"; +import { getAuth } from "firebase/auth"; // TODO: Replace the following with your app's Firebase project configuration const firebaseConfig = JSON.parse(import.meta.env.VITE_FIREBASE_CONFIG); diff --git a/src/util/deepLowercaseKeys.ts b/src/util/deepLowercaseKeys.ts index 9847d6e..ddfc375 100644 --- a/src/util/deepLowercaseKeys.ts +++ b/src/util/deepLowercaseKeys.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + /** * Deep renames all keys in an object to lowercase * @param obj - The object to transform