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-725: Mutation Hooks: Extract Files #1035

Merged
merged 10 commits into from
Dec 20, 2024
Merged

Conversation

jmcmillenmusic
Copy link
Collaborator

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.

Related

Changes

I converted useExtract.js to useExtract.ts and created a mutation that extracts files from a ZIP file into the directory where the ZIP file is currently located.

Testing

  1. Navigate to a ZIP file in any directory.
  2. Select that ZIP file and click on the Extract button.
  3. In the modal that appears, click on the purple Extract button.
  4. A job gets submitted to extract files from the ZIP file, and you'll eventually see the folder containing those files in that directory.

UI

image

Notes

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 5.44218% with 139 lines in your changes missing coverage. Please review.

Project coverage is 70.51%. Comparing base (a82283b) to head (e8d9863).
Report is 6 commits behind head on task/WP-724.

Files with missing lines Patch % Lines
client/src/hooks/datafiles/mutations/useExtract.ts 6.30% 104 Missing ⚠️
client/src/utils/getExtractParams.ts 2.77% 35 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           task/WP-724    #1035      +/-   ##
===============================================
- Coverage        71.99%   70.51%   -1.48%     
===============================================
  Files              537      538       +1     
  Lines            33847    33967     +120     
  Branches          2985     2935      -50     
===============================================
- Hits             24369    23953     -416     
- Misses            9279     9815     +536     
  Partials           199      199              
Flag Coverage Δ
javascript 72.71% <5.44%> (-1.83%) ⬇️
unittests 60.83% <ø> (ø)

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

Files with missing lines Coverage Δ
server/portal/settings/settings_default.py 0.00% <ø> (ø)
client/src/utils/getExtractParams.ts 2.77% <2.77%> (ø)
client/src/hooks/datafiles/mutations/useExtract.ts 6.30% <6.30%> (ø)

... and 13 files with indirect coverage changes

server/portal/apps/workspace/api/views.py Outdated Show resolved Hide resolved
client/src/hooks/datafiles/mutations/useCompress.ts Outdated Show resolved Hide resolved
@@ -19,6 +19,10 @@ describe('DataFiles', () => {
compress: '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

This config should be below and then you need to mock fetch to provide the extract and compress app mocks

config: {
          extractApp: { id: 'extract', version: '0.0.1' },
          compress: { id: 'compress', version: '0.0.3' },
        },

@jmcmillenmusic jmcmillenmusic changed the base branch from main to task/WP-724 December 17, 2024 17:32
@rstijerina rstijerina merged commit 86e16aa into task/WP-724 Dec 20, 2024
4 of 6 checks passed
@rstijerina rstijerina deleted the task/WP-725-new branch December 20, 2024 16:49
rstijerina added a commit that referenced this pull request Jan 6, 2025
* Starting from scratch

* Set up useCompress.ts

* Still working on useCompress()

* Progressing with useCompress mutation

* Committing branch in its current state; not fully functioning

* wip

* Reworked useCompress.ts

* wip

* Still trying to fix it; much closer now

* handle undefined execSystemId

* Compress mutation finally successful

* Toasts and modals work correctly

* Linted client-side code

* Added an additional asynchronous call; updated Compress modal

* Refactored types into useSubmitJob.ts

* Corrected mutation hook to return archive in current directory instead of root

* Update client/src/hooks/datafiles/mutations/useCompress.ts

Co-authored-by: Sal Tijerina <[email protected]>

* Linted client-side code

* Can't get this test to pass still

* Linted client-side code

* Finally got the failing test to pass

* Skipping tests temporarily, cleaned up code

* Skipping saga tests

* Corrected defaultPrivateSystem and edited package-lock.json

* Made corrections to files based on feedback

* Added final change to account for empty strings or undefined in job_post['appVersion']

* Task/WP-725: Mutation Hooks: Extract Files (#1035)

* 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]>

* update example; add comment

---------

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

3 participants