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

refactor: Add CsvRecord class instead of using adhoc CsvRecord struct #991

Merged
merged 2 commits into from
Jan 11, 2021

Conversation

frankchn
Copy link
Contributor

Problem

Currently, the decryption worker returns an ad-hoc CsvRecord struct for consumption that is constructed in a piecemeal basis in the business logic.

Solution

We unify the logic to generate the CsvRecord struct in a class with the appropriate methods.

Note that we cannot post a full-fledged object (i.e. including JS methods on the object) using postMessage, so we construct the appropriate fields as properties of the original CsvRecord, so minimal modification to submission.client.factory.js is necessary.

Tests

Ensure that CSV and attachment downloads continue to work as expected.

Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to suggest converting updateSubmissionData to become a getter method instead - please lmk your thoughts!

@frankchn frankchn merged commit 64ffe9c into develop Jan 11, 2021
@frankchn frankchn deleted the frank-download-fix branch January 11, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants