Skip to content

Commit

Permalink
YDA-5889: add warning for unsupported characters in deposit space
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidastri authored Aug 30, 2024
1 parent dd09c5f commit f65391c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deposit/static/deposit/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,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 @@ -262,6 +263,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 deposit/templates/deposit/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 f65391c

Please sign in to comment.