Reformat.
This commit is contained in:
@@ -7,7 +7,7 @@ import store from "../store/store";
|
||||
import { DecodedAd1, OwnerRecordInterface } from "./decode-ad1.interface";
|
||||
|
||||
const DecodeAD1 = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedAd1> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -147,7 +147,7 @@ const DecodeAD1 = async (
|
||||
"INS_CT_PH",
|
||||
"INS_CT_PHX",
|
||||
"LOSS_CAT",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Copy specific logic for manipulation.
|
||||
|
||||
@@ -6,7 +6,7 @@ import { DecodedAD2 } from "./decode-ad2.interface";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
|
||||
const DecodeAD2 = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedAD2> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -135,7 +135,7 @@ const DecodeAD2 = async (
|
||||
//"LOC_PH",
|
||||
//"LOC_PHX",
|
||||
//"LOC_EA",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -6,7 +6,7 @@ import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { DecodedEnv } from "./decode-env.interface";
|
||||
|
||||
const DecodeEnv = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedEnv> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -32,7 +32,7 @@ const DecodeEnv = async (
|
||||
//TODO: Several of these fields will fail. Should extend schema to capture them.
|
||||
//"EST_SYSTEM",
|
||||
"ESTFILE_ID",
|
||||
])
|
||||
]),
|
||||
);
|
||||
rawEnvData.ciecaid = rawEnvData.estfile_id;
|
||||
delete rawEnvData.estfile_id;
|
||||
|
||||
@@ -7,7 +7,7 @@ import store from "../store/store";
|
||||
import { DecodedLin, DecodedLinLine } from "./decode-lin.interface";
|
||||
|
||||
const DecodeLin = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedLin> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -80,7 +80,7 @@ const DecodeLin = async (
|
||||
"BETT_PCTG",
|
||||
"BETT_AMT",
|
||||
"BETT_TAX",
|
||||
])
|
||||
]),
|
||||
);
|
||||
//Apply line by line adjustments.
|
||||
singleLineData.op_code_desc = opCodeData[singleLineData.lbr_op]?.desc;
|
||||
|
||||
@@ -6,7 +6,7 @@ import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { DecodedPfh } from "./decode-pfh.interface";
|
||||
|
||||
const DecodePfh = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPfh> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -50,7 +50,7 @@ const DecodePfh = async (
|
||||
"ADJ_STRDIS",
|
||||
//"ADJ_BTR_IN", //Remove
|
||||
"TAX_PREDIS",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "./decode-pfl.interface";
|
||||
|
||||
const DecodePfl = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPfl> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -67,7 +67,7 @@ const DecodePfl = async (
|
||||
"LBR_TX_IN4",
|
||||
"LBR_TX_TY5",
|
||||
"LBR_TX_IN5",
|
||||
])
|
||||
]),
|
||||
);
|
||||
//Apply line by line adjustments.
|
||||
//Set the job.rate_<CIECA_TYPE> field based on the value.
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "./decode-pfm.interface";
|
||||
|
||||
const DecodePfm = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPfm> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -80,8 +80,8 @@ const DecodePfm = async (
|
||||
"MAT_TX_IN4",
|
||||
"MAT_TX_TY5",
|
||||
"MAT_TX_IN5",
|
||||
])
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
//Also capture the whole object.
|
||||
@@ -93,7 +93,7 @@ const DecodePfm = async (
|
||||
|
||||
//Apply line by line adjustments.
|
||||
const mapaLine: DecodedPfmLine | undefined = rawPfmData.find(
|
||||
(line) => line.matl_type === "MAPA"
|
||||
(line) => line.matl_type === "MAPA",
|
||||
);
|
||||
if (mapaLine) {
|
||||
jobMaterialRates.rate_mapa =
|
||||
@@ -102,7 +102,7 @@ const DecodePfm = async (
|
||||
}
|
||||
|
||||
const mashLine: DecodedPfmLine | undefined = rawPfmData.find(
|
||||
(line) => line.matl_type === "MASH"
|
||||
(line) => line.matl_type === "MASH",
|
||||
);
|
||||
if (mashLine) {
|
||||
jobMaterialRates.rate_mash =
|
||||
@@ -111,7 +111,7 @@ const DecodePfm = async (
|
||||
}
|
||||
|
||||
const mahwLine: DecodedPfmLine | undefined = rawPfmData.find(
|
||||
(line) => line.matl_type === "MAHW"
|
||||
(line) => line.matl_type === "MAHW",
|
||||
);
|
||||
if (mahwLine) {
|
||||
jobMaterialRates.rate_mahw =
|
||||
@@ -122,7 +122,7 @@ const DecodePfm = async (
|
||||
const additionalMaterials = ["MA2S", "MA2T", "MA3S", "MACS", "MABL"];
|
||||
additionalMaterials.forEach((type) => {
|
||||
const line: DecodedPfmLine | undefined = rawPfmData.find(
|
||||
(line) => line.matl_type === type
|
||||
(line) => line.matl_type === type,
|
||||
);
|
||||
if (line) {
|
||||
jobMaterialRates[`rate_${type.toLowerCase()}`] =
|
||||
|
||||
@@ -7,7 +7,7 @@ import YNBoolConverter from "../../util/ynBoolConverter";
|
||||
import { DecodedPfo, DecodedPfoLine } from "./decode-pfo.interface";
|
||||
|
||||
const DecodePfo = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPfo> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -58,8 +58,8 @@ const DecodePfo = async (
|
||||
"STOR_T_IN5",
|
||||
"STOR_T_TY6",
|
||||
"STOR_T_IN6",
|
||||
])
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "./decode-pfp.interface";
|
||||
|
||||
const DecodePfp = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPfp> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -51,7 +51,7 @@ const DecodePfp = async (
|
||||
"PRT_TX_IN4",
|
||||
"PRT_TX_TY5",
|
||||
"PRT_TX_IN5",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
singleLineData.prt_tax_rt = singleLineData.prt_tax_rt / 100;
|
||||
@@ -66,7 +66,7 @@ const DecodePfp = async (
|
||||
acc[line.prt_type] = line;
|
||||
return acc;
|
||||
},
|
||||
{} as DecodedPfpLinesByType
|
||||
{} as DecodedPfpLinesByType,
|
||||
);
|
||||
|
||||
return { parts_tax_rates: parsedPfpFile };
|
||||
|
||||
@@ -6,7 +6,7 @@ import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { DecodedPft, DecodedPftLine } from "./decode-pft.interface";
|
||||
|
||||
const DecodePft = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedPft> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -154,7 +154,7 @@ const DecodePft = async (
|
||||
"TY6_THRES5",
|
||||
"TY6_RATE5",
|
||||
"TY6_SUR5",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -6,7 +6,7 @@ import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { DecodedTtl, DecodedTtlLine } from "./decode-ttl.interface";
|
||||
|
||||
const DecodeTtl = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedTtl> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -42,7 +42,7 @@ const DecodeTtl = async (
|
||||
"G_TTL_DISC",
|
||||
"G_TAX",
|
||||
"GST_AMT",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -7,7 +7,7 @@ import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import store from "../store/store";
|
||||
|
||||
const DecodeVeh = async (
|
||||
extensionlessFilePath: string
|
||||
extensionlessFilePath: string,
|
||||
): Promise<DecodedVeh> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
@@ -56,7 +56,7 @@ const DecodeVeh = async (
|
||||
"PAINT_CD1",
|
||||
"PAINT_CD2",
|
||||
"PAINT_CD3",
|
||||
])
|
||||
]),
|
||||
);
|
||||
|
||||
//Apply business logic transfomrations.
|
||||
|
||||
@@ -10,7 +10,7 @@ const requestMiddleware: RequestMiddleware = async (request) => {
|
||||
`%c[Graphql Request]%c${request.operationName}`,
|
||||
"color: red",
|
||||
"color: green",
|
||||
request
|
||||
request,
|
||||
);
|
||||
|
||||
return {
|
||||
@@ -23,7 +23,7 @@ const client: GraphQLClient = new GraphQLClient(
|
||||
import.meta.env.VITE_GRAPHQL_ENDPOINT,
|
||||
{
|
||||
requestMiddleware,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export async function getTokenFromRenderer(): Promise<string> {
|
||||
@@ -35,7 +35,7 @@ export async function getTokenFromRenderer(): Promise<string> {
|
||||
} catch (error) {
|
||||
log.error(
|
||||
"Unable to send request to renderer process for token",
|
||||
errorTypeCheck(error)
|
||||
errorTypeCheck(error),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ function createWindow(): void {
|
||||
label: "Log the Store",
|
||||
click: (): void => {
|
||||
log.debug(
|
||||
"Store Contents" + JSON.stringify(store.store, null, 4)
|
||||
"Store Contents" + JSON.stringify(store.store, null, 4),
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -171,7 +171,7 @@ function createWindow(): void {
|
||||
jobs
|
||||
{
|
||||
id}}
|
||||
`
|
||||
`,
|
||||
)
|
||||
.then((data) => {
|
||||
log.info("Data from graffle", data);
|
||||
|
||||
@@ -27,7 +27,7 @@ const logIpcMessages = (): void => {
|
||||
`%c[IPC Main]%c${messageType}`,
|
||||
"color: red",
|
||||
"color: green",
|
||||
payload
|
||||
payload,
|
||||
);
|
||||
// Call original handler if it existed
|
||||
if (originalHandler) {
|
||||
@@ -38,7 +38,7 @@ const logIpcMessages = (): void => {
|
||||
};
|
||||
|
||||
ipcMain.on(ipcTypes.toMain.test, () =>
|
||||
console.log("** Verify that ipcMain is loaded and working.")
|
||||
console.log("** Verify that ipcMain is loaded and working."),
|
||||
);
|
||||
|
||||
//Auth handler
|
||||
@@ -67,15 +67,15 @@ if (import.meta.env.DEV) {
|
||||
//Settings Handlers
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.get,
|
||||
SettingsWatchedFilePathsGet
|
||||
SettingsWatchedFilePathsGet,
|
||||
);
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.add,
|
||||
SettingsWatchedFilePathsAdd
|
||||
SettingsWatchedFilePathsAdd,
|
||||
);
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.remove,
|
||||
SettingsWatchedFilePathsRemove
|
||||
SettingsWatchedFilePathsRemove,
|
||||
);
|
||||
|
||||
//Watcher Handlers
|
||||
|
||||
@@ -17,7 +17,7 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
if (!result.canceled) {
|
||||
Store.set(
|
||||
"settings.filepaths",
|
||||
_.union(result.filePaths, Store.get("settings.filepaths"))
|
||||
_.union(result.filePaths, Store.get("settings.filepaths")),
|
||||
);
|
||||
addWatcherPath(result.filePaths);
|
||||
}
|
||||
@@ -26,11 +26,11 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
};
|
||||
const SettingsWatchedFilePathsRemove = async (
|
||||
event: IpcMainInvokeEvent,
|
||||
path: string
|
||||
path: string,
|
||||
): Promise<string[]> => {
|
||||
Store.set(
|
||||
"settings.filepaths",
|
||||
_.without(Store.get("settings.filepaths"), path)
|
||||
_.without(Store.get("settings.filepaths"), path),
|
||||
);
|
||||
removeWatcherPath(path);
|
||||
return Store.get("settings.filepaths");
|
||||
|
||||
@@ -12,14 +12,14 @@ import log from "electron-log/main";
|
||||
|
||||
const ipcMainHandleAuthStateChanged = async (
|
||||
event: IpcMainEvent,
|
||||
user: User | null
|
||||
user: User | null,
|
||||
): Promise<void> => {
|
||||
Store.set("user", user);
|
||||
|
||||
//Need to query the currently active shop, and store the metadata as well.
|
||||
//Also need to query the OP Codes for decoding reference.
|
||||
const activeBodyshop: ActiveBodyshopQueryResult = await client.request(
|
||||
QUERY_ACTIVE_BODYSHOP_TYPED
|
||||
QUERY_ACTIVE_BODYSHOP_TYPED,
|
||||
);
|
||||
|
||||
Store.set("app.bodyshop", activeBodyshop.bodyshops[0]);
|
||||
@@ -28,7 +28,7 @@ const ipcMainHandleAuthStateChanged = async (
|
||||
QUERY_MASTERDATA_TYPED,
|
||||
{
|
||||
key: `${activeBodyshop.bodyshops[0].region_config}_ciecaopcodes`,
|
||||
}
|
||||
},
|
||||
);
|
||||
Store.set("app.masterdata.opcodes", JSON.parse(OpCodes.masterdata[0]?.value));
|
||||
log.debug("Received authentication state change from Renderer.", user);
|
||||
|
||||
6
src/preload/index.d.ts
vendored
6
src/preload/index.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
import { ElectronAPI } from '@electron-toolkit/preload'
|
||||
import { ElectronAPI } from "@electron-toolkit/preload";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: ElectronAPI
|
||||
api: unknown
|
||||
electron: ElectronAPI;
|
||||
api: unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import { contextBridge } from 'electron'
|
||||
import { electronAPI } from '@electron-toolkit/preload'
|
||||
import 'electron-log/preload'
|
||||
import { contextBridge } from "electron";
|
||||
import { electronAPI } from "@electron-toolkit/preload";
|
||||
import "electron-log/preload";
|
||||
|
||||
// Custom APIs for renderer
|
||||
const api = {}
|
||||
const api = {};
|
||||
|
||||
// Use `contextBridge` APIs to expose Electron APIs to
|
||||
// renderer only if context isolation is enabled, otherwise
|
||||
// just add to the DOM global.
|
||||
if (process.contextIsolated) {
|
||||
try {
|
||||
contextBridge.exposeInMainWorld('electron', electronAPI)
|
||||
contextBridge.exposeInMainWorld('api', api)
|
||||
contextBridge.exposeInMainWorld("electron", electronAPI);
|
||||
contextBridge.exposeInMainWorld("api", api);
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error(error);
|
||||
}
|
||||
} else {
|
||||
// @ts-ignore (define in dts)
|
||||
window.electron = electronAPI
|
||||
window.electron = electronAPI;
|
||||
// @ts-ignore (define in dts)
|
||||
window.api = api
|
||||
window.api = api;
|
||||
}
|
||||
|
||||
@@ -1,93 +1,97 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { Page } from '@playwright/test';
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { Page } from "@playwright/test";
|
||||
|
||||
// src/renderer/src/App.test.tsx
|
||||
|
||||
// Mock data
|
||||
const mockUser = {
|
||||
uid: 'test123',
|
||||
email: 'test@example.com',
|
||||
displayName: 'Test User',
|
||||
uid: "test123",
|
||||
email: "test@example.com",
|
||||
displayName: "Test User",
|
||||
toJSON: () => ({
|
||||
uid: 'test123',
|
||||
email: 'test@example.com',
|
||||
displayName: 'Test User'
|
||||
})
|
||||
uid: "test123",
|
||||
email: "test@example.com",
|
||||
displayName: "Test User",
|
||||
}),
|
||||
};
|
||||
|
||||
test.describe('App Component', () => {
|
||||
test.describe("App Component", () => {
|
||||
let page: Page;
|
||||
|
||||
|
||||
test.beforeEach(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
|
||||
|
||||
// Mock Firebase Auth
|
||||
await page.addInitScript(() => {
|
||||
window.mockAuthState = null;
|
||||
|
||||
|
||||
// Mock the firebase auth module
|
||||
jest.mock('./util/firebase', () => ({
|
||||
jest.mock("./util/firebase", () => ({
|
||||
auth: {
|
||||
onAuthStateChanged: (callback) => {
|
||||
callback(window.mockAuthState);
|
||||
// Return mock unsubscribe function
|
||||
return () => {};
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
// Mock electron IPC
|
||||
window.electron = {
|
||||
ipcRenderer: {
|
||||
send: jest.fn()
|
||||
}
|
||||
send: jest.fn(),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
|
||||
await page.goto("/");
|
||||
});
|
||||
|
||||
test('should show SignInForm when user is not authenticated', async () => {
|
||||
test("should show SignInForm when user is not authenticated", async () => {
|
||||
await page.evaluate(() => {
|
||||
window.mockAuthState = null;
|
||||
});
|
||||
|
||||
|
||||
await page.reload();
|
||||
|
||||
|
||||
// Check if SignInForm is visible
|
||||
const signInForm = await page.locator('form').filter({ hasText: 'Sign In' });
|
||||
const signInForm = await page
|
||||
.locator("form")
|
||||
.filter({ hasText: "Sign In" });
|
||||
await expect(signInForm).toBeVisible();
|
||||
});
|
||||
|
||||
test('should show routes when user is authenticated', async () => {
|
||||
test("should show routes when user is authenticated", async () => {
|
||||
await page.evaluate((user) => {
|
||||
window.mockAuthState = user;
|
||||
}, mockUser);
|
||||
|
||||
|
||||
await page.reload();
|
||||
|
||||
|
||||
// Check if AuthHome is visible
|
||||
const authHome = await page.locator('div:text("AuthHome")');
|
||||
await expect(authHome).toBeVisible();
|
||||
|
||||
|
||||
// Check that electron IPC was called with auth state
|
||||
await expect(page.evaluate(() => {
|
||||
return window.electron.ipcRenderer.send.mock.calls.length > 0;
|
||||
})).resolves.toBe(true);
|
||||
await expect(
|
||||
page.evaluate(() => {
|
||||
return window.electron.ipcRenderer.send.mock.calls.length > 0;
|
||||
}),
|
||||
).resolves.toBe(true);
|
||||
});
|
||||
|
||||
test('should navigate to settings page when authenticated', async () => {
|
||||
test("should navigate to settings page when authenticated", async () => {
|
||||
await page.evaluate((user) => {
|
||||
window.mockAuthState = user;
|
||||
}, mockUser);
|
||||
|
||||
|
||||
await page.reload();
|
||||
|
||||
|
||||
// Navigate to settings
|
||||
await page.click('a[href="/settings"]');
|
||||
|
||||
|
||||
// Check if Settings page is visible
|
||||
const settingsPage = await page.locator('div:text("Settings")');
|
||||
await expect(settingsPage).toBeVisible();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ const App: React.FC = () => {
|
||||
if (user) {
|
||||
window.electron.ipcRenderer.send(
|
||||
ipcTypes.toMain.authStateChanged,
|
||||
user.toJSON()
|
||||
user.toJSON(),
|
||||
);
|
||||
window.electron.ipcRenderer.send(ipcTypes.toMain.watcher.start);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ const Home: React.FC = () => {
|
||||
<Button
|
||||
onClick={(): void => {
|
||||
window.electron.ipcRenderer.send(
|
||||
ipcTypes.toMain.debug.decodeEstimate
|
||||
ipcTypes.toMain.debug.decodeEstimate,
|
||||
);
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -24,7 +24,7 @@ const SignInForm: React.FC = () => {
|
||||
};
|
||||
|
||||
const onFinishFailed: FormProps<FieldType>["onFinishFailed"] = (
|
||||
errorInfo
|
||||
errorInfo,
|
||||
) => {
|
||||
log.log("Failed:", errorInfo);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react'
|
||||
import { useState } from "react";
|
||||
|
||||
function Versions(): JSX.Element {
|
||||
const [versions] = useState(window.electron.process.versions)
|
||||
const [versions] = useState(window.electron.process.versions);
|
||||
|
||||
return (
|
||||
<ul className="versions">
|
||||
@@ -9,7 +9,7 @@ function Versions(): JSX.Element {
|
||||
<li className="chrome-version">Chromium v{versions.chrome}</li>
|
||||
<li className="node-version">Node v{versions.node}</li>
|
||||
</ul>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default Versions
|
||||
export default Versions;
|
||||
|
||||
@@ -7,5 +7,5 @@ import "./util/ipcRendererHandler";
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ ipcRenderer.on(
|
||||
(event: Electron.IpcRendererEvent, arg) => {
|
||||
console.log("Received test message from main process");
|
||||
console.log(arg);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
ipcRenderer.on(
|
||||
@@ -24,7 +24,7 @@ ipcRenderer.on(
|
||||
async (event: Electron.IpcRendererEvent, arg) => {
|
||||
const token = await auth.currentUser?.getIdToken();
|
||||
ipcRenderer.send(ipcTypes.toMain.user.getTokenResponse, token);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
ipcRenderer.on(
|
||||
@@ -33,7 +33,7 @@ ipcRenderer.on(
|
||||
console.log("Watcher has started");
|
||||
console.log(arg);
|
||||
dispatch(watcherStarted());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
ipcRenderer.on(
|
||||
@@ -42,7 +42,7 @@ ipcRenderer.on(
|
||||
console.log("Watcher has stopped");
|
||||
console.log(arg);
|
||||
dispatch(watcherStopped());
|
||||
}
|
||||
},
|
||||
);
|
||||
ipcRenderer.on(
|
||||
ipcTypes.toRenderer.watcher.error,
|
||||
@@ -50,5 +50,5 @@ ipcRenderer.on(
|
||||
console.log("Watcher has encountered an error");
|
||||
console.log(error);
|
||||
dispatch(watcherError(error));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ function deepLowerCaseKeys<T = any>(obj: any): T {
|
||||
|
||||
return result;
|
||||
},
|
||||
{} as Record<string, any>
|
||||
{} as Record<string, any>,
|
||||
) as T;
|
||||
}
|
||||
export default deepLowerCaseKeys;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"toolbar": {
|
||||
"help": "Help"
|
||||
}
|
||||
"toolbar": {
|
||||
"help": "Help"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"translation": {
|
||||
"navigation": {
|
||||
"home": "Home",
|
||||
"settings": "Settings"
|
||||
},
|
||||
"settings": {
|
||||
"actions": {
|
||||
"addpath": "Add path",
|
||||
"startwatcher": "Start Watcher",
|
||||
"stopwatcher": "Stop Watcher\n"
|
||||
},
|
||||
"labels": {
|
||||
"started": "Started",
|
||||
"stopped": "Stopped",
|
||||
"watcherstatus": "Watcher Status"
|
||||
}
|
||||
}
|
||||
}
|
||||
"translation": {
|
||||
"navigation": {
|
||||
"home": "Home",
|
||||
"settings": "Settings"
|
||||
},
|
||||
"settings": {
|
||||
"actions": {
|
||||
"addpath": "Add path",
|
||||
"startwatcher": "Start Watcher",
|
||||
"stopwatcher": "Stop Watcher\n"
|
||||
},
|
||||
"labels": {
|
||||
"started": "Started",
|
||||
"stopped": "Stopped",
|
||||
"watcherstatus": "Watcher Status"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user