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-731: Mutation hook: Trash file/folder #994

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

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 useTrash.js to useTrash.ts and created a mutation that sends a selected file/folder to the Trash by updating its path.

Testing

  1. Navigate to a file/folder that you wish to throw away.
  2. Select the file/folder in question.
  3. Click on the Trash button.
  4. You should get a notification that the file was moved to the Trash.

UI

image

Notes

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 22.68908% with 92 lines in your changes missing coverage. Please review.

Project coverage is 72.58%. Comparing base (764fcee) to head (891a6b6).

Files with missing lines Patch % Lines
client/src/hooks/datafiles/mutations/useTrash.ts 19.26% 88 Missing ⚠️
...ts/DataFiles/DataFilesToolbar/DataFilesToolbar.jsx 60.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #994      +/-   ##
==========================================
- Coverage   72.68%   72.58%   -0.11%     
==========================================
  Files         534      534              
  Lines       33656    33733      +77     
  Branches     2989     2993       +4     
==========================================
+ Hits        24464    24484      +20     
- Misses       8994     9051      +57     
  Partials      198      198              
Flag Coverage Δ
javascript 75.26% <22.68%> (-0.14%) ⬇️
unittests 60.84% <ø> (ø)

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

Files with missing lines Coverage Δ
...ts/DataFiles/DataFilesToolbar/DataFilesToolbar.jsx 76.05% <60.00%> (+2.19%) ⬆️
client/src/hooks/datafiles/mutations/useTrash.ts 19.26% <19.26%> (ø)

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.

Does delete! Just a couple of changes for ensuring axios instead of the generic fetch request. And changes on making sure we are ensuring all promises of all deletion operations are met! Looks great so far

client/package.json Outdated Show resolved Hide resolved
client/src/hooks/datafiles/mutations/useTrash.ts 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.

After the typing change up top its almost good to go!

client/src/hooks/datafiles/mutations/useTrash.ts 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!

@jmcmillenmusic jmcmillenmusic requested a review from van-go December 6, 2024 19:19
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