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 2023-03-01 13:03:21 #6266

Merged
merged 54 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2a608d6
package.jsonのlint:eslintとlint:prettierの対象にjsxを追加
dowdiness Feb 3, 2023
19b0351
prettierによる警告の修正
dowdiness Feb 3, 2023
0f43269
eslintによる警告の修正
dowdiness Feb 3, 2023
cf92a2c
研修生が提出物を提出した時のアドバイザーへの通知をnewspaper化する
futa4095 Feb 10, 2023
dd92940
ページ作成をドキュメント作成に変更
djkazunoko Feb 17, 2023
8d5061b
退会手続きページのタイトルから「休会」を外した
djkazunoko Feb 18, 2023
3909f49
今日か明日開催の定期イベントをダッシュボードに表示させた
shucream-p Feb 1, 2023
80d2c72
イベントの日付が表示されていなかったので修正した
shucream-p Feb 1, 2023
ba9b221
自分が参加している定期イベントのみダッシュボードに表示させた
shucream-p Feb 3, 2023
bc649b9
モデルのテストを追加
shucream-p Feb 3, 2023
e718c40
cookieに保存するキーをイベントの種類ごとに指定するよう変更した
shucream-p Feb 3, 2023
2203f4b
Date.currentを使うように修正した
shucream-p Feb 3, 2023
c02ebc5
&.を使うよう修正した
shucream-p Feb 4, 2023
8200c94
ログインユーザーが参加する近日開催定期イベントの変数名を修正した
shucream-p Feb 4, 2023
28c858a
定期イベントテストデータの開始時間を修正した
shucream-p Feb 4, 2023
7505385
デコレーターのテストを修正した
shucream-p Feb 4, 2023
5f6dc07
prettierの警告を修正した
shucream-p Feb 4, 2023
2c495ee
イベント、定期イベントのpage-notice にデザインを入れた
machida Feb 15, 2023
13ad335
Date.currentを使うよう修正した
shucream-p Feb 17, 2023
6f5463e
メソッド名をholding_today?とholding_tomorrow?にそれぞれ変更した
shucream-p Feb 21, 2023
9c2d641
RegularEvent#holding_tomorrow?のテストを追加した
shucream-p Feb 21, 2023
39532fe
日報一覧の投稿者名のカッコ内を名前ではなく「名前(カナ)」に変更
maimux2x Feb 13, 2023
b880ec4
名前の表示方法の修正によって落ちていたテストの修正
maimux2x Feb 23, 2023
ec9742b
テストデータの読み込み方を修正
maimux2x Feb 23, 2023
4690fc2
ページネーションの条件分岐の漏れを修正した(show画面でページネーションが表示されないようにした)
lef237 Feb 24, 2023
55457ae
Bump omniauth and omniauth-github
dependabot[bot] Feb 24, 2023
a19f8a7
Merge pull request #6263 from fjordllc/dependabot/bundler/omniauth-an…
komagata Feb 25, 2023
de3ba18
Merge pull request #6214 from fjordllc/feature/use-newspaper-to-notif…
komagata Feb 25, 2023
e9d95fa
Merge pull request #6243 from fjordllc/feature/change-retirement-page…
komagata Feb 25, 2023
0aaf013
Merge pull request #6156 from fjordllc/chore/eslint-prettier-in-react
komagata Feb 25, 2023
affad34
Merge pull request #6238 from fjordllc/feature/change-new-document-title
komagata Feb 25, 2023
ac8ef02
Merge pull request #6161 from fjordllc/feature/show-the-regular-event…
komagata Feb 25, 2023
e65d60a
Merge pull request #6261 from fjordllc/feature/reports-vue-to-react
komagata Feb 25, 2023
3a4b468
入会者のスコープを修正した
lef237 Feb 25, 2023
0a35ec8
コードを読みやすく修正した
lef237 Feb 25, 2023
d4aefb2
余計なコードを削除した
lef237 Feb 25, 2023
38cf062
prettierのエラーでCIが通らないため、エラーが発生しているファイルを修正
maimux2x Feb 26, 2023
e7c6143
Merge pull request #6268 from fjordllc/bug/prettier_error
komagata Feb 27, 2023
e26b1ef
コンフリクトの解消
Jan 21, 2023
dee6abf
rubocopが通らなかったためroleメソッドの修正
Jan 31, 2023
0a55a6c
モデルで定義されているメソッドに置き換えた
Jan 31, 2023
c0f24e5
booleanを返すことがわかるように修正
Feb 27, 2023
45a37a5
Question作成時のmentorへのWatch作成処理をnewspaperに置き換え
maimux2x Feb 26, 2023
d611012
レビューいただいた内容の修正
maimux2x Feb 9, 2023
438ad94
rubocopの指摘を修正
maimux2x Feb 9, 2023
9c947ef
createとupdateでnewspaperの呼び出しを分けた
maimux2x Feb 26, 2023
bfede30
ファイルとクラス名をCreatingMentorsWatchForQueestionからMentorsWatchForQuestionCr…
maimux2x Feb 26, 2023
ccb8925
コンフリクトの解消間違いを修正
maimux2x Feb 26, 2023
3cae424
Merge pull request #6267 from fjordllc/feature/number-of-users-for-tr…
komagata Feb 27, 2023
4aa424a
Merge pull request #6081 from fjordllc/feature/give-class-to-hibernat…
komagata Feb 27, 2023
3b6964e
Merge pull request #6165 from fjordllc/bug/replaced_process_of_creati…
komagata Feb 27, 2023
907e81d
Merge pull request #6216 from fjordllc/feature/display_user_name_with…
komagata Feb 27, 2023
0914317
質問個別ページのDOM構造に重複があったのを修正
machida Mar 1, 2023
57c1c12
Merge pull request #6286 from fjordllc/question-container
machida Mar 1, 2023
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: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ gem 'net-pop', require: false
gem 'net-smtp', require: false # TODO: Remove it if you use rails 7.0.1
gem 'newspaper'
gem 'oauth2'
gem 'omniauth', '~> 1.9.2'
gem 'omniauth-github', '~> 1.4.0'
gem 'omniauth', '~> 2.1.1'
gem 'omniauth-github', '~> 2.0.1'
gem 'pg'
gem 'postmark-rails'
gem 'rack-cors', require: 'rack/cors'
Expand Down
27 changes: 15 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ GEM
discord-notifier (1.0.3)
erubi (1.11.0)
execjs (2.8.1)
faraday (2.6.0)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.1)
faraday-net_http (3.0.2)
ffi (1.15.5)
globalid (1.0.1)
activesupport (>= 5.0)
Expand Down Expand Up @@ -206,7 +206,7 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.6.2)
jwt (2.5.0)
jwt (2.7.0)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand Down Expand Up @@ -281,15 +281,16 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (1.9.2)
omniauth (2.1.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-github (1.4.0)
omniauth (~> 1.5)
omniauth-oauth2 (>= 1.4.0, < 2.0)
omniauth-oauth2 (1.7.3)
rack (>= 2.2.3)
rack-protection
omniauth-github (2.0.1)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8)
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
omniauth (~> 2.0)
os (1.1.4)
parallel (1.22.1)
parser (3.1.2.1)
Expand Down Expand Up @@ -321,6 +322,8 @@ GEM
rack (>= 1.1, < 2.3)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-protection (3.0.5)
rack
rack-proxy (0.7.4)
rack
rack-test (2.0.2)
Expand Down Expand Up @@ -566,8 +569,8 @@ DEPENDENCIES
net-smtp
newspaper
oauth2
omniauth (~> 1.9.2)
omniauth-github (~> 1.4.0)
omniauth (~> 2.1.1)
omniauth-github (~> 2.0.1)
pg
postmark-rails
pry-byebug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
background-color: $success

