From 6d38c0e322a540f0581ec592718043d7a66a3ac0 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Fri, 22 Sep 2017 17:02:23 -0600 Subject: [PATCH 1/4] fix #601 prefill price from uri only working for edit button revert last commit --- ui/js/component/publishForm/view.jsx | 6 ++++-- ui/js/page/publish/index.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/js/component/publishForm/view.jsx b/ui/js/component/publishForm/view.jsx index b502f4add..5149b1416 100644 --- a/ui/js/component/publishForm/view.jsx +++ b/ui/js/component/publishForm/view.jsx @@ -20,6 +20,7 @@ class PublishForm extends React.PureComponent { this.state = { id: null, + uri: null, rawName: "", name: "", bid: 10, @@ -166,7 +167,6 @@ class PublishForm extends React.PureComponent { claim() { const { claimsByUri } = this.props; const { uri } = this.state; - return claimsByUri[uri]; } @@ -285,6 +285,7 @@ class PublishForm extends React.PureComponent { let newState = { id: claim_id, + uri: "", channel: channel_name || "anonymous", bid: amount, meta_title: title, @@ -437,9 +438,10 @@ class PublishForm extends React.PureComponent { } onFileChange() { + const { mode } = this.state; if (this.refs.file.getValue()) { this.setState({ hasFile: true }); - if (!this.state.customUrl) { + if (!this.state.customUrl && mode !== "edit") { let fileName = this._getFileName(this.refs.file.getValue()); this.nameChanged(fileName); } diff --git a/ui/js/page/publish/index.js b/ui/js/page/publish/index.js index f0547941d..534c784ae 100644 --- a/ui/js/page/publish/index.js +++ b/ui/js/page/publish/index.js @@ -9,6 +9,7 @@ import { selectClaimsByUri, } from "selectors/claims"; import { selectResolvingUris } from "selectors/content"; +import { makeSelectCostInfoForUri } from "selectors/cost_info"; import { doFetchClaimListMine, doFetchChannelListMine, @@ -20,7 +21,7 @@ import { selectBalance } from "selectors/wallet"; import rewards from "rewards"; import PublishPage from "./view"; -const select = state => ({ +const select = (state, props) => ({ balance: selectBalance(state), myClaims: selectMyClaims(state), fetchingChannels: selectFetchingMyChannels(state), From a5f65d678d4cce42fec5cd5e47817f9ea9504694 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Fri, 22 Sep 2017 22:22:55 -0600 Subject: [PATCH 2/4] fix #606 tidy up minor fix --- ui/js/component/fileDetails/view.jsx | 9 +++++--- ui/js/component/publishForm/view.jsx | 1 - ui/js/page/file/view.jsx | 33 ++-------------------------- ui/js/page/publish/index.js | 3 +-- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/ui/js/component/fileDetails/view.jsx b/ui/js/component/fileDetails/view.jsx index c2cfda468..6a4cd2047 100644 --- a/ui/js/component/fileDetails/view.jsx +++ b/ui/js/component/fileDetails/view.jsx @@ -29,10 +29,13 @@ class FileDetails extends React.PureComponent { const { description, language, license } = metadata; const { height } = claim; const mediaType = lbry.getMediaType(contentType); - const directory = fileInfo && fileInfo.download_path - ? path.dirname(fileInfo.download_path) + + const downloadPath = fileInfo + ? path.normalize(fileInfo.download_path) : null; + const directory = downloadPath ? path.dirname(downloadPath) : null; + return (
@@ -63,7 +66,7 @@ class FileDetails extends React.PureComponent { {__("Downloaded to")} - openFolder(directory)}> + openFolder(downloadPath)}> {directory} diff --git a/ui/js/component/publishForm/view.jsx b/ui/js/component/publishForm/view.jsx index 5149b1416..0337aeba9 100644 --- a/ui/js/component/publishForm/view.jsx +++ b/ui/js/component/publishForm/view.jsx @@ -285,7 +285,6 @@ class PublishForm extends React.PureComponent { let newState = { id: claim_id, - uri: "", channel: channel_name || "anonymous", bid: amount, meta_title: title, diff --git a/ui/js/page/file/view.jsx b/ui/js/page/file/view.jsx index 8f3bb8168..f502d583f 100644 --- a/ui/js/page/file/view.jsx +++ b/ui/js/page/file/view.jsx @@ -11,36 +11,6 @@ import WalletSendTip from "component/walletSendTip"; import DateTime from "component/dateTime"; import * as icons from "constants/icons"; -const FormatItem = props => { - const { - publishedDate, - contentType, - claim: { height }, - metadata: { language, license }, - } = props; - - const mediaType = lbry.getMediaType(contentType); - - return ( - - - - - - - - - - - - - - - -
{__("Published on")}
{__("Content-Type")}{mediaType}
{__("Language")}{language}
{__("License")}{license}
- ); -}; - class FilePage extends React.PureComponent { componentDidMount() { this.fetchFileInfo(this.props); @@ -109,7 +79,8 @@ class FilePage extends React.PureComponent { {!fileInfo || fileInfo.written_bytes <= 0 ? - {isRewardContent && {" "}} + {isRewardContent && + {" "}} : null}

{title}

diff --git a/ui/js/page/publish/index.js b/ui/js/page/publish/index.js index 534c784ae..f0547941d 100644 --- a/ui/js/page/publish/index.js +++ b/ui/js/page/publish/index.js @@ -9,7 +9,6 @@ import { selectClaimsByUri, } from "selectors/claims"; import { selectResolvingUris } from "selectors/content"; -import { makeSelectCostInfoForUri } from "selectors/cost_info"; import { doFetchClaimListMine, doFetchChannelListMine, @@ -21,7 +20,7 @@ import { selectBalance } from "selectors/wallet"; import rewards from "rewards"; import PublishPage from "./view"; -const select = (state, props) => ({ +const select = state => ({ balance: selectBalance(state), myClaims: selectMyClaims(state), fetchingChannels: selectFetchingMyChannels(state), From b6279febc55b9efb719e2f3cf0706ca6d295dca7 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Sat, 23 Sep 2017 22:46:22 -0600 Subject: [PATCH 3/4] show full path to prevent confusion --- ui/js/component/fileDetails/view.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/js/component/fileDetails/view.jsx b/ui/js/component/fileDetails/view.jsx index 6a4cd2047..aaa6ab24e 100644 --- a/ui/js/component/fileDetails/view.jsx +++ b/ui/js/component/fileDetails/view.jsx @@ -34,8 +34,6 @@ class FileDetails extends React.PureComponent { ? path.normalize(fileInfo.download_path) : null; - const directory = downloadPath ? path.dirname(downloadPath) : null; - return (
@@ -62,12 +60,12 @@ class FileDetails extends React.PureComponent { {__("License")}{license} - {directory && + {downloadPath && {__("Downloaded to")} openFolder(downloadPath)}> - {directory} + {downloadPath} } From 71bb48eaf51ef487c325328e72945700daaabb1e Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 24 Sep 2017 16:36:50 -0400 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f22fa8404..c91d955b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,13 +12,13 @@ Web UI version numbers should always match the corresponding version of LBRY App * ### Changed - * - * + * Changed the File page to make it clearer how to to open the folder for a file ### Fixed * Improve layout (and implementation) of the icon panel in file tiles and cards * The folder icon representing a local download now shows up properly on Channel pages (#587) - * + * While editing a publish, the URL will no longer change if you select a new file. (#601) + * Fixed issues with opening the folder for a file (#606) ### Deprecated *