Fix UX issues on Team Management tab (#23417)

* Don't disable download button after click

* Allow reuploading for team membership CSV
This commit is contained in:
Nathan Sprenkle
2020-03-17 12:03:53 -04:00
committed by GitHub
parent 6f7585c6b7
commit 9535c37c79
2 changed files with 9 additions and 1 deletions

View File

@@ -43,5 +43,10 @@ define([
AjaxHelpers.respondWithError(requests);
expect(view.handleCsvUploadFailure).toHaveBeenCalled();
});
it('should clear input file after upload to allow reuploading', function() {
view.uploadCsv(mockUploadClickEvent);
expect(view.$('#upload-team-csv-input').prop('value')).toEqual('');
});
});
});

View File

@@ -17,7 +17,7 @@
},
events: {
'click #download-team-csv-input': ViewUtils.withDisabledElement('downloadCsv'),
'click #download-team-csv-input': 'downloadCsv',
'change #upload-team-csv-input': ViewUtils.withDisabledElement('uploadCsv')
},
@@ -44,6 +44,9 @@
var self = this;
var formData = new FormData();
// clear selected file to allow re-uploading
$(event.target).prop('value', '');
formData.append('csv', file); // xss-lint: disable=javascript-jquery-append
return $.ajax({
type: 'POST',