.page-notices__item
.a-badge
min-width: 5rem
&:not(:first-child)
border-top: dashed 1px rgba(white, .2)
12 changes: 8 additions & 4 deletions app/assets/stylesheets/atoms/_a-page-notice.sass
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
&.has-close
position: relative
display: flex
text-align: left
p
+text-block(1em 1.5, $reversal-text)
+media-breakpoint-up(md)
Expand All @@ -35,16 +36,20 @@
text-decoration: none
+media-breakpoint-down(sm)
display: block
position: relative
padding-left: 4rem
.a-badge
margin-right: .75rem
background-color: rgba(black, .4)
border: none
+media-breakpoint-down(sm)
+position(absolute, left 0, top 0)
.a-page-notice__label
+hover-link-reversal
+media-breakpoint-up(md)
max-width: 17.5rem
overflow: hidden
text-overflow: ellipsis
display: inline-block
white-space: nowrap
vertical-align: bottom

.a-page-notice__inner-start
flex: 1
Expand All @@ -58,7 +63,6 @@
font-size: 1.5rem
opacity: .6
transition: all .2s ease-out
margin-left: .5rem
transform: translateX(1rem)
+margin(vertical, -.75rem)
&:hover
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/admin/campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def create

def index
@campaigns = Campaign.order(end_at: :desc)
@retired_students = User.retired_students
@normal_students = User.where(admin: false, mentor: false, adviser: false, trainee: false)
@continued_students = User.where(admin: false, mentor: false, adviser: false, trainee: false, retired_on: nil)
end

