mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Use FileStatus in UploadButton, register form
This commit is contained in:
parent
5bc447ecc8
commit
5250427ce0
@ -11,9 +11,12 @@ import InputFineUploader from './input_fineuploader';
|
|||||||
import UploadButton from '../ascribe_uploader/ascribe_upload_button/upload_button';
|
import UploadButton from '../ascribe_uploader/ascribe_upload_button/upload_button';
|
||||||
import FormSubmitButton from '../ascribe_buttons/form_submit_button';
|
import FormSubmitButton from '../ascribe_buttons/form_submit_button';
|
||||||
|
|
||||||
|
import { FileStatus } from '../ascribe_uploader/react_s3_fine_uploader_utils';
|
||||||
|
|
||||||
|
import AscribeSpinner from '../ascribe_spinner';
|
||||||
|
|
||||||
import ApiUrls from '../../constants/api_urls';
|
import ApiUrls from '../../constants/api_urls';
|
||||||
import AppConstants from '../../constants/application_constants';
|
import AppConstants from '../../constants/application_constants';
|
||||||
import AscribeSpinner from '../ascribe_spinner';
|
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
import { mergeOptions } from '../../utils/general_utils';
|
import { mergeOptions } from '../../utils/general_utils';
|
||||||
@ -84,7 +87,7 @@ let RegisterPieceForm = React.createClass({
|
|||||||
|
|
||||||
handleChangedDigitalWork(digitalWorkFile) {
|
handleChangedDigitalWork(digitalWorkFile) {
|
||||||
if (digitalWorkFile &&
|
if (digitalWorkFile &&
|
||||||
(digitalWorkFile.status === 'deleted' || digitalWorkFile.status === 'canceled')) {
|
(digitalWorkFile.status === FileStatus.DELETED || digitalWorkFile.status === FileStatus.CANCELED)) {
|
||||||
this.refs.form.refs.thumbnail_file.reset();
|
this.refs.form.refs.thumbnail_file.reset();
|
||||||
this.setState({ digitalWorkFile: null });
|
this.setState({ digitalWorkFile: null });
|
||||||
} else {
|
} else {
|
||||||
|
@ -10,7 +10,7 @@ import AppConstants from '../../constants/application_constants';
|
|||||||
import { getCookie } from '../../utils/fetch_api_utils';
|
import { getCookie } from '../../utils/fetch_api_utils';
|
||||||
|
|
||||||
|
|
||||||
const { func, bool, shape, string, number, element, oneOf, arrayOf } = React.PropTypes;
|
const { func, bool, shape, string, number, element, oneOf, oneOfType, arrayOf } = React.PropTypes;
|
||||||
|
|
||||||
const InputFineUploader = React.createClass({
|
const InputFineUploader = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { displayValidProgressFilesFilter } from '../react_s3_fine_uploader_utils';
|
import { displayValidProgressFilesFilter, FileStatus } from '../react_s3_fine_uploader_utils';
|
||||||
import { getLangText } from '../../../utils/lang_utils';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
import { truncateTextAtCharIndex } from '../../../utils/general_utils';
|
import { truncateTextAtCharIndex } from '../../../utils/general_utils';
|
||||||
|
|
||||||
@ -43,11 +43,11 @@ export default function UploadButton({ className = 'btn btn-default btn-sm' } =
|
|||||||
},
|
},
|
||||||
|
|
||||||
getUploadingFiles() {
|
getUploadingFiles() {
|
||||||
return this.props.filesToUpload.filter((file) => file.status === 'uploading');
|
return this.props.filesToUpload.filter((file) => file.status === FileStatus.UPLOADING);
|
||||||
},
|
},
|
||||||
|
|
||||||
getUploadedFile() {
|
getUploadedFile() {
|
||||||
return this.props.filesToUpload.filter((file) => file.status === 'upload successful')[0];
|
return this.props.filesToUpload.filter((file) => file.status === FileStatus.UPLOAD_SUCESSFUL)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
handleOnClick() {
|
handleOnClick() {
|
||||||
|
Loading…
Reference in New Issue
Block a user