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

fix: ensure cross-platform compatibility with file exports #4336

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

jamesgeorge007
Copy link
Member

@jamesgeorge007 jamesgeorge007 commented Sep 9, 2024

This PR enforces the usage of platform-based API for file exports ensuring compatibility across web and Desktop apps. This accounts for export flows related to collections (REST/GQL) & environments.

Closes #4332 HFE-578.

What's changed

  • The initializeDownloadCollection() helper function is renamed to initializeDownloadFile() and the implementation has been updated to rely on the platform-level APIs instead of the browser-based behaviour. It now returns a promise.
  • For exports in general, there'll be a suggested name having the name computed from the URL (based on contents) as a fallback. The platform-level definition under hoppscotch-selfhost-web saveFileWithDialog(), is updated to prioritise the name if supplied.
  • The exportAsJSON helper function compiling the export business logic for environments is refactored to leverage the above helper function.
  • Minor code refactors aimed at eliminating redundancy to consume existing computed properties, etc and related cleanup.

Notes to reviewers

Please verify all the export flows (individual/bulk at the workspace level) for both the web and Desktop apps.

@AndrewBastin AndrewBastin merged commit a395643 into patch Sep 10, 2024
1 check passed
@AndrewBastin AndrewBastin deleted the fix/platform-based-file-export branch September 10, 2024 07:23
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.

[bug]: I can't export a collection or environment - Desktop Mac
2 participants