Skip to content

Commit

Permalink
report.vueがダッシュボードに反映されるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
TakashimaAyaka authored and TakashimaAyaka committed Oct 3, 2022
1 parent a32d67f commit 4c4fe9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def index
@inactive_students = User.with_attached_avatar.inactive_students_and_trainees.order(last_activity_at: :desc)
@job_seeking_users = User.with_attached_avatar.job_seeking.includes(:reports, :products, :works, :course, :company)
@collegue_trainees = current_user.collegue_trainees&.with_attached_avatar&.includes(:reports, :products, :comments)
@reports = Report.list
display_events_on_dashboard
display_welcome_message_for_adviser
set_required_fields
Expand Down
1 change: 1 addition & 0 deletions app/javascript/components/report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import CommentUserIcon from 'comment-user-icon'
export default {
name: 'Report',
components: {
'comment-user-icon': CommentUserIcon
},
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import Watches from '../components/watches.vue'
import WatchToggle from '../components/watch-toggle.vue'
import UserMentorMemo from '../components/user_mentor_memo.vue'
import Talks from '../components/talks.vue'
import Report from '../components/report.vue'

const mounter = new VueMounter()
mounter.addComponent(Hello)
Expand All @@ -95,6 +96,7 @@ mounter.addComponent(Watches)
mounter.addComponent(WatchToggle)
mounter.addComponent(UserMentorMemo)
mounter.addComponent(Talks)
mounter.addComponent(Report)
mounter.mount()

// Support component names relative to this directory:
Expand Down
3 changes: 2 additions & 1 deletion app/views/users/_sad_emotion_report.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
= image_tag Report.faces['sad'], id: 'sad', alt: 'sad', class: 'card-header__title-emotion-image'
| のユーザー
.card-list
= render partial: 'reports/report', collection: reports, as: :report
div(data-vue="Report" data-vue-report="#{@report}")

0 comments on commit 4c4fe9a

Please sign in to comment.