Browser: Use object name with prefix to delete sub-path objects (#4013)

master
Rushan 8 years ago committed by Harshavardhana
parent 6e9c91f43a
commit 5cec6bd80d
  1. 21
      browser/app/js/components/Browse.js

@ -227,7 +227,12 @@ export default class Browse extends React.Component {
removeObject() { removeObject() {
const {web, dispatch, currentPath, currentBucket, deleteConfirmation, checkedObjects} = this.props const {web, dispatch, currentPath, currentBucket, deleteConfirmation, checkedObjects} = this.props
let objects = checkedObjects.length > 0 ? checkedObjects : [deleteConfirmation.object] let objects = []
if (checkedObjects.length > 0) {
objects = checkedObjects.map(obj => `${currentPath}${obj}`)
} else {
objects = [deleteConfirmation.object]
}
web.RemoveObject({ web.RemoveObject({
bucketname: currentBucket, bucketname: currentBucket,
@ -721,7 +726,7 @@ export default class Browse extends React.Component {
</label> </label>
<div className="set-expire"> <div className="set-expire">
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireDays', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireDays', 1, shareObject.object) }></i>
<div className="set-expire-title"> <div className="set-expire-title">
Days Days
</div> </div>
@ -732,10 +737,10 @@ export default class Browse extends React.Component {
max={ 7 } max={ 7 }
defaultValue={ 5 } /> defaultValue={ 5 } />
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireDays', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireDays', -1, shareObject.object) }></i>
</div> </div>
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireHours', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireHours', 1, shareObject.object) }></i>
<div className="set-expire-title"> <div className="set-expire-title">
Hours Hours
</div> </div>
@ -746,10 +751,10 @@ export default class Browse extends React.Component {
max={ 23 } max={ 23 }
defaultValue={ 0 } /> defaultValue={ 0 } />
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireHours', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireHours', -1, shareObject.object) }></i>
</div> </div>
<div className="set-expire-item"> <div className="set-expire-item">
<i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireMins', 1, shareObject.object) }></i> <i className="set-expire-increase" onClick={ this.handleExpireValue.bind(this, 'expireMins', 1, shareObject.object) }></i>
<div className="set-expire-title"> <div className="set-expire-title">
Minutes Minutes
</div> </div>
@ -760,9 +765,9 @@ export default class Browse extends React.Component {
max={ 59 } max={ 59 }
defaultValue={ 0 } /> defaultValue={ 0 } />
</div> </div>
<i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireMins', -1, shareObject.object) }></i> <i className="set-expire-decrease" onClick={ this.handleExpireValue.bind(this, 'expireMins', -1, shareObject.object) }></i>
</div> </div>
</div> </div>
</div> </div>
</ModalBody> </ModalBody>
<div className="modal-footer"> <div className="modal-footer">

Loading…
Cancel
Save