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

Slack関連情報を削除 #2957

Merged
merged 13 commits into from
Jul 19, 2021
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
4 changes: 2 additions & 2 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def user_params
params.require(:user).permit(
:adviser, :login_name, :name,
:name_kana, :email, :course_id,
:description, :slack_account, :discord_account, :github_account,
:description, :discord_account, :github_account,
:twitter_account, :facebook_url, :blog_url,
:password, :password_confirmation, :job,
:organization, :os, :study_place,
:experience, :prefecture_code, :company_id,
:trainee, :job_seeking, :nda,
:graduated_on, :retired_on, :free,
:job_seeker, :slack_participation, :github_collaborator,
:job_seeker, :github_collaborator,
:officekey_permission, :tag_list
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/current_user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def user_params
params.require(:user).permit(
:adviser, :login_name, :name,
:name_kana, :email, :course_id,
:description, :job_seeking, :slack_account, :discord_account,
:description, :job_seeking, :discord_account,
:github_account, :twitter_account, :facebook_url,
:blog_url, :password, :password_confirmation,
:job, :organization, :os,
Expand Down
1 change: 0 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def set_required_fields
@required_fields = RequiredField.new(
description: current_user.description,
github_account: current_user.github_account,
slack_account: current_user.slack_account,
discord_account: current_user.discord_account
)
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 @@ -126,7 +126,7 @@ def user_params
params.require(:user).permit(
:login_name, :name, :name_kana,
:email, :course_id, :description,
:slack_account, :discord_account, :github_account, :twitter_account,
:discord_account, :github_account, :twitter_account,
:facebook_url, :blog_url, :password,
:password_confirmation, :job, :organization,
:os, :experience, :prefecture_code,
Expand Down
1 change: 0 additions & 1 deletion app/models/required_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class RequiredField

attribute :description, :string
attribute :github_account, :string
attribute :slack_account, :string
attribute :discord_account, :string

validates :description, presence: true
Expand Down
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class User < ApplicationRecord
include Taggable
include Searchable

self.ignored_columns = %i[slack_account slack_participation]

Copy link
Contributor

Choose a reason for hiding this comment

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

ignored_columnsってものを使うと指定したカラムを無視してくれるんですね!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

そのようです!
Railsがカラム情報をキャッシュしているというのも知らなかったので、勉強になりました〜

authenticates_with_sorcery!
VALID_SORT_COLUMNS = %w[id login_name company_id updated_at created_at report comment asc desc].freeze
AVATAR_SIZE = '88x88>'
Expand Down
11 changes: 1 addition & 10 deletions app/views/admin/users/_table.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
th.admin-table__label
| 企業
= render 'sort_column', order_by: 'company_id', direction: direction, target: @target
th.admin-table__label Slack
th.admin-table__label Discord
th.admin-table__label
| 最終アクセス
Expand Down Expand Up @@ -52,8 +51,6 @@
= user.company.name
- else
| -
td.admin-table__item-value.is-text-align-center
= user.slack_account.presence || '-'
td.admin-table__item-value.is-text-align-center
= user.discord_account.presence || '-'
td.admin-table__item-value.is-text-align-center
Expand Down Expand Up @@ -87,19 +84,13 @@
- else
= link_to '卒業', user_graduation_path(user), method: :patch, data: { confirm: '本当によろしいですか?' }, class: 'a-button is-sm is-primary'
td.admin-table__item-value.is-text-align-center
- if user.slack_participation?
= link_to 'https://fjord.slack.com/admin', class: 'a-button is-sm is-warning is-icon', target: '_blank', rel: 'noopener' do
i.fab.fa-slack
- else
.a-button.is-sm.is-disabled.is-icon
i.fab.fa-slack
- if user.github_collaborator?
= link_to 'https://github.com/orgs/fjordllc/people', class: 'a-button is-sm is-warning is-icon', target: '_blank', rel: 'noopener' do
i.fab.fa-github-alt
- else
.a-button.is-sm.is-disabled.is-icon
i.fab.fa-github-alt
- if user.retired_on? && (user.slack_participation? || user.github_collaborator?)
- if user.retired_on? && user.github_collaborator?
.admin-table__item-block-link-container
= link_to edit_admin_user_path(user, anchor: 'external-services') do
| 外部サービス設定変更
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
header.auth-form__header
h1.auth-form__title
= title
- if admin_login? && @user.retired_on? && (@user.slack_participation? || @user.github_collaborator?)
- if admin_login? && @user.retired_on? && @user.github_collaborator?
.auth-form__alert
= link_to '#external-services' do
| 外部サービスの設定を変更してください。
Expand Down
5 changes: 0 additions & 5 deletions app/views/users/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,10 @@
.form-item-block__title
| 外部サービス
.form-item-block__items
.form-item-block__item
= render 'users/form/slack_participation', f: f, user: user
.form-item-block__item
= render 'users/form/github_collaborator', f: f, user: user
.a-form-help
ul
li
= link_to 'https://fjord.slack.com/admin', target: '_blank', rel: 'noopener' do
| Slack設定
li
= link_to 'https://github.com/orgs/fjordllc/people', target: '_blank', rel: 'noopener' do
| GitHub設定
Expand Down
5 changes: 0 additions & 5 deletions app/views/users/_metas.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
| 完了プラクティス
.user-metas__item-value
= user.completed_practices.size
.user-metas__item
.user-metas__item-label
| Slackアカウント
.user-metas__item-value
= user.slack_account.presence || '未登録'
.user-metas__item
.user-metas__item-label
| Discordアカウント
Expand Down
7 changes: 0 additions & 7 deletions app/views/users/form/_slack_participation.html.slim

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/users/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ header.page-header
.row
.col-xs-12.col-lg-6.col-xxl-6
.a-card.is-user
- if admin_login? && @user.retired_on? && (@user.slack_participation? || @user.github_collaborator?)
- if admin_login? && @user.retired_on? && @user.github_collaborator?
.a-card__alert
= link_to edit_admin_user_path(anchor: 'external-services') do
| 外部サービスの設定を変更してください。
Expand Down
2 changes: 0 additions & 2 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ja:
facebook_url: Facebook URL
blog_url: ブログURL
github_account: GitHubアカウント
slack_account: Slackアカウント
discord_account: Discordアカウント
password: パスワード
password_confirmation: パスワード(確認)
Expand Down Expand Up @@ -81,7 +80,6 @@ ja:
opinion: ご意見
mail_notification: メール通知
job_seeker: 就職を希望する
slack_participation: Slack参加
github_collaborator: GitHubチーム
tag_list: タグ
course:
Expand Down
20 changes: 0 additions & 20 deletions db/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ muryou:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Muryou Nosuke
name_kana: ムリョウ ノスケ
slack_account: muryou
discord_account: muryou#2222
twitter_account: muryou
facebook_url: http://www.facebook.com/muryou
Expand All @@ -226,7 +225,6 @@ kensyu:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Kensyu Seiko
name_kana: ケンシュウ セイコ
slack_account: kensyu
discord_account: kensyu#3333
github_account: kensyu
twitter_account: kensyu
Expand All @@ -252,7 +250,6 @@ senpai:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Senpai Ichiro
name_kana: センパイ イチロウ
slack_account: senpai
discord_account: senpai#4444
github_account: senpai
twitter_account: senpai
Expand All @@ -275,7 +272,6 @@ kananashi: #name_kanaを持たないユーザー
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: ユーザーです 読み方のカナが無い
slack_account: kananashi
discord_account: kananashi#6666
github_account: kananashi
twitter_account: kananashi
Expand All @@ -297,7 +293,6 @@ osnashi: #osを持たないユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: ユーザーです OSが無い
name_kana: ナシ オーエス
slack_account: osnashi
discord_account: osnashi#7777
github_account: osnashi
twitter_account: osnashi
Expand All @@ -318,7 +313,6 @@ jobseeker: #就活希望するユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: 就活 のぞむ
name_kana: シュウカツ ノゾム
slack_account: jobseeker
discord_account: jobseeker#8888
github_account: jobseeker
twitter_account: jobseeker
Expand All @@ -340,7 +334,6 @@ daimyo: # 大名エンジニアカレッジに通うユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: 大名 太郎
name_kana: ダイミョウ タロウ
slack_account: daimyo
discord_account: daimyo#9999
github_account: daimyo
twitter_account: daimyo
Expand All @@ -362,7 +355,6 @@ nippounashi: # 日報を投稿していないユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: Nippou nashi
name_kana: ニッポウ ナシ
slack_account: nippounashi
discord_account: nippounashi#0001
twitter_account: nippounashi
facebook_url: http://www.facebook.com/nippounashi
Expand All @@ -384,7 +376,6 @@ with_hyphen:
salt: zW3kQ9ubsxQQtzzzs4ap
name: ハイフンありユーザー
name_kana: ハイフンアリユーザー
slack_account: *login_name
github_account: *login_name
discord_account: with_hyphen#1234
twitter_account: with_hyphen
Expand All @@ -406,7 +397,6 @@ sumi:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 秋元 澄
name_kana: アキモト スミ
slack_account: sumi
github_account: sumi
discord_account: sumi#1234
twitter_account: sumi
Expand All @@ -430,7 +420,6 @@ nobu:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 岡野 伸江
name_kana: オカノ ノブエ
slack_account: nobu
github_account: nobu
discord_account: nobu#1234
twitter_account: nobu
Expand All @@ -452,7 +441,6 @@ rie:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 服部 梨絵
name_kana: ハットリ リエ
slack_account: rie
github_account: rie
discord_account: rie#1234
twitter_account: rie
Expand All @@ -474,7 +462,6 @@ take:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 青木 武久
name_kana: アオキ タケヒサ
slack_account: take
github_account: take
discord_account: take#1234
twitter_account: take
Expand All @@ -496,7 +483,6 @@ kunimi:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 平川 邦美
name_kana: ヒラカワ クニミ
slack_account: kunimi
github_account: kunimi
discord_account: kunimi#1234
twitter_account: kunimi
Expand All @@ -518,7 +504,6 @@ tomo:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 向井 知美
name_kana: ムカイ トモミ
slack_account: tomo
github_account: tomo
discord_account: tomo#1234
twitter_account: tomo
Expand All @@ -540,7 +525,6 @@ akiyosi:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 秋山 義幸
name_kana: アキヤマ ヨシユキ
slack_account: akiyosi
github_account: akiyosi
discord_account: akiyosi#1234
twitter_account: akiyosi
Expand All @@ -562,7 +546,6 @@ tomomi:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 西川 知実
name_kana: ニシカワ トモミ
slack_account: tomomi
github_account: tomomi
discord_account: tomomi#1234
twitter_account: tomomi
Expand All @@ -584,7 +567,6 @@ ogaoga:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 小笠原 里江子
name_kana: オガサハラ リエコ
slack_account: ogaoga
github_account: ogaoga
discord_account: ogaoga#1234
twitter_account: ogaoga
Expand All @@ -606,7 +588,6 @@ take8:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 武井 恵八郎
name_kana: タケイ エイハチロウ
slack_account: take8
github_account: take8
discord_account: take8#1234
twitter_account: take8
Expand All @@ -630,7 +611,6 @@ fujiyasu:
salt: zW3kQ9ubsxQQtzzzs4ap
name: 藤野 安則
name_kana: フジノ ヤスノリ
slack_account: fujiyasu
github_account: fujiyasu
discord_account: fujiyasu#1234
twitter_account: fujiyasu
Expand Down
9 changes: 0 additions & 9 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ muryou:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Muryou Nosuke
name_kana: ムリョウ ノスケ
slack_account: muryou
discord_account: muryou#2222
twitter_account: muryou
facebook_url: http://www.facebook.com/muryou
Expand All @@ -227,7 +226,6 @@ kensyu:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Kensyu Seiko
name_kana: ケンシュウ セイコ
slack_account: kensyu
discord_account: kensyu#3333
github_account: kensyu
twitter_account: kensyu
Expand All @@ -253,7 +251,6 @@ senpai:
salt: zW3kQ9ubsxQQtzzzs4ap
name: Senpai Ichiro
name_kana: センパイ イチロウ
slack_account: senpai
discord_account: senpai#4444
github_account: senpai
twitter_account: senpai
Expand All @@ -276,7 +273,6 @@ kananashi: #name_kanaを持たないユーザー
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: ユーザーです 読み方のカナが無い
slack_account: kananashi
discord_account: kananashi#6666
github_account: kananashi
twitter_account: kananashi
Expand All @@ -298,7 +294,6 @@ osnashi: #osを持たないユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: ユーザーです OSが無い
name_kana: ナシ オーエス
slack_account: osnashi
discord_account: osnashi#7777
github_account: osnashi
twitter_account: osnashi
Expand All @@ -319,7 +314,6 @@ jobseeker: #就活希望するユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: 就活 のぞむ
name_kana: シュウカツ ノゾム
slack_account: jobseeker
discord_account: jobseeker#8888
github_account: jobseeker
twitter_account: jobseeker
Expand All @@ -341,7 +335,6 @@ daimyo: # 大名エンジニアカレッジに通うユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: 大名 太郎
name_kana: ダイミョウ タロウ
slack_account: daimyo
discord_account: daimyo#9999
github_account: daimyo
twitter_account: daimyo
Expand All @@ -363,7 +356,6 @@ nippounashi: # 日報を投稿していないユーザー
salt: zW3kQ9ubsxQQtzzzs4ap
name: Nippou nashi
name_kana: ニッポウ ナシ
slack_account: nippounashi
discord_account: nippounashi#0001
twitter_account: nippounashi
facebook_url: http://www.facebook.com/nippounashi
Expand All @@ -385,7 +377,6 @@ with_hyphen:
salt: zW3kQ9ubsxQQtzzzs4ap
name: ハイフンありユーザー
name_kana: ハイフンアリユーザー
slack_account: *login_name
github_account: *login_name
discord_account: with_hyphen#1234
twitter_account: with_hyphen
Expand Down