Select thumbnail, spee.ch upload #1248
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#1248
Loading…
Reference in a new issue
No description provided.
Delete branch "select-thumbnail"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR...
Lets
<FileSelector>
take custom labelsAdds
thumbnail_upload_statuses
constantsAdds
<SelectThumbnail>
component and uses it in<PublishForm>
Adds
ModalConfirmThumbnailUpload
which is called by<SelectThumbnail>
Adds
uploadThumbnailStatus
toPublishState
(and notPublishParams
) inpublishReducer
Uses existing reducers and selectors, adds
doResetThumbnailStatus
anddoUploadThumbnail
actions for spee.ch requestsAdds
a.link
CSSCleans up some errors I got committing changes
@liamcardenas this is ready for review. I think I got the rebase right but I'm not positive. I tested it post merge, commit, push, and it works fine.
A couple things that could/maybe should be done:
The modal and publish form write to the same
state.publish.nsfw
so if the thumbnail is marked nsfw it will be checked when the user gets to that option on the page. Should we turn off the ability to not mark a file nsfw when the thumbnail being uploaded was marked nsfw, by disabling the checkbox?Should we disable publishing until the upload is complete? Until it does, the thumbnail field is a blank string, it doesn't get back the url with a claim_id until the upload is complete.
@seanyesmunt this is working and ready for review
Approved w/ minor comments
Can you add parens for legibility?
@ -70,1 +74,3 @@
// Returns a new uri to be used in the form and begins to resolve that uri for bid help text
componentWillMount() {
this.props.resetThumbnailStatus();
}
This method is being deprecated, it's good to start using
getDerivedStateFromProps()
https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops
@ -33,0 +90,4 @@
dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { uploadThumbnailStatus: STATUSES.IN_PROGRESS },
});
Can you split this line out with brackets for legibility?
@ -33,0 +113,4 @@
thumbnail: `${json.data.url}${fileExt}`,
},
})
: uploadError('Upload failed')
Can you clean up some of the formatting from ln90 to 110?
Line breaks, indentation, etc
I cleaned this up based on comments from @skhameneh and other changes since the last time I worked on
select-thumbnail
. I moved constants tolbry-redux
in /lbryio/lbry-redux/pull/39 which is a prereq for this PR.I did not implement getDerivedStateFromProps thinking that pattern is all over the app and should be its own issue to clean up everywhere.
It now resets the thumbnail upload status when the whole form is reset. I refactored the errors and tested it on a faulty URL and everything worked like it should. Though some more @tzarebczan testing is probably in order.
This should be in lbry-redux
@ -30,6 +34,90 @@ export const doUpdatePublishForm = (publishFormValue: UpdatePublishFormData) =>
data: { ...publishFormValue },
});
Is this the correct path?