Skip to content

Commit

Permalink
[processing#1220] Update plaintext file uploading to match other file…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
catarak committed Oct 13, 2020
1 parent e88574f commit d5abae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions client/modules/IDE/actions/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export function dropzoneAcceptCallback(userId, file, done) {
localIntercept(file).then((result) => {
file.content = result; // eslint-disable-line
done('Uploading plaintext file locally.');
file.previewElement.classList.remove('dz-error');
file.previewElement.classList.add('dz-success');
file.previewElement.querySelector('.dz-upload').style.width = '100%';
})
.catch((result) => {
done(`Failed to download file ${file.name}: ${result}`);
Expand Down
7 changes: 2 additions & 5 deletions client/modules/IDE/components/FileUploader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import getConfig from '../../../utils/getConfig';
import { fileExtensionsAndMimeTypes } from '../../../../server/utils/fileUtils';

const s3Bucket = getConfig('S3_BUCKET_URL_BASE') ||
`https://s3-${getConfig('AWS_REGION')}.amazonaws.com/${getConfig('S3_BUCKET')}/`;
`https://s3-${getConfig('AWS_REGION')}.amazonaws.com/${getConfig('S3_BUCKET')}/`;

class FileUploader extends React.Component {
componentDidMount() {
Expand All @@ -34,10 +34,7 @@ class FileUploader extends React.Component {
dictDefaultMessage: this.props.t('FileUploader.DictDefaultMessage'),
accept: this.props.dropzoneAcceptCallback.bind(this, userId),
sending: this.props.dropzoneSendingCallback,
complete: this.props.dropzoneCompleteCallback,
success: (file, response) => {
file.previewElement.querySelector('.dz-progress').remove();
}
complete: this.props.dropzoneCompleteCallback
// error: (file, errorMessage) => {
// console.log(file);
// console.log(errorMessage);
Expand Down

0 comments on commit d5abae1

Please sign in to comment.