Skip to content

Commit

Permalink
Fix for #995 (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvolf authored Dec 2, 2023
1 parent 452ddd0 commit a18605f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function isEmpty(str: string) {
return str === null || str === undefined || str.trim() === '';
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {ProjectService} from "../api/ProjectService";
import {Project} from "../api/ProjectModels";
import {CamelUi} from "../designer/utils/CamelUi";
import {shallow} from "zustand/shallow";
import {isEmpty} from "../../../java/org/apache/camel/karavan/util/StringUtils";

export function CreateProjectModal () {

Expand Down Expand Up @@ -55,7 +56,7 @@ export function CreateProjectModal () {
}

function onKeyDown(event: React.KeyboardEvent<HTMLDivElement>): void {
if (event.key === 'Enter' && name !== undefined && description !== undefined && projectId !== undefined) {
if (event.key === 'Enter' && !isEmpty(name) && !isEmpty(description) && !isEmpty(projectId)) {
confirmAndCloseModal();
}
}
Expand Down

0 comments on commit a18605f

Please sign in to comment.