-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support non-numeric values for Usage chart filter parameters #716
Support non-numeric values for Usage chart filter parameters #716
Commits on Dec 10, 2018
-
Add new functionality to Usage chart requests
Added the ability for Usage chart requests to provide non-numeric values for '_filter' parameters. The new feature will attempt to translate these non-numeric values into appropriate id values that can be used during chart generation. Specifically this new feature is to support integration w/ Coldfront.
Configuration menu - View commit details
-
Copy full SHA for 876fd88 - Browse repository at this point
Copy the full SHA 876fd88View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0ad5c2 - Browse repository at this point
Copy the full SHA e0ad5c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bfd9fcd - Browse repository at this point
Copy the full SHA bfd9fcdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 152dbb1 - Browse repository at this point
Copy the full SHA 152dbb1View commit details -
Simplification of the
translateValue
function per @jpwhite4Per code review comments I've simplified this function. - Moved the `is_numeric` check to the top of the function and used it as a short circuit. - Removed the anonymous function and moved the code it contained to the bottom of the function, executed contingent on which `case`, if any, is hit.
Configuration menu - View commit details
-
Copy full SHA for 45a6454 - Browse repository at this point
Copy the full SHA 45a6454View commit details -
New integration tests for the newly added Usage functionality
This new test checks that the `_filter` variables accept non-id values (optionally, multiple comma delimited values). The test data includes the following: - Tests run as all users ( pub, cd, cs, pi, usr ) - Multiple Realms ( Jobs, Cloud ) - For the Jobs realm, all combinations of: ( including single, multiple, numeric & non-numeric values ) - 'resource', 'resource_filter' - 'pi', 'pi_filter' - For the Cloud realm: ( including single, multiple, numeric, and non-numeric values ) - 'project', 'project_filter'
Configuration menu - View commit details
-
Copy full SHA for 607dc71 - Browse repository at this point
Copy the full SHA 607dc71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20926ef - Browse repository at this point
Copy the full SHA 20926efView commit details -
As this function should only ever return one value the code has been updated so that this is the case.
Configuration menu - View commit details
-
Copy full SHA for 9f1e4d2 - Browse repository at this point
Copy the full SHA 9f1e4d2View commit details -
- Updated `translateFilterValue` to return an array of values and the calling code to work with an array as opposed to a single value. This is to support the use case of a system account being associated with more than one person. - Updated `translateFilterValue` to only interpret `$usageFilterValue` as a string if it contains quotes ( single or double ). This allows us to identify when the calling code is passing us a value that is intended to be interpreted as a string not a number. - Updated Test Cases so that string values are quoted with both single / double quotes. - Added additional test cases that test what happens when a string value is provided that is not found in the db.
Configuration menu - View commit details
-
Copy full SHA for e20cc9d - Browse repository at this point
Copy the full SHA e20cc9dView commit details -
Refactor / Simplification of Usage Filter generation
Refactored a portion of the `convertChartRequest` function and combined the two `for-each` loops that were populating the `$meFilters` variable. Now we have one loop that has the same functionality. Also a tiny comment update in the `translateFilterValue` function for the 'pi' filter type. Now that we always return an array the previous comment didn't really make sense anymore.
Configuration menu - View commit details
-
Copy full SHA for ab8932b - Browse repository at this point
Copy the full SHA ab8932bView commit details -
Simplified
translateFilterValue
Now that we have a reliable test for what constitutes a "string" ( i.e. must be quoted ) we can simplify the internals of `translateFilterValue` by removing the vast majority of the if/elseif block. Also added a few comments to help provide context.
Configuration menu - View commit details
-
Copy full SHA for f149e41 - Browse repository at this point
Copy the full SHA f149e41View commit details -
Providing more informative exception info
Added `$usageFilterType` to the message for the exception thrown in `translateFilterValue`.
Configuration menu - View commit details
-
Copy full SHA for e5d01de - Browse repository at this point
Copy the full SHA e5d01deView commit details -
Updating the translateFilterValue exception message
Added the invalid `$usageFilterValue` to the exception message and updated the section in the tests that handled detecting when exceptions are thrown to handle this update.
Configuration menu - View commit details
-
Copy full SHA for fb095a8 - Browse repository at this point
Copy the full SHA fb095a8View commit details -
Update classes/DataWarehouse/Access/Usage.php
Co-Authored-By: ryanrath <ryanrath@buffalo.edu>
Configuration menu - View commit details
-
Copy full SHA for 0f83768 - Browse repository at this point
Copy the full SHA 0f83768View commit details