logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.31k stars 406 forks source link

fix(console): should be able to remove the zip on upload error #6306

Closed charIeszhao closed 1 month ago

charIeszhao commented 1 month ago

Summary

Should be able to remove the uploaded zip on error occurred, and removing the zip should not dirty the form.

Previously, I used the parser functions to transform the DB data from and to the form data type, but it seems it's not necessary and causing issues, since setting the form value to undefined does not clear the value change in React Hook Form. Therefore, changing it back to its original type definition CustomUiAssets | null and it solves the issue naturally.

Testing

Locally tested

Checklist

- [ ] .changeset - [ ] unit tests - [ ] integration tests - [ ] necessary TSDoc comments

github-actions[bot] commented 1 month ago

COMPARE TO master

Total Size Diff :chart_with_downwards_trend: -162 Bytes

Diff by File |Name|Diff| |---|---| |packages/console/src/components/CustomUiAssetsUploader/index.tsx|:chart_with_downwards_trend: -55 Bytes| |packages/console/src/pages/SignInExperience/PageContent/utils/parser.ts|:chart_with_downwards_trend: -133 Bytes| |packages/console/src/pages/SignInExperience/types.ts|:chart_with_downwards_trend: -84 Bytes|