Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

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

Closed
wants to merge 2 commits into from

Conversation

FanZeros
Copy link

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 halo-dev/halo#1921
Fixes halo-dev/halo#1850

Screenshots:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@auto-assign auto-assign bot requested review from guqing, JohnNiang, LIlGG and ruibaby May 20, 2022 08:53
@f2c-ci-robot f2c-ci-robot bot added the release-note-none Denotes a PR that doesn't merit a release note. label May 20, 2022
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented May 20, 2022

@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 halo-dev/halo#1921
Fixes halo-dev/halo#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 f2c-ci-robot bot added the kind/bug Categorizes issue or PR as related to a bug. label May 20, 2022
@f2c-ci-robot f2c-ci-robot bot requested review from QuentinHsu and wan92hen May 20, 2022 08:53
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented May 20, 2022

[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

@FanZeros FanZeros changed the title 对输出区域进行trim 对输入区域进行trim May 20, 2022
@FanZeros
Copy link
Author

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

@guqing
Copy link
Member

guqing commented May 20, 2022

貌似这次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

@FanZeros
Copy link
Author

好的,按着流程做了一遍

@@ -1,76 +0,0 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你不错误的删除了这个文件,需要撤销对该文件的更改

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@guqing
Copy link
Member

guqing commented May 20, 2022

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

@guqing
Copy link
Member

guqing commented May 20, 2022

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

@f2c-ci-robot f2c-ci-robot bot changed the title 对输入区域进行trim Remove leading and trailing spaces from the value of the URL type input elements May 20, 2022
This reverts commit 4c16f62.
@FanZeros
Copy link
Author

懂了,麻烦你了

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ruibaby
Copy link
Member

ruibaby commented May 24, 2022

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

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

@FanZeros
Copy link
Author

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

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

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

@ruibaby
Copy link
Member

ruibaby commented May 24, 2022

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

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

@FanZeros
Copy link
Author

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

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

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

@JohnNiang
Copy link
Member

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

@wzrove
Copy link
Member

wzrove commented Nov 14, 2022

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

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

@ruibaby ruibaby closed this Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
5 participants