Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Time entry report export#457

Merged
supriya3105 merged 4 commits intodevelopfrom
time-entry-report-export
Jun 10, 2022
Merged

Time entry report export#457
supriya3105 merged 4 commits intodevelopfrom
time-entry-report-export

Conversation

@sudeeptarlekar
Copy link
Contributor

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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

Signed-off-by: sudeeptarlekar <[email protected]>
Signed-off-by: sudeeptarlekar <[email protected]>
@github-actions
Copy link

github-actions bot commented Jun 9, 2022

Current Code Coverage Percent of this PR:

87.84 %

Files having coverage below 100%

Impacted Files Coverage
/app/policies/payments/provider_policy.rb 85.71 %
/app/services/invoice_payment/checkout.rb 44.0 %
/app/services/invoice_payment/pdf_generation.rb 70.97 %
/app/services/report/filters.rb 87.1 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/lib/benchmarking/benchmarker.rb 0.0 %

@supriya3105
Copy link
Contributor

@apoorv1316 Please test this on priority.

Copy link
Collaborator

@apoorv1316 apoorv1316 left a comment

Choose a reason for hiding this comment

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

@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?

@sudeeptarlekar
Copy link
Contributor Author

sudeeptarlekar commented Jun 9, 2022

Where you tested this?
Do you mean multiple entries from same team member?

@supriya3105
Copy link
Contributor

@apoorv1316 Was this discussed with Sudeep after today's stand up call ?

@apoorv1316
Copy link
Collaborator

@sudeeptarlekar Shared a loom video for it.

@sudeeptarlekar
Copy link
Contributor Author

Fixed the issue

end

def process
CSV.generate(headers: true) do |csv|
Copy link
Member

Choose a reason for hiding this comment

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

@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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can, but how are we thinking of making it available for download to user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

I'm okay with that.

Comment on lines +17 to +18
format.csv { send_data Report::GenerateCsv.new(entries).process }
format.pdf { send_data Report::GeneratePdf.new(reports).process }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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" }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are adding filename from React.

@supriya3105 supriya3105 merged commit c650c33 into develop Jun 10, 2022
@supriya3105 supriya3105 deleted the time-entry-report-export branch June 10, 2022 11:55
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants