From 23ae86e0e77cb263df584a4690e9f0912298d07f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 3 Oct 2018 15:00:06 -0400 Subject: [PATCH 01/21] remove copyright and fix other license edit --- .../publishForm/internal/license-type.jsx | 9 +--- src/renderer/component/publishForm/view.jsx | 10 ----- src/renderer/redux/actions/publish.js | 43 ++++++++++++------- src/renderer/redux/reducers/publish.js | 5 +-- 4 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/renderer/component/publishForm/internal/license-type.jsx b/src/renderer/component/publishForm/internal/license-type.jsx index ea76636de..736dec2bb 100644 --- a/src/renderer/component/publishForm/internal/license-type.jsx +++ b/src/renderer/component/publishForm/internal/license-type.jsx @@ -5,13 +5,11 @@ import { CC_LICENSES, COPYRIGHT, OTHER, PUBLIC_DOMAIN, NONE } from 'constants/li type Props = { licenseType: string, - copyrightNotice: ?string, licenseUrl: ?string, otherLicenseDescription: ?string, handleLicenseChange: (string, string) => void, handleLicenseDescriptionChange: (SyntheticInputEvent<*>) => void, handleLicenseUrlChange: (SyntheticInputEvent<*>) => void, - handleCopyrightNoticeChange: (SyntheticInputEvent<*>) => void, }; class LicenseType extends React.PureComponent { @@ -38,11 +36,8 @@ class LicenseType extends React.PureComponent { licenseType, otherLicenseDescription, licenseUrl, - copyrightNotice, - handleLicenseChange, handleLicenseDescriptionChange, handleLicenseUrlChange, - handleCopyrightNoticeChange, } = this.props; return ( @@ -72,8 +67,8 @@ class LicenseType extends React.PureComponent { label={__('Copyright notice')} type="text" name="copyright-notice" - value={copyrightNotice} - onChange={handleCopyrightNoticeChange} + value={otherLicenseDescription} + onChange={handleLicenseDescriptionChange} /> )} diff --git a/src/renderer/component/publishForm/view.jsx b/src/renderer/component/publishForm/view.jsx index 4bdfe1f19..b04500063 100644 --- a/src/renderer/component/publishForm/view.jsx +++ b/src/renderer/component/publishForm/view.jsx @@ -45,7 +45,6 @@ type Props = { licenseType: string, otherLicenseDescription: ?string, licenseUrl: ?string, - copyrightNotice: ?string, uri: ?string, bidError: ?string, publishing: boolean, @@ -200,7 +199,6 @@ class PublishForm extends React.PureComponent { handlePublish() { const { filePath, - copyrightNotice, licenseType, licenseUrl, otherLicenseDescription, @@ -211,8 +209,6 @@ class PublishForm extends React.PureComponent { let publishingLicense; switch (licenseType) { case COPYRIGHT: - publishingLicense = copyrightNotice; - break; case OTHER: publishingLicense = otherLicenseDescription; break; @@ -233,7 +229,6 @@ class PublishForm extends React.PureComponent { license: publishingLicense, licenseUrl: publishingLicenseUrl, otherLicenseDescription, - copyrightNotice, name: this.props.name, contentIsFree: this.props.contentIsFree, price: this.props.price, @@ -339,7 +334,6 @@ class PublishForm extends React.PureComponent { licenseType, otherLicenseDescription, licenseUrl, - copyrightNotice, uri, bidError, publishing, @@ -585,7 +579,6 @@ class PublishForm extends React.PureComponent { licenseType={licenseType} otherLicenseDescription={otherLicenseDescription} licenseUrl={licenseUrl} - copyrightNotice={copyrightNotice} handleLicenseChange={(newLicenseType, newLicenseUrl) => updatePublishForm({ licenseType: newLicenseType, @@ -600,9 +593,6 @@ class PublishForm extends React.PureComponent { handleLicenseUrlChange={event => updatePublishForm({ licenseUrl: event.target.value }) } - handleCopyrightNoticeChange={event => - updatePublishForm({ copyrightNotice: event.target.value }) - } /> diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index 8e6c54e42..70a5cdcf9 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -18,25 +18,13 @@ import { selectosNotificationsEnabled } from 'redux/selectors/settings'; import { doNavigate } from 'redux/actions/navigation'; import fs from 'fs'; import path from 'path'; +import { CC_LICENSES, COPYRIGHT, OTHER } from 'constants/licenses'; type Action = UpdatePublishFormAction | { type: ACTIONS.CLEAR_PUBLISH }; type PromiseAction = Promise; type Dispatch = (action: Action | PromiseAction | Array) => any; type GetState = () => {}; -export const doClearPublish = () => (dispatch: Dispatch): PromiseAction => { - dispatch({ type: ACTIONS.CLEAR_PUBLISH }); - return dispatch(doResetThumbnailStatus()); -}; - -export const doUpdatePublishForm = (publishFormValue: UpdatePublishFormData) => ( - dispatch: Dispatch -): UpdatePublishFormAction => - dispatch({ - type: ACTIONS.UPDATE_PUBLISH_FORM, - data: { ...publishFormValue }, - }); - export const doResetThumbnailStatus = () => (dispatch: Dispatch): PromiseAction => { dispatch({ type: ACTIONS.UPDATE_PUBLISH_FORM, @@ -73,6 +61,19 @@ export const doResetThumbnailStatus = () => (dispatch: Dispatch): PromiseAction ); }; +export const doClearPublish = () => (dispatch: Dispatch): PromiseAction => { + dispatch({ type: ACTIONS.CLEAR_PUBLISH }); + return dispatch(doResetThumbnailStatus()); +}; + +export const doUpdatePublishForm = (publishFormValue: UpdatePublishFormData) => ( + dispatch: Dispatch +): UpdatePublishFormAction => + dispatch({ + type: ACTIONS.UPDATE_PUBLISH_FORM, + data: { ...publishFormValue }, + }); + export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch: Dispatch) => { const thumbnail = fs.readFileSync(filePath); const fileExt = path.extname(filePath); @@ -164,15 +165,27 @@ export const doPrepareEdit = (claim: any, uri: string) => (dispatch: Dispatch) = description, fee, language, - licenseType: license, - licenseUrl, nsfw, thumbnail, title, uri, uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined, + licenseUrl, }; + // Make sure custom liscence's are mapped properly + if (!CC_LICENSES.some(({ value }) => value === license)) { + if (!licenseUrl) { + publishData.licenseType = COPYRIGHT; + } else { + publishData.licenseType = OTHER; + } + + publishData.otherLicenseDescription = license; + } else { + publishData.licenseType = license; + } + dispatch({ type: ACTIONS.DO_PREPARE_EDIT, data: publishData }); }; diff --git a/src/renderer/redux/reducers/publish.js b/src/renderer/redux/reducers/publish.js index b28c9b4cd..c3e728384 100644 --- a/src/renderer/redux/reducers/publish.js +++ b/src/renderer/redux/reducers/publish.js @@ -28,7 +28,6 @@ type PublishState = { bidError: ?string, otherLicenseDescription: string, licenseUrl: string, - copyrightNotice: string, pendingPublishes: Array, }; @@ -54,7 +53,6 @@ export type UpdatePublishFormData = { bidError?: string, otherLicenseDescription?: string, licenseUrl?: string, - copyrightNotice?: string, }; export type UpdatePublishFormAction = { @@ -114,9 +112,8 @@ const defaultState: PublishState = { bid: 0.1, bidError: undefined, licenseType: 'None', - otherLicenseDescription: '', + otherLicenseDescription: 'All rights reserved', licenseUrl: '', - copyrightNotice: 'All rights reserved', publishing: false, publishSuccess: false, publishError: undefined, From 9c74cd7f64e5fe7266ce1371e508caeb133d95c4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 4 Oct 2018 00:11:08 -0400 Subject: [PATCH 02/21] general css fixes --- .eslintrc.json | 4 +- .../component/transactionListRecent/view.jsx | 4 ++ src/renderer/component/userHistory/view.jsx | 28 ++++++----- .../component/userHistoryItem/view.jsx | 33 ++++++------- src/renderer/page/help/view.jsx | 2 +- src/renderer/scss/_gui.scss | 14 +----- src/renderer/scss/_vars.scss | 6 ++- src/renderer/scss/all.scss | 2 + src/renderer/scss/component/_button.scss | 2 - src/renderer/scss/component/_card.scss | 3 +- src/renderer/scss/component/_item-list.scss | 26 +++++++++++ src/renderer/scss/component/_search.scss | 3 -- src/renderer/scss/component/_table.scss | 46 ------------------- src/renderer/scss/component/_time.scss | 9 ++++ static/themes/dark.css | 4 +- 15 files changed, 82 insertions(+), 104 deletions(-) create mode 100644 src/renderer/scss/component/_item-list.scss create mode 100644 src/renderer/scss/component/_time.scss diff --git a/.eslintrc.json b/.eslintrc.json index bb482f3f2..19f686074 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -40,6 +40,8 @@ "react/require-default-props": 0, "react/jsx-closing-tag-location": 0, "jsx-a11y/no-noninteractive-element-to-interactive-role": 0, - "class-methods-use-this": 0 + "class-methods-use-this": 0, + "jsx-a11y/interactive-supports-focus": 0, + "jsx-a11y/click-events-have-key-events": 0 } } diff --git a/src/renderer/component/transactionListRecent/view.jsx b/src/renderer/component/transactionListRecent/view.jsx index 325bbc1cb..fefcab356 100644 --- a/src/renderer/component/transactionListRecent/view.jsx +++ b/src/renderer/component/transactionListRecent/view.jsx @@ -24,6 +24,10 @@ class TransactionListRecent extends React.PureComponent { return (
{__('Recent Transactions')}
+
+ {__('To view all of your transactions, navigate to the')}{' '} +
{fetchingTransactions && (
diff --git a/src/renderer/component/userHistory/view.jsx b/src/renderer/component/userHistory/view.jsx index ae8f4b532..55b040d74 100644 --- a/src/renderer/component/userHistory/view.jsx +++ b/src/renderer/component/userHistory/view.jsx @@ -117,21 +117,19 @@ class UserHistoryPage extends React.PureComponent { />
{!!history.length && ( - - - {history.map(item => ( - { - this.onSelect(item.uri); - }} - /> - ))} - -
+
+ {history.map(item => ( + { + this.onSelect(item.uri); + }} + /> + ))} +
)} {pageCount > 1 && ( diff --git a/src/renderer/component/userHistoryItem/view.jsx b/src/renderer/component/userHistoryItem/view.jsx index de35a919b..b5ae79808 100644 --- a/src/renderer/component/userHistoryItem/view.jsx +++ b/src/renderer/component/userHistoryItem/view.jsx @@ -36,27 +36,24 @@ class UserHistoryItem extends React.PureComponent { } return ( - - - - - {moment(lastViewed).from(moment())} - {title} - -