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

管理ページの企業一覧を非React化した #8230

Merged
merged 7 commits into from
Dec 15, 2024

Conversation

Ryooo-k
Copy link
Contributor

@Ryooo-k Ryooo-k commented Nov 29, 2024

Issue

概要

管理ページの企業一覧ページを非React化しました。

views/admin/companies/index.html.slimで使用されているReactコンポーネントAdminCompanies.jsxを削除し、view内で完結するようにしました。

スクリーンショット 2024-11-29 18 32 31

変更確認方法

  1. chore/company-list-non-vue-reactをローカルに取り込む
    i. git fetch origin pull/8230/head:chore/company-list-non-vue-react
    ii. git checkout chore/company-list-non-vue-react
  2. foreman start -f Procfile.dev でローカルサーバーを立ち上げる
  3. ユーザー名komagata、パスワードtesttestでログインする
  4. 企業一覧ページにアクセスする
  5. 下記事項を確認する
  • 1ページ目に企業が20社分表示されているか確認する
  • 2ページ目に企業が8社分表示されているか確認する
  • 企業名をクリックすると詳細ページに画面遷移するか確認する

スクリーンショット 2024-11-29 18 49 02

  • アドバイザー招待リンクをクリックするとFBCアドバイザー参加登録画面になるか確認する

スクリーンショット 2024-11-29 18 53 12

  • 研修生招待リンクをクリックするとFBC参加登録画面になるか確認する

スクリーンショット 2024-11-29 18 54 32

  • ページネーションボタンが機能しているか確認する

スクリーンショット 2024-11-29 18 56 27

  • 1ページ目と2ページ目の「名前」「ロゴ」「ウェブサイト」が下記画像と同じ順番・画像・文字列であるか確認する

スクリーンショット 2024-11-29 18 58 05

Screenshot

今回の変更に伴う画面変更はありません。

@Ryooo-k Ryooo-k self-assigned this Nov 29, 2024
@Ryooo-k Ryooo-k marked this pull request as ready for review November 29, 2024 10:17
@Ryooo-k
Copy link
Contributor Author

Ryooo-k commented Nov 29, 2024

@hagiya0121
お疲れ様です!
こちらのレビューお願いしたいのですが可能でしょうか?🙏

@Ryooo-k Ryooo-k requested a review from hagiya0121 November 29, 2024 10:22
@hagiya0121
Copy link
Contributor

@Ryooo-k
了解です!三日以内には返せると思います🙂

Copy link
Contributor

@hagiya0121 hagiya0121 left a comment

Choose a reason for hiding this comment

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

@Ryooo-k
動作に問題はありませんでした。気になった点をコメントしたので確認お願いします🙏

Comment on lines 47 to 53
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href=company.adviser_sign_up_url
i.fa-solid.fa-user-plus
td.admin-table__item-value.is-text-align-center
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href=company.trainee_sign_up_url
i.fa-solid.fa-user-plus
td.admin-table__item-value.is-text-align-center
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href="/admin/companies/#{company.id}/edit"
Copy link
Contributor

Choose a reason for hiding this comment

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

研修生招待リンク編集のリンクのtitleアドバイザーサインアップURLなのは変だと思いました。
もともとのReactのコード自体が間違っているようです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご指摘ありがとうございます!修正時に気づくべきでした😅
titleはリンク先のタイトル名に修正いたします。

Comment on lines 42 to 53
a href="/companies/#{company.id}" = company.name
td.admin-table__item-value
img.admin-table__item-logo-image src=company.logo_url
td.admin-table__item-value = company.website
td.admin-table__item-value.is-text-align-center
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href=company.adviser_sign_up_url
i.fa-solid.fa-user-plus
td.admin-table__item-value.is-text-align-center
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href=company.trainee_sign_up_url
i.fa-solid.fa-user-plus
td.admin-table__item-value.is-text-align-center
a.a-button.is-sm.is-secondary.is-icon title="アドバイザーサインアップURL" href="/admin/companies/#{company.id}/edit"
Copy link
Contributor

@hagiya0121 hagiya0121 Nov 30, 2024

Choose a reason for hiding this comment

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

aタグではなくlink_toを使った方がいいと思います🤔

- @companies.each do |company|
tr.admin-table__item
td.admin-table__item-value.company-name
a href="/companies/#{company.id}" = company.name
Copy link
Contributor

Choose a reason for hiding this comment

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

ここと53行目もURLヘルパーメゾッドが使えると思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

link_toに変更します。また"/companies/#{company.id}"のURIをcompany_path(company)に変換できるので、これも合わせて修正しておきます。

td.admin-table__item-value.company-name
a href="/companies/#{company.id}" = company.name
td.admin-table__item-value
img.admin-table__item-logo-image src=company.logo_url
Copy link
Contributor

Choose a reason for hiding this comment

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

image_tagが使えると思います

Copy link
Contributor

Choose a reason for hiding this comment

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

app/controllers/api/admin/companies_controller.rbapp/views/api/admin/companies/index.json.jbuildertest/integration/api/companies_test.rbも削除していいと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご指摘ありがとうございます。app/views/api/admin/companies/_company.json.jbuilderも削除して問題なさそうですので、削除しておきます。

@@ -27,4 +27,29 @@ main.page-main
hr.a-border
.page-body
.container.is-lg
= react_component 'AdminCompanies'
div[data-testid="admin-companies"]
Copy link
Contributor

Choose a reason for hiding this comment

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

reactではないのでdata-testid="admin-companies"はいらないのかなあと思いました🤔
テストファイルでwithin "[data-testid='admin-companies']" doの形でスコープを限定していて、消してしまってもテストは通るのですがなぜスコープを限定しているのかはよく分からないです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

確かにdata-testid="admin-companiesがなくてもテストは通りますね🧐このDocsを見てテストを安定させてるのかと理解してましたが、SPAだとあまり気にしなくて良さそうですね。
なのでテストコードと共にdata-testid="admin-companies"は削除しておきます。

Copy link
Contributor

Choose a reason for hiding this comment

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

不要なコメントが残っています。

@Ryooo-k
Copy link
Contributor Author

Ryooo-k commented Dec 3, 2024

@hagiya0121
ご確認ありがとうございます!
修正いたしましたので再度ご確認お願いいたします。

Copy link
Contributor

@hagiya0121 hagiya0121 left a comment

Choose a reason for hiding this comment

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

@Ryooo-k
修正お疲れ様です!
問題なかったのでApproveします👌

@Ryooo-k
Copy link
Contributor Author

Ryooo-k commented Dec 4, 2024

@hagiya0121
ご確認ありがとうございます!

@komagata
メンバーレビューが完了しましたので、レビューをお願いいたします。

@Ryooo-k Ryooo-k requested a review from komagata December 4, 2024 01:25
Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

確認させて頂きました。OKです〜🙆‍♂️

@komagata komagata merged commit 559c745 into main Dec 15, 2024
4 checks passed
@komagata komagata deleted the chore/company-list-non-vue-react branch December 15, 2024 23:33
@github-actions github-actions bot mentioned this pull request Dec 15, 2024
32 tasks
@machida
Copy link
Member

machida commented Feb 4, 2025

@Ryooo-k 本番で確認しましたー🙆‍♂️

@Ryooo-k
Copy link
Contributor Author

Ryooo-k commented Feb 4, 2025

@machida
ご確認ありがとうございます!
issueはcloseしておきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants