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

Release 2024-06-04 14:22:37 +0000 #7802

Merged
merged 82 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9fe0f08
view_componentをインストール
reckyy Apr 13, 2024
0196cee
viewcomponentを用いたrenderに変更
reckyy Apr 13, 2024
be5f170
ロジックをメソッド化
reckyy Apr 14, 2024
87dc23a
用いられていないメソッドを無視する設定を追加
reckyy Apr 14, 2024
32a7f2b
unconfirmed_link.vue, unconfirmed_links_open_button.vueを削除
naokinaokiboo Apr 15, 2024
f486359
products.vueの不要コードの削除・整理
naokinaokiboo Apr 15, 2024
ece987a
不要コードの削除に伴い、参照されなくなったVueを削除
naokinaokiboo Apr 15, 2024
3510f6b
ディレクトリ名変更
reckyy Apr 20, 2024
67ae8d7
resizeのオプションを変更して仕様に満たす方法にした
kyokucho1989 Apr 21, 2024
86f9e40
/reportsのユーザーアイコンにroleを表す色枠が表示されないバグを修正
hirano-vm4 Mar 17, 2024
08e2eb3
/productsのユーザーアイコンにroleを表す色枠が表示されないバグを修正
hirano-vm4 Mar 17, 2024
4985a96
/external_entriesのユーザーアイコンにroleを表す色枠が表示されないバグを修正
hirano-vm4 Mar 17, 2024
e4f0627
/reportsでユーザーロール情報が取得できるように変更
hirano-vm4 Mar 29, 2024
8cb8880
ユーザー一覧ページの絞り込みタブに関するシステムテストを追加
unikounio Mar 30, 2024
9a6939f
ユーザー一覧ページの「現役生」タブを「現役 + 研修生」タブに変更
unikounio Mar 30, 2024
e61fdac
ユーザー一覧ページの絞り込みタブに「現役生」を追加
unikounio Mar 30, 2024
6984d3c
ユーザー一覧ページの絞り込みタブの並び替え
unikounio Mar 30, 2024
23acf29
メンター or 管理者でログインしたときだけユーザー一覧の期生別(全員)ページに現役生、卒業生、退会者の人数を表示する
a-terumoto-gs Apr 19, 2024
ca83a29
システムテスト追加
a-terumoto-gs Apr 19, 2024
9e502d0
期生別一覧のデザインを調整
machida May 1, 2024
fdbfb10
休会中の人数を現役生の人数に含まないようにした、他の追加された表示に合わせてテスト修正
a-terumoto-gs May 2, 2024
2de7c54
共通化できる箇所をメソッドとして切り出し、合わせてメソッドテストを追加
a-terumoto-gs May 7, 2024
632cfcb
コード整形
a-terumoto-gs May 7, 2024
fd1a660
「全ての日報」を非React化
naokinaokiboo May 8, 2024
efa152b
使用されていなかったコードを削除
naokinaokiboo May 8, 2024
2b10ce6
「未チェックの日報」を非React化
naokinaokiboo May 8, 2024
d45da03
「未チェックの日報を一括で開く」ボタンの見た目をReactでの実装に合わせる
naokinaokiboo May 8, 2024
8b87f1e
文字列をシンボルに変更
a-terumoto-gs May 9, 2024
3771064
WIP状態の日報を提出する際にエラーが発生した場合に関するシステムテストを追加
unikounio May 9, 2024
e0de854
WIP状態の日報を提出する際にエラーが発生した場合のバグを解消
unikounio May 9, 2024
08658e7
userのroleとjobで絞り込みできるように実装
reckyy Feb 21, 2024
6a50161
ヘルパーメソッド作成
reckyy Feb 21, 2024
175d024
休会+会社員の絞り込みの正常系テスト追加
reckyy Feb 21, 2024
86b3622
ユーザー絞り込みにデザイン
machida Mar 5, 2024
b1ac533
職業でも全員検索できるように追加
reckyy Mar 6, 2024
6960b37
空行を削除
reckyy Mar 6, 2024
cbd4433
ヘルパーメソッドのテスト追加
reckyy Mar 8, 2024
62c8958
定数をfreeze
reckyy Mar 11, 2024
d654776
コードの意図を説明するコメント追加
reckyy Mar 11, 2024
20af5b9
正常にテストできていなかったため、修正
reckyy Mar 11, 2024
d82379b
jobの検索ロジックをcontrollerからmodelに移行
reckyy Mar 25, 2024
768eb2c
testの命名を変更
reckyy Apr 20, 2024
d7fe6a0
渡しそびれていたインスタンス変数を追記
reckyy Apr 28, 2024
ae62b46
Bump nokogiri from 1.16.2 to 1.16.5
dependabot[bot] May 13, 2024
e28230e
メンターメニューの中身を追加
Shrimprin May 15, 2024
261f18e
不要な単語を削除
reckyy May 16, 2024
5b9c09d
Bump rexml from 3.2.6 to 3.2.8
dependabot[bot] May 16, 2024
f4d7334
ユーザー人数表示箇所を括りだして繰り返し処理の形に
a-terumoto-gs May 20, 2024
1442b0f
請求書払いのユーザーの項目を実装
Shrimprin May 20, 2024
2495e28
Merge pull request #7674 from fjordllc/chore/introduce-view-component
komagata May 25, 2024
c490258
ブログのサムネイルが最新記事に表示されるように修正
Shrimprin May 26, 2024
5b746d3
招待URLページを追加
naokinaokiboo Mar 12, 2024
831f51b
ドロップダウンの選択項目を元に招待URLを作成する処理を追加
naokinaokiboo Mar 12, 2024
5908a39
招待URLページに関するテストを追加
naokinaokiboo Mar 12, 2024
962b074
ロールの選択項目名をロケールファイルに定義
naokinaokiboo Mar 18, 2024
5d986b9
ブラウザのバックボタンで戻ったときに、選択項目と表示URLが異なる不具合に対処
naokinaokiboo Mar 20, 2024
09844a9
招待URLページのデザイン調整
machida Mar 25, 2024
1c5619a
デザイン調整に伴い、javascriptで取得するclass名を修正
naokinaokiboo Mar 28, 2024
4dd22b4
javascriptでのreturnの条件の間違いを修正
naokinaokiboo Mar 28, 2024
0f7c857
1つのテストの粒度を小さくし、複数のテストに分割
naokinaokiboo Mar 28, 2024
a895a56
重複しているテストコードをメソッド化
naokinaokiboo Apr 15, 2024
ea7a2ca
招待URLの変更をHTTPリクエスト無しで行うように修正
naokinaokiboo May 28, 2024
26d6616
Merge pull request #7725 from fjordllc/chore/remove-unconfirmed-link-vue
komagata May 28, 2024
1050883
Merge pull request #7722 from fjordllc/feature/constantize-size-of-th…
komagata May 28, 2024
f73c490
Merge pull request #7418 from fjordllc/feature/admin-can-sort-by-user…
komagata May 28, 2024
b79fc6c
Merge pull request #7619 from fjordllc/feature/update-users-filtering…
komagata May 28, 2024
4bad428
Merge pull request #7774 from fjordllc/dependabot/bundler/nokogiri-1.…
komagata May 28, 2024
032dd6f
Bump pug from 3.0.2 to 3.0.3
dependabot[bot] May 28, 2024
d4be2c2
Merge pull request #7769 from fjordllc/bug/incorrect-wip-report-submi…
komagata May 28, 2024
1292055
Merge pull request #7559 from fjordllc/bug/fix-missing-role-border-on…
komagata May 28, 2024
1b738bb
Merge pull request #7765 from fjordllc/chore/convert-daily-reports-to…
komagata May 28, 2024
32a476c
Merge pull request #7784 from fjordllc/dependabot/bundler/rexml-3.2.8
komagata May 28, 2024
1798ca7
Merge pull request #7713 from fjordllc/feature/display-count-of-categ…
komagata May 28, 2024
3719b7f
Merge pull request #7777 from fjordllc/chore/add-mentor-menu-contents
komagata May 28, 2024
d238227
Merge pull request #7808 from fjordllc/dependabot/npm_and_yarn/pug-3.0.3
komagata May 28, 2024
daa2cbd
Merge pull request #7788 from fjordllc/feature/add-invoice-section-to…
komagata May 28, 2024
71594c7
Merge pull request #7803 from fjordllc/fix/display-blog-thumbnail-on-…
komagata May 28, 2024
ec518cd
Merge pull request #7542 from fjordllc/feature/add-invitation-url-page
komagata May 28, 2024
5c2546d
フロントエンドプログラマーコース用のseedを追加
komagata Jun 1, 2024
cc5cf62
Merge pull request #7820 from fjordllc/chore/seed-for-frontend_course
komagata Jun 2, 2024
9ce7882
応援幕2024終了
machida Jun 4, 2024
9f0434a
Merge pull request #7824 from fjordllc/rm-rubykaigi2024
machida Jun 4, 2024
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
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Metrics/ModuleLength:
Exclude:
- app/decorators/user_decorator.rb

