Skip to content
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

As a Compliance Officer, I want to directly access the documents listed in the file viewer so that I can look at the contents of the files #288

Closed
matthieu-foucault opened this issue Jul 30, 2021 · 2 comments
Assignees

Comments

@matthieu-foucault
Copy link
Contributor

matthieu-foucault commented Jul 30, 2021

Description

Part of the compliance process involves opening the various attachments submitted with a SWRS report. Given the number of reports, attachments, and the fact that they are located across all archives, being able to download reports in a timely manner is paramount.

This user story's work is comprised of a metabase question (with a custom column using the concat function) that uses the attachment's and report's info to generate a link to ggircs application. This will allow the user to access links to documents directly from the file comparison viewer.

The file name in the URL should be URL-encoded (spaces replaced with %20, and other special characters, if any are present in the attachments file names) Modern browsers don't seem to mind spaces and slashes

The ggircs application already supports direct download of files through its API, so no work is needed on that end.

Scenarios

the swrs_history.report_attachment table has the following columns:

  • md5 hash
  • zip file name
  • file path

The swrs_transform.load_report_attachment(), needs to, for each record in the swrs_transform.historical_report_attachment_data materialized view, find the corresponding record in the swrs_extract.eccc_attachment table, based on the swrs_extract.eccc_attachment.swrs_report_id, swrs_extract.eccc_attachment.source_type_id and swrs_extract.eccc_attachment.uploaded_file_name columns.

Given that I am logged in metabase,
When viewing a question named attachments with download links
Then I can see a column named download_link, with a link to the ggircs application.

Given an attachment with file a path of Output_Prod%2FReport_1234_2020_SourceTypeId_42_some%20file.pdf and a zip_file_name of GHGBC_PROD_20200101.zip
When viewing the download_link column in the attachments with download links question
Then the link should be https://cas-ggircs.apps.silver.devops.gov.bc.ca/api/eccc/files/GHGBC_PROD_20200101.zip/download?filename=Output_Prod%2FReport_1234_2020_SourceTypeId_42_some%20file.pdf

@matthieu-foucault matthieu-foucault changed the title As a Compliance Officer, I want to directly access the documents listed in the file viewer so that I can look at the differences in files in more details. As a Compliance Officer, I want to directly access the documents listed in the file viewer so that I can look at the contents of the files Aug 3, 2021
@matthieu-foucault
Copy link
Contributor Author

This issue's description needs to be updated. We discovered that older attachments do not follow the same naming convention, so we'll have to find the attachment's full path in the ETL process and record it in the db

@LindsayMacfarlane
Copy link

Thank you for the demo @matthieu-foucault!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants