diff --git a/CHANGELOG.md b/CHANGELOG.md index 386fe6462..681a8357f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,7 +122,7 @@ To Be Released: 2018-05-31. - [ ] uppy-server: document docker image setup for uppy-server (@ifedapoolarewaju) - [ ] xhrupload: emit a final `upload-progress` event in the XHRUpload plugin just before firing `upload-complete` (tus-js-client already handles this internally) (@arturi) - [x] core: add more mime-to-extension mappings from https://github.com/micnic/mime.json/blob/master/index.json (which ones?) (#806 /@arturi, @goto-bus-stop) -- [ ] providers: select files only after “select” is pressed, don’t add them right away when they are checked (keep a list of fileIds in state?); better UI + solves issue with autoProceed uploading in background, which is weird; re-read https://github.com/transloadit/uppy/pull/419#issuecomment-345210519 (@arturi, @goto-bus-stop) +- [x] providers: select files only after “select” is pressed, don’t add them right away when they are checked (keep a list of fileIds in state?); better UI + solves issue with autoProceed uploading in background, which is weird; re-read https://github.com/transloadit/uppy/pull/419#issuecomment-345210519 (@arturi, @goto-bus-stop) - [x] tus: add `filename` and `filetype`, so that tus servers knows what headers to set https://github.com/tus/tus-js-client/commit/ebc5189eac35956c9f975ead26de90c896dbe360 (#844 / @vith) - [ ] core: look into utilizing https://github.com/que-etc/resize-observer-polyfill for responsive components. See also https://github.com/transloadit/uppy/issues/750 - [x] core: ⚠️ **breaking** removed .run() (to solve issues like #756), update docs (#793 / goto-bus-stop) diff --git a/src/core/Core.js b/src/core/Core.js index 365a928ae..fbd6e466b 100644 --- a/src/core/Core.js +++ b/src/core/Core.js @@ -34,7 +34,14 @@ class Uppy { failedToUpload: 'Failed to upload %{file}', noInternetConnection: 'No Internet connection', connectedToInternet: 'Connected to the Internet', - noFilesFound: 'You have no files or folders here' + // Strings for remote providers + noFilesFound: 'You have no files or folders here', + selectXFiles: { + 0: 'Select %{smart_count} file', + 1: 'Select %{smart_count} files' + }, + cancel: 'Cancel', + logOut: 'Log out' } } diff --git a/src/scss/_provider.scss b/src/scss/_provider.scss index 87b7a982f..bbc4866de 100644 --- a/src/scss/_provider.scss +++ b/src/scss/_provider.scss @@ -392,21 +392,15 @@ outline: rgb(59, 153, 252) auto 5px; } -.uppy-ProviderBrowser-doneBtn { - position: absolute; - bottom: 16px; - right: 16px; - z-index: $zIndex-3; - width: 50px; - height: 50px; +.uppy-ProviderBrowser-footer { + display: flex; + align-items: center; + background: $color-white; + height: 65px; + border-top: 1px solid rgba($color-gray, 0.3); + padding: 0 15px; - .uppy-Dashboard--wide & { - width: 60px; - height: 60px; + & button { + margin-right: 10px; } } - -.uppy-ProviderBrowser-doneBtn .UppyIcon { - width: 45%; - height: 45%; -} diff --git a/src/views/ProviderView/Browser.js b/src/views/ProviderView/Browser.js index bb7136a3a..f755b0d6b 100644 --- a/src/views/ProviderView/Browser.js +++ b/src/views/ProviderView/Browser.js @@ -1,9 +1,11 @@ +const classNames = require('classnames') const Breadcrumbs = require('./Breadcrumbs') const Filter = require('./Filter') const Table = require('./ItemList') +const FooterActions = require('./FooterActions') const { h } = require('preact') -module.exports = (props) => { +const Browser = (props) => { let filteredFolders = props.folders let filteredFiles = props.files @@ -12,56 +14,48 @@ module.exports = (props) => { filteredFiles = props.filterItems(props.files) } + const selected = props.currentSelection.length + return ( -
+
-
+
{props.pluginIcon && props.pluginIcon()}
- {props.showBreadcrumbs && Breadcrumbs({ - getFolder: props.getFolder, - directories: props.directories, - title: props.title - })} - {props.username} - + {props.showBreadcrumbs && + } +
{ props.showFilter && } - {Table({ - columns: [{ + - - + }]} + folders={filteredFolders} + files={filteredFiles} + activeRow={props.isActiveRow} + sortByTitle={props.sortByTitle} + sortByDate={props.sortByDate} + isChecked={props.isChecked} + handleFolderClick={props.getNextFolder} + toggleCheckbox={props.toggleCheckbox} + getItemName={props.getItemName} + getItemIcon={props.getItemIcon} + handleScroll={props.handleScroll} + title={props.title} + showTitles={props.showTitles} + getItemId={props.getItemId} + i18n={props.i18n} + /> + {selected > 0 && } ) } -//
-// -//
+module.exports = Browser diff --git a/src/views/ProviderView/FooterActions.js b/src/views/ProviderView/FooterActions.js new file mode 100644 index 000000000..249349d3c --- /dev/null +++ b/src/views/ProviderView/FooterActions.js @@ -0,0 +1,14 @@ +const { h } = require('preact') + +module.exports = (props) => { + return +} diff --git a/src/views/ProviderView/Item.js b/src/views/ProviderView/Item.js index bf415185e..f7dc2ca96 100644 --- a/src/views/ProviderView/Item.js +++ b/src/views/ProviderView/Item.js @@ -12,9 +12,9 @@ module.exports = (props) => { ev.preventDefault() // when file is clicked, select it, but when folder is clicked, open it if (props.type === 'folder') { - return props.handleClick(ev) + return props.handleFolderClick(ev) } - props.handleCheckboxClick(ev) + props.handleClick(ev) } return ( @@ -27,13 +27,13 @@ module.exports = (props) => { id={props.id} checked={props.isChecked} disabled={props.isDisabled} - onchange={props.handleCheckboxClick} + onchange={props.handleClick} onkeyup={stop} onkeydown={stop} onkeypress={stop} />