sartography/spiff-arena

dev.app - File upload - unwanted delete button

Closed this issue · 5 comments

We may have to override the FileWidget to this properly https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/core/src/components/widgets/FileWidget.tsx#L120

That way we can handle the layout and whether or not to display that button from there. Ideally we'd keep the button but it would be a little x maybe to differentiate it from the array list remove.

We currently are already overriding the icon buttons but we have very little control there since the buttons are not passed very much info: https://github.com/sartography/spiff-arena/blob/main/spiffworkflow-frontend/src/rjsf/carbon_theme/IconButton/IconButton.tsx#L1

so previously there was a trash can icon for the items. but there wasn't otherwise a way to clear files you had previously selected in a form. so for example, if you had a list of items in a form, and each item allowed you to select a file and also type a name in a text box, there would have been no way to clear the file without also deleting the entire item, which would have included the name. when we upgraded react json schema form, they had fixed this by putting a trash can icon next to the file field. this is ultimately good and correct. but it is weird in the form linked on this ticket, because each item in the list only had one thing in it, the file field, so it sort of seemed like there was just a duplicate trash can icon. also the trash can icon on the file field was a weird choice and sort of looked bad. we have updated the icon to be a minus icon. hopefully it looks better now and this all makes sense.

Noticing few UI issues around this.
Please fix these.

  1. Even after a file is selected it shows the 'No file chosen' text
  2. For long file names there are alignment issues
    Image
  3. The outer trash icon also get alignment issues when the above happens

Image

#1667 should address the new issues with "No file chosen" and the trashcan icon.

Above issues seems to be fixed now