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

Task/WP-724: Mutation Hooks: Compress Files #1009

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

Conversation

jmcmillenmusic
Copy link
Collaborator

@jmcmillenmusic jmcmillenmusic commented Nov 15, 2024

Overview

We are working on updating our current mutations to utilize TypeScript and React Query instead of React Redux. This should improve the speed and functionality of all portal systems going forward.

Changes the compressApp and extractApp app parameters to objects:

    "compressApp": {
        "id": "compress",
        "version": "0.0.3"  # Can be set to "" to use the latest version
    },
    "extractApp": {
        "id": "extract",
        "version": "0.0.1"  # Can be set to "" to use the latest version
    },

Related

Changes

I converted useCompress.js to useCompress.ts and created a mutation that compresses the selected files into a ZIP file that gets placed in the Root directory.

Testing

  1. Navigate to any folder containing multiple files.
  2. Select 2 or more files and click on the Compress button in the Toolbar.
  3. Click on the Compress button in the modal that appears.
  4. The modal will close, and you get a notification that the ZIP file will be in your Root directory shortly.

UI

image

Notes

  1. Folders cannot be compressed.
  2. The total size of all files to be compressed must be less than 2 GB.

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 5.65476% with 317 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@928dc75). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...lient/src/hooks/datafiles/mutations/useCompress.ts 3.81% 126 Missing ⚠️
client/src/hooks/datafiles/mutations/useExtract.ts 6.30% 104 Missing ⚠️
client/src/utils/getCompressParams.ts 2.22% 44 Missing ⚠️
client/src/utils/getExtractParams.ts 2.77% 35 Missing ⚠️
server/portal/apps/workspace/api/views.py 25.00% 4 Missing and 2 partials ⚠️
client/src/redux/sagas/datafiles.sagas.js 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1009   +/-   ##
=======================================
  Coverage        ?   70.48%           
=======================================
  Files           ?      538           
  Lines           ?    33983           
  Branches        ?     2936           
=======================================
  Hits            ?    23954           
  Misses          ?     9829           
  Partials        ?      200           
Flag Coverage Δ
javascript 72.68% <5.18%> (?)
unittests 60.80% <25.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ient/src/hooks/datafiles/mutations/useSubmitJob.ts 100.00% <100.00%> (ø)
client/src/utils/types.ts 100.00% <100.00%> (ø)
server/portal/settings/settings_default.py 0.00% <ø> (ø)
client/src/redux/sagas/datafiles.sagas.js 39.05% <33.33%> (ø)
server/portal/apps/workspace/api/views.py 55.23% <25.00%> (ø)
client/src/utils/getExtractParams.ts 2.77% <2.77%> (ø)
client/src/utils/getCompressParams.ts 2.22% <2.22%> (ø)
client/src/hooks/datafiles/mutations/useExtract.ts 6.30% <6.30%> (ø)
...lient/src/hooks/datafiles/mutations/useCompress.ts 3.81% <3.81%> (ø)

@rstijerina
Copy link
Member

Client side tests failing

client/package.json Outdated Show resolved Hide resolved
client/src/hooks/datafiles/mutations/useCompress.ts Outdated Show resolved Hide resolved
client/src/utils/getCompressParams.ts Outdated Show resolved Hide resolved
client/src/hooks/datafiles/mutations/useCompress.ts Outdated Show resolved Hide resolved
@jmcmillenmusic
Copy link
Collaborator Author

jmcmillenmusic commented Dec 9, 2024

Client side tests failing

I'll come back to the tests I skipped once I get the Extract hook working with the new changes we talked about.

client/package-lock.json Outdated Show resolved Hide resolved
server/portal/apps/workspace/api/views.py Show resolved Hide resolved
client/src/hooks/datafiles/mutations/useCompress.ts Outdated Show resolved Hide resolved
client/package-lock.json Outdated Show resolved Hide resolved
client/src/hooks/datafiles/useDataFilesAllocations.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@jalowe13 jalowe13 left a comment

Choose a reason for hiding this comment

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

LGTM! Works as intended

Copy link
Collaborator

@jarosenb jarosenb left a comment

Choose a reason for hiding this comment

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

Works locally, so giving this an approval- might need Chandra's input on backend changes.

jmcmillenmusic and others added 3 commits December 20, 2024 10:49
* Set up new branch to branch off of Compress branch

* Reversed changes to files based on feedback after rebasing branch

* Skipping failing test temporarily

* Linted client-side code

* Removed changes to files unrelated to task due to pointing a branch to a branch other than main

---------

Co-authored-by: Jeff McMillen <[email protected]>
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.

5 participants