React/Redux - publish component #323

Merged
bones7242 merged 80 commits from react-upload into master 2018-01-25 22:43:20 +01:00
13 changed files with 37 additions and 121 deletions
Showing only changes of commit 234531401c - Show all commits

View file

@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import ChannelLoginForm from '../containers/ChannelLoginForm.jsx';
import ChannelCreateForm from '../containers/ChannelCreateForm.jsx';
@ -68,9 +67,4 @@ const mapStateToProps = state => {
};
};
ChannelSelector.propTypes = {
loggedInChannelName: PropTypes.string,
publishInChannel : PropTypes.bool,
};
export default connect(mapStateToProps, null)(ChannelSelector);

View file

@ -1,5 +1,4 @@
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
import React from 'react';
import PropTypes from 'prop-types';
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
class Preview extends React.Component {
constructor (props) {
@ -40,10 +39,4 @@ class Preview extends React.Component {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
}
};
Preview.propTypes = {
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
file : PropTypes.object.isRequired,
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
thumbnail : PropTypes.string.isRequired,
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
dimPreview: PropTypes.bool.isRequired,
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
};
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
export default Preview;

neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred
neb-b commented 2018-01-18 06:08:35 +01:00 (Migrated from github.com)
Review

Generally you should avoid doing dom stuff/setting state in componentWillMount. Especially since it seems that they will be removing it in a future React version.

componentDidMount is preferred

Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version. `componentDidMount` is preferred

View file

@ -1,22 +1,17 @@
import React from 'react';
import ProgressBar from '../components/ProgressBar.jsx';
const LOAD_START = 'LOAD_START';
const LOADING = 'LOADING';
const PUBLISHING = 'PUBLISHING';
const SUCCESS = 'SUCCESS';
const FAILED = 'FAILED';
import * as publishStates from '../constants/publishing_states';
function PublishStatus ({ status, message }) {
return (
<div className="row row--tall flex-container--column flex-container--center-center">
{(status === LOAD_START) &&
{(status === publishStates.LOAD_START) &&
<div className="row align-content-center">
<p>File is loading to server</p>
<p className="blue">{message}</p>
</div>
}
{(status === LOADING) &&
{(status === publishStates.LOADING) &&
<div>
<div className="row align-content-center">
<p>File is loading to server</p>
@ -24,20 +19,20 @@ function PublishStatus ({ status, message }) {
</div>
</div>
}
{(status === PUBLISHING) &&
{(status === publishStates.PUBLISHING) &&
<div className="row align-content-center">
<p>Upload complete. Your file is now being published on the blockchain...</p>
<ProgressBar/>
<p>Curious what magic is happening here? <a className="link--primary" target="blank" href="https://lbry.io/faq/what-is-lbry">Learn more.</a></p>
</div>
}
{(status === SUCCESS) &&
{(status === publishStates.SUCCESS) &&
<div className="row align-content-center">
<p>Your publish is complete! You are being redirected to it now.</p>
<p>If you are not automatically redirected, <a class="link--primary" target="_blank" href={message}>click here.</a></p>
</div>
}
{(status === FAILED) &&
{(status === publishStates.FAILED) &&
<div className="row align-content-center">
<p>Something went wrong...</p>
<p><strong>{message}</strong></p>

View file

@ -4,7 +4,6 @@ import {updateLoggedInChannel} from '../actions/index';
import { makeGetRequest, makePostRequest } from '../utils/xhr.js';
import { setUserCookies } from '../utils/cookies.js';
import { replaceChannelSelectionInNavBar } from '../utils/page.js';
import PropTypes from 'prop-types';
class ChannelCreateForm extends React.Component {
constructor (props) {
@ -171,8 +170,4 @@ const mapDispatchToProps = dispatch => {
};
};
ChannelCreateForm.propTypes = {
onChannelLogin: PropTypes.func.isRequired,
};
export default connect(null, mapDispatchToProps)(ChannelCreateForm);

View file

@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import { updateLoggedInChannel } from '../actions/index';
import { setUserCookies } from '../utils/cookies.js';
import { replaceChannelSelectionInNavBar } from '../utils/page.js';
import PropTypes from 'prop-types';
class ChannelLoginForm extends React.Component {
constructor (props) {
@ -83,8 +82,4 @@ const mapDispatchToProps = dispatch => {
};
};
ChannelLoginForm.propTypes = {
onChannelLogin: PropTypes.func.isRequired,
};
export default connect(null, mapDispatchToProps)(ChannelLoginForm);

View file

@ -1,9 +1,8 @@
import React from 'react';
import { setPublishInChannel } from '../actions/index';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
class AnonymousOrChannelSelect extends React.Component {
class channelSelect extends React.Component {
constructor (props) {
super(props);
this.toggleAnonymousPublish = this.toggleAnonymousPublish.bind(this);
@ -46,9 +45,4 @@ const mapDispatchToProps = dispatch => {
};
}
AnonymousOrChannelSelect.propTypes = {
publishInChannel : PropTypes.bool.isRequired,
onPublishInChannelChange: PropTypes.func.isRequired,
};
export default connect(mapStateToProps, mapDispatchToProps)(AnonymousOrChannelSelect);
export default connect(mapStateToProps, mapDispatchToProps)(channelSelect);

View file

@ -1,9 +1,8 @@
import React from 'react';
import { selectFile, updateError } from '../actions';
import { connect } from 'react-redux';
import Preview from '../components/Preview.jsx';
import { selectFile, updateError } from '../actions';
import { validateFile } from '../utils/file.js';
import PropTypes from 'prop-types';
import Preview from '../components/Preview.jsx';
class Dropzone extends React.Component {
constructor (props) {
@ -160,11 +159,4 @@ const mapDispatchToProps = dispatch => {
};
};
Dropzone.propTypes = {
file : PropTypes.object,
thumbnail : PropTypes.string.isRequired,
fileError : PropTypes.string,
onFileError: PropTypes.func.isRequired,
};
export default connect(mapStateToProps, mapDispatchToProps)(Dropzone);

View file

@ -1,4 +1,6 @@
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import React from 'react';
import { connect } from 'react-redux';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import { getCookie } from '../utils/cookies.js';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import PreviewDropzone from './Dropzone.jsx';
import PublishTitleInput from './PublishTitleInput.jsx';
import ChannelSelector from '../components/ChannelSelector.jsx';
@ -6,11 +8,8 @@ import PublishUrlInput from './PublishUrlInput.jsx';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import PublishThumbnailInput from './PublishThumbnailInput.jsx';
import PublishMetadataInputs from './PublishMetadataInputs.jsx';
import AnonymousOrChannelSelect from './ChannelSelect.jsx';
import { connect } from 'react-redux';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import PropTypes from 'prop-types';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import { getCookie } from '../utils/cookies.js';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import {selectFile, clearFile, updateLoggedInChannel, updatePublishStatus, updateError} from '../actions';
import * as states from '../constants/publishing_states';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
import * as publishStates from '../constants/publishing_states';
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
class PublishForm extends React.Component {
constructor (props) {
@ -55,18 +54,18 @@ class PublishForm extends React.Component {
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
const fd = this.appendDataToFormData(file, metadata);
const that = this;
xhr.upload.addEventListener('loadstart', function () {
that.props.onPublishStatusChange(states.LOAD_START, 'upload started');
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.LOAD_START, 'upload started');
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
});
xhr.upload.addEventListener('progress', function (e) {
if (e.lengthComputable) {
const percentage = Math.round((e.loaded * 100) / e.total);
console.log('progress:', percentage);
that.props.onPublishStatusChange(states.LOADING, `${percentage}%`);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.LOADING, `${percentage}%`);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
}
}, false);
xhr.upload.addEventListener('load', function () {
console.log('loaded 100%');
that.props.onPublishStatusChange(states.PUBLISHING, null);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.PUBLISHING, null);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
}, false);
xhr.open('POST', uri, true);
xhr.onreadystatechange = function () {
@ -75,12 +74,12 @@ class PublishForm extends React.Component {
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
if (xhr.status === 200) {
console.log('publish complete!');
const url = JSON.parse(xhr.response).message.url;
that.props.onPublishStatusChange(states.SUCCESS, url);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.SUCCESS, url);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
window.location = url;
} else if (xhr.status === 502) {
that.props.onPublishStatusChange(states.FAILED, 'Spee.ch was not able to get a response from the LBRY network.');
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.FAILED, 'Spee.ch was not able to get a response from the LBRY network.');
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
} else {
that.props.onPublishStatusChange(states.FAILED, JSON.parse(xhr.response).message);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
that.props.onPublishStatusChange(publishStates.FAILED, JSON.parse(xhr.response).message);
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
}
}
};
@ -226,24 +225,4 @@ const mapDispatchToProps = dispatch => {
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
};
};
PublishForm.propTypes = {
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
file : PropTypes.object.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
claim : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
title : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
thumbnail : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
description : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
license : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
nsfw : PropTypes.bool.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
loggedInChannel : PropTypes.object.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
publishInChannel : PropTypes.bool.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
fileError : PropTypes.string,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
urlError : PropTypes.string,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
publishSubmitError : PropTypes.string,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
onFileSelect : PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
onFileClear : PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
onChannelLogin : PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
onPublishStatusChange: PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
onPublishSubmitError : PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
};
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
export default connect(mapStateToProps, mapDispatchToProps)(PublishForm);

kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux
kauffj commented 2018-01-15 20:25:38 +01:00 (Migrated from github.com)
Review

These consts need to be shared across files

These consts need to be shared across files
kauffj commented 2018-01-15 20:31:56 +01:00 (Migrated from github.com)
Review

I suspect this shouldn't be necessary with addition of Redux

I suspect this shouldn't be necessary with addition of Redux

View file

@ -1,7 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import { updateMetadata } from '../actions/index';
import PropTypes from 'prop-types';
/*
const textarea = document.getElementById('publish-description');
@ -15,12 +14,15 @@ class MetadataInputs extends React.Component {
constructor (props) {
super(props);
this.state = {
showInputs: false,
showInputs : false,
descriptionLimit : 200,
descriptionScrollHeight: null,
};
this.toggleShowInputs = this.toggleShowInputs.bind(this);
this.handleInput = this.handleInput.bind(this);
this.handleCheck = this.handleCheck.bind(this);
this.handleSelection = this.handleSelection.bind(this);
this.setDescriptionScrollHeight = this.setDescriptionScrollHeight.bind(this);
}
toggleShowInputs () {
this.setState({'showInputs': !this.state.showInputs});
@ -43,6 +45,10 @@ class MetadataInputs extends React.Component {
const selectedOption = event.target.selectedOptions[0].value;
this.props.onMetadataChange(name, selectedOption);
}
setDescriptionScrollHeight (event) {
const scrollHeight = event.target.scrollHeight;
this.setState({descriptionScrollHeight: scrollHeight});
}
render () {
return (
<div id="publish-details" className="row row--padded row--no-top row--wide">
@ -53,7 +59,16 @@ class MetadataInputs extends React.Component {
<div className="column column--3 column--med-10 align-content-top">
<label htmlFor="publish-license" className="label">Description:</label>
</div><div className="column column--7 column--sml-10">
<textarea rows="1" id="publish-description" className="textarea textarea--primary textarea--full-width" name="description" placeholder="Optional description" value={this.props.description} onChange={this.handleInput} />
<textarea
rows="1"
id="publish-description"
className="textarea textarea--primary textarea--full-width"
name="description"
placeholder="Optional description"
value={this.props.description}
onInput={this.setDescriptionScrollHeight}
height={Math.min(this.state.descriptionScrollHeight, this.state.descriptionLimit) + 'px'}
onChange={this.handleInput} />
</div>
</div>
@ -99,11 +114,4 @@ const mapDispatchToProps = dispatch => {
};
};
MetadataInputs.propTypes = {
description : PropTypes.string.isRequired,
license : PropTypes.string.isRequired,
nsfw : PropTypes.bool.isRequired,
onMetadataChange: PropTypes.func.isRequired,
};
export default connect(mapStateToProps, mapDispatchToProps)(MetadataInputs);

View file

@ -1,7 +1,6 @@
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
import React from 'react';
import { connect } from 'react-redux';
import { updateMetadata } from '../actions/index';
import PropTypes from 'prop-types';
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
class ThumbnailInput extends React.Component {
constructor (props) {
@ -84,9 +83,4 @@ const mapDispatchToProps = dispatch => {
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
};
};
ThumbnailInput.propTypes = {
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
thumbnail : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
onThumbnailChange: PropTypes.func.isRequired,
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
};
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
export default connect(mapStateToProps, mapDispatchToProps)(ThumbnailInput);

kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)
kauffj commented 2018-01-15 20:30:54 +01:00 (Migrated from github.com)
Review

I suspect there is a less hacky way to do this ;)

I suspect there is a less hacky way to do this ;)

View file

@ -1,7 +1,6 @@
import React from 'react';
import {updateMetadata} from '../actions/index';
import {connect} from 'react-redux';
import PropTypes from 'prop-types';
class TitleInput extends React.Component {
constructor (props) {
@ -35,9 +34,4 @@ const mapDispatchToProps = dispatch => {
};
}
TitleInput.propTypes = {
title : PropTypes.string.isRequired,
onMetadataChange: PropTypes.func.isRequired,
};
export default connect(mapStateToProps, mapDispatchToProps)(TitleInput);

View file

@ -3,7 +3,6 @@ import Dropzone from './Dropzone.jsx';
import PublishForm from './PublishForm.jsx';
import PublishStatus from '../components/PublishStatus.jsx';
import {connect} from 'react-redux';
import PropTypes from 'prop-types';
class PublishTool extends React.Component {
render () {
@ -32,10 +31,4 @@ const mapStateToProps = state => {
};
};
PublishTool.propTypes = {
file : PropTypes.object,
status : PropTypes.string,
message: PropTypes.string,
};
export default connect(mapStateToProps, null)(PublishTool);

View file

@ -4,7 +4,6 @@ import { connect } from 'react-redux';
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
import { makeGetRequest } from '../utils/xhr.js';
import UrlMiddle from '../components/PublishUrlMiddle.jsx';
import {updateError} from '../actions';
import PropTypes from 'prop-types';
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
class UrlChooser extends React.Component {
constructor (props) {
@ -105,13 +104,4 @@ const mapDispatchToProps = dispatch => {
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
};
};
UrlChooser.propTypes = {
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
fileName : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
loggedInChannelName : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
loggedInChannelShortId: PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
publishInChannel : PropTypes.bool.isRequired,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
claim : PropTypes.string.isRequired,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
urlError : PropTypes.string,
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
};
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
export default connect(mapStateToProps, mapDispatchToProps)(UrlChooser);

kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
kauffj commented 2018-01-15 20:29:33 +01:00 (Migrated from github.com)
Review

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).

You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).