mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-29 02:55:22 +02:00
Refactor appName generation in dashboard components
- Updated the appName generation logic in `AddApplication`, `AddCompose`, and `AddDatabase` components to use the `slugify` function for improved consistency and readability. - Enhanced the `slugify` function to return a default value of "service" if the input is empty, ensuring robustness in name generation. - Improved project name validation in `handle-project.tsx` to enforce stricter rules on naming conventions.
This commit is contained in:
@@ -5,7 +5,7 @@ export const slugify = (text: string | undefined) => {
|
||||
return "";
|
||||
}
|
||||
|
||||
const cleanedText = text.trim().replace(/[^a-zA-Z0-9\s]/g, "");
|
||||
const cleanedText = text.trim().replace(/[^a-zA-Z0-9\s]/g, "") || "service";
|
||||
|
||||
return slug(cleanedText, {
|
||||
lower: true,
|
||||
|
||||
Reference in New Issue
Block a user