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

reports/reportのvueをvue mounterに対応させた #5344

Merged
merged 5 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
pager(v-bind='pagerProps')
</template>
<script>
import Report from 'report.vue'
import Report from 'components/report.vue'
import UnconfirmedLink from 'unconfirmed_link.vue'
import LoadingListPlaceholder from 'loading-list-placeholder.vue'
import Pager from 'pager.vue'

export default {
name: 'Reports',
components: {
report: Report,
'unconfirmed-link': UnconfirmedLink,
Expand All @@ -52,11 +53,11 @@ export default {
},
props: {
userId: {
type: String,
type: Number,
default: null
},
companyId: {
type: String,
type: Number,
default: null
},
limit: {
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import '../learning-status.js'
import '../check.js'
import '../check-stamp.js'
import '../unconfirmed-links-open.js'
import '../reports.js'
import '../comments.js'
import '../notifications_bell.js'
import '../question-page.js'
Expand Down Expand Up @@ -78,6 +77,7 @@ import Books from '../components/books.vue'
import Pages from '../components/pages.vue'
import Questions from '../components/questions.vue'
import WorriedUsers from '../components/worried-users.vue'
import Reports from '../components/reports.vue'

const mounter = new VueMounter()
mounter.addComponent(Hello)
Expand All @@ -87,4 +87,5 @@ mounter.addComponent(Books)
mounter.addComponent(Pages)
mounter.addComponent(Questions)
mounter.addComponent(WorriedUsers)
mounter.addComponent(Reports)
mounter.mount()
18 changes: 0 additions & 18 deletions app/javascript/reports.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/companies/reports/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ header.page-header

.page-body
.container.is-md
#js-reports(company-id="#{@company.id}")
div(data-vue="Reports" data-vue-company-id:number="#{@company.id}")
2 changes: 1 addition & 1 deletion app/views/current_user/reports/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ header.page-header

.page-body
.container.is-md
#js-reports(data-user-id="#{current_user.id}")
div(data-vue="Reports" data-vue-user-id:number="#{current_user.id}")
- if current_user.reports.present?
.form-actions
ul.form-actions__items
Expand Down
2 changes: 1 addition & 1 deletion app/views/reports/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ header.page-header
= label_tag :practice_id, 'プラクティスで絞り込む', class: 'a-form-label'
= select_tag :practice_id, options_from_collection_for_select(current_user.practices, :id, :title, selected: params[:practice_id]), include_blank: '全ての日報を表示', onchange: 'this.form.submit()', id: 'js-choices-single-select'

#js-reports
div(data-vue="Reports")
4 changes: 2 additions & 2 deletions app/views/reports/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ header.page-header
| 提出物
.side-tabs-contents
.side-tabs-contents__item#side-tabs-content-1
#js-reports(data-user-id="#{@report.user.id}" data-limit="10")
div(data-vue="Reports" data-vue-user-id:number="#{@report.user.id}" data-vue-limit="10")
.side-tabs-contents__item#side-tabs-content-2.is-only-mentor
.user-info
= render 'users/user_secret_attributes', user: @report.user
Expand All @@ -181,7 +181,7 @@ header.page-header
.o-empty-message__text
| 提出物はまだありません。
- else
#js-reports(data-user-id="#{@report.user.id}" data-limit="10")
div(data-vue="Reports" data-vue-user-id:number="#{@report.user.id}" data-vue-limit="10")

- if flash[:notify_help] && flash[:celebrate_report_count]
= render '/shared/modal', id: 'modal-notify-help', modal_title: '🎉 おめでとう!', auto_show: true
Expand Down
2 changes: 1 addition & 1 deletion app/views/reports/unchecked/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ header.page-header

.page-body
.container.is-md
#js-reports
div(data-vue="Reports")
2 changes: 1 addition & 1 deletion app/views/talks/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ header.page-header
class: 'a-button is-sm is-danger is-block'
#js-user-mentor-memo(data-user-id="#{@user.id}" data-products-mode="#{true}")
.side-tabs-contents__item#side-tabs-content-2
#js-reports(data-user-id="#{@user.id}" data-limit="10")
div(data-vue="Reports" data-vue-user-id:number="#{@user.id}" data-vue-limit="10")
2 changes: 1 addition & 1 deletion app/views/users/reports/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ header.page-header

.page-body
.container.is-md
#js-reports data-user-id="#{params[:user_id]}"
div(data-vue="Reports" data-vue-user-id:number="#{params[:user_id]}")
5 changes: 2 additions & 3 deletions test/system/api/check/reports_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ class Check::ReportsTest < ApplicationSystemTestCase
click_button '日報を確認'
end
click_button '日報の確認を取り消す'
within('.page-content') do
assert_no_text '確認済'
end

assert_button '日報を確認'
assert_no_css 'stamp stamp-approve'
end

test 'comment and check report' do
Expand Down