On Sat, Nov 18, 2017 at 6:50 PM, Craig Russell <[email protected]> wrote:
> I've done most of the validation for vote and notice links but cannot figure 
> out how to:
>
> 1. Make the error message itself appear in red

In general, colors are controlled by CSS.  In this tool, there is tool
specific CSS here:

https://github.com/apache/whimsy/blob/master/www/project/icla/public/css/icla.css

The tool also makes use of boostrap:

https://getbootstrap.com/

I'd recommend using the alert CSS classes:

https://v4-alpha.getbootstrap.com/components/alerts/

Note that wunderbar (and the vue filter) supports a shorthand:

  .div.alert.alert_danger

If you look in pages/invite.js.rb, you will see an example where this
is used for another error message.

> 2. Make the vote link and notice link entry fields appear in red until they 
> are validated (either empty or filled properly)

Adding "required: true" to the _input line for the vote link will make
the border red until validated.

If you want to have the field appear in red otherwise, you will need
to make them invalid.  Try the following in the javascript console:

document.getElementById('votelink').setCustomValidity('error message')

To reset it:

document.getElementById('votelink').setCustomValidity('error message')

Note: you can see the error message by hovering over the field.

> 3. Turn off (Preview Invitation) unless the vote and notice links are 
> validated

@disabled should be set to true unless all of the fields are
validated.  So if you set a custom validity error (per above), it
should prevent the preview invitation button from becoming enabled.

> Craig L Russell
> Secretary, Apache Software Foundation
> [email protected] http://db.apache.org/jdo

- Sam Ruby

Reply via email to