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

imprv: Behavior when creating first user fails #8801

Merged

Conversation

miya
Copy link
Member

@miya miya commented May 13, 2024

Task

#146003 [v7] [issue] 最初のユーザーを作成する時に8文字以内のパスワードで登録しようとすると「インストールに失敗しました...」というトースターのみが表示される
#146005 修正

Demo

2024-05-13.16.37.12.mov

@miya miya requested a review from yuki-takei May 13, 2024 07:31
@miya miya self-assigned this May 13, 2024
@miya miya linked an issue May 13, 2024 that may be closed by this pull request
@@ -27,11 +27,17 @@ module.exports = (crowi: Crowi): Router => {
const router = express.Router();

// eslint-disable-next-line max-len
router.post('/', registerRules(), apiV3FormValidator, addActivity, async(req: FormRequest, res: ApiV3Response) => {
router.post('/', registerRules(), registerValidation, addActivity, async(req: FormRequest, res: ApiV3Response) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

apiV3FormValidator middleware ではなく registerRules() に対応する registerValidation middleware を利用するように変更。

if (!req.form.isValid) {
const errors = req.form.errors;
return res.apiv3Err(errors, 400);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

/register にならって追記。Validation に失敗したらここでエラーを返却する。

if (!req.form.isValid) {
const errors = req.form.errors;
return res.apiv3Err(errors, 400);
}

))}
</p>
)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

LoginForm.tsx にならってサーバーからのエラー結果を form 上部のアラートに表示するようにした

{
registerErrors != null && registerErrors.length > 0 && (
<p className="alert alert-danger">
{registerErrors.map(err => (
<span>
{t(err.message)}<br />
</span>
))}
</p>
)
}

Copy link

reg-suit bot commented May 13, 2024

reg-suit detected visual differences.

Check this report, and review them.

🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴

⚫⚫⚫⚫⚫⚫⚫⚫⚫
🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵

What do the circles mean? The number of circles represent the number of changed images.
🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items

How can I change the check status? If reviewers approve this PR, the reg context status will be green automatically.

@yuki-takei yuki-takei merged commit 48ab3f3 into master May 13, 2024
22 of 26 checks passed
@yuki-takei yuki-takei deleted the imprv/146005-behavior-when-creating-first-user-fails branch May 13, 2024 09:26
@github-actions github-actions bot mentioned this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

[7.0.4] GROWIのインストールに失敗しました。
2 participants