LibraryOfCongress/viewshare — pull request #129 by dfeeney (2014-09-03 06:04:03+00:00)
Title: fixes #125, and provides a more substantial framework for view/facet validation

This fixes the issue with table views not being initialized property (#125). The issue turned out to be a combination of the new property multiselect widget not initializing the property list when it comes in empty, and a secondary issue with the wrong change event being fired on the multiselect.

In the process of tracking this down, I modified the rudimentary (true/false) validation method to cache an array of error messages. If a particular view/facet fails to validate, these error messages are now rendered to the preview pane in lieu of the exhibit itself. In addition, the save button is disabled for the view editor. The error messages are terrible, but they're better than the blank pane you saw previously. Currently, there are four widgets with explicit validation: The Table view, the slider widget, the numeric widget, and the logo widget. If the widget validates but the preview render generates an exception, you see an 'Invalid Configuration' message. You can easily see this in action by selecting a timeline view and picking any property without a date value.

Since the exhibit numeric facet expects values explicitly typed as numbers, I modified the property selection list for this to only show number properties.