feature: show message for empty provider files

cc @kvz @arturi
This commit is contained in:
Ifedapo Olarewaju 2018-05-21 14:54:24 +01:00
parent ff628b67ee
commit b576dfe37a
5 changed files with 11 additions and 15 deletions

View file

@ -33,7 +33,8 @@ class Uppy {
uppyServerError: 'Connection with Uppy Server failed',
failedToUpload: 'Failed to upload',
noInternetConnection: 'No Internet connection',
connectedToInternet: 'Connected to the Internet'
connectedToInternet: 'Connected to the Internet',
noFilesFound: 'You have no files or folders here'
}
}

View file

@ -1,6 +1,7 @@
.uppy-Provider-auth,
.uppy-Provider-error,
.uppy-Provider-loading {
.uppy-Provider-loading,
.uppy-Provider-empty {
display: flex;
align-items: center;
justify-content: center;

View file

@ -46,7 +46,8 @@ module.exports = (props) => {
handleScroll: props.handleScroll,
title: props.title,
showTitles: props.showTitles,
getItemId: props.getItemId
getItemId: props.getItemId,
i18n: props.i18n
})}
<button class="UppyButton--circular UppyButton--blue uppy-ProviderBrowser-doneBtn"
type="button"

View file

@ -2,17 +2,9 @@ const Row = require('./Item')
const { h } = require('preact')
module.exports = (props) => {
// const headers = props.columns.map((column) => {
// return html`
// <th class="uppy-ProviderBrowserTable-headerColumn uppy-ProviderBrowserTable-column" onclick=${props.sortByTitle}>
// ${column.name}
// </th>
// `
// })
// <thead class="uppy-ProviderBrowserTable-header">
// <tr>${headers}</tr>
// </thead>
if (!props.folders.length && !props.files.length) {
return <div class="uppy-Provider-empty">{props.i18n('noFilesFound')}</div>
}
return (
<div class="uppy-ProviderBrowser-body">

View file

@ -590,7 +590,8 @@ module.exports = class ProviderView {
showTitles: this.opts.showTitles,
showFilter: this.opts.showFilter,
showBreadcrumbs: this.opts.showBreadcrumbs,
pluginIcon: this.plugin.icon
pluginIcon: this.plugin.icon,
i18n: this.plugin.uppy.i18n
})
return Browser(browserProps)