From dbac4aca390bc0eec20587b2443240daeaf6a133 Mon Sep 17 00:00:00 2001 From: jessopb <36554050+jessopb@users.noreply.github.com> Date: Fri, 19 Jun 2020 13:10:34 -0400 Subject: [PATCH] Revert "improve channel update" --- package.json | 2 +- static/app-strings.json | 26 +- ui/component/channelAbout/view.jsx | 1 - ui/component/channelEdit/index.js | 2 - ui/component/channelEdit/view.jsx | 207 +- ui/component/claimAbandonButton/view.jsx | 5 +- ui/component/claimPreviewTile/view.jsx | 2 +- ui/page/channel/index.js | 2 - ui/page/channel/view.jsx | 32 +- ui/page/channels/index.js | 8 +- ui/page/channels/view.jsx | 22 +- ui/redux/actions/publish.js | 4 +- yarn.lock | 5086 ++++++++-------------- 13 files changed, 2015 insertions(+), 3384 deletions(-) diff --git a/package.json b/package.json index 0f03eaec3..d0e4af11d 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#d00744a8b5474f28553ed8b68ee5400a4ad84b4c", + "lbry-redux": "lbryio/lbry-redux#f8ac5359d9d05fba2c3a536003a9d4c64b86c9f0", "lbryinc": "lbryio/lbryinc#72eee35f5181940eb4a468a27ddb2a2a4e362fb0", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/static/app-strings.json b/static/app-strings.json index 2d336ee64..8ee132cfe 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1199,8 +1199,15 @@ "lbry.tv Premium - 1 month": "lbry.tv Premium - 1 month", "We will refund no questions asked within 30 days.": "We will refund no questions asked within 30 days.", "Your Wallet": "Your Wallet", + "Buy": "Buy", + "Buy LBRY Credits": "Buy LBRY Credits", + "Country": "Country", + "Only some countries are eligible at this time. We are working to make this available to everyone.": "Only some countries are eligible at this time. We are working to make this available to everyone.", + "Select your country": "Select your country", + "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.": "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.", "Try Anyway": "Try Anyway", "Purchase Amount": "Purchase Amount", + "Your browser does not support iframes.": "Your browser does not support iframes.", "Not a valid LBRY address": "Not a valid LBRY address", "Confirm Tip": "Confirm Tip", "Supporting": "Supporting", @@ -1223,14 +1230,6 @@ "Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.": "Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.", "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.": "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.", "%view_count% Views": "%view_count% Views", - "Buy": "Buy", - "Buy LBRY Credits": "Buy LBRY Credits", - "Country": "Country", - "Only some countries are eligible at this time. We are working to make this available to everyone.": "Only some countries are eligible at this time. We are working to make this available to everyone.", - "Select your country": "Select your country", - "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.": "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.", - "Your browser does not support iframes.": "Your browser does not support iframes.", - "There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing Ctrl+R/Cmd+R.": "There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing Ctrl+R/Cmd+R.", "Tap to unmute": "Tap to unmute", "0 Bytes": "0 Bytes", "Bytes": "Bytes", @@ -1242,8 +1241,11 @@ "EB": "EB", "ZB": "ZB", "YB": "YB", + "Save": "Save", + "Saving...": "Saving...", "Thanks for the feedback! You help make the app better for everyone.": "Thanks for the feedback! You help make the app better for everyone.", "Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.": "Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.", + "Changelog": "Changelog", "Supporting Content Requires LBC": "Supporting Content Requires LBC", "With LBC, you can send tips to your favorite creators, or help boost their content for more people to see.": "With LBC, you can send tips to your favorite creators, or help boost their content for more people to see.", "Boost Your Content": "Boost Your Content", @@ -1255,11 +1257,5 @@ "Make this support permanent": "Make this support permanent", "Custom support amount": "Custom support amount", "(%lbc_balance% available)": "(%lbc_balance% available)", - "Loading your channels...": "Loading your channels...", - "Changelog": "Changelog", - "Thumbnail source": "Thumbnail source", - "Cover source": "Cover source", - "Save": "Save", - "Saving...": "Saving...", - "Your changes will be live in a few minutes": "Your changes will be live in a few minutes" + "Loading your channels...": "Loading your channels..." } diff --git a/ui/component/channelAbout/view.jsx b/ui/component/channelAbout/view.jsx index 98acce7cb..c18b651f3 100644 --- a/ui/component/channelAbout/view.jsx +++ b/ui/component/channelAbout/view.jsx @@ -31,7 +31,6 @@ function ChannelAbout(props: Props) {
- {description && (
diff --git a/ui/component/channelEdit/index.js b/ui/component/channelEdit/index.js index eaebfb91f..e40609668 100644 --- a/ui/component/channelEdit/index.js +++ b/ui/component/channelEdit/index.js @@ -8,7 +8,6 @@ import { doUpdateChannel, makeSelectAmountForUri, makeSelectClaimForUri, - selectUpdateChannelError, } from 'lbry-redux'; import ChannelPage from './view'; @@ -25,7 +24,6 @@ const select = (state, props) => ({ languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state), amount: makeSelectAmountForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state), - updateError: selectUpdateChannelError(state), }); const perform = dispatch => ({ diff --git a/ui/component/channelEdit/view.jsx b/ui/component/channelEdit/view.jsx index 784d039ef..1311a1a3a 100644 --- a/ui/component/channelEdit/view.jsx +++ b/ui/component/channelEdit/view.jsx @@ -3,10 +3,10 @@ import React, { useState } from 'react'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import SelectAsset from 'component/selectAsset'; +import * as PAGES from 'constants/pages'; import { MINIMUM_PUBLISH_BID } from 'constants/claim'; import TagsSearch from 'component/tagsSearch'; import { FF_MAX_CHARS_IN_DESCRIPTION } from 'constants/form-field'; -import ErrorText from 'component/common/error-text'; type Props = { claim: ChannelClaim, @@ -22,11 +22,10 @@ type Props = { tags: Array, locations: Array, languages: Array, - updateChannel: any => Promise, + updateChannel: any => void, updateThumb: string => void, updateCover: string => void, - doneEditing: () => void, - updateError: string, + setEditing: boolean => void, }; function ChannelForm(props: Props) { @@ -42,11 +41,10 @@ function ChannelForm(props: Props) { locations, languages, amount, - doneEditing, + setEditing, updateChannel, updateThumb, updateCover, - updateError, } = props; const { claim_id: claimId } = claim; @@ -103,119 +101,110 @@ function ChannelForm(props: Props) { }; const handleSubmit = () => { - updateChannel(params).then(success => { - if (success) { - doneEditing(); - } - }); + updateChannel(params); + setEditing(false); }; // TODO clear and bail after submit return ( -
-
- handleThumbnailChange(v)} - currentValue={params.thumbnailUrl} - assetName={'Thumbnail'} - recommended={__('Recommended ratio is 1:1')} - /> +
+ handleThumbnailChange(v)} + currentValue={params.thumbnailUrl} + assetName={'Thumbnail'} + recommended={__('Recommended ratio is 1:1')} + /> - handleCoverChange(v)} - currentValue={params.coverUrl} - assetName={'Cover'} - recommended={__('Recommended ratio is 6.25:1')} - /> + handleCoverChange(v)} + currentValue={params.coverUrl} + assetName={'Cover'} + recommended={__('Recommended ratio is 6.25:1')} + /> - setParams({ ...params, title: e.target.value })} - /> - handleBidChange(parseFloat(event.target.value))} - placeholder={0.1} - /> + setParams({ ...params, title: e.target.value })} + /> + handleBidChange(parseFloat(event.target.value))} + placeholder={0.1} + /> - setParams({ ...params, website: e.target.value })} - /> + setParams({ ...params, website: e.target.value })} + /> - setParams({ ...params, email: e.target.value })} - /> + setParams({ ...params, email: e.target.value })} + /> - setParams({ ...params, description: text })} - textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION} - /> + setParams({ ...params, description: text })} + textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION} + /> - { - const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name); - setParams({ ...params, tags: newTags }); - }} - onSelect={newTags => { - newTags.forEach(newTag => { - if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) { - setParams({ ...params, tags: [...params.tags, newTag] }); - } else { - // If it already exists and the user types it in, remove it - setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) }); - } - }); - }} - /> -
-
- {updateError && updateError.length ? ( - {updateError} - ) : ( -

- {__('After submitting, you will not see the changes immediately. Please check back in a few minutes.')} -

- )} -
-
+ { + const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name); + setParams({ ...params, tags: newTags }); + }} + onSelect={newTags => { + newTags.forEach(newTag => { + if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) { + setParams({ ...params, tags: [...params.tags, newTag] }); + } else { + // If it already exists and the user types it in, remove it + setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) }); + } + }); + }} + /> +
+
+

+ {__('After submitting, you will not see the changes immediately. Please check back in a few minutes.')} +

+
); } diff --git a/ui/component/claimAbandonButton/view.jsx b/ui/component/claimAbandonButton/view.jsx index 1730e13a0..52d5c37a0 100644 --- a/ui/component/claimAbandonButton/view.jsx +++ b/ui/component/claimAbandonButton/view.jsx @@ -8,15 +8,14 @@ type Props = { doOpenModal: (string, {}) => void, claim: StreamClaim, abandonActionCallback: any => void, - iconSize: number, }; export default function ClaimAbandonButton(props: Props) { - const { doOpenModal, claim, abandonActionCallback, iconSize } = props; + const { doOpenModal, claim, abandonActionCallback } = props; function abandonClaim() { doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback }); } - return