Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean default system error messages (#12951) (#13759) (CP: 2.7) #13782

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -32,7 +32,10 @@ public void setLocationWithNotificationDisabled_noErrorMessages() {
$(NativeButtonElement.class).first().click();

// There can be "Session Expired" message because of heartbeat
checkLogsForErrors(msg -> msg.equals("Session Expired"));
// Strings defined in com.vaadin.flow.server.SystemMessages
checkLogsForErrors(
msg -> msg.contains("Session Expired") || 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
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