-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
414 Be able to download files via custom forms #416
Conversation
@dantownsend I think this is a great feature. I left a couple of comments. Maybe it's for some other PR, but now I noticed that Pydantic validation errors not displayed well in UI. |
That's interesting - definitely needs improvement! Thanks for highlighting it. |
@dantownsend Our piccolo_admin/admin_ui/src/components/FormAdd.vue Lines 122 to 127 in 0132344
with this if (axios.isAxiosError(error) && error.response) {
const responseData =
error.request.responseType === "blob" &&
error.response.data instanceof Blob &&
error.response.data.type &&
error.response.data.type
.toLowerCase()
.indexOf("json") != -1
? JSON.parse(await error.response.data.text())
: error.response.data
this.errors = parseErrorResponse(
responseData,
error.response.status
)
} After that we displayed the error messages nicely as before. Hope that helps. |
That's really helpful - thanks! I wasn't sure what negative effects |
@dantownsend Exactly, |
OK, I've added the blob -> JSON conversion logic now. |
I think the PR is done now. It ended up being huge because I broke down By breaking it up, it also means I can more easily include chunks of it in the Sphinx docs using Warning - to run the app locally now, you do |
@sinisaos Do you see anything else, or am I good to merge? I know it's a massive PR, with a lot of noise in it. |
@dantownsend I tried this PR and everything works and looks great. I have nothing to add and I don't see anything that would be a problem. It's great that you split |
@sinisaos Cool, thanks a lot - I really appreciate it 👍 |
Resolves #414
Remaining tasks:
For a future PR: