Skip to content

Commit

Permalink
YDA-5914 - Fixed - Clicking on upload file or folder in deposit modul…
Browse files Browse the repository at this point in the history
…e lists all the folders. (#360)

* YDA-5914 - Fixed - Clicking on upload file or folder in deposit module lists all the folders.

* YDA-5914 - Fixed lint issues
  • Loading branch information
kaur16 authored Sep 4, 2024
1 parent f65391c commit 92394a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions deposit/static/deposit/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ let downloadChecksumReportTextTooltip
let downloadChecksumReportCSVTooltip

$(function () {
// Extract current location from query string (default to '').
currentFolder = decodeURIComponent((/(?:\?|&)dir=([^&]*)/
.exec(window.location.search) || [0, ''])[1])

// Canonicalize path somewhat, for convenience.
currentFolder = path.replace(/\/+/g, '/').replace(/\/$/, '')

Expand Down Expand Up @@ -201,7 +205,6 @@ $(function () {

$('.upload-folder').on('click', function () {
uploadFolder = true
console.log(uploadFolder)
})

$('.upload-file').on('click', function () {
Expand Down Expand Up @@ -802,7 +805,7 @@ const getFolderContents = (() => {
limit: batchSize,
sort_order: args.order[0].dir,
sort_on: ['name', 'size', 'modified'][args.order[0].column - 1],
space: 'Space.RESEARCH'
space: 'Space.DEPOSIT'
})

// If another requests has come while we were waiting, simply drop this one.
Expand Down Expand Up @@ -946,7 +949,7 @@ function startBrowsing () {
$('#file-browser').on('length.dt', function (e, settings, len) {
Yoda.storage.session.set('pageLength', len)
})
browse(currentFolder)
browse(currentFolder, true)
}

window.addEventListener('popstate', function (e) {
Expand Down
2 changes: 1 addition & 1 deletion deposit/static/deposit/js/dlgFileBrowseOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ const getFolderContents2 = (() => {
limit: batchSize,
sort_order: args.order[0].dir,
sort_on: ['name', 'modified'][args.order[0].column],
space: 'Space.RESEARCH'
space: 'Space.DEPOSIT'
})

// If another requests has come while we were waiting, simply drop this one.
Expand Down

0 comments on commit 92394a8

Please sign in to comment.