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

Edit Dialog for Images #1151

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

Conversation

asuresh-code
Copy link
Contributor

@asuresh-code asuresh-code commented Dec 11, 2024

Description

see #1075

N.B. Needs to wait for corresponding backend PR to merge.

Testing instructions

Checkout **add-update-endpoint-without-primary-for-images-#35** on the Object Storage API repo to test with the api.

  • Review code
  • Check Actions build
  • Review changes to test coverage
  • {more steps here}

Agile board tracking

closes #1075

@asuresh-code asuresh-code self-assigned this Dec 11, 2024
@asuresh-code asuresh-code marked this pull request as draft December 11, 2024 10:10
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 77.93296% with 79 lines in your changes missing coverage. Please review.

Project coverage is 98.56%. Comparing base (f445361) to head (6f49f96).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../attachments/uploadAttachmentsDialog.component.tsx 6.06% 62 Missing ⚠️
src/common/images/uploadImagesDialog.component.tsx 80.30% 13 Missing ⚠️
src/common/editFileDialog.component.tsx 97.60% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1151      +/-   ##
===========================================
- Coverage    98.98%   98.56%   -0.42%     
===========================================
  Files           97       98       +1     
  Lines        17672    18027     +355     
  Branches      2187     3044     +857     
===========================================
+ Hits         17492    17768     +276     
- Misses         179      258      +79     
  Partials         1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asuresh-code asuresh-code marked this pull request as ready for review December 13, 2024 13:46
@asuresh-code asuresh-code force-pushed the feature/add-edit-image-dialog-#1075 branch from 5d3f5a7 to 601f256 Compare December 16, 2024 13:23
@joshuadkitenge
Copy link
Collaborator

Can you amove the editFileDialog out of common/images to common/ please

Copy link
Member

@rowan04 rowan04 left a comment

Choose a reason for hiding this comment

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

just some grammar rewriting for the if test descriptions. The rest of the code looks good I think but I haven't tested the functionality.

src/common/editFileDialog.component.test.tsx Outdated Show resolved Hide resolved
src/common/editFileDialog.component.test.tsx Outdated Show resolved Hide resolved
src/common/editFileDialog.component.test.tsx Outdated Show resolved Hide resolved
cypress/e2e/with_mock_data/items.cy.ts Outdated Show resolved Hide resolved
cypress/e2e/with_mock_data/items.cy.ts Outdated Show resolved Hide resolved
src/common/editFileDialog.component.tsx Outdated Show resolved Hide resolved

const { mutateAsync: patchFile, isPending: isEditPending } = usePatchFile();

const initialFile: ObjectFilePatch = React.useMemo(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make the same changes that you have do to the uppy post here please. So don't allow the user to change the extenstion. and display the extension next the textField please.

asuresh-code and others added 6 commits January 10, 2025 12:13
Commit PR Review Suggestions.

Co-authored-by: rowan04 <[email protected]>
Co-authored-by: Joshua Kitenge <[email protected]>
…facilities/inventory-management-system into feature/add-edit-image-dialog-#1075
…facilities/inventory-management-system into feature/add-edit-image-dialog-#1075
@asuresh-code asuresh-code force-pushed the feature/add-edit-image-dialog-#1075 branch from b117bbc to 0cc1b3a Compare January 14, 2025 13:11
@asuresh-code asuresh-code force-pushed the feature/add-edit-image-dialog-#1075 branch from 0cc1b3a to 5db78e1 Compare January 14, 2025 13:53
@rowan04
Copy link
Member

rowan04 commented Jan 15, 2025

why does one of the images not show for me? it seems to happen for any catalogue item, always the 3rd image. I assume its not to do with your changes here but maybe you know why
image

@joshuadkitenge
Copy link
Collaborator

why does one of the images not show for me? it seems to happen for any catalogue item, always the 3rd image. I assume its not to do with your changes here but maybe you know why image

That is on purpose for the unit and e2e test with the mock data

@joshuadkitenge
Copy link
Collaborator

Can you add the end adornment to the uppy upload dialog file in this pr please

@joshuadkitenge joshuadkitenge marked this pull request as draft January 16, 2025 15:07
@@ -87,6 +87,10 @@ describe('Edit file dialog', () => {

it('Edits an image correctly', async () => {
createView();

//Checks if file extension is displayed. If it's editable, actual value will not match expected.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
//Checks if file extension is displayed. If it's editable, actual value will not match expected.
// Checks if file extension is displayed. If it's editable, actual value will not match expected.

);
});
});

it('not changing any fields shows error', () => {
it('shows error when no fields have been changed', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
it('shows error when no fields have been changed', () => {
it('shows error message when no fields have been changed', () => {

apologies i know i changed it to this the first time :)

@joshuadkitenge
Copy link
Collaborator

Can you add the end adornment to the uppy upload dialog file in this pr please

Can this be done for both dialog images and attachments

@asuresh-code asuresh-code marked this pull request as ready for review January 17, 2025 14:33
@asuresh-code asuresh-code requested a review from rowan04 January 17, 2025 14:33
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.

Edit images
3 participants