inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 87 forks source link

Deleting a draft redirects to a hardcoded URL #1846

Open karkraeg opened 2 hours ago

karkraeg commented 2 hours ago

In deposit.js the delete_ function has the redirect URL after deleting a draft hardcoded: https://github.com/inveniosoftware/invenio-rdm-records/blob/0d313c61bda1c509c8518c1c30f8abc337e96967/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/state/actions/deposit.js#L262

This should be read from the config value APP_RDM_DASHBOARD_ROUTES["uploads"] instead.

karkraeg commented 2 hours ago

@zzacharo as discussed tuesday in the telecon, could you provide some insight here as to how the flask config could best be read from the deposit.js? Thanks! The config object doesn't contain it.

zzacharo commented 1 hour ago

Hello,

I think it should be enough to inject the new variables in the form config:

That would go down to the deposit form state here and then it is available in the actions because of how we configure the redux store

Give it a go and let me know!