fix(boards): issues with old-import board name containing spaces (#4052)

This commit is contained in:
Meier Lukas
2025-09-12 18:44:37 +02:00
committed by GitHub
parent 3703f428b0
commit f7471b6c63
5 changed files with 11 additions and 3 deletions

View File

@@ -61,6 +61,10 @@ const getBoardAndPermissionsAsync = async (params: Awaited<Props["params"]>) =>
notFound();
}
if (error instanceof TRPCError && error.code === "BAD_REQUEST") {
notFound();
}
throw error;
}
};

View File

@@ -45,6 +45,10 @@ export const createBoardLayout = <TParams extends Params>({
notFound();
}
if (error instanceof TRPCError && error.code === "BAD_REQUEST") {
notFound();
}
throw error;
});
const colorScheme = await getCurrentColorSchemeAsync();

View File

@@ -59,7 +59,7 @@ export const ImportBoardModal = createModal(({ actions }) => {
}
setFileValid(true);
form.setFieldValue("configuration.name", result.data.configProperties.name);
form.setFieldValue("configuration.name", result.data.configProperties.name.replaceAll(" ", "-"));
})();
},
},

View File

@@ -29,7 +29,7 @@ export const analyseOldmarrImportAsync = async (file: File) => {
}
return {
name: entry.name.replace(".json", ""),
name: entry.name.replaceAll(" ", "-").replace(".json", ""),
config: result.data ?? null,
isError: !result.success,
};

View File

@@ -22,7 +22,7 @@ export const boardNameSchema = z
.string()
.min(1)
.max(255)
.regex(/^[A-Za-z0-9-\\_]*$/);
.regex(/^[A-Za-z0-9-_]*$/);
export const boardColumnCountSchema = z.number().min(1).max(24);
export const boardByNameSchema = z.object({