Skip to content

Commit

Permalink
fix: clean default system error messages (#12951) (#12973)
Browse files Browse the repository at this point in the history
Fixes #12939

Co-authored-by: caalador <[email protected]>
  • Loading branch information
vaadin-bot and caalador authored Feb 9, 2022
1 parent 88b682f commit 5a343f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@
* <li><b>sessionExpiredURL</b> = null</li>
* <li><b>sessionExpiredNotificationEnabled</b> = false</li>
* <li><b>sessionExpiredCaption</b> = "Session Expired"</li>
* <li><b>sessionExpiredMessage</b> = "Take note of any unsaved data, and
* <u>click here</u> or press ESC key to continue."</li>
* <li><b>sessionExpiredMessage</b> = "Take note of any unsaved data, and click
* here or press ESC key to continue."</li>
* <li><b>internalErrorURL</b> = null</li>
* <li><b>internalErrorNotificationEnabled</b> = true</li>
* <li><b>internalErrorCaption</b> = "Internal error"</li>
* <li><b>internalErrorMessage</b> = "Please notify the administrator.<br>
* Take note of any unsaved data, and <u>click here</u> or press ESC to
* continue."</li>
* <li><b>internalErrorMessage</b> = "Please notify the administrator. Take note
* of any unsaved data, and click here or press ESC to continue."</li>
* <li><b>cookiesDisabledURL</b> = null</li>
* <li><b>cookiesDisabledNotificationEnabled</b> = true</li>
* <li><b>cookiesDisabledCaption</b> = "Cookies disabled"</li>
* <li><b>cookiesDisabledMessage</b> = "This application requires cookies to
* function.<br>
* Please enable cookies in your browser and <u>click here</u> or press ESC to
* try again.</li>
* function. Please enable cookies in your browser and click here or press ESC
* to try again.</li>
* </ul>
*
* @since 1.0
Expand All @@ -54,17 +52,17 @@ public class SystemMessages implements Serializable {
protected String sessionExpiredURL = null;
protected boolean sessionExpiredNotificationEnabled = false;
protected String sessionExpiredCaption = "Session Expired";
protected String sessionExpiredMessage = "Take note of any unsaved data, and <u>click here</u> or press ESC key to continue.";
protected String sessionExpiredMessage = "Take note of any unsaved data, and click here or press ESC key to continue.";

protected String internalErrorURL = null;
protected boolean internalErrorNotificationEnabled = true;
protected String internalErrorCaption = "Internal error";
protected String internalErrorMessage = "Please notify the administrator.<br>Take note of any unsaved data, and <u>click here</u> or press ESC to continue.";
protected String internalErrorMessage = "Please notify the administrator. Take note of any unsaved data, and click here or press ESC to continue.";

protected String cookiesDisabledURL = null;
protected boolean cookiesDisabledNotificationEnabled = true;
protected String cookiesDisabledCaption = "Cookies disabled";
protected String cookiesDisabledMessage = "This application requires cookies to function.<br>Please enable cookies in your browser and <u>click here</u> or press ESC to try again.";
protected String cookiesDisabledMessage = "This application requires cookies to function. Please enable cookies in your browser and click here or press ESC to try again.";

/**
* Private constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setLocationWithNotificationDisabled_noErrorMessages() {
// Strings defined in com.vaadin.flow.server.SystemMessages
checkLogsForErrors(
msg -> msg.contains("Session Expired") || msg.contains(
"Take note of any unsaved data, and <u>click here</u> or press ESC key to continue."));
"Take note of any unsaved data, and click here or press ESC key to continue."));

// There can't be any error dialog
Assert.assertFalse(isElementPresent(By.className("v-system-error")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void setLocationWithNotificationEnabled_noErrorMessages() {
// There can be "Session Expired" message because of heartbeat
// Strings defined in com.vaadin.flow.server.SystemMessages
checkLogsForErrors(msg -> msg.contains("Session Expired")
|| msg.contains("Take note of any unsaved data, and <u>click "
+ "here</u> or press ESC key to continue."));
|| msg.contains("Take note of any unsaved data, and click "
+ "here or press ESC key to continue."));

// There can't be any error dialog
Assert.assertFalse(isElementPresent(By.className("v-system-error")));
Expand Down

0 comments on commit 5a343f1

Please sign in to comment.