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

Closed karkraeg closed 3 weeks ago

karkraeg commented 1 month 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 1 month 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 month 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!

karkraeg commented 1 month ago

Hi @zzacharo, thanks for your help! It will be fixed with https://github.com/inveniosoftware/invenio-app-rdm/pull/2889 and https://github.com/inveniosoftware/invenio-rdm-records/pull/1859