1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Change export of validationParts and validationTypes to be ValidationParts and ValidationTypes

This commit is contained in:
Brett Sun 2016-07-05 10:55:49 +02:00
parent 1511f06504
commit 2dce333c6a
7 changed files with 24 additions and 24 deletions

View File

@ -7,7 +7,7 @@ import Property from './../ascribe_forms/property';
import ReactS3FineUploader from './../ascribe_uploader/react_s3_fine_uploader';
import AppConstants from '../../constants/application_constants';
import { validationTypes } from '../../constants/uploader_constants';
import { ValidationTypes } from '../../constants/uploader_constants';
import { makeCsrfHeader } from '../../utils/csrf';
import { getLangText } from '../../utils/lang';
@ -40,7 +40,7 @@ let FurtherDetailsFileuploader = React.createClass({
areAssetsDownloadable: true,
label: getLangText('Additional files'),
multiple: false,
validation: validationTypes.additionalData
validation: ValidationTypes.additionalData
};
},

View File

@ -13,7 +13,7 @@ import Form from '../ascribe_forms/form';
import Property from '../ascribe_forms/property';
import AppConstants from '../../constants/application_constants';
import { validationTypes } from '../../constants/uploader_constants';
import { ValidationTypes } from '../../constants/uploader_constants';
import { getLangText } from '../../utils/lang';
import { formSubmissionValidation } from '../ascribe_uploader/react_s3_fine_uploader_utils';
@ -79,8 +79,8 @@ let CreateContractForm = React.createClass({
url: resolveUrl('blob_contracts')
}}
validation={{
itemLimit: validationTypes.additionalData.itemLimit,
sizeLimit: validationTypes.additionalData.sizeLimit,
itemLimit: ValidationTypes.additionalData.itemLimit,
sizeLimit: ValidationTypes.additionalData.sizeLimit,
allowedExtensions: ['pdf']
}}
areAssetsDownloadable={true}

View File

@ -15,7 +15,7 @@ import withContext from '../context/with_context';
import { currentUserShape, locationShape } from '../prop_types';
import AppConstants from '../../constants/application_constants';
import { validationParts, validationTypes } from '../../constants/uploader_constants';
import { ValidationParts, ValidationTypes } from '../../constants/uploader_constants';
import { FileStatus, formSubmissionValidation } from '../ascribe_uploader/react_s3_fine_uploader_utils';
import { getLangText } from '../../utils/lang';
@ -170,7 +170,7 @@ let RegisterPieceForm = React.createClass({
createBlobRoutine={{
url: resolveUrl('blob_digitalworks')
}}
validation={validationTypes.registerWork}
validation={ValidationTypes.registerWork}
setIsUploadReady={this.setIsUploadReady('digitalWorkKeyReady')}
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}
isFineUploaderActive={isFineUploaderActive}
@ -197,9 +197,9 @@ let RegisterPieceForm = React.createClass({
fileClass: 'thumbnail'
}}
validation={{
itemLimit: validationTypes.workThumbnail.itemLimit,
sizeLimit: validationTypes.workThumbnail.sizeLimit,
allowedExtensions: validationParts.allowedExtensions.images
itemLimit: ValidationTypes.workThumbnail.itemLimit,
sizeLimit: ValidationTypes.workThumbnail.sizeLimit,
allowedExtensions: ValidationParts.allowedExtensions.images
}}
setIsUploadReady={this.setIsUploadReady('thumbnailKeyReady')}
fileClassToUpload={{

View File

@ -11,7 +11,7 @@ import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader';
import UploadButton from '../ascribe_uploader/ascribe_upload_button/upload_button';
import AppConstants from '../../constants/application_constants';
import { validationTypes } from '../../constants/uploader_constants';
import { ValidationTypes } from '../../constants/uploader_constants';
import { formSubmissionValidation } from '../ascribe_uploader/react_s3_fine_uploader_utils';
import { makeCsrfHeader } from '../../utils/csrf';
@ -69,8 +69,8 @@ let ContractSettingsUpdateButton = React.createClass({
url: resolveUrl('blob_contracts')
}}
validation={{
itemLimit: validationTypes.registerWork.itemLimit,
sizeLimit: validationTypes.additionalData.sizeLimit,
itemLimit: ValidationTypes.registerWork.itemLimit,
sizeLimit: ValidationTypes.additionalData.sizeLimit,
allowedExtensions: ['pdf']
}}
setIsUploadReady={() =>{/* So that ReactS3FineUploader is not complaining */}}

View File

@ -13,7 +13,7 @@ import Property from '../../../../../ascribe_forms/property';
import AscribeSpinner from '../../../../../ascribe_spinner';
import { validationParts, validationTypes } from '../../../../../../constants/uploader_constants';
import { ValidationParts, ValidationTypes } from '../../../../../../constants/uploader_constants';
import { formSubmissionValidation } from '../../../../../ascribe_uploader/react_s3_fine_uploader_utils';
import { getLangText } from '../../../../../../utils/lang';
@ -175,9 +175,9 @@ let MarketAdditionalDataForm = React.createClass({
setIsUploadReady={this.setIsUploadReady}
submitFile={function () {}}
validation={{
itemLimit: validationTypes.workThumbnail.itemLimit,
sizeLimit: validationTypes.workThumbnail.sizeLimit,
allowedExtensions: validationParts.allowedExtensions.images
itemLimit: ValidationTypes.workThumbnail.itemLimit,
sizeLimit: ValidationTypes.workThumbnail.sizeLimit,
allowedExtensions: ValidationParts.allowedExtensions.images
}} />
<Property
name='artist_bio'

View File

@ -1,4 +1,4 @@
import { validationParts } from './uploader_constants';
import { ValidationParts } from './uploader_constants';
import { deepMatchObject } from '../utils/general';
import { getLangText } from '../utils/lang';
@ -112,7 +112,7 @@ const ErrorClasses = {
// Fallback error tips
'largeFileSize': {
'prettifiedText': getLangText(`We handle files up to ${validationParts.sizeLimit.default / 1000000000}GB ` +
'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 doesnt seem to ' +
'progress at all, try restarting the process.')

View File

@ -1,5 +1,5 @@
// Validation types
export const validationParts = {
export const ValidationParts = {
allowedExtensions: {
images: ['png', 'jpg', 'jpeg', 'gif']
},
@ -13,9 +13,9 @@ export const validationParts = {
}
};
const { itemLimit, sizeLimit } = validationParts;
const { itemLimit, sizeLimit } = ValidationParts;
export const validationTypes = {
export const ValidationTypes = {
additionalData: {
itemLimit: itemLimit.multiple,
sizeLimit: sizeLimit.default
@ -39,8 +39,8 @@ export const S3_ACL = process.env.S3_ACL;
export const S3_BUCKET = process.env.S3_BUCKET;
export default {
validationParts,
validationTypes,
ValidationParts,
ValidationTypes,
RETRY_ATTEMPT_TO_SHOW_CONTACT_US,
S3_ACCESS_KEY,
S3_ACL,