Fix "invalid thumbnail" error behaviour #6072

Closed
keikari wants to merge 1 commit from invalid-thumbnail-fix into master
keikari commented 2021-05-16 13:22:08 +02:00 (Migrated from github.com)
modified:   selectThumbnail/view.jsx
Fix issue with "invalid thumbnail"


modified:   publishForm/view.jsx
Prevent upload of publish when in thumbnail upload tool. As there isn't thumbnail yet.


modified:   publishFormErrors/view.jsx
Show "A thumbnail is required. Please upload or provide an image
URL above." error when user is in thumbnail upload tool.

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number:
#6044

What is the current behavior?

When entering invalid URL for thumbnail, an "Invalid thumbnail" error appears.
"Invalid thumbnail" error didn't get cleared when a valid thumbnail was uploaded, which prevented the upload of the publish.
Only way to clear error was to clear thumbnail URL or enter a valid URL to an image.

What is the new behavior?

When entering invalid URL for thumbnail, an "Invalid thumbnail" error appears.
Error is cleared when user switches to "thumbnail upload tool".
"A thumbnail is required...." error is shown instead, until thumbnail is successfully uploaded, or if user switches back to entering URL for thumbnail.

Other information

modified: selectThumbnail/view.jsx Fix issue with "invalid thumbnail" modified: publishForm/view.jsx Prevent upload of publish when in thumbnail upload tool. As there isn't thumbnail yet. modified: publishFormErrors/view.jsx Show "A thumbnail is required. Please upload or provide an image URL above." error when user is in thumbnail upload tool. ## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: ## Fixes Issue Number: #6044 ## What is the current behavior? When entering invalid URL for thumbnail, an "Invalid thumbnail" error appears. "Invalid thumbnail" error didn't get cleared when **a valid thumbnail was uploaded**, which prevented the upload of the publish. Only way to clear error was to clear thumbnail URL or enter a valid URL to an image. ## What is the new behavior? When entering invalid URL for thumbnail, an "Invalid thumbnail" error appears. Error is cleared when user switches to "thumbnail upload tool". "A thumbnail is required...." error is shown instead, until thumbnail is successfully uploaded, or if user switches back to entering URL for thumbnail. ## Other information <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
keikari commented 2021-05-16 14:14:53 +02:00 (Migrated from github.com)

I tried to clone and build master branch today and the "invalid thumbnail" issue still existed.

I tried to clone and build master branch today and the "invalid thumbnail" issue still existed.
infinite-persistence commented 2021-05-17 02:47:54 +02:00 (Migrated from github.com)

Ah, I totally missed out the "a valid thumbnail was uploaded" in the description. I was only focusing on the scenario of switching between New and Edit.

I think the proper fix is still at redux, though. A one-line thumbnailError: undefined in doUploadThumbnail in the success case should address the root-cause.

Ah, I totally missed out the "a valid thumbnail was uploaded" in the description. I was only focusing on the scenario of switching between New and Edit. I think the proper fix is still at redux, though. A one-line `thumbnailError: undefined` in `doUploadThumbnail` in the success case should address the root-cause.
keikari commented 2021-05-17 09:30:57 +02:00 (Migrated from github.com)

Oh, I'm not really familiar with the app's code, so I just took a shot at it. I will close this PR for now and start looking how to do it in the redux. Or maybe someone else would be able to fix it faster.

That does sound a better fix, I guess it doesn't matter what kind of thumbnail error it is showing at the bottom, as long as it clears when thumbnail is good.

Oh, I'm not really familiar with the app's code, so I just took a shot at it. I will close this PR for now and start looking how to do it in the redux. Or maybe someone else would be able to fix it faster. That does sound a better fix, I guess it doesn't matter what kind of thumbnail error it is showing at the bottom, as long as it clears when thumbnail is good.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LBRYCommunity/lbry-desktop!6072
No description provided.