Issue 55: Add custom filter for submission type by list. #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #55
This borrows heavily on the work resolved for Issue 54 (see commit cbe080b).
Most of the field values Controller end points are under the Submission Controller rather than its own Controller. This introduces complications because the UI is using "FieldValue" and mapping it to a Submission Controller. Getting the list of FieldValues, independent of a Submission, does not belong in the Submission Controller. There are a lot of work-arounds or other unusual design changes here to accommodate this situation. A new
FieldValueRepo
is added on the UI.This adds new functionality for selecting all Field Values associated with a given Field Predicate. This is used to select the specific Field Predicate that is hard-coded as
submission_type
.It turns out the escape string usage in
cbe080bcdc4477bc1f5f8ceeff27abbf0bb94528
is not entirely correct. The string does need to be escaped, but not the%
and not the_
. Only the slashes.Change the
escapeString()
function to handle this use case.The Submission Type column already exists.
Create a new one called
Submission Type (List)
.This exposed a problem in the design where the names of the columns are used to generate the array key names and HTML attribute names. The use of
(
and)
is not well supported there. Break out the sanitizer used in several places into a single function call and have that function call also handle(
and)
. Other cases are not handled and I am leaving those to be handled on an as-needed basis. To avoid conflicts with the existing Submission Type, the new Submission Type (List) is suffixed withList
in several places.The
submissionListColumns
variable in theprocessUpdate
of theSubmissionListController
is being used for both the Manage Filter Columns and the Submission List Columns. This is a problem where the newSubmission Type (List)
is only a Filter and is not a Column to select. The code had to be re-worked to address this.I chose the quick and simple approach of making another variable. There may be better ways but this seems good enough at this time.
A recent change introduced setting
$dirty
on$scope.getSelectedOrganization()
but that did not handle the case where$scope.getSelectedOrganization()
is undefined or NULL. This broke some unit tests but is now fixed.Update the CLI tests to generate Submission Types that are not always different. The Submission Type is created outside of the transaction loop to ensure only a small set is created. If there already exists Submission Types then no new ones are created and the existing ones are re-used. This allows for building generated test data on a system with existing data already populated.