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

chore(file-uploader): Fixed bugs related to visuals and pausing #3072

Merged
merged 10 commits into from
Nov 28, 2022

Conversation

ErikCH
Copy link
Contributor

@ErikCH ErikCH commented Nov 22, 2022

Description of changes

This PR fixes the following issues

  • Image overlap container
  • Error messages overlapping container
  • Editing file name with wrong extension gets cleared if you edit again and click cancel (along with that, now you can only edit the filename, changing the extension gives an error)
  • Missing visuals for the resume file state in the file tracker
  • Moved the developer preview message to top of the docs for file uploader
  • Fixed broken tests

Issue #, if available

Asana

Description of how you validated changes

Added tests

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated
  • No side effects or sideEffects field updated
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ErikCH ErikCH requested a review from a team as a code owner November 22, 2022 21:39
@changeset-bot
Copy link

changeset-bot bot commented Nov 22, 2022

⚠️ No Changeset found

Latest commit: 30bd640

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -74,7 +74,7 @@ Array [
style={
Object {
"alignItems": "center",
"borderColor": "hsl(210, 8%, 55%)",
"borderColor": "hsl(210, 10%, 58%)",
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a bunch of snapshot test updates because I changed a border color.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@ErikCH ErikCH temporarily deployed to ci November 23, 2022 19:21 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 19:21 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 19:21 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 19:21 Inactive
@@ -100,11 +100,15 @@
--amplify-components-fileuploader-file-image-border-radius
);
color: var(--amplify-components-fileuploader-file-image-color);
img {
max-height: 100%;
Copy link
Contributor

@ioanabrooks ioanabrooks Nov 23, 2022

Choose a reason for hiding this comment

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

Just curious, why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's defaulting to auto and it needs to be 100% for it to fill the container.

Copy link
Contributor

@ioanabrooks ioanabrooks Nov 23, 2022

Choose a reason for hiding this comment

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

Does inherit do the trick? 100% may cause issues if the parent's width is specified. non-blocking tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In inherit does not work. It overflows on that value. I can change it to height 100% if that's better.

@ErikCH ErikCH requested a review from ioanabrooks November 23, 2022 22:06
Comment on lines 274 to 278
const isValidExtension = (fileName: string, fileName2: string): boolean => {
const extension = fileName.split('.').pop();
const fileExtension = fileName2.split('.').pop();
return fileExtension === extension;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I would either memoize this function with a useCallback, or better yet, move it outside the component in a util file, to prevent unnecessary re-renders from happenning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll move it into the uploader utils.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ErikCH ErikCH temporarily deployed to ci November 23, 2022 22:22 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 22:22 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 22:22 Inactive
@ErikCH ErikCH temporarily deployed to ci November 23, 2022 22:22 Inactive
@ErikCH ErikCH requested a review from ioanabrooks November 24, 2022 00:20
@ErikCH ErikCH temporarily deployed to ci November 24, 2022 00:37 Inactive
@ErikCH ErikCH temporarily deployed to ci November 24, 2022 00:37 Inactive
@ErikCH ErikCH temporarily deployed to ci November 24, 2022 00:37 Inactive
@ErikCH ErikCH temporarily deployed to ci November 24, 2022 00:37 Inactive
@ErikCH ErikCH merged commit 0d7400f into fileuploader/main Nov 28, 2022
@ErikCH ErikCH deleted the fileuploader/bug-fix branch November 28, 2022 16:38
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