Skip to content

Commit

Permalink
Remove punctuation from validation errors in create directory dialog
Browse files Browse the repository at this point in the history
This is what PatternFly advices and is consistent with the rest of our
validation error messages.
  • Loading branch information
jelly committed Nov 6, 2024
1 parent 0a98018 commit 078560e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/dialogs/mkdir.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const _ = cockpit.gettext;

function check_name(candidate: string) {
if (candidate === "") {
return _("Directory name cannot be empty.");
return _("Directory name cannot be empty");
} else if (candidate.length >= 256) {
return _("Directory name too long.");
return _("Directory name too long");
} else if (candidate.includes("/")) {
return _("Directory name cannot include a /.");
return _("Directory name cannot include a /");
} else {
return undefined;
}
Expand Down
6 changes: 3 additions & 3 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -866,15 +866,15 @@ class TestFiles(testlib.MachineCase):
b.set_input_text("#create-directory-input", "test")
b.set_input_text("#create-directory-input", "")
b.wait_visible("button.pf-m-primary:disabled")
b.wait_in_text("#create-directory-input-helper", "Directory name cannot be empty.")
b.wait_in_text("#create-directory-input-helper", "Directory name cannot be empty")

b.set_input_text("#create-directory-input", "a" * 256)
b.wait_visible("button.pf-m-primary:disabled")
b.wait_in_text("#create-directory-input-helper", "Directory name too long.")
b.wait_in_text("#create-directory-input-helper", "Directory name too long")

b.set_input_text("#create-directory-input", "foo/bar")
b.wait_visible("button.pf-m-primary:disabled")
b.wait_in_text("#create-directory-input-helper", "Directory name cannot include a /.")
b.wait_in_text("#create-directory-input-helper", "Directory name cannot include a /")

b.set_input_text("#create-directory-input", "test")
b.wait_visible("button.pf-m-primary:not(:disabled)")
Expand Down

0 comments on commit 078560e

Please sign in to comment.