Lint/MissingSuper:
Exclude:
- 'app/components/**/*'

AllCops:
Exclude:
- '**/templates/**/*'
Expand Down
1 change: 1 addition & 0 deletions .traceroute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ ignore_unreachable_actions:
- any_login\/.*
- .*#recaptcha_enabled?
- .*#valid_recaptcha?
- .*#system_test_entrypoint
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ gem 'stringio', '3.1.0'
gem 'stripe'
gem 'stripe-i18n', git: 'https://github.com/komagata/stripe-i18n', branch: 'update-depencency'
gem 'tzinfo', '~> 2.0', '>= 2.0.6'
gem 'view_component'

group :development, :test do
gem 'byebug', platforms: %i[mri mingw x64_mingw]
Expand Down
15 changes: 11 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ GEM
netrc (0.11.0)
newspaper (0.2.0)
nio4r (2.7.0)
nokogiri (1.16.2-arm64-darwin)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-darwin)
nokogiri (1.16.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
oauth-tty (~> 1.0, >= 1.0.1)
Expand Down Expand Up @@ -446,7 +446,8 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rollbar (3.5.2)
rss (0.3.0)
rexml
Expand Down Expand Up @@ -535,6 +536,7 @@ GEM
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
stripe (10.1.0)
strscan (3.1.0)
syntax_suggest (1.1.0)
temple (0.10.3)
thor (1.3.0)
Expand All @@ -561,6 +563,10 @@ GEM
uniform_notifier (1.16.0)
vcr (6.2.0)
version_gem (1.1.3)
view_component (3.11.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
view_source_map (0.3.0)
rails (>= 5)
web-console (4.2.1)
Expand Down Expand Up @@ -682,6 +688,7 @@ DEPENDENCIES
traceroute
tzinfo (~> 2.0, >= 2.0.6)
vcr
view_component
view_source_map
web-console (>= 4.1.0)
webmock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
.thumbnail-card__inner
.thumbnail-card__row
= link_to work, class: 'thumbnail-card__image-link' do
- if work.thumbnail.attached?
= image_tag work.thumbnail_url, class: 'thumbnail-card__image'
- else
= image_tag('work-blank.svg', class: 'thumbnail-card__image')
= thumbnail
.thumbnail-card__row
h2.thumbnail-card__title
= link_to work, class: 'thumbnail-card__title-link' do
Expand All @@ -18,7 +15,7 @@
.thumbnail-card__icon
= link_to user_path(work.user) do
span class="a-user-role is-#{work.user.primary_role}"
= image_tag work.user.avatar_url, title: work.user.icon_title, class: 'a-user-icons__item-icon a-user-icon'
= creator_avatar
.thumbnail-card__user
= link_to work.user.name, user_path(work.user), class: 'a-user-name'
.thumbnail-card__metas
Expand Down
23 changes: 23 additions & 0 deletions app/components/works/work_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

class Works::WorkComponent < ViewComponent::Base
def initialize(work:)
@work = work
end

def thumbnail
if work.thumbnail.attached?
image_tag work.thumbnail_url, class: 'thumbnail-card__image'
else
image_tag('work-blank.svg', class: 'thumbnail-card__image')
end
end

def creator_avatar
image_tag work.user.avatar_url, title: work.user.icon_title, class: 'a-user-icons__item-icon a-user-icon'
end

private

attr_reader :work
end
12 changes: 12 additions & 0 deletions app/controllers/admin/invitation_url_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class Admin::InvitationUrlController < AdminController
def index
@invitation_url_template = new_user_url(
company_id: 'dummy_company_id',
role: 'dummy_role',
course_id: 'dummy_course_id',
token: ENV['TOKEN'] || 'token'
)
end
end
2 changes: 2 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def index
else
user_scope.where(retired_on: nil)
end
@job = params[:job]
user_scope = user_scope.users_job(@job) if @job.present?
@users = user_scope.with_attached_avatar
.preload(:company, :course)
.order_by_counts(params[:order_by] || 'id', @direction)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def search_for_users(target, target_users, search_word)
end

def target_allowlist
target_allowlist = %w[student_and_trainee followings mentor graduate adviser trainee year_end_party]
target_allowlist = %w[student_and_trainee student trainee followings mentor graduate adviser year_end_party]
target_allowlist.push('job_seeking') if current_user.adviser?
target_allowlist.push('all') if @company
target_allowlist.concat(%w[job_seeking hibernated retired inactive all]) if current_user.mentor? || current_user.admin?
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/reports/unchecked_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# frozen_string_literal: true

class Reports::UncheckedController < ApplicationController
PAGER_NUMBER = 25

before_action :require_staff_login
def index; end
def index
@reports = Report.unchecked.not_wip.list.page(params[:page]).per(PAGER_NUMBER)
end
end
9 changes: 8 additions & 1 deletion app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class ReportsController < ApplicationController
PAGER_NUMBER = 25

include Rails.application.routes.url_helpers
before_action :set_report, only: %i[show]
before_action :set_my_report, only: %i[destroy]
Expand All @@ -11,7 +13,10 @@ class ReportsController < ApplicationController
before_action :set_categories, only: %i[create update]
before_action :set_watch, only: %i[show]

def index; end
def index
@reports = Report.list.page(params[:page]).per(PAGER_NUMBER)
@reports = @reports.joins(:practices).where(practices: { id: params[:practice_id] }) if params[:practice_id].present?
end

def show
@products = @report.user.products.not_wip.order(published_at: :desc)
Expand Down Expand Up @@ -58,6 +63,7 @@ def create
end

def update
before_wip_status = @report.wip
set_wip
@report.practice_ids = nil if params[:report][:practice_ids].nil?
@report.assign_attributes(report_params)
Expand All @@ -66,6 +72,7 @@ def update
Newspaper.publish(:report_save, { report: @report })
redirect_to redirect_url(@report), notice: notice_message(@report), flash: flash_contents(@report)
else
@report.wip = before_wip_status
render :edit
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def fetch_target_users
end

def target_allowlist
target_allowlist = %w[student_and_trainee followings mentor graduate adviser trainee year_end_party]
target_allowlist = %w[student_and_trainee student trainee followings mentor graduate adviser year_end_party]
target_allowlist.push('job_seeking') if current_user.adviser?
target_allowlist.concat(%w[job_seeking hibernated retired inactive all]) if current_user.mentor? || current_user.admin?
target_allowlist
Expand Down
10 changes: 10 additions & 0 deletions app/helpers/users_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,14 @@ def all_countries_with_subdivisions
.to_h
.to_json
end

def roles_for_select
roles = %w[all student_and_trainee inactive hibernated retired graduate adviser mentor trainee year_end_party campaign]
roles.map { |role| [t("target.#{role}"), role] }
end

def jobs_for_select
user_jobs = User.jobs.keys.map { |job| [t("activerecord.enums.user.job.#{job}"), job] }
user_jobs.prepend(%w[全員 all])
end
end
5 changes: 4 additions & 1 deletion app/javascript/components/CommentUserIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React from 'react'

export default function CommentUserIcon({ comment }) {
const roleClass = `is-${comment.primary_role}`
return (
<a
className="card-list-item__user-icons-icon"
href={`/users/${comment.user_id}`}>
<img className="a-user-icon" src={comment.user_icon} />
<span className={`a-user-role ${roleClass}`}>
<img className="a-user-icon" src={comment.user_icon} />
</span>
</a>
)
}
14 changes: 8 additions & 6 deletions app/javascript/components/Product.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ const UserIcons = ({ users }) => {
key={user.url}
href={user.url}
className="card-list-item__user-icons-icon">
<img
title={user.icon_title}
alt={user.icon_title}
src={user.avatar_url}
className={`a-user-icon is-${user.primary_role}`}
/>
<span className={`a-user-role is-${user.primary_role}`}>
<img
title={user.icon_title}
alt={user.icon_title}
src={user.avatar_url}
className="a-user-icon"
/>
</span>
</a>
))}
</div>
Expand Down
9 changes: 5 additions & 4 deletions app/javascript/components/external-entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
.card-list-item__inner
.card-list-item__user
a.card-list-item__user-link(:href='externalEntry.user.url')
img.card-list-item__user-icon.a-user-icon(
:title='externalEntry.user.icon_title',
:alt='externalEntry.user.icon_title',
:src='externalEntry.user.avatar_url')
span(:class='`a-user-role is-${externalEntry.user.primary_role}`')
img.card-list-item__user-icon.a-user-icon(
:title='externalEntry.user.icon_title',
:alt='externalEntry.user.icon_title',
:src='externalEntry.user.avatar_url')
.card-list-item__rows
.card-list-item__row
.card-list-item-title
Expand Down
57 changes: 0 additions & 57 deletions app/javascript/elapsed_days.vue

