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

会社個別 > 提出物一覧を vue.js 化した #4549

Merged
merged 14 commits into from
Apr 20, 2022

Conversation

clio209
Copy link
Contributor

@clio209 clio209 commented Apr 2, 2022

概要

会社個別ページ>提出物一覧をvue.js化しました。以下のPRを参考にしています。

変更前

_development__DAIMYO_Engineer_College所属ユーザーの提出物___FJORD_BOOT_CAMP(フィヨルドブートキャンプ)

変更後

_development__DAIMYO_Engineer_College所属ユーザーの提出物___FJORD_BOOT_CAMP(フィヨルドブートキャンプ)_と_メモ

確認方法

  1. ブランチfeature/convert-companies-products-to-vuejsl をローカルに取り込み、会社個別 > 提出物一覧画面でvue.js化されていることを確認する

@clio209 clio209 self-assigned this Apr 2, 2022
@clio209 clio209 force-pushed the feature/convert-companies-products-to-vuejs branch from 593cf9e to dc44442 Compare April 6, 2022 06:02
@clio209
Copy link
Contributor Author

clio209 commented Apr 6, 2022

@garammasala29 さん

@clio209 clio209 requested a review from garammasala29 April 6, 2022 12:28
@clio209 clio209 marked this pull request as ready for review April 7, 2022 22:06
Copy link
Contributor

@garammasala29 garammasala29 left a comment

Choose a reason for hiding this comment

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

@clio209 さん
お疲れ様です。レビュー依頼ありがとうございました!遅くなってしまい申し訳ありません💦
提出物に関してあまり触れてこなかったので、とても勉強になりました!
コメントしましたので、ご確認いただけたらと思います🙏


def index
@products = Product
.list
.order_for_list
.page(params[:page])
@products = @products.joins(:user).where(users: { company_id: params[:company_id] }) if params[:company_id]
Copy link
Contributor

Choose a reason for hiding this comment

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

なるほど、joinsメソッドでテーブルを結合させて絞り込んでいるんですね👍

.thread-list.a-card
= render partial: 'products/product', collection: @products, as: :product
= paginate @products
#js-company-products(company-id="#{@company.id}" data-title="#{title}" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#js-company-products(company-id="#{@company.id}" data-title="#{title}" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
#js-company-products(company-id="#{@company.id}" data-title="#{title}" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")

page-bodyを消すか、一段下げるかですかね🤔

<script>
import Pager from 'pager.vue'
import Product from 'product.vue'
export default {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export default {
export default {

公式ドキュメントなど1行空いていることが多い気がしますね

props: {
title: title,
companyID: companyID,
isMentor: isMentor === 'true',
Copy link
Contributor

Choose a reason for hiding this comment

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

文字列で渡すことでwarningを回避しているんですね!

Comment on lines 21 to 22
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')

こちらもcontainerの中のような気がします。

(this.params.tag ? `tags/${this.params.tag}` : '') +
`?page=${this.currentPage}` +
(this.params.target ? `&target=${this.params.target}` : '') +
(this.params.watch ? `&watch=${this.params.watch}` : '') +
Copy link
Contributor

Choose a reason for hiding this comment

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

tagtargetwatchなどユーザーに関連するものですかね🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

コメントありがとうございます。削除いたしました。

Comment on lines 48 to 50
targetName() {
return this.currentTag || this.currentTarget
},
Copy link
Contributor

Choose a reason for hiding this comment

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

今回使用されていないのでは…と思います!(多分company-userから流用してきた流れかと😄)
こちら以外にもこのvueファイルで不必要なメソッドなどがありそうなので、一度見返していただけたらと思います🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

有難うございます!!不必要な箇所を作事いたしました🙇‍♂️


<script>
import Pager from 'pager.vue'
import Product from 'product.vue'
Copy link
Contributor

Choose a reason for hiding this comment

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

Productをインポートすることで提出者orメンターが出てしまうので、何かしら対応が必要になってくるのかな〜と思いました💦
スクリーンショット

Copy link
Contributor Author

Choose a reason for hiding this comment

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

コメント有難うございます!komagataさんに確認いたします。
@komagata さん
こちら、この表記(提出者、メンター)が表示されても問題ないでしょうか?元来誰がコメントしているのかまでアイコンで見えることから、この表記が出ても論理的に問題ないのかなとは思います。またはこの表記を消した方が良いでしょうか?

Copy link
Member

Choose a reason for hiding this comment

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

@clio209 こちらそのままで問題ございません〜

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@garammasala29 さん
レビュー有難うございます!修正しましたので、お時間ある時にご確認いただけますと幸いです。

@clio209 clio209 force-pushed the feature/convert-companies-products-to-vuejs branch 2 times, most recently from fb36639 to a735df6 Compare April 14, 2022 04:04
Copy link
Contributor

@garammasala29 garammasala29 left a comment

Choose a reason for hiding this comment

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

@clio209 さん
お疲れ様です。ご修正ありがとうございました😄
少しコメントしていますが、LGTMとさせていただきます👍

@@ -9,4 +9,4 @@ header.page-header
- if current_user.admin? || current_user.mentor?
= render 'products/tabs'

#js-products(data-title="#{title}" data-selected-tab="all" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
#js-products(data-title="#{title}" data-selected-tab="all" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
Copy link
Contributor

Choose a reason for hiding this comment

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

今回のissueに関連はないかなと思うので、差分が出ていて気になりました!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

すいません、毎回コンフリクトが起こり、色々弄って先祖返りしたりしたためかと思われます。。恥💦💦

if (this.params.target) {
return (
location.pathname +
`?target=${this.params.target}` +
Copy link
Contributor

Choose a reason for hiding this comment

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

ここにもまだtargetが残っていそうですね🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご確認本当にありがとうございます!!

@clio209 clio209 requested a review from komagata April 14, 2022 09:08
@clio209
Copy link
Contributor Author

clio209 commented Apr 14, 2022

@komagata
お手隙の際にご確認頂けますと幸いです🙇‍♂️

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.

conflictの修正をお願いします〜

@clio209 clio209 force-pushed the feature/convert-companies-products-to-vuejs branch from 7823d1c to 5473768 Compare April 17, 2022 08:15
@clio209 clio209 force-pushed the feature/convert-companies-products-to-vuejs branch from e2a76a6 to df60ae1 Compare April 18, 2022 06:32
@clio209
Copy link
Contributor Author

clio209 commented Apr 18, 2022

@komagata
conflictの修正を行いました。お手隙の際にご確認いただけますと幸いです。

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 ac586a8 into main Apr 20, 2022
@komagata komagata deleted the feature/convert-companies-products-to-vuejs branch April 20, 2022 04:45
@github-actions github-actions bot mentioned this pull request Apr 20, 2022
20 tasks
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.

3 participants