def edit; end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def show
def update
question = Question.find(params[:id])
if question.update(question_params)
Newspaper.publish(:question_update, question)
head :ok
else
head :bad_request
Expand Down
13 changes: 13 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def index
if current_user
display_dashboard
display_events_on_dashboard
display_regular_events_on_dashboard
display_welcome_message_for_adviser
set_required_fields
render aciton: :index
Expand Down Expand Up @@ -61,6 +62,18 @@ def display_events_on_dashboard
@events_coming_soon_except_job_hunting = @events_coming_soon.where.not(job_hunting: true)
end

def display_regular_events_on_dashboard
cookies_ids = JSON.parse(cookies[:confirmed_regular_event_ids]) if cookies[:confirmed_regular_event_ids]
regular_events_comming_soon = RegularEvent.today_events + RegularEvent.tomorrow_events
@regular_events_comming_soon_for_current_user = regular_events_comming_soon.select { |event| event.participated_by?(current_user) }

cookies_ids&.each do |id|
@regular_events_comming_soon_for_current_user.delete_if do |event|
event.id == id.to_i
end
end
end

def display_welcome_message_for_adviser
@welcome_message_first_time = cookies[:confirmed_welcome_message]
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def update
set_wip
update_published_at
if @product.update(product_params)
Newspaper.publish(:product_update, @product)
redirect_to @product, notice: notice_message(@product, :update)
notice_another_mentor_assined_as_checker
notice_product_update if @product.checker_id.present?
Expand Down
1 change: 1 addition & 0 deletions app/controllers/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def create
@question.user = current_user
@question.wip = params[:commit] == 'WIP'
if @question.save
Newspaper.publish(:question_create, @question)
redirect_to @question, notice: notice_message(@question)
else
render :new
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/regular_event_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def holding_cycles
def next_holding_date
if finished
'開催終了'
elsif event_day?
elsif holding_today?
'本日開催'
else
"次回の開催日は #{l next_event_date} です"
Expand Down
40 changes: 22 additions & 18 deletions app/decorators/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ def twitter_url
end

def roles
roles = []

roles << :retired if retired_on?
roles << :admin if admin?
roles << :mentor if mentor?
roles << :adviser if adviser?
roles << :graduate if graduated_on?
roles << :trainee if trainee?
role_list = [
{ role: 'retired', value: retired? },
{ role: 'hibernationed', value: hibernated? },
{ role: 'admin', value: admin? },
{ role: 'mentor', value: mentor? },
{ role: 'adviser', value: adviser? },
{ role: 'graduate', value: graduated? },
{ role: 'trainee', value: trainee? }
]
roles = role_list.find_all { |v| v[:value] }
.map { |v| v[:role] }
roles << :student if roles.empty?

roles
Expand All @@ -25,9 +28,9 @@ def primary_role

def staff_roles
staff_roles = [
{ role: '管理者', value: admin },
{ role: 'メンター', value: mentor },
{ role: 'アドバイザー', value: adviser }
{ role: '管理者', value: admin? },
{ role: 'メンター', value: mentor? },
{ role: 'アドバイザー', value: adviser? }
]
staff_roles.find_all { |v| v[:value] }
.map { |v| v[:role] }
Expand All @@ -38,12 +41,13 @@ def roles_to_s
return '' if roles.empty?

roles = [
{ role: '退会ユーザー', value: retired_on? },
{ role: '管理者', value: admin },
{ role: 'メンター', value: mentor },
{ role: 'アドバイザー', value: adviser },
{ role: '卒業生', value: graduated_on? },
{ role: '研修生', value: trainee }
{ role: '退会ユーザー', value: retired? },
{ role: '休会ユーザー', value: hibernated? },
{ role: '管理者', value: admin? },
{ role: 'メンター', value: mentor? },
{ role: 'アドバイザー', value: adviser? },
{ role: '卒業生', value: graduated? },
{ role: '研修生', value: trainee? }
]
roles.find_all { |v| v[:value] }
.map { |v| v[:role] }
Expand Down Expand Up @@ -83,7 +87,7 @@ def title
end

