podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Export container should not use dedicated store

Open axel7083 opened this issue 1 year ago • 5 comments

Is your enhancement related to a problem? Please describe

Currently we have an router path /containers/export which requires a store

https://github.com/containers/podman-desktop/blob/8419cb69b7608045f2f4a96808a436335054a4e1/packages/renderer/src/stores/export-container-store.ts#L27

When the ContainerAction wants to export a container it fill the store with the ContainerInfo, then redirect to the page.

https://github.com/containers/podman-desktop/blob/423d44cc7857dc3c1b225c4a17ce37623dda9923/packages/renderer/src/lib/container/ContainerActions.svelte#L118-L119

This seems to be a very weird and heavy pattern for nothing.

Describe the solution you'd like

Proposal: change /containers/export to /container/<container-id>/export so the component can fetch the container id, and the corresponding ContainerInfoUI it requires.

We then can delete this store and avoid having all managed in the export component with the router parameter

Describe alternatives you've considered

No response

Additional context

No response

axel7083 avatar Jul 03 '24 12:07 axel7083

cc @benoitf @deboer-tim @lstocchi any opinion ?

axel7083 avatar Jul 03 '24 12:07 axel7083

I agree

benoitf avatar Jul 03 '24 12:07 benoitf

I think that the plan was to extend this to support multiple containers export eventually but we were busy on other things and never update it

lstocchi avatar Jul 03 '24 13:07 lstocchi

I think that the plan was to extend this to support multiple containers export eventually but we were busy on other things and never update it

FWIW when/if we support multiple containers I think changing the URL pattern to something like '?id=' with multiple params allowed is better than URL+store, so I would still go ahead with this change.

deboer-tim avatar Jul 03 '24 13:07 deboer-tim

I think that the plan was to extend this to support multiple containers export eventually but we were busy on other things and never update it

FWIW when/if we support multiple containers I think changing the URL pattern to something like '?id=' with multiple params allowed is better than URL+store

Yes I was thinking the same

axel7083 avatar Jul 03 '24 13:07 axel7083