This file was deleted.

40 changes: 40 additions & 0 deletions app/javascript/invitation-url-updater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
document.addEventListener('DOMContentLoaded', async () => {
const invitationElements = Array.from(
document.querySelectorAll('.invitation__element select')
)
const invitationUrl = document.querySelector('.js-invitation-url')
const invitationUrlText = document.querySelector('.js-invitation-url-text')

if (invitationElements.length === 0 || !invitationUrlText || !invitationUrl) {
return
}

const updateInvitationURL = async () => {
const invitationCompany = document.querySelector('.js-invitation-company')
const invitationRole = document.querySelector('.js-invitation-role')
const invitationCourse = document.querySelector('.js-invitation-course')

const selectedCompanyId =
invitationCompany.options[invitationCompany.selectedIndex].value
const selectedRole =
invitationRole.options[invitationRole.selectedIndex].value
const selectedCourseId =
invitationCourse.options[invitationCourse.selectedIndex].value

const invitationUrlTemplate =
document.querySelector('.invitation__url').dataset.invitationUrlTemplate
const targetUrl = invitationUrlTemplate
.replace(/company_id=[^&]*/, `company_id=${selectedCompanyId}`)
.replace(/role=[^&]*/, `role=${selectedRole}`)
.replace(/course_id=[^&]*/, `course_id=${selectedCourseId}`)

invitationUrl.href = targetUrl
invitationUrlText.value = targetUrl
}

invitationElements.forEach((invitationElement) => {
invitationElement.addEventListener('change', updateInvitationURL)
})

window.addEventListener('pageshow', updateInvitationURL)
})
1 change: 1 addition & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import '../upload-image-to-article.js'
import '../header-dropdown.js'
import '../editor-selection-form.js'
import '../user_mentor_memo.js'
import '../invitation-url-updater.js'

import VueMounter from '../VueMounter.js'
import Books from '../components/books.vue'
Expand Down
Loading
Loading