Issue 1930: Add custom filter for embargo type by list. #1935
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 #1930
There is existing (dead) code for this already.
Re-vitalize the (dead) code, clean it up, and get it working.
The
embargoTypes.name
SQL in the back-end operates differently in that it is not involved in part of a column name and is exclusively for filtering. This changes the nature of the query and I opted to go with sub-queries for selecting the IDs because I can design it this way and avoidLEFT JOIN
(orINNER JOIN
). This has not seen extensive performance testing but this new SQL query conditions should be run through some performance testing.I went with
Embargo Type
for the new custom filter because the existing code used that name.A custom filter
uniqueEmbargoType
is created because theunique
/uniq
angularjs is not available. Usingunique
oruniq
yields an error like this:Using the custom filter (
uniqueEmbargoType
) avoids having to pass the additional| filter:{isActive: true}
and similar. This can be done and is done within the same filter.This adds a unit test for the filter (AngularJS context of filter) for the Embargo Type filter (Vireo table list context of filter).
The addition of the
Embargo Type
causes a test in theSystemDataLoaderTest
class to fail due to a hard-coded value representing all of the default filters. This has been updated to include the new filter in the total.The UI has an existing filter view, and that filter view is now slightly tweaked to address problems in the user experience. I opted to make its design more closely match that of the Status filter (which goes in line with the issue request using Status filter as an example).
This PR has an escaped issue discovered and fixed in #1936.
There is overlapping changes and so if PR #1936 is not to be merged then the SQL escape fixes need to be cherry-picked out from that PR and added to this PR.
The following SQL may be needed to updating existing repositories when not using the
ddl-auto
to update.