Skip to content

Commit

Permalink
YDA-5889: add warning for unsupported characters in filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidastri authored Aug 30, 2024
1 parent 55f776f commit dd09c5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions research/static/research/js/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ $(function () {
r.cancel()
$('#files').html('')
$('#uploads').addClass('hidden')
$('#unsupportedCharsWarning').addClass('hidden')
// clear information present for next time dialog is presented
$('.uploads-progress-information').html('')
$('.uploads-total-progress-bar').css('width', '0%')
Expand All @@ -347,6 +348,11 @@ $(function () {
const folderName = file.relativePath.substring(0, file.relativePath.indexOf('/'))
let overwrite = false

const diamondQuestionMarkPattern = /\uFFFD/
if (diamondQuestionMarkPattern.test(file.name)) {
$('#unsupportedCharsWarning').removeClass('hidden')
}

const $self = $('#' + file.uniqueIdentifier)
// Pause btn
$self.find('.upload-pause').on('click', function () {
Expand Down
3 changes: 3 additions & 0 deletions research/templates/research/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ <h5 class="modal-title">Uploads
<button type="button" class="btn-close btn-close-uploads-overview" data-bs-dismiss="modal" aria-label="Close" title="Close"></button>
</div>
<div class="modal-body">
<div id="unsupportedCharsWarning" class="hidden alert alert-primary">
Uploaded filenames contain unsupported characters and are renamed for compatibility.
</div>
<div id="files"></div>
</div>
<div class="modal-footer">
Expand Down

0 comments on commit dd09c5f

Please sign in to comment.