csvalpha/amber-ui

Sepa export is broken

Closed this issue · 2 comments

Export a (valid) debit collection, expected behaviour is that an XML file will be downloaded.
Instead, the following message is shown:
image

Current workaround is to refresh the page, and suddenly you are prompted with the XML file.

Not sure if it fixes this, but #369 changes some filesaver related stuff in the sepa route.

I checked, and it does not fix it. I think it has to do with the route model hook not being run when transitioning from debit.collection.show to debit.collection.sepa

update:

This seems to be due to the fact that page-action.hbs provides pageAction.linkArgument as @model to the LinkTo component. The linkArgument for the download sepa action is specified in route debit.collection.show to be a collection object. This is apparently intended behaviour: https://guides.emberjs.com/release/routing/linking-between-routes/#toc_the-linkto--component
I believe I have come across a similar issue before, and it's quite a sneaky bug.

I am going to put a fix in a separate branch. Filesaver isn't broken. I will check out #369 nonetheless, because that PR has existed for a while now