Просмотр исходного кода

Merge branch 'master' into 2.0

Artur Paikin 3 лет назад
Родитель
Сommit
8bcf1c6897

+ 2 - 2
README.md

@@ -259,9 +259,9 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu
 :---: |:---: |:---: |:---: |:---: |:---: |
 [ajkachnic](https://github.com/ajkachnic) |[dependabot[bot]](https://github.com/apps/dependabot) |[zcallan](https://github.com/zcallan) |[aduh95](https://github.com/aduh95) |[tim-kos](https://github.com/tim-kos) |[janko](https://github.com/janko) |
 
-[<img alt="wilkoklak" src="https://avatars.githubusercontent.com/u/17553085?v=4&s=117" width="117">](https://github.com/wilkoklak) |[<img alt="mifi" src="https://avatars.githubusercontent.com/u/402547?v=4&s=117" width="117">](https://github.com/mifi) |[<img alt="oliverpool" src="https://avatars.githubusercontent.com/u/3864879?v=4&s=117" width="117">](https://github.com/oliverpool) |[<img alt="Botz" src="https://avatars.githubusercontent.com/u/2706678?v=4&s=117" width="117">](https://github.com/Botz) |[<img alt="mcallistertyler" src="https://avatars.githubusercontent.com/u/14939210?v=4&s=117" width="117">](https://github.com/mcallistertyler) |[<img alt="mokutsu-coursera" src="https://avatars.githubusercontent.com/u/65177495?v=4&s=117" width="117">](https://github.com/mokutsu-coursera) |
+[<img alt="mifi" src="https://avatars.githubusercontent.com/u/402547?v=4&s=117" width="117">](https://github.com/mifi) |[<img alt="wilkoklak" src="https://avatars.githubusercontent.com/u/17553085?v=4&s=117" width="117">](https://github.com/wilkoklak) |[<img alt="oliverpool" src="https://avatars.githubusercontent.com/u/3864879?v=4&s=117" width="117">](https://github.com/oliverpool) |[<img alt="Botz" src="https://avatars.githubusercontent.com/u/2706678?v=4&s=117" width="117">](https://github.com/Botz) |[<img alt="mcallistertyler" src="https://avatars.githubusercontent.com/u/14939210?v=4&s=117" width="117">](https://github.com/mcallistertyler) |[<img alt="mokutsu-coursera" src="https://avatars.githubusercontent.com/u/65177495?v=4&s=117" width="117">](https://github.com/mokutsu-coursera) |
 :---: |:---: |:---: |:---: |:---: |:---: |
-[wilkoklak](https://github.com/wilkoklak) |[mifi](https://github.com/mifi) |[oliverpool](https://github.com/oliverpool) |[Botz](https://github.com/Botz) |[mcallistertyler](https://github.com/mcallistertyler) |[mokutsu-coursera](https://github.com/mokutsu-coursera) |
+[mifi](https://github.com/mifi) |[wilkoklak](https://github.com/wilkoklak) |[oliverpool](https://github.com/oliverpool) |[Botz](https://github.com/Botz) |[mcallistertyler](https://github.com/mcallistertyler) |[mokutsu-coursera](https://github.com/mokutsu-coursera) |
 
 [<img alt="DJWassink" src="https://avatars.githubusercontent.com/u/1822404?v=4&s=117" width="117">](https://github.com/DJWassink) |[<img alt="taoqf" src="https://avatars.githubusercontent.com/u/15901911?v=4&s=117" width="117">](https://github.com/taoqf) |[<img alt="Murderlon" src="https://avatars.githubusercontent.com/u/9060226?v=4&s=117" width="117">](https://github.com/Murderlon) |[<img alt="tuoxiansp" src="https://avatars.githubusercontent.com/u/3960056?v=4&s=117" width="117">](https://github.com/tuoxiansp) |[<img alt="dominiceden" src="https://avatars.githubusercontent.com/u/6367692?v=4&s=117" width="117">](https://github.com/dominiceden) |[<img alt="elenalape" src="https://avatars.githubusercontent.com/u/22844059?v=4&s=117" width="117">](https://github.com/elenalape) |
 :---: |:---: |:---: |:---: |:---: |:---: |

+ 1 - 1
packages/@uppy/companion/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@uppy/companion",
-  "version": "2.12.0",
+  "version": "2.12.1",
   "description": "OAuth helper and remote fetcher for Uppy's (https://uppy.io) extensible file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Dropbox and Google Drive, S3 and more :dog:",
   "main": "lib/companion.js",
   "types": "lib/companion.d.ts",

+ 7 - 0
packages/@uppy/companion/src/server/helpers/jwt.js

@@ -55,6 +55,13 @@ const addToCookies = (res, token, companionOptions, authProvider, prefix) => {
     httpOnly: true,
   }
 
+  // Fix to show thumbnails on Chrome
+  // https://community.transloadit.com/t/dropbox-and-box-thumbnails-returning-401-unauthorized/15781/2
+  if (companionOptions.server && companionOptions.server.protocol === 'https') {
+    cookieOptions.sameSite = 'none'
+    cookieOptions.secure = true
+  }
+
   if (companionOptions.cookieDomain) {
     cookieOptions.domain = companionOptions.cookieDomain
   }

+ 9 - 9
website/src/examples/dashboard/app.es6

@@ -6,7 +6,7 @@ const Instagram = require('@uppy/instagram')
 const Facebook = require('@uppy/facebook')
 const OneDrive = require('@uppy/onedrive')
 const Zoom = require('@uppy/zoom')
-const Box = require('@uppy/box')
+// const Box = require('@uppy/box')
 const ImageEditor = require('@uppy/image-editor')
 const Url = require('@uppy/url')
 const Webcam = require('@uppy/webcam')
@@ -35,7 +35,6 @@ function uppyInit () {
 
   const uppy = new Uppy({
     logger: Uppy.debugLogger,
-    restrictions: { requiredMetaFields: ['caption'] }
   })
 
   uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/', resume: true })
@@ -79,6 +78,7 @@ function uppySetOptions () {
     maxNumberOfFiles: 3,
     minNumberOfFiles: 2,
     allowedFileTypes: ['image/*', 'video/*'],
+    requiredMetaFields: ['caption'],
   }
 
   window.uppy.setOptions({
@@ -148,13 +148,13 @@ function uppySetOptions () {
     window.uppy.removePlugin(zoomInstance)
   }
 
-  const boxInstance = window.uppy.getPlugin('Box')
-  if (opts.Box && !boxInstance) {
-    window.uppy.use(Box, { target: Dashboard, companionUrl: COMPANION })
-  }
-  if (!opts.Box && boxInstance) {
-    window.uppy.removePlugin(boxInstance)
-  }
+  //   const boxInstance = window.uppy.getPlugin('Box')
+  //   if (opts.Box && !boxInstance) {
+  //     window.uppy.use(Box, { target: Dashboard, companionUrl: COMPANION })
+  //   }
+  //   if (!opts.Box && boxInstance) {
+  //     window.uppy.removePlugin(boxInstance)
+  //   }
 
   const webcamInstance = window.uppy.getPlugin('Webcam')
   if (opts.Webcam && !webcamInstance) {

+ 3 - 3
website/src/examples/dashboard/app.html

@@ -16,7 +16,7 @@
     <li><label for="opts-ScreenCapture"><input type="checkbox" id="opts-ScreenCapture" checked/> Screen Capture</label></li>
     <li><label for="opts-GoogleDrive"><input type="checkbox" id="opts-GoogleDrive" checked/> Google Drive</label></li>
     <li><label for="opts-Dropbox"><input type="checkbox" id="opts-Dropbox" checked/> Dropbox</label></li>
-    <li><label for="opts-Box"><input type="checkbox" id="opts-Box" checked/> Box</label></li>
+    <!-- <li><label for="opts-Box"><input type="checkbox" id="opts-Box" checked/> Box</label></li> -->
     <li><label for="opts-Instagram"><input type="checkbox" id="opts-Instagram" checked/> Instagram</label></li>
     <li><label for="opts-Facebook"><input type="checkbox" id="opts-Facebook" checked/> Facebook</label></li>
     <li><label for="opts-OneDrive"><input type="checkbox" id="opts-OneDrive" checked/> OneDrive</label></li>
@@ -47,7 +47,7 @@
     ScreenCapture: document.querySelector('#opts-ScreenCapture'),
     GoogleDrive: document.querySelector('#opts-GoogleDrive'),
     Dropbox: document.querySelector('#opts-Dropbox'),
-    Box: document.querySelector('#opts-Box'),
+    // Box: document.querySelector('#opts-Box'),
     Instagram: document.querySelector('#opts-Instagram'),
     Facebook: document.querySelector('#opts-Facebook'),
     OneDrive: document.querySelector('#opts-OneDrive'),
@@ -69,7 +69,7 @@
     GoogleDrive: true,
     Instagram: true,
     Dropbox: true,
-    Box: true,
+    // Box: true,
     OneDrive: true,
     Facebook: false,
     Url: true,