浏览代码

transloadit: Capitalise Assembly in user facing messages

And also in debug and test messages too!
Renée Kooi 7 年之前
父节点
当前提交
e6b28acc7f
共有 2 个文件被更改,包括 12 次插入12 次删除
  1. 8 8
      src/plugins/Transloadit/index.js
  2. 4 4
      src/plugins/Transloadit/index.test.js

+ 8 - 8
src/plugins/Transloadit/index.js

@@ -25,7 +25,7 @@ module.exports = class Transloadit extends Plugin {
     const defaultLocale = {
     const defaultLocale = {
       strings: {
       strings: {
         creatingAssembly: 'Preparing upload...',
         creatingAssembly: 'Preparing upload...',
-        creatingAssemblyFailed: 'Transloadit: Could not create assembly',
+        creatingAssemblyFailed: 'Transloadit: Could not create Assembly',
         encoding: 'Encoding...'
         encoding: 'Encoding...'
       }
       }
     }
     }
@@ -144,7 +144,7 @@ module.exports = class Transloadit extends Plugin {
   createAssembly (fileIDs, uploadID, options) {
   createAssembly (fileIDs, uploadID, options) {
     const pluginOptions = this.opts
     const pluginOptions = this.opts
 
 
-    this.uppy.log('[Transloadit] create assembly')
+    this.uppy.log('[Transloadit] create Assembly')
 
 
     return this.client.createAssembly({
     return this.client.createAssembly({
       params: options.params,
       params: options.params,
@@ -227,7 +227,7 @@ module.exports = class Transloadit extends Plugin {
       return this.connectSocket(assembly)
       return this.connectSocket(assembly)
         .then(() => assembly)
         .then(() => assembly)
     }).then((assembly) => {
     }).then((assembly) => {
-      this.uppy.log('[Transloadit] Created assembly')
+      this.uppy.log('[Transloadit] Created Assembly')
       return assembly
       return assembly
     }).catch((err) => {
     }).catch((err) => {
       this.uppy.info(this.i18n('creatingAssemblyFailed'), 'error', 0)
       this.uppy.info(this.i18n('creatingAssemblyFailed'), 'error', 0)
@@ -396,7 +396,7 @@ module.exports = class Transloadit extends Plugin {
 
 
       const newAssemblies = state.assemblies
       const newAssemblies = state.assemblies
       const previousAssemblies = prevState.assemblies
       const previousAssemblies = prevState.assemblies
-      this.uppy.log('[Transloadit] Current assembly status after restore')
+      this.uppy.log('[Transloadit] Current Assembly status after restore')
       this.uppy.log(newAssemblies)
       this.uppy.log(newAssemblies)
       this.uppy.log('[Transloadit] Assembly status before restore')
       this.uppy.log('[Transloadit] Assembly status before restore')
       this.uppy.log(previousAssemblies)
       this.uppy.log(previousAssemblies)
@@ -689,10 +689,10 @@ module.exports = class Transloadit extends Plugin {
       const onAssemblyFinished = (assembly) => {
       const onAssemblyFinished = (assembly) => {
         // An assembly for a different upload just finished. We can ignore it.
         // An assembly for a different upload just finished. We can ignore it.
         if (assemblyIDs.indexOf(assembly.assembly_id) === -1) {
         if (assemblyIDs.indexOf(assembly.assembly_id) === -1) {
-          this.uppy.log(`[Transloadit] afterUpload(): Ignoring finished assembly ${assembly.assembly_id}`)
+          this.uppy.log(`[Transloadit] afterUpload(): Ignoring finished Assembly ${assembly.assembly_id}`)
           return
           return
         }
         }
-        this.uppy.log(`[Transloadit] afterUpload(): Got assembly finish ${assembly.assembly_id}`)
+        this.uppy.log(`[Transloadit] afterUpload(): Got Assembly finish ${assembly.assembly_id}`)
 
 
         // TODO set the `file.uploadURL` to a result?
         // TODO set the `file.uploadURL` to a result?
         // We will probably need an option here so the plugin user can tell us
         // We will probably need an option here so the plugin user can tell us
@@ -709,10 +709,10 @@ module.exports = class Transloadit extends Plugin {
       const onAssemblyError = (assembly, error) => {
       const onAssemblyError = (assembly, error) => {
         // An assembly for a different upload just errored. We can ignore it.
         // An assembly for a different upload just errored. We can ignore it.
         if (assemblyIDs.indexOf(assembly.assembly_id) === -1) {
         if (assemblyIDs.indexOf(assembly.assembly_id) === -1) {
-          this.uppy.log(`[Transloadit] afterUpload(): Ignoring errored assembly ${assembly.assembly_id}`)
+          this.uppy.log(`[Transloadit] afterUpload(): Ignoring errored Assembly ${assembly.assembly_id}`)
           return
           return
         }
         }
-        this.uppy.log(`[Transloadit] afterUpload(): Got assembly error ${assembly.assembly_id}`)
+        this.uppy.log(`[Transloadit] afterUpload(): Got Assembly error ${assembly.assembly_id}`)
         this.uppy.log(error)
         this.uppy.log(error)
 
 
         // Clear postprocessing state for all our files.
         // Clear postprocessing state for all our files.

+ 4 - 4
src/plugins/Transloadit/index.test.js

@@ -98,7 +98,7 @@ describe('Transloadit', () => {
     })
     })
   })
   })
 
 
-  it('Should merge files with same parameters into one assembly', () => {
+  it('Should merge files with same parameters into one Assembly', () => {
     const uppy = new Core({ autoProceed: false })
     const uppy = new Core({ autoProceed: false })
 
 
     uppy.use(Transloadit, {
     uppy.use(Transloadit, {
@@ -145,11 +145,11 @@ describe('Transloadit', () => {
     })
     })
   })
   })
 
 
-  it('Does not create an assembly if no files are being uploaded', () => {
+  it('Does not create an Assembly if no files are being uploaded', () => {
     const uppy = new Core()
     const uppy = new Core()
     uppy.use(Transloadit, {
     uppy.use(Transloadit, {
       getAssemblyOptions () {
       getAssemblyOptions () {
-        throw new Error('should not create assembly')
+        throw new Error('should not create Assembly')
       }
       }
     })
     })
     uppy.run()
     uppy.run()
@@ -157,7 +157,7 @@ describe('Transloadit', () => {
     return uppy.upload()
     return uppy.upload()
   })
   })
 
 
-  it('Creates an assembly if no files are being uploaded but `alwaysRunAssembly` is enabled', () => {
+  it('Creates an Assembly if no files are being uploaded but `alwaysRunAssembly` is enabled', () => {
     const uppy = new Core()
     const uppy = new Core()
     uppy.use(Transloadit, {
     uppy.use(Transloadit, {
       alwaysRunAssembly: true,
       alwaysRunAssembly: true,