bcgov / NRPTI

Natural Resources Public Transparency Initiative
Apache License 2.0
5 stars 15 forks source link

[BUG] When manually adding a record to NRPTI, the record is not appearing in the NRCED .csv export #1231

Closed acatchpole closed 3 months ago

acatchpole commented 4 months ago

Describe the Bug Manually added record IS showing up in search results in NRPTI/NRCED but IS NOT showing up when exporting those results to .csv

Expected Behaviour When a user clicks on the 'Export to CSV' button, ALL currently shown results should be included in that .csv

Actual Behaviour I manually add a NRCED Published record to NRPTI. This record appears in the search results for both NRCED and NRPTI. But when I go to export the results to .csv, the manually added record is not included in the .csv. This has been observed in both the DEV and TEST pods.

Implications A clear and concise description of any implications.

Steps To Reproduce Steps to reproduce the behaviour:

  1. Go to NRPTI Test page
  2. Click on 'Add Record'
  3. Create a test record
  4. Set some search filters that include your test record and a small number of other records
  5. Observe that your test record appears in the results
  6. Go to (NRCED Test page)[https://nrced-f00029-test.apps.silver.devops.gov.bc.ca/records]
  7. Use the same search filters as before
  8. Observe that the test record shows up
  9. Click on 'Export to CSV'
  10. In the generated .csv, observe that the test record is not present
acatchpole commented 4 months ago

This bug is a result of the changes around #1211 #1220 #1222. When the 'Export to CSV' button is hit, a search is performed based on the given filters. While the general search function (through the records-list.component) was updated to pass down the associated actCode alongside any ActName, that fix does not seem to be working with the search that happens with the .csv export. Therefore, any records that have an actCode instead of the actName will not be returned by this search (but only when filtering by the actName).

The 2 likely paths for fixing:

  1. Follow the pattern for the existing fix by having any relevant actCode appended to the query. OR
  2. A better solution would be to make the fix in the backend. If an actName is received in a search, the response should include records that match both the actName and the associated actCode.
acatchpole commented 3 months ago

fix deployed to prod