Misc linting fixes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
export interface DecodedTtl {
|
||||
clm_total: number;
|
||||
depreciation_taxes: number;
|
||||
cieca_ttl: DecodedTtlLine;
|
||||
cieca_ttl: { data: DecodedTtlLine };
|
||||
}
|
||||
|
||||
export interface DecodedTtlLine {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -45,7 +45,8 @@ async function ImportJob(filepath: string): Promise<void> {
|
||||
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,
|
||||
|
||||
@@ -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<void> => {
|
||||
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<void> => {
|
||||
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
|
||||
|
||||
@@ -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<string[]> => {
|
||||
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<string[]> => {
|
||||
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<string[]> => {
|
||||
const filepaths: string[] = Store.get("settings.filepaths") || [];
|
||||
return filepaths;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import Store from "../store/store";
|
||||
const ipcMainHandleAuthStateChanged = async (
|
||||
event: IpcMainEvent,
|
||||
user: User | null
|
||||
) => {
|
||||
): Promise<void> => {
|
||||
Store.set("user", user);
|
||||
};
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import ImportJob from "../decoder/decoder";
|
||||
let watcher: FSWatcher;
|
||||
|
||||
async function StartWatcher(): Promise<boolean> {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user