replaced backend with vite

This commit is contained in:
Felix Kaspar
2024-05-10 22:38:47 +02:00
parent 2fc152e96f
commit 6eed4a3238
9 changed files with 760 additions and 117 deletions

View File

@@ -1,16 +0,0 @@
import i18next from "i18next";
import resourcesToBackend from "i18next-resources-to-backend";
i18next
.use(resourcesToBackend((language: string, namespace: string) => import(`../public/locales/${namespace}/${language}.json`, {
assert: { type: "json" },
})))
.init({
// debug: true,
ns: ["common"], // Preload this namespace, no need to add the others, they will load once their module is loaded
defaultNS: "common",
fallbackLng: "en",
interpolation: {
escapeValue: false,
}
});

View File

@@ -5,16 +5,16 @@ import { Progress } from "../functions";
import { validateOperations } from "./validateOperations";
import { getOperatorByName } from "./operatorAccessor";
export async function traverseOperations(operations: Action[], input: PdfFile[], progressCallback: (state: Progress) => void): Promise<PdfFile[]> {
const validationResult = await validateOperations(operations);
export async function traverseOperations(actions: Action[], input: PdfFile[], progressCallback: (state: Progress) => void): Promise<PdfFile[]> {
const validationResult = await validateOperations(actions);
if(!validationResult.valid) {
return Promise.reject({validationError: validationResult.reason});
}
const waitOperations = organizeWaitOperations(operations);
const waitOperations = organizeWaitOperations(actions);
let results: PdfFile[] = [];
await nextOperation(operations, input, progressCallback);
await nextOperation(actions, input, progressCallback);
return results;
async function nextOperation(actions: Action[] | undefined, input: PdfFile[], progressCallback: (state: Progress) => void): Promise<void> {

View File

@@ -5,7 +5,6 @@ import { getOperatorByName } from "./operatorAccessor";
/** This function validates the "workflow-json" from the API */
export async function validateOperations(actions: Action[]): Promise<{ valid: boolean, reason?: string}> {
const done: Action[] = [];
for (const action of actions) {
if (action.type === "done") {
if(done[action.values.id] !== undefined) {