From 028058a12f01af117674b307991063985c4bc55d Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Mon, 8 Feb 2016 11:03:41 +0100 Subject: [PATCH] Small things that could only be fixed after merging --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 4 +--- js/constants/error_constants.js | 9 ++++++--- js/constants/uploader_constants.js | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 90a72157..cbdc6ab1 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -15,6 +15,7 @@ import GlobalNotificationActions from '../../actions/global_notification_actions import AppConstants from '../../constants/application_constants'; import { ErrorClasses, testErrorAgainstAll } from '../../constants/error_constants'; +import { RETRY_ATTEMPT_TO_SHOW_CONTACT_US } from '../../constants/uploader_constants'; import { displayValidFilesFilter, FileStatus, transformAllowedExtensionsToInputAcceptProp } from './react_s3_fine_uploader_utils'; import { getCookie } from '../../utils/fetch_api_utils'; @@ -34,9 +35,6 @@ const { shape, element, arrayOf } = React.PropTypes; -// After 5 manual retries, show the contact us prompt. -const RETRY_ATTEMPT_TO_SHOW_CONTACT_US = 5; - const ReactS3FineUploader = React.createClass({ propTypes: { areAssetsDownloadable: bool, diff --git a/js/constants/error_constants.js b/js/constants/error_constants.js index 4df095ee..2baeaf10 100644 --- a/js/constants/error_constants.js +++ b/js/constants/error_constants.js @@ -1,5 +1,7 @@ 'use strict' +import { validationParts } from './uploader_constants'; + import { deepMatchObject } from '../utils/general_utils'; import { getLangText } from '../utils/lang_utils'; @@ -112,9 +114,10 @@ const ErrorClasses = { // Fallback error tips 'largeFileSize': { - 'prettifiedText': getLangText('We handle files up to 25GB but your Internet connection may not. With ' + - 'large files and limited bandwith, it may take some time to complete. If ' + - 'it doesn’t seem to progress at all, try restarting the process.') + 'prettifiedText': getLangText(`We handle files up to ${validationParts.sizeLimit.default / 1000000000}GB ` + + 'but your Internet connection may not. With large files and limited ' + + 'bandwith, it may take some time to complete. If it doesn’t seem to ' + + 'progress at all, try restarting the process.') }, 'tryDifferentBrowser': { 'prettifiedText': getLangText("We're still having trouble uploading your file. It might be your " + diff --git a/js/constants/uploader_constants.js b/js/constants/uploader_constants.js index c2f8559b..ae7787fe 100644 --- a/js/constants/uploader_constants.js +++ b/js/constants/uploader_constants.js @@ -30,3 +30,6 @@ export const validationTypes = { sizeLimit: sizeLimit.thumbnail } }; + +// Number of manual retries before showing a contact us screen on the uploader. +export const RETRY_ATTEMPT_TO_SHOW_CONTACT_US = 5;