Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
c4125d2c
Commit
c4125d2c
authored
Mar 02, 2022
by
Markus Scheidgen
Browse files
Fixed missing UploadsPage reload after deleting an upload.
parent
b8a864c3
Pipeline
#124209
passed with stages
in 34 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gui/src/components/uploads/UploadsPage.js
View file @
c4125d2c
...
...
@@ -41,6 +41,7 @@ import TooltipButton from '../utils/TooltipButton'
import
ReloadIcon
from
'
@material-ui/icons/Replay
'
import
Quantity
from
'
../Quantity
'
import
{
SourceApiCall
,
SourceApiDialogButton
}
from
'
../buttons/SourceDialogButton
'
import
{
useHistory
}
from
'
react-router-dom
'
export
const
help
=
`
NOMAD allows you to upload data. After upload, NOMAD will process your data: it will
...
...
@@ -255,6 +256,7 @@ export function UploadsPage() {
order_by
:
'
upload_create_time
'
,
order
:
'
desc
'
})
const
history
=
useHistory
()
const
fetchData
=
useCallback
(()
=>
{
const
{
page_size
,
page
,
order_by
,
order
}
=
pagination
...
...
@@ -271,9 +273,12 @@ export function UploadsPage() {
fetchData
()
}
// This history dependency makes sure that the uploads are reloaded after page navigating
// back to the UploadsPage. E.g. if an upload was deleted on the UploadPage, we are
// history.pushed back to the UploadsPage and want to reload the list of uploads.
useEffect
(()
=>
{
fetchData
()
},
[
fetchData
])
},
[
fetchData
,
history
])
const
isDisabled
=
unpublished
?
(
unpublished
.
pagination
?
unpublished
.
pagination
.
total
>=
servicesUploadLimit
:
false
)
:
false
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment