oxidecomputer / console

Oxide Web Console
https://console-preview.oxide.computer
Mozilla Public License 2.0
128 stars 10 forks source link

Table bulk actions #424

Open david-crespo opened 3 years ago

david-crespo commented 3 years ago

Low priority because we can't actually do this yet on the API side and I'm not about to fire off a request for every selected row. But it will come in handy to have a generic thing in the table controls that takes a list of bulk actions, something like

{ 
  label: ReactNode , 
  action: (selectedRows: Row[]) => void 
}

action could take IDs instead of the whole rows, but if everything is done by name, then we'll need names instead. Passing rows is more flexible, with no downside that I can see.

image
david-crespo commented 1 year ago

We don’t have these in the API and probably won’t soon.

david-crespo commented 2 months ago

Let's think about this again! @iliana suggested a client-side implementation would be fine and I agree. We were unsure at the time how the API would progress. Now we can say it's pretty unlikely we will build bulk modification into the API any time soon, and a client-side implementation is a fine workaround. I am happy to pop up a modal with a list of the things being deleted and say right at the top: "This is happening the browser. If you leave or refresh the page it will stop the process." It will be quite fast anyway — much faster than image upload.