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

Update batch capture functions, add composable to fetch batch history #3592

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

tinykite
Copy link
Contributor

@tinykite tinykite commented Aug 19, 2024

Summary

This update refactors some previous component-scoped functions into composables (the Vue equivalent of React hooks) for reusability and adds a new composable for fetching a user's batch capture history.

Additional Notes

  • Refactors handleBatchDetailsFetch and handleBatchFormatting. These have been renamed following the normal style for Vue composables, which are typically named Use....
  • Adds useBatchHistoryFetch to fetch a user's batch history
  • Adds LinkBatchHistory component with minimal developer-only UI for testing out fetch functionality

Right now, this code merely displays the batch history when a user requests it by toggling a button. It does not automatically update the list of timestamps. In the future, this could become more reactive by moving the batchCaptureId out of CreateLinkBatch and into the global store in globalStore.js — then writing a watch function to watch for changes to the batch capture id, and re-fetching an updated list of batch history info.

For example,

  watch(() => globalStore.batchCaptureId, () => {
        ....do a thing
  });

Screenshots

image

Linear issue

Satisfies Linear issue 2316

How to test

  • Make sure you've toggled the vue-dashboard and developer-playground Django flags
  • Clicking "Fetch Batch History" should fetch and display the unformatted timestamps for the start time of the past 7 batch capture requests.
  • If you initiate another batch capture using the Perma UI, you should be able to click "Fetch Batch History" again and see a new timestamp show up at the top of the list.

@tinykite tinykite changed the title Update batch capture functions Update batch capture functions, add composable to fetch batch history Aug 19, 2024
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.03%. Comparing base (182a9c9) to head (c9501a0).
Report is 22 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3592   +/-   ##
========================================
  Coverage    69.03%   69.03%           
========================================
  Files           48       48           
  Lines         6978     6978           
========================================
  Hits          4817     4817           
  Misses        2161     2161           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tinykite tinykite force-pushed the update-batch-capture-functions branch from 70f6253 to c9501a0 Compare August 20, 2024 13:41
@tinykite tinykite marked this pull request as ready for review August 20, 2024 13:42
@tinykite tinykite requested a review from a team as a code owner August 20, 2024 13:42
@tinykite tinykite requested review from teovin and removed request for a team August 20, 2024 13:42
@teovin
Copy link
Contributor

teovin commented Aug 22, 2024

Looks good!

I noticed a couple of things that were implemented via another PR I think. So feel free to look at them now or create a new ticket. Or just ignore if we aren't working on these yet :)

The first one is when I initiate a batch capture, the progress modal shrinks to a very small size creating a scroll bar. I think we should tweak its sizing so everything is visible.

image

And two, we should write the first sentence as Batch is complete. and add a period to the end of the second sentence:

image

@tinykite
Copy link
Contributor Author

I noticed a couple of things that were implemented via another PR I think. So feel free to look at them now or create a new ticket. Or just ignore if we aren't working on these yet :)

Great observations! I'll merge this work in now and think that would be great follow-up work for the team to tackle in the future.

@tinykite tinykite merged commit a76cb62 into harvard-lil:develop Aug 22, 2024
2 checks passed
@tinykite tinykite deleted the update-batch-capture-functions branch August 22, 2024 18:06
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