def long_name
"#{login_name} (#{name})"
"#{name} (#{name_kana})"
end

def enrollment_period
Expand Down
12 changes: 10 additions & 2 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

module HomeHelper
def today_or_tommorow(event)
if event.start_at.to_date.today?
if event.holding_today?
'今日'
elsif event.start_at.to_date == Date.tomorrow
elsif event.holding_tomorrow?
'明日'
end
end

def event_date(event)
if event.holding_today?
Date.current
elsif event.holding_tomorrow?
Date.tomorrow
end
end

def anchor_to_required_field(attribute)
{
avatar_attached: 'form-user-avatar',
Expand Down
34 changes: 23 additions & 11 deletions app/javascript/components/AdminCompanies.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ import Pagination from './Pagination'
export default function AdminCompanies() {
const per = 20
const neighbours = 4
const defaultPage = parseInt(queryString.parse(location.search)['page']) || 1
const defaultPage = parseInt(queryString.parse(location.search).page) || 1
const [page, setPage] = useState(defaultPage)

useEffect(() => {
setPage(page)
}, [page])

const { data, error } = useSWR(`/api/admin/companies.json?page=${page}&per=${per}`, fetcher)
const { data, error } = useSWR(
`/api/admin/companies.json?page=${page}&per=${per}`,
fetcher
)
if (error) return <>An error has occurred.</>
if (!data) return <>Loading...</>

Expand All @@ -30,7 +33,7 @@ export default function AdminCompanies() {
per={per}
neighbours={neighbours}
page={page}
onChange={e => handlePaginate(e.page)}
onChange={(e) => handlePaginate(e.page)}
/>
<div className="admin-table">
<table className="admin-table__table">
Expand All @@ -56,13 +59,13 @@ export default function AdminCompanies() {
per={per}
neighbours={neighbours}
page={page}
onChange={e => handlePaginate(e.page)}
onChange={(e) => handlePaginate(e.page)}
/>
</>
)
}

const AdminCompany = ({company}) => {
const AdminCompany = ({ company }) => {
const url = `/companies/${company.id}`
const editUrl = `/admin/companies/${company.id}/edit`

Expand All @@ -75,18 +78,27 @@ const AdminCompany = ({company}) => {
<img className="admin-table__item-logo-image" src={company.logo_url} />
</td>
<td className="admin-table__item-value">{company.website}</td>
<td className="admin-table__item-value admin-table__item-value is-text-align-center">
<a title="アドバイザーサインアップURL" href={company.adviser_sign_up_url} className="a-button is-sm is-secondary is-icon">
<td className="admin-table__item-value is-text-align-center">
<a
title="アドバイザーサインアップURL"
href={company.adviser_sign_up_url}
className="a-button is-sm is-secondary is-icon">
<i className="fa-solid fa-user-plus"></i>
</a>
</td>
<td className="admin-table__item-value admin-table__item-value is-text-align-center">
<a title="アドバイザーサインアップURL" href={company.trainee_sign_up_url} className="a-button is-sm is-secondary is-icon">
<td className="admin-table__item-value is-text-align-center">
<a
title="アドバイザーサインアップURL"
href={company.trainee_sign_up_url}
className="a-button is-sm is-secondary is-icon">
<i className="fa-solid fa-user-plus"></i>
</a>
</td>
<td className="admin-table__item-value admin-table__item-value is-text-align-center">
<a title="アドバイザーサインアップURL" href={editUrl} className="a-button is-sm is-secondary is-icon">
<td className="admin-table__item-value is-text-align-center">
<a
title="アドバイザーサインアップURL"
href={editUrl}
className="a-button is-sm is-secondary is-icon">
<i className="fa-solid fa-pen"></i>
</a>
</td>
Expand Down
6 changes: 2 additions & 4 deletions app/javascript/components/AdminCourses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@ function AdminCourse(props) {
<li>
<a
href={editUrl}
className="a-button is-sm is-secondary is-icon is-block"
>
className="a-button is-sm is-secondary is-icon is-block">
<i className="fa fa-solid fa-pen" />
</a>
</li>
<li>
<a
href={sortUrl}
className="a-button is-sm is-secondary is-icon is-block"
>
className="a-button is-sm is-secondary is-icon is-block">
<i className="fa-solid fa-align-justify" />
</a>
</li>
Expand Down
Loading