Conversation
Signed-off-by: sudeeptarlekar <[email protected]>
Signed-off-by: sudeeptarlekar <[email protected]>
Signed-off-by: sudeeptarlekar <[email protected]>
Current Code Coverage Percent of this PR:87.84 %Files having coverage below 100%
|
|
@apoorv1316 Please test this on priority. |
apoorv1316
left a comment
There was a problem hiding this comment.
@sudeeptarlekar When I add a team member filter and then export CSV then in the downloaded file I only get the report of one employee. Can you please check that?
|
Where you tested this? |
|
@apoorv1316 Was this discussed with Sudeep after today's stand up call ? |
|
@sudeeptarlekar Shared a loom video for it. |
|
Fixed the issue |
| end | ||
|
|
||
| def process | ||
| CSV.generate(headers: true) do |csv| |
There was a problem hiding this comment.
@sudeeptarlekar Can we move the report generation to a worker? Otherwise, this entire CSV generation works synchronously, And it will cause heavy load in the server.
There was a problem hiding this comment.
We can, but how are we thinking of making it available for download to user?
There was a problem hiding this comment.
Imo, synchronous download for now will work as there won't be much data, though I agree this should be asynchronous, but we can fix this in future, it will be little efforts when we decide how we will let user download a file.
Thoughts?
| format.csv { send_data Report::GenerateCsv.new(entries).process } | ||
| format.pdf { send_data Report::GeneratePdf.new(reports).process } |
There was a problem hiding this comment.
| format.csv { send_data Report::GenerateCsv.new(entries).process } | |
| format.pdf { send_data Report::GeneratePdf.new(reports).process } | |
| format.csv { send_data Report::GenerateCsv.new(entries).process, filename: "createddate_companyname_miru_report"} | |
| format.pdf { send_data Report::GeneratePdf.new(reports).process, filename: "createddate_companyname_miru_report" } |
There was a problem hiding this comment.
We are adding filename from React.
Signed-off-by: sudeeptarlekar <[email protected]>
5bc04ae to
f35d8d6
Compare
* Added functionality to export time entries Signed-off-by: sudeeptarlekar <[email protected]> * Resolved rubocop Signed-off-by: sudeeptarlekar <[email protected]> * Resolved PR comments Signed-off-by: sudeeptarlekar <[email protected]> * Fixed group by clause while report export Signed-off-by: sudeeptarlekar <[email protected]>
Notion card
https://www.notion.so/saeloun/Time-entry-Report-Export-as-CSV-7c53b4d80f9942588129ffe705e6aa85
Summary
Ability to export time entry report as CSV of PDF
Preview
export_report.mp4
Type of change
Checklist: