From 5b2c88b3ff78c293b69be674988783f4bc664885 Mon Sep 17 00:00:00 2001 From: 839 <8398a7@gmail.com> Date: Wed, 30 Oct 2024 23:01:38 +0900 Subject: [PATCH 1/5] [gem] add rolify --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 8c98ff86..fa27e43c 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ gem 'rails' gem 'rails_admin' gem 'ransack' gem 'react-rails' +gem 'rolify' gem 'sassc-rails' gem 'sentry-rails' gem 'sentry-ruby' diff --git a/Gemfile.lock b/Gemfile.lock index bd6a9b92..56bf0f93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -378,6 +378,7 @@ GEM railties (>= 5.0) retriable (3.1.2) rexml (3.2.6) + rolify (6.0.1) rspec-core (3.11.0) rspec-support (~> 3.11.0) rspec-expectations (3.11.1) @@ -587,6 +588,7 @@ DEPENDENCIES rails_admin ransack react-rails + rolify rspec-its rspec-rails rspec-retry From af5fc85727523ee831d1c2329ea2476dab53ac53 Mon Sep 17 00:00:00 2001 From: 839 <8398a7@gmail.com> Date: Wed, 30 Oct 2024 23:05:39 +0900 Subject: [PATCH 2/5] remove unused functions --- Gemfile | 2 - Gemfile.lock | 94 -------------------------- app/controllers/messages_controller.rb | 2 +- app/views/messages/new.html.slim | 12 ++-- config/environments/development.rb | 3 +- config/storage.yml | 7 -- lib/irt/sync.rb | 4 -- lib/slack/gcs_dispatcher.rb | 39 ----------- lib/twitter_dispatcher.rb | 17 ----- 9 files changed, 8 insertions(+), 172 deletions(-) delete mode 100644 lib/slack/gcs_dispatcher.rb delete mode 100644 lib/twitter_dispatcher.rb diff --git a/Gemfile b/Gemfile index fa27e43c..056f2616 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ gem 'bootsnap', require: false gem 'coffee-rails' gem 'devise' gem 'draper' -gem 'google-cloud-storage' # }}} # h,i,j,k,l,m,n {{{ gem 'kaminari' @@ -39,7 +38,6 @@ gem 'sinatra' gem 'slim-rails' gem 'ts_routes' gem 'turbolinks' -gem 'twitter' # }}} # v,w,x,y,z {{{ gem 'webpacker' diff --git a/Gemfile.lock b/Gemfile.lock index 56bf0f93..3d0e5b4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,6 @@ GEM bindex (0.8.1) bootsnap (1.13.0) msgpack (~> 1.2) - buftok (0.2.0) builder (3.2.4) bullet (7.0.3) activesupport (>= 3.0.0) @@ -112,7 +111,6 @@ GEM crack (0.4.5) rexml crass (1.0.6) - declarative (0.0.20) devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -121,11 +119,7 @@ GEM warden (~> 1.2.3) diff-lcs (1.5.0) digest (3.1.0) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) draper (4.0.2) actionpack (>= 5.0) activemodel (>= 5.0) @@ -133,7 +127,6 @@ GEM activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - equalizer (0.0.11) erubi (1.11.0) et-orbi (1.2.7) tzinfo @@ -148,62 +141,13 @@ GEM ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.0) ffi (1.17.0) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) - rake fugit (1.7.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) globalid (1.0.0) activesupport (>= 5.0) - google-apis-core (0.9.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.14.0) - google-apis-core (>= 0.7.2, < 2.a) - google-apis-storage_v1 (0.17.0) - google-apis-core (>= 0.7, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.41.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.17.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.2.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) hashdiff (1.0.1) hashie (5.0.0) - http (4.4.1) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - http-parser (~> 1.2.0) - http-cookie (1.0.5) - domain_name (~> 0.5) - http-form_data (2.3.0) - http-parser (1.2.3) - ffi-compiler (>= 1.0, < 2.0) - http_parser.rb (0.6.0) - httpclient (2.8.3) i18n (1.12.0) concurrent-ruby (~> 1.0) json (2.6.2) @@ -231,21 +175,15 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.2) matrix (0.4.2) - memoist (0.16.2) - memoizable (0.4.2) - thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) mini_magick (4.11.0) mini_mime (1.1.5) mini_portile2 (2.8.4) minitest (5.16.3) msgpack (1.5.6) - multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.2.3) mustermann (2.0.2) ruby2_keywords (~> 0.0.1) - naught (1.1.0) nested_form (0.3.2) net-imap (0.2.3) digest @@ -288,7 +226,6 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) - os (1.1.4) parallel (1.22.1) parser (3.1.2.1) ast (~> 2.4.1) @@ -367,16 +304,11 @@ GEM tilt redis (4.8.0) regexp_parser (2.8.2) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) - retriable (3.1.2) rexml (3.2.6) rolify (6.0.1) rspec-core (3.11.0) @@ -453,12 +385,6 @@ GEM sidekiq-prometheus-exporter (0.1.17) rack (>= 1.6.0) sidekiq (>= 3.3.1) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simple_oauth (0.3.1) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -493,10 +419,8 @@ GEM strscan (3.0.4) temple (0.8.2) thor (1.2.1) - thread_safe (0.3.6) tilt (2.0.11) timeout (0.3.0) - trailblazer-option (0.1.2) ts_routes (1.0.3) railties (>= 4.0) turbo-rails (1.1.1) @@ -506,23 +430,8 @@ GEM turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - twitter (7.0.0) - addressable (~> 2.3) - buftok (~> 0.2.0) - equalizer (~> 0.0.11) - http (~> 4.0) - http-form_data (~> 2.0) - http_parser.rb (~> 0.6.0) - memoizable (~> 0.4.0) - multipart-post (~> 2.0) - naught (~> 1.0) - simple_oauth (~> 0.3.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) unicode-display_width (2.3.0) uniform_notifier (1.16.0) vcr (6.1.0) @@ -547,7 +456,6 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - webrick (1.7.0) websocket (1.2.10) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) @@ -569,7 +477,6 @@ DEPENDENCIES devise draper factory_bot_rails - google-cloud-storage json_expressions kaminari listen @@ -610,7 +517,6 @@ DEPENDENCIES spring-commands-rspec ts_routes turbolinks - twitter vcr web-console webdrivers diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c8c3e352..510d9b27 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -16,7 +16,7 @@ def create Slack::MessageDispatcher.send(message.id) flash[:notice] = '承りました。対応はしばしお待ちください。' else - flash[:danger] = '何らかの不具合で送信できていません。Twitterなどにご連絡下さい。' + flash[:danger] = '何らかの不具合で送信できていません。Xなどにご連絡下さい。' end redirect_to root_path end diff --git a/app/views/messages/new.html.slim b/app/views/messages/new.html.slim index a9c8d63f..f4e6e771 100644 --- a/app/views/messages/new.html.slim +++ b/app/views/messages/new.html.slim @@ -8,10 +8,10 @@ section.accordions button.toggle aria-label='toggle' .accordion-body .accordion-content - p 以下の手順でTwitterで連絡してください。 + p 以下の手順でXで連絡してください。 blockquote.twitter-tweet data-lang='ja' p lang='ja' dir='ltr' - a href='https://twitter.com/sukemasa_P' + a href='https://x.com/sukemasa_P' | @sukemasa_P | お問い合わせありがとうございます。本人確認のため a href='https://t.co/btjiBmWBvp' @@ -21,17 +21,17 @@ section.accordions br | 削除することもできますし、dm経由で一時的なパスワードに変更することも可能です。 | — IIDX☆12参考表 (@IIDX_12) - a href='https://twitter.com/IIDX_12/status/774630178425155584' + a href='https://x.com/IIDX_12/status/774630178425155584' | 2016年9月10日 - script src='//platform.twitter.com/widgets.js' charset='utf-8' async=true + script src='//platform.x.com/widgets.js' charset='utf-8' async=true .content ul li 既にiidxidが使われている li 何らかの不具合やバグ報告など | 対応は - = link_to 'http://twitter.com/IIDX_12' - = icon 'twitter', 'Twitter', style: 'fab' + = link_to 'http://x.com/IIDX_12' + = icon 'twitter', 'X', style: 'fab' | のほうが迅速なことが多いです。 br font color='red' diff --git a/config/environments/development.rb b/config/environments/development.rb index bec334f9..73c75428 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -34,8 +34,7 @@ end # Store uploaded files on the local file system (see config/storage.yml for options). - # config.active_storage.service = :local - config.active_storage.service = :google + config.active_storage.service = :local # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false diff --git a/config/storage.yml b/config/storage.yml index ed000761..ef2d9f65 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -5,7 +5,6 @@ test: local: service: Disk root: <%= Rails.root.join("storage") %> - # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) # amazon: # service: S3 @@ -32,9 +31,3 @@ local: # service: Mirror # primary: local # mirrors: [ amazon, google, microsoft ] - -google: - service: GCS - project: iidx-app - credentials: <%= ENV.fetch('GCLOUD_SERVICE_KEY') { Rails.root.join('abilitysheet-service-account.json') } %> - bucket: abilitysheet diff --git a/lib/irt/sync.rb b/lib/irt/sync.rb index 5faa5e40..dfbeccf9 100644 --- a/lib/irt/sync.rb +++ b/lib/irt/sync.rb @@ -1,14 +1,10 @@ # frozen_string_literal: true -require 'twitter_dispatcher' - module Irt class Sync def self.run hash = fetch Ability.sync(hash) - twitter = TwitterDispatcher.new - twitter.tweet('地力値表を更新しました') end def self.fetch diff --git a/lib/slack/gcs_dispatcher.rb b/lib/slack/gcs_dispatcher.rb deleted file mode 100644 index f653294d..00000000 --- a/lib/slack/gcs_dispatcher.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -module Slack - class GcsDispatcher - def self.success(env) - body = { - icon_emoji: ':gcp_gcs:', - username: 'GCS Dispatcher', - attachments: [ - { - color: :good, - title: 'backup success', - pretext: '_GCP GCS_', - text: "#{Time.zone.now} #{env} backup success!", - mrkdwn_in: %w[pretext] - } - ] - } - Net::HTTP.post_form(Abilitysheet::Application::SLACK_URI, payload: body.to_json) - end - - def self.failed(env, exception) - body = { - icon_emoji: ':gcp_gcs:', - username: 'GCS Dispatcher', - attachments: [ - { - color: :danger, - title: 'backup failed', - pretext: '_GCP GCS_', - text: "#{Time.zone.now} #{env} backup failed...\n#{exception}", - mrkdwn_in: %w[pretext] - } - ] - } - Net::HTTP.post_form(Abilitysheet::Application::SLACK_URI, payload: body.to_json) - end - end -end diff --git a/lib/twitter_dispatcher.rb b/lib/twitter_dispatcher.rb deleted file mode 100644 index ef5460ec..00000000 --- a/lib/twitter_dispatcher.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class TwitterDispatcher - def initialize - tokens = ENV['TWITTER_TOKENS'].split(',') - @client = Twitter::REST::Client.new do |config| - config.consumer_key = tokens[0] - config.consumer_secret = tokens[1] - config.access_token = tokens[2] - config.access_token_secret = tokens[3] - end - end - - def tweet(text) - @client.update(text) - end -end From 1bf69afd28d0b2c39ef9899886d5e3d231551f84 Mon Sep 17 00:00:00 2001 From: 839 <8398a7@gmail.com> Date: Wed, 30 Oct 2024 23:14:08 +0900 Subject: [PATCH 3/5] Using docker in the development environment --- compose.yml | 16 ++++++++++++++++ config/database.yml | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 compose.yml diff --git a/compose.yml b/compose.yml new file mode 100644 index 00000000..5f2b450a --- /dev/null +++ b/compose.yml @@ -0,0 +1,16 @@ +services: + db: + image: postgres:17.0 + ports: + - 15432:5432 + environment: + POSTGRES_USER: abilitysheet + POSTGRES_HOST_AUTH_METHOD: trust + volumes: + - ./tmp/pgdata:/var/lib/postgresql/data + cache: + image: redis:7.4.1 + ports: + - 16379:6379 + volumes: + - ./tmp/redisdata:/var/lib/redis/data diff --git a/config/database.yml b/config/database.yml index 567cd88d..30a047e4 100644 --- a/config/database.yml +++ b/config/database.yml @@ -2,6 +2,9 @@ default: &default adapter: postgresql encoding: unicode pool: 5 + host: 127.0.0.1 + port: 15432 + username: abilitysheet development: <<: *default From b7ac2705dfe667c052adeda35d1f52ffd3f41c82 Mon Sep 17 00:00:00 2001 From: 839 <8398a7@gmail.com> Date: Fri, 1 Nov 2024 21:22:28 +0900 Subject: [PATCH 4/5] Role management with rolify --- .../admin/dashboards_controller.rb | 2 +- app/controllers/admin/sheets_controller.rb | 2 +- app/controllers/api/api_controller.rb | 4 +-- app/controllers/api/v1/messages_controller.rb | 2 +- app/controllers/application_controller.rb | 21 ----------- app/controllers/logs_controller.rb | 2 +- app/helpers/application_helper.rb | 6 +--- app/javascript/app/Adsense/Adsenses.tsx | 30 ---------------- app/javascript/app/Adsense/index.tsx | 18 ---------- .../app/Sheet/components/SheetList/index.tsx | 2 -- .../app/Welcome/components/index.tsx | 2 -- app/javascript/lib/models/Environment.ts | 4 --- app/models/concerns/user/api.rb | 1 - app/models/concerns/user/role.rb | 29 --------------- app/models/role.rb | 31 ++++++++++++++++ app/models/user.rb | 11 ++++-- app/views/layouts/_footer.html.slim | 2 +- app/views/layouts/_nav.html.slim | 4 +-- app/views/layouts/application.html.slim | 3 +- app/views/logs/list.html.slim | 3 -- app/views/logs/sheet.html.slim | 3 -- app/views/logs/show.html.slim | 8 ++--- app/views/recommends/index.html.slim | 3 -- app/views/sheets/power.html.slim | 3 -- config/initializers/rolify.rb | 10 ++++++ .../20241030141643_rolify_create_roles.rb | 18 ++++++++++ .../20241030141745_remove_role_from_users.rb | 5 +++ db/schema.rb | 21 +++++++++-- docs/erd.png | Bin 356848 -> 388720 bytes spec/factories/users.rb | 4 +-- spec/models/role_spec.rb | 22 ++++++++++++ spec/models/user_spec.rb | 1 - spec/requests/users_spec.rb | 1 - spec/systems/admin/dashboards_spec.rb | 5 +-- spec/systems/admin/messages_spec.rb | 21 ++++++----- spec/systems/admin/rails_admin_spec.rb | 2 +- spec/systems/admin/users_spec.rb | 33 +++++++++--------- spec/systems/logs/show_logs_spec.rb | 10 +++--- spec/systems/navbar/display_navbar_spec.rb | 9 ++--- 39 files changed, 172 insertions(+), 186 deletions(-) delete mode 100644 app/javascript/app/Adsense/Adsenses.tsx delete mode 100644 app/javascript/app/Adsense/index.tsx delete mode 100644 app/models/concerns/user/role.rb create mode 100644 app/models/role.rb create mode 100644 config/initializers/rolify.rb create mode 100644 db/migrate/20241030141643_rolify_create_roles.rb create mode 100644 db/migrate/20241030141745_remove_role_from_users.rb create mode 100644 spec/models/role_spec.rb diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index 27d0a071..67deebe9 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -2,7 +2,7 @@ class Admin::DashboardsController < ApplicationController before_action :authenticate_user! - before_action :owner_user! + before_action :admin_user! def index @email = User.where.not(email: '').count diff --git a/app/controllers/admin/sheets_controller.rb b/app/controllers/admin/sheets_controller.rb index 16243ca8..157287d6 100644 --- a/app/controllers/admin/sheets_controller.rb +++ b/app/controllers/admin/sheets_controller.rb @@ -2,7 +2,7 @@ class Admin::SheetsController < ApplicationController before_action :authenticate_user! - before_action :member_user! + before_action :admin_user! before_action :load_sheet, except: %i[index new create] def index diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index 2ec4fcbb..937d8f09 100644 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -20,9 +20,9 @@ def authenticate! raise UnauthorizedError unless current_user end - def authenticate_member! + def authenticate_admin! raise UnauthorizedError unless current_user - raise UnauthorizedError if current_user.role < User::Role::MEMBER + raise UnauthorizedError unless current_user.admin? end def authenticate_slack! diff --git a/app/controllers/api/v1/messages_controller.rb b/app/controllers/api/v1/messages_controller.rb index cd1b578b..95148b99 100644 --- a/app/controllers/api/v1/messages_controller.rb +++ b/app/controllers/api/v1/messages_controller.rb @@ -2,7 +2,7 @@ class Api::V1::MessagesController < Api::V1::BaseController def index - authenticate_member! + authenticate_admin! render json: { num: Message.where(state: false).count } end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 92ef7f9c..5c777915 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -45,27 +45,6 @@ def admin_user! redirect_to root_path end - def special_user! - return if current_user.special? - - flash[:danger] = '不正な操作です.' - redirect_to list_log_path - end - - def owner_user! - return if current_user.owner? - - flash[:danger] = '許可されていないページです' - redirect_to root_path - end - - def member_user! - return if current_user.member? - - flash[:danger] = '許可されていないページです' - redirect_to root_path - end - def handle_unverified_request super rescue ActionController::InvalidAuthenticityToken => e diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb index 1483fdc0..e5e15618 100644 --- a/app/controllers/logs_controller.rb +++ b/app/controllers/logs_controller.rb @@ -54,7 +54,7 @@ def show end def destroy - log = current_user.owner? ? Log.find(params[:id]) : current_user.logs.find(params[:id]) + log = current_user.admin? ? Log.find(params[:id]) : current_user.logs.find(params[:id]) if log flash[:notice] = "#{log.title}のログを削除し,状態を戻しました" log.destroy diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2726c347..85be1b46 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,10 +5,6 @@ def return_ability_rival(cnt) params[:action] == 'clear' ? @sheets[cnt].n_ability : @sheets[cnt].h_ability end - def adsense(slot = 2) - react_component_wrapper 'Adsense', slot: slot - end - def react_component_wrapper(component, props = {}) props[:context] = { sentry_dsn: ENV['SENTRY_JS_DSN'] @@ -19,7 +15,7 @@ def react_component_wrapper(component, props = {}) def render_ads? return true unless current_user - !(current_user.special? || current_user.owner?) + !(current_user.admin? || current_user.skip_ad?) end def recent_link(iidxid) diff --git a/app/javascript/app/Adsense/Adsenses.tsx b/app/javascript/app/Adsense/Adsenses.tsx deleted file mode 100644 index 029680c3..00000000 --- a/app/javascript/app/Adsense/Adsenses.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -// @ts-ignore -import Adsense from 'react-adsense'; -import { useSelector } from 'react-redux'; - -import { RootState } from '../../lib/ducks'; - -const Adsenses: React.SFC<{ slot: 1 | 2 }> = (props) => { - const { client, slots } = useSelector( - (state: RootState) => state.$$meta.env.adsense, - ); - const $$currentUser = useSelector( - (state: RootState) => state.$$meta.currentUser, - ); - - const slot = slots[props.slot - 1]; - if ($$currentUser && !$$currentUser.renderAds()) { - return null; - } - return ( -
- -
- ); -}; - -export default Adsenses; diff --git a/app/javascript/app/Adsense/index.tsx b/app/javascript/app/Adsense/index.tsx deleted file mode 100644 index 9046477c..00000000 --- a/app/javascript/app/Adsense/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import rootReducer, { rootSaga, RootState } from '../../lib/ducks'; -import { actions, initialState } from '../../lib/ducks/Meta'; -import storeCreator from '../../lib/store'; -import Adsenses from './Adsenses'; - -export default (props: { slot: 1 | 2 } & AbilitysheetContext) => { - const store = storeCreator(props, rootReducer, rootSaga, { - $$meta: initialState, - }); - store.dispatch(actions.considerQueryString()); - return ( - - - - ); -}; diff --git a/app/javascript/app/Sheet/components/SheetList/index.tsx b/app/javascript/app/Sheet/components/SheetList/index.tsx index 1de30cc9..4136055f 100644 --- a/app/javascript/app/Sheet/components/SheetList/index.tsx +++ b/app/javascript/app/Sheet/components/SheetList/index.tsx @@ -1,6 +1,5 @@ import React, { SFC, useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import Adsenses from '../../../Adsense/Adsenses'; import { RootState } from '../../ducks'; import { actions } from '../../ducks/Sheet'; import LampTd from './LampTd'; @@ -143,7 +142,6 @@ const SheetList: SFC = (props) => { return ( <> - {owner() ? (