AlertMessages

Not logged in - Log In / Register

The Launchpad Web app now supports four kinds of alert messages: error messages, warning messages, informational messages, and debugging data. AddForm, EditForm, and GeneralForm use these automatically, but sometimes you'll have to use them yourself (instead of the old portalError and portalMessage CSS classes).

How to roll your own alerts

{X}

<p class="error message">
The action you asked for didn't succeed.

/!\

<p class="warning message">
You're in danger of losing significant time, work, or privacy (perhaps by inattention or a possible mistake).

{i}

<p class="informational message">
Something unusual but not dangerous has happened, such as successfully creating something.

{i}

<p class="debugging message">
This should never appear in production.

If you want to highlight a form field with an error message underneath, use the classes separately.

<div class="error">
[Here's a form field with an error in it.]
{X} <div class="message"> There is no product with that name.

Testing that you've used the correct alert style

When you write tests for a page containing an alert message, include the type of alert in the expected output. For example:

  ...error message...
  ...There is no product with that name.

  ...warning message...
  ...There is no branch with that name. Continuing will register this branch automatically.

  ...informational message...
  ...Thank you for your bug report!

AlertMessages (last edited 2011-01-19 22:14:11 by mpt)