fix(boards): issues with old-import board name containing spaces (#4052)
This commit is contained in:
@@ -61,6 +61,10 @@ const getBoardAndPermissionsAsync = async (params: Awaited<Props["params"]>) =>
|
|||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error instanceof TRPCError && error.code === "BAD_REQUEST") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ export const createBoardLayout = <TParams extends Params>({
|
|||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error instanceof TRPCError && error.code === "BAD_REQUEST") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
const colorScheme = await getCurrentColorSchemeAsync();
|
const colorScheme = await getCurrentColorSchemeAsync();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export const ImportBoardModal = createModal(({ actions }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setFileValid(true);
|
setFileValid(true);
|
||||||
form.setFieldValue("configuration.name", result.data.configProperties.name);
|
form.setFieldValue("configuration.name", result.data.configProperties.name.replaceAll(" ", "-"));
|
||||||
})();
|
})();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const analyseOldmarrImportAsync = async (file: File) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: entry.name.replace(".json", ""),
|
name: entry.name.replaceAll(" ", "-").replace(".json", ""),
|
||||||
config: result.data ?? null,
|
config: result.data ?? null,
|
||||||
isError: !result.success,
|
isError: !result.success,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const boardNameSchema = z
|
|||||||
.string()
|
.string()
|
||||||
.min(1)
|
.min(1)
|
||||||
.max(255)
|
.max(255)
|
||||||
.regex(/^[A-Za-z0-9-\\_]*$/);
|
.regex(/^[A-Za-z0-9-_]*$/);
|
||||||
export const boardColumnCountSchema = z.number().min(1).max(24);
|
export const boardColumnCountSchema = z.number().min(1).max(24);
|
||||||
|
|
||||||
export const boardByNameSchema = z.object({
|
export const boardByNameSchema = z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user