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

招待URL作成時に研修生を支払い方法別に選択可能にした・研修生の場合は会員登録時の支払い方法の指定を必須にした #8013

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Commits on Aug 21, 2024

  1. Configuration menu
    Copy the full SHA
    5bee5cd View commit details
    Browse the repository at this point in the history
  2. 研修生の登録フォームに支払い方法のチェックボックスを追加

    ・これまで管理者用の項目だった「請求書払いの設定」のUIを削除し、支払い方法(請求書orクレジットカード)を選択するためのチェックボックスを一般ユーザー向けの項目として新たに作成した。併せて、登録フォームに遷移する前の招待URL作成ページのロール欄でどれを選択したかによって、登録フォームが表示された初期状態でどちらの支払い方法にチェックが入っているか(または入っていないか)を振り分けるように修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    0cb5fec View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d049286 View commit details
    Browse the repository at this point in the history
  4. インスタンス変数(@pay_by_invoice、@pay_by_credit_card)を廃止・カード番号入力フォームの表示切り替えを実…

    …装・チェックボックスのパーシャルの名称を変更
    
    ・コントローラーで研修生の支払い方法に関する情報を@pay_by_invoiceと@pay_by_credit_cardに格納していたが、params[:role]の参照で事足りるため、これら二つのインスタンス変数は廃止した。
    
    ・「研修生(支払い方法を選択)」を選んだ場合は参加登録フォーム上でチェックボックスのチェックを変更できることから、カード番号入力フォームの表示/非表示を切り替えができる必要があったため実装した。
    
    ・チェックボックスのパーシャルは既存のUIを流用したため名称が_invoice_paymentのままになっていたが、実態に即していないため変更した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    b57659b View commit details
    Browse the repository at this point in the history
  5. 不要なidを削除した

    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    6ba33e9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b97344f View commit details
    Browse the repository at this point in the history
  7. 「請求書払い」のチェックボックスにバリデーションを追加・ビューでparamsを呼び出さないように変更・UsersControllerのne…

    …wアクション内の条件分岐の書き方を変更
    
        ・招待URL作成ページで「研修生(請求書払い)」を選択した場合は登録フォームの「請求書払い」のチェックボックスはtrueでなくてはならないため、そ
    のバリデーションを追加した。
    
        ・ビューでparamsを直接呼び出すとURLに含まれるパラメーターに変更があった場合の対応が煩雑になる恐れがあるため、ビューで必要な情報はコントロー
    ラーでインスタンス変数に代入して使用することとした。
    
        ・UsersControllerのnewアクションではparams[:role]の値によって分岐する処理をif文で記述していたが、case文で記述した方が可読性が高いと判断した
    ため変更した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    bf5a712 View commit details
    Browse the repository at this point in the history
  8. card-form-display-switcher内のクレジットカードのチェックボックスの取得方法を変更

    ・クレジットカードのチェックボックスのDOM要素を取得する際getElementsByNameを使用していたが、対象の要素が見つからない場合でも空のNodeListが返ってしまい、条件分岐が正しく動作しないため、要素が見つからない場合にnullを返すquerySelectorに置き換えた。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    bc0c8cc View commit details
    Browse the repository at this point in the history
  9. 選択された支払い方法のチェックを外せないようにした

    ・招待URL作成ページで選択された支払い方法のチェックボックスは登録フォームが表示された時点でチェック済みになっているが、これまではそのチェックを外すことができてしまっていた。そのため、誤操作でチェックを外してしまい無駄にバリデーションエラーになる可能性も考えられたため、ユーザーがチェックを外せないようにした。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    7b7cfdf View commit details
    Browse the repository at this point in the history
  10. 「請求書払い」チェックボックスのバリデーションエラーが起きて登録フォームが再表示された際にチェックボックスが反応しなくなる不具合を解消

    ・バリデーションで引っかかった場合はrenderで再度newテンプレートが呼び出されるが、招待URL作成ページからの遷移でない場合は必要なパラメータがURLに含まれておらず、チェックボックスが操作不能になる不具合が出ていたため修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    406c6b6 View commit details
    Browse the repository at this point in the history
  11. 「研修生(支払い方法を選択)」が選択された場合のチェックボックスの挙動の制御を追加

    ・招待URL作成ページにて「研修生(支払い方法を選択)」が選択された場合、登録ページのチェックボックスの挙動が、
      (1)「請求書払い」と「クレジットカード払い」のいずれか一方しかチェックできない、
      (2)「クレジットカード払い」が選択されている時のみカード情報の入力フォームを表示する、
    となるように実装した。
    それに伴い、カード情報の入力フォームの表示/非表示の制御と2種類のチェックボックスの状態制御を同時に行う必要があったため、card-form-display-switcher.jsで行っていた処理をpayment-methods-check-boxes.jsに統合した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    abca2af View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    5833942 View commit details
    Browse the repository at this point in the history
  13. クレジットカード情報入力欄のバリデーションを変更

    ・DOMツリーにクレジットカード情報の入力フォームが存在すると、カード情報が空欄の場合や有効な番号でない場合にフォーム全体の送信を止める機能が実装されているが、招待URL作成ページで「研修生(支払い方法を選択)」を選んだ場合、クレジットカードフォームが空欄の状態であってもフォームが送信されなければならない(請求書払いを選択している)状況があり得ることになるため、「クレジットカード払い」のチェックボックスにチェックがない場合には当該バリデーションを無効化するように変更した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    7bfebcf View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    b72a0c2 View commit details
    Browse the repository at this point in the history
  15. Stripeのカードフォームが正しくマウントされていなかったのを修正

    ・「研修生(クレジットカード払い)」を選択した場合の登録フォームでStripeのカード番号の入力欄が正しくマウントされていなかったため修正。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    8903062 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    78ea52f View commit details
    Browse the repository at this point in the history
  17. 招待URL以外から会員登録ページへアクセスできない不具合を修正

    ・users#newアクションの中でuser_paramsを呼び出してしまっていたことで、/users/newなどのパラメーターを持たないか不十分なURLではParameterMissingエラーが発生し、アクセスできない状況となっていたため修正した。
    併せて、変数@ROLEは廃止し、@userのパラメーターとして扱うことでパーシャルに渡す変数の削減も行った。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    3bd04aa View commit details
    Browse the repository at this point in the history
  18. 「研修生(請求書払い)」の場合に登録フォームが送信できない不具合を修正

    ・支払い方法を選択できる場合の登録フォームにあるselectableCreditCardCheckBoxにチェックが入っているかどうかがフォームをそのまま送信するかクレジットカードのバリデーションを通すかの条件となっており、請求書払いが確定している登録フォーム上では存在しない要素のプロパティを呼び出すことになってしまいエラーとなっていたため修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    c297a3f View commit details
    Browse the repository at this point in the history
  19. 「研修生(クレジットカード払い)」の場合にカード番号を入力していなくてもフォームが送信できてしまう不具合を修正

    ・クレジットカードのバリデーションを作動させる条件にcheckedCreditCardCheckBoxが含まれておらず正常に動作していなかったため修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    bfcfd43 View commit details
    Browse the repository at this point in the history
  20. 会員登録ページのタイトル表示不具合を修正

    ・メンター用の登録フォームの場合は「FBCメンター参加登録」と表示されていなければならないところ、一般受講生と同じ「FBC参加登録」となってしまっていたため修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    a549e57 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    22c82cb View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    c597245 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    7b9a830 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    a9cb8c8 View commit details
    Browse the repository at this point in the history
  25. 研修生がクレジットカードを使用して参加登録する際のテストを修正

    ・クレジットカード情報の入力を伴う他のテストに倣ってVCRでログをとるように修正した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    5e99d94 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    f0b2445 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    9a5022e View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    2a9ae53 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    6cef309 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    83c4b31 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    380de29 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    5684ba8 View commit details
    Browse the repository at this point in the history
  33. keepCheckBoxCheckedでチェックボックスの存在確認をしている部分を修正

    ・引数checkBoxesの要素である二つのチェックボックスのうち少なくとも一つは必ずnullが渡ってくるためif文で存在確認をしていたが、オプショナルチェーン演算子(?.)を使用するほうがより簡潔に書けるため変更した。
    ham-cap committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    2d50f53 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    c6b2cc9 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    fcee79a View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    0225806 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    e6d767c View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    36497e4 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    7c76d88 View commit details
    Browse the repository at this point in the history