console icon indicating copy to clipboard operation
console copied to clipboard

Remove leading and trailing spaces from the value of the URL type input elements

Open FanZeros opened this issue 2 years ago • 13 comments

What type of PR is this?

/kind bug /kind optimization

What this PR does / why we need it:

对admin的部分input区域进行trim,包括地址、前缀等 避免输入部分的前后空格导致页面出错

Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/1921 Fixes https://github.com/halo-dev/halo/issues/1850

Screenshots:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

FanZeros avatar May 20 '22 08:05 FanZeros

@FanZeros: The label(s) kind/optimization cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind bug /kind optimization

What this PR does / why we need it:

对admin的部分input区域进行trim,包括地址、前缀等 避免输入部分的前后空格导致页面出错

Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/1921 Fixes https://github.com/halo-dev/halo/issues/1850

Screenshots:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

f2c-ci-robot[bot] avatar May 20 '22 08:05 f2c-ci-robot[bot]

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign ruibaby after the PR has been reviewed. You can assign the PR to them by writing /assign @ruibaby in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

f2c-ci-robot[bot] avatar May 20 '22 08:05 f2c-ci-robot[bot]

貌似这次PR把我上次改的内容也加进去了 #568

FanZeros avatar May 20 '22 09:05 FanZeros

貌似这次PR把我上次改的内容也加进去了 #568

可以通过如下方式优化一下commit

git fetch upstream
git reset --soft upstream/master
git add .
// check the changes
git commit -m "your message here"
git push origin HEAD -f

guqing avatar May 20 '22 10:05 guqing

好的,按着流程做了一遍

FanZeros avatar May 20 '22 11:05 FanZeros

hi @FanZeros,你的commit message需要规范一下,我们代码审查通过后是bot自动合并,如果你的commit message不规范就需要我们手动干预才能合并,增加了工作量,建议你使用语义化的简短信息,使用英文概述此次提交所做的事情,你可以参考 halo 的历史提交信息来写 https://github.com/halo-dev/halo/commits/master

guqing avatar May 20 '22 11:05 guqing

/retitle Remove leading and trailing spaces from the value of the URL type input elements

guqing avatar May 20 '22 12:05 guqing

懂了,麻烦你了

FanZeros avatar May 20 '22 12:05 FanZeros

/cc @halo-dev/sig-halo-admin

建议实际体验一下修改之后的输入体验。看看是否会对输入造成影响。个人认为最好的解决方式是添加表单验证规则,提示使用者不能包含前后空格,或者允许输入空格,但在提交的时候手动 trim 一下。

ruibaby avatar May 24 '22 11:05 ruibaby

/cc @halo-dev/sig-halo-admin

建议实际体验一下修改之后的输入体验。看看是否会对输入造成影响。个人认为最好的解决方式是添加表单验证规则,提示使用者不能包含前后空格,或者允许输入空格,但在提交的时候手动 trim 一下。

体验了下,目前没有发现会对输入造成影响。表单验证规则这一部分如果必要的话我最近会尝试一下相关实现。

FanZeros avatar May 24 '22 15:05 FanZeros

体验了下,目前没有发现会对输入造成影响。表单验证规则这一部分如果必要的话我最近会尝试一下相关实现。

主要考虑到使用者可能不明白为什么输入空格会没有反应,如果使用表单验证的话,可以比较直观的知道。

ruibaby avatar May 24 '22 15:05 ruibaby

体验了下,目前没有发现会对输入造成影响。表单验证规则这一部分如果必要的话我最近会尝试一下相关实现。

主要考虑到使用者可能不明白为什么输入空格会没有反应,如果使用表单验证的话,可以比较直观的知道。

那些位置不应该包含空格的输入,感觉使用者不会特意去输入空格吧。不过你说的也很有道理

FanZeros avatar May 25 '22 04:05 FanZeros

/ping @halo-dev/sig-halo-admin

JohnNiang avatar Jul 12 '22 15:07 JohnNiang

hi @FanZeros,你的commit message需要规范一下,我们代码审查通过后是bot自动合并,如果你的commit message不规范就需要我们手动干预才能合并,增加了工作量,建议你使用语义化的简短信息,使用英文概述此次提交所做的事情,你可以参考 halo 的历史提交信息来写 https://github.com/halo-dev/halo/commits/master

可以引入commitlint 配合 husky在本地提交前做校验。

wzrove avatar Nov 14 '22 03:11 wzrove