Skip to content
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

fix: 修复 inputImage 裁剪模式配置文件大小限制报错问题 #7055

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

2betop
Copy link
Collaborator

@2betop 2betop commented Jun 1, 2023

What

🤖 Generated by Copilot at 25066c4

This pull request enhances the input-image component to support file size limits, cropping, and better error handling. It also updates the Chinese documentation and adds a new translation key for the cropped image label.

🤖 Generated by Copilot at 25066c4

input-image is the gate to hell
Drop your files and face the spell
Cropped or large, valid or not
You'll see the message of your lot

Why

How

🤖 Generated by Copilot at 25066c4

  • Add a new translation key File.imageAfterCrop to the locale files for German, English, and Chinese, with the corresponding values for cropped image. (link, link, link)
  • Update the Chinese documentation of the input-image component to match the English version, by changing the section title from 限制文件大小 to 限制文件宽度, and adding a new section 限制文件大小 with an example schema. (docs/zh-CN/components/form/input-image.md, link, link)
  • Add a new condition to the handleDrop method of the input-image component, to alert the user with error messages if the drop event contains an array of errors instead of files. This handles the case when the user tries to drop an invalid file type or size. (packages/amis/src/renderers/Form/InputImage.tsx, link)
  • Add another condition to the handleDrop method of the input-image component, to use the translation key File.imageAfterCrop as the file name if the file name is undefined. This handles the case when the user crops an image and drops it to the input-image component, which does not have a file name by default. (packages/amis/src/renderers/Form/InputImage.tsx, link)

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions bot added the fix label Jun 1, 2023
@lurunze1226 lurunze1226 merged commit f425646 into baidu:master Jun 1, 2023
5 checks passed
@2betop 2betop deleted the fix-input-image branch July 4, 2023 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants