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

Export students as CSV #847

Merged
merged 9 commits into from Nov 8, 2019
Merged

Export students as CSV #847

merged 9 commits into from Nov 8, 2019

Conversation

hisahi
Copy link
Contributor

@hisahi hisahi commented Nov 7, 2019

Short description

#611: Export student table CSV as instructor

DoD

I have:

  • added actual code.
  • produced clean code that passes ESLint.
  • code that actually does what it should.
  • documented the code or added documentation to the wiki.
  • added or modified test(s).
  • test(s) that actually pass.

@hisahi hisahi added enhancement New feature or request frontend Only frontend (use "full-stack" if work in both) work-in-progress For PRs (only); means that not yet ready for review/merge labels Nov 7, 2019
@hisahi hisahi removed the work-in-progress For PRs (only); means that not yet ready for review/merge label Nov 7, 2019
@hisahi hisahi changed the title WIP: Export students as CSV Export students as CSV Nov 7, 2019
Copy link
Contributor

@mjaakko mjaakko left a comment

Choose a reason for hiding this comment

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

Also, maybe it would be possible to create a generic "Export CSV" component that would be easier to unit test?

labtool2.0/src/components/pages/CoursePage/TeacherMain.js Outdated Show resolved Hide resolved
}
for (let i = 1; i <= props.selectedInstance.weekAmount; ++i) {
const points = weekPoints[i]
values.push(points || points === 0 ? points : '-')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these CSV files are intended to be machine-readable and in that case - would not be a good value for missing points.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not certain whether this is for being machine-readable or just for importing into a spreadsheet.

Co-Authored-By: Jaakko Malkki <32361480+mjaakko@users.noreply.github.com>
@hisahi
Copy link
Contributor Author

hisahi commented Nov 7, 2019

Also, maybe it would be possible to create a generic "Export CSV" component that would be easier to unit test?

It's unlikely this would be used more than once, so it's better to somehow write tests for the existing code - not sure what the best approach is, though. Mocking downloadFile?

@mjaakko
Copy link
Contributor

mjaakko commented Nov 7, 2019

Also, maybe it would be possible to create a generic "Export CSV" component that would be easier to unit test?

It's unlikely this would be used more than once, so it's better to somehow write tests for the existing code - not sure what the best approach is, though. Mocking downloadFile?

Mocking downloadFile would be fine. We want to test that exported CSV is in correct format and has correct data in all columns.

@hisahi hisahi requested a review from mjaakko November 7, 2019 17:26
@hisahi hisahi merged commit 88d45ac into trunk Nov 8, 2019
@hisahi hisahi deleted the feat/csv-export branch November 8, 2019 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Only frontend (use "full-stack" if work in both)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants