Prechádzať zdrojové kódy

revert dashboard:file-removed-ui

Artur Paikin 4 rokov pred
rodič
commit
945b7b92fb

+ 1 - 6
packages/@uppy/dashboard/src/components/FileItem/Buttons/index.js

@@ -112,12 +112,7 @@ module.exports = function Buttons (props) {
           i18n={i18n}
           i18n={i18n}
           info={props.info}
           info={props.info}
           log={props.log}
           log={props.log}
-          onClick={() => {
-            removeFile(file.id)
-            // So that developers can distinguish when users manually removed
-            // files in the UI, vs uppy.reset() (see #2301)
-            this.props.emit('dashboard:file-removed-ui', file)
-          }}
+          onClick={() => removeFile(file.id)}
         />
         />
       ) : null}
       ) : null}
     </div>
     </div>

+ 0 - 1
packages/@uppy/dashboard/src/components/FileItem/index.js

@@ -106,7 +106,6 @@ module.exports = class FileItem extends Component {
             i18n={this.props.i18n}
             i18n={this.props.i18n}
             log={this.props.log}
             log={this.props.log}
             info={this.props.info}
             info={this.props.info}
-            emit={this.props.emit}
           />
           />
         </div>
         </div>
       </div>
       </div>

+ 0 - 1
packages/@uppy/dashboard/src/components/FileList.js

@@ -41,7 +41,6 @@ module.exports = (props) => {
     i18n: props.i18n,
     i18n: props.i18n,
     log: props.log,
     log: props.log,
     info: props.info,
     info: props.info,
-    emit: props.emit,
     // features
     // features
     acquirers: props.acquirers,
     acquirers: props.acquirers,
     resumableUploads: props.resumableUploads,
     resumableUploads: props.resumableUploads,

+ 0 - 1
packages/@uppy/dashboard/src/index.js

@@ -842,7 +842,6 @@ module.exports = class Dashboard extends Plugin {
       i18nArray: this.i18nArray,
       i18nArray: this.i18nArray,
       removeFile: this.uppy.removeFile,
       removeFile: this.uppy.removeFile,
       info: this.uppy.info,
       info: this.uppy.info,
-      emit: this.uppy.emit,
       note: this.opts.note,
       note: this.opts.note,
       metaFields: pluginState.metaFields,
       metaFields: pluginState.metaFields,
       resumableUploads: capabilities.resumableUploads || false,
       resumableUploads: capabilities.resumableUploads || false,

+ 0 - 13
website/src/docs/dashboard.md

@@ -193,8 +193,6 @@ See also `disableStatusBar` option, which can hide the progress and upload butto
 
 
 Sometimes you might want to let users remove an uploaded file. Enabling this option only shows the remove `X` button in the Dashboard UI, but to actually send a request you should listen to [`file-removed`](https://uppy.io/docs/uppy/#file-removed) event and add your logic there.
 Sometimes you might want to let users remove an uploaded file. Enabling this option only shows the remove `X` button in the Dashboard UI, but to actually send a request you should listen to [`file-removed`](https://uppy.io/docs/uppy/#file-removed) event and add your logic there.
 
 
-> For an implementation example, please see [#2301](https://github.com/transloadit/uppy/issues/2301#issue-628931176)).
-
 ### `note: null`
 ### `note: null`
 
 
 Optionally, specify a string of text that explains something about the upload for the user. This is a place to explain any `restrictions` that are put in place. For example: `'Images and video only, 2–3 files, up to 1 MB'`.
 Optionally, specify a string of text that explains something about the upload for the user. This is a place to explain any `restrictions` that are put in place. For example: `'Images and video only, 2–3 files, up to 1 MB'`.
@@ -434,14 +432,3 @@ Fired when the user clicks “edit” icon next to a file in the Dashboard. The
 ### `dashboard:file-edit-complete`
 ### `dashboard:file-edit-complete`
 
 
 Fired when the user finished editing the file metadata.
 Fired when the user finished editing the file metadata.
-
-### `dashboard:file-removed-ui`
-
-This event is useful if you are using the [`showRemoveButtonAfterComplete: true`](/docs/dashboard/#showRemoveButtonAfterComplete-false) option, and want to distinguish when a user has manually removed file in the UI, vs when “cancel all” has been pressed or `uppy.close()` or `uppy.reset()` has been called.
-(See [#2301](https://github.com/transloadit/uppy/issues/2301#issue-628931176)).
-
-```js
-uppy.on('dashboard:file-removed-ui', (file) => {
-  // Your “file removed” logic
-})
-```