-
Notifications
You must be signed in to change notification settings - Fork 0
ユーザー作成ページの実装 #148
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
ユーザー作成ページの実装 #148
Conversation
| <LoginSubmitButton isPending={isPending} /> | ||
| <LoginSubmitButton /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
消さなくてもよかったのでは?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これはクライアント側でログインのフック動かしてた時にそのフックを使った通信が通信中かどうかみるものやからactionの通信には反応せんはず
それにactionの通信はオーバーレイかかるようにしたしね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
作成するユーザは1人だから user-create/UserCreateComponent.tsx の方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
変更した
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
home.users.create の方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
変更した
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| validate: { | ||
| name: (value) => { | ||
| if (value.length < 1) { | ||
| return '名前は必須です'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ユーザー名は必須ですの方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
変更した
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/app/utils/password.ts
Outdated
| @@ -0,0 +1,11 @@ | |||
| export const passwordGen = () => { | |||
| let password = ''; | |||
| const passwordCheck = (element: string) => | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
関数名は動詞から始めた方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なんと言うか関数というよりフラグのような認識で作ってたからミスったわ
描き直します
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
変更した
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| successNotification('パスワードをコピーしました'); | ||
| copy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
順番逆の方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <Tooltip | ||
| label={ | ||
| copied ? 'パスワードをコピーしました' : 'パスワードをコピーする' | ||
| } | ||
| withArrow | ||
| position="right" | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| } | ||
| }; | ||
|
|
||
| const UserAddPage = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserCreatePage にしておこう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return ( | ||
| <Button | ||
| disabled | ||
| leftSection={<PasswordValidProgress counts={counts} />} | ||
| >{`パスワードの有効時間:${counts}秒`}</Button> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return ( | |
| <Button | |
| disabled | |
| leftSection={<PasswordValidProgress counts={counts} />} | |
| >{`パスワードの有効時間:${counts}秒`}</Button> | |
| ); | |
| }; | |
| const fmtedCounts = counts.toString().padStart(2, ' '); | |
| return ( | |
| <Button | |
| disabled | |
| leftSection={<PasswordValidProgress counts={counts} />} | |
| >{`パスワードの有効時間:${fmtedCounts}秒`}</Button> | |
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/app/utils/password.ts
Outdated
| @@ -0,0 +1,11 @@ | |||
| export const passwordGen = () => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
関数名は動詞から始めた方がいいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const handlePasswordGenButtonClick = () => { | ||
| const password = passwordGen(); | ||
| clipborad.copy(password); | ||
| // カウントダウンを正常に動かすために、29秒に設定 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「コールバック関数の実行時間を考慮して」の方が分かりやすいと思った
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| setCounts(counts - 1); | ||
| } | ||
| }, 1000); | ||
| return () => clearInterval(countDown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ページが閉じられた時に実行されることをコメントで書いておきたい
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
やったこと
確認した方法
pnpm iでアップデートpnpm run devで実行したスクリーンショット
自動生成したコード