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 loadModelRuns to the store as a global action #503

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

floryst
Copy link
Contributor

@floryst floryst commented Sep 12, 2024

  • loadModelRuns is now part of the store as queryModelRuns and updates store state.
  • queryModelRuns manages pagination state through "firstPage" and "nextPage" requests (see ModelRunList.vue for usage).
  • checkDownloading is now part of the store as refreshModelRunDownloadingStatuses. Additionally, it has been fixed to properly update the downloading statuses of all loaded pagination pages.
    • A side note: I have yet to test this function!
  • All usages of state.downloadCheck have been replaced with calls to refreshModelRunDownloadingStatuses.

@floryst
Copy link
Contributor Author

floryst commented Sep 12, 2024

This technically conflicts with #502, but it's still reviewable in its current form. This should be merged into/after #502.

Copy link
Member

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

This makes sense to me, and it works without any issues. I'll defer to @BryonLewis for approval since this is a clientside-only change

Comment on lines +286 to +291
await ApiService.getObservationImages(id, data);
// Notify the ModelRunList that downloading is happening
if (imageDownloadingModelRunId.value) {
emit('image-download', imageDownloadingModelRunId.value);
}
refreshModelRunDownloadingStatuses();
Copy link
Member

Choose a reason for hiding this comment

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

I assume this was autoformatted. I'll file an issue to investigate why the linting step didn't flag this the first time around

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the linting step isn't performing as intended when I run npm run lint:fix, but I haven't looked into it yet.

- Rename loadModelRuns to queryModelRuns
- Rename checkDownloading to refreshModelRunDownloadingStatuses
@floryst floryst force-pushed the refactor-loadModelRuns-to-store branch from 6c3c887 to 962407c Compare September 12, 2024 20:22
Copy link
Contributor

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

Thanks Again this was extremely helpful.

@floryst floryst merged commit 9924c14 into main Sep 13, 2024
8 checks passed
@floryst floryst deleted the refactor-loadModelRuns-to-store branch September 13, 2024 13:56
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.

3 participants