delay_henka 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5061e5afca8b978824aca8b8b33372bf9254a70
4
- data.tar.gz: 266de2770b1bb768edf0fe080a9c17c4c09b05bf
3
+ metadata.gz: 4f8bfafbbd9b0c638824870b3fc0b21d470ec9b7
4
+ data.tar.gz: d9e70c9acbffc6e43b87e94ab356a9f397e04e79
5
5
  SHA512:
6
- metadata.gz: 287d1d32a51cf1fd3df5774e9c1b5d182052eb71d4ec68b38745362b2f7091ee2fce43c8889a2cb6b258736513bd3cb0594cd2f86cb4031a05537551ed001402
7
- data.tar.gz: 889d79073d7ca291fb1e9f5e457431679b5fbdf0058c70ca003a635873b54b81c59bb3ebff1faf636cdc61d57098912881b5077ec62c82139dc738cc497de07c
6
+ metadata.gz: 465a5f1d209012d24d7ccafdf4ff1a666601ff08b605e45e67a636ef24ef55f4ee68863c6e655b0f788abcfb4c14217964b13ace4abb2cf08fec403fde39dc01
7
+ data.tar.gz: 8a6dd71943d3c26826a505db0a0e80b90299804410eff2ab938993b174d939382b20896cb1d46e91bdfb0f2ee7f2000662241f86ba16aad66207a9c5184dc2fb
@@ -0,0 +1,26 @@
1
+ module DelayHenka
2
+ module Web
3
+ module Admin
4
+ class ScheduledActionsController < DelayHenka.base_view_controller.constantize
5
+
6
+ before_action :set_scheduled_action, only: %i(destroy)
7
+
8
+ def index
9
+ @actions = ScheduledAction.order('created_at DESC')
10
+ end
11
+
12
+ def destroy
13
+ @action.destroy!
14
+ redirect_back fallback_location: web_admin_scheduled_actions_path, flash: { success: 'Destroy succeeded' }
15
+ end
16
+
17
+ private
18
+
19
+ def set_scheduled_action
20
+ @action = ScheduledAction.find(params[:id])
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ -# This partial is rendered by including application.
2
+ -# Required local variables:
3
+ -# * scheduled_actions
4
+ -# To render this partial:
5
+ -# = render 'delay_henka/web/admin/scheduled_actions/summary_table', scheduled_actions: @actions
6
+
7
+ %table.table.table-bordered.table-responsive
8
+ %thead
9
+ %tr
10
+ %th Action
11
+ %th Arguments
12
+ %th Schedule At
13
+ %th Action
14
+ %tbody
15
+ - scheduled_actions.each do |action|
16
+ %tr
17
+ %td= action.method_name
18
+ %td= action.argument
19
+ %td= action.schedule_at
20
+ %td= link_to 'Delete', delay_henka.web_admin_scheduled_action_path(action), method: :delete
@@ -0,0 +1,23 @@
1
+ %h1 Scheduled Actions
2
+ %table.table
3
+ %thead
4
+ %tr
5
+ %th Type
6
+ %th Id
7
+ %th Method
8
+ %th Argument
9
+ %th State
10
+ %th Return Value
11
+ %th Schedule At
12
+ %th Submitted By
13
+ %tbody
14
+ - @actions.each do |action|
15
+ %tr
16
+ %td= action.actionable_type
17
+ %td= action.actionable_id
18
+ %td= action.method_name
19
+ %td= action.argument
20
+ %td= action.state
21
+ %td= action.return_value
22
+ %td= action.schedule_at
23
+ %td= action.submitted_by_id
@@ -1,6 +1,7 @@
1
1
  DelayHenka::Engine.routes.draw do
2
2
  namespace :web do
3
3
  namespace :admin do
4
+ resources :scheduled_actions, only: %i(index destroy)
4
5
  resources :scheduled_changes, only: %i(index destroy)
5
6
  end
6
7
  end
@@ -10,6 +10,11 @@ module DelayHenka
10
10
  ->{ staged.order('created_at DESC') },
11
11
  class_name: 'DelayHenka::ScheduledChange',
12
12
  as: :changeable
13
+
14
+ has_many :upcoming_actions,
15
+ ->{ staged.order('created_at DESC') },
16
+ class_name: 'DelayHenka::ScheduledAction',
17
+ as: :actionable
13
18
  end
14
19
  end
15
20
 
@@ -1,3 +1,3 @@
1
1
  module DelayHenka
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delay_henka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - zino
@@ -122,12 +122,15 @@ files:
122
122
  - app/assets/javascripts/delay_henka/application.js
123
123
  - app/assets/stylesheets/delay_henka/application.css
124
124
  - app/controllers/delay_henka/application_controller.rb
125
+ - app/controllers/delay_henka/web/admin/scheduled_actions_controller.rb
125
126
  - app/controllers/delay_henka/web/admin/scheduled_changes_controller.rb
126
127
  - app/helpers/delay_henka/application_helper.rb
127
128
  - app/models/delay_henka/application_record.rb
128
129
  - app/models/delay_henka/scheduled_action.rb
129
130
  - app/models/delay_henka/scheduled_change.rb
130
131
  - app/services/delay_henka/whether_schedule.rb
132
+ - app/views/delay_henka/web/admin/scheduled_actions/_summary_table.html.haml
133
+ - app/views/delay_henka/web/admin/scheduled_actions/index.html.haml
131
134
  - app/views/delay_henka/web/admin/scheduled_changes/_summary_table.html.haml
132
135
  - app/views/delay_henka/web/admin/scheduled_changes/index.html.haml
133
136
  - app/views/layouts/delay_henka/application